:root {
  --paper: #faf4e1; --ink: #2e2a26; --quiet: #6a6258; --faint: #998f7e; --rule: #ded8cb; --lift: #fffaf0;
  --night: #0e1a2a; --cream: #faf4e1; --amber: #e9c46a; --tape: rgba(198, 98, 66, .42);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --col: 46rem; --wide: 68rem; --gutter: 2rem;
  --grain-blend: multiply;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .24 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191611; --ink: #e9e3d1; --quiet: #a79c8a; --faint: #6f675a; --rule: #38342c; --lift: #25211a;
    --grain-blend: screen;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .92 0 0 0 0 .88 0 0 0 0 .8 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.65 var(--sans); overflow-x: hidden; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: var(--grain-blend); background-image: var(--grain); z-index: 3; }
h1, h2, h3 { font-weight: 400; margin: 0; overflow-wrap: break-word; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
em { font-style: normal; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
h1:focus { outline: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li { margin-bottom: .5rem; }
li > p { margin-bottom: .5rem; }
li > p:last-child { margin-bottom: 0; }
img { display: block; }

/* The one header, on every page. */
.top { display: flex; align-items: center; justify-content: space-between; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: auto; padding: 1rem var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: .5rem; font: 400 1.35rem/1 var(--serif); }
.perch { height: 2.5rem; width: auto; }
.top-nav { display: flex; gap: 1.5rem; font-size: .9375rem; color: var(--quiet); }
.top-nav a:hover, .top-nav a[aria-current] { color: var(--ink); }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; padding: 2rem var(--gutter) 3.5rem; font-size: .8125rem; color: var(--quiet); }
.legal a:hover { color: var(--ink); }

/* ---------- a page: one centred column ---------- */
.col { max-width: calc(var(--col) + 2 * var(--gutter)); margin: auto; padding: 0 var(--gutter); }
.path { display: flex; gap: .5em; margin: 2.5rem 0 1rem; font-size: .9375rem; color: var(--quiet); }
.path a:hover { color: var(--ink); }
.path a + a::before { content: "/"; margin-right: .5em; color: var(--faint); }
.title { font: 400 3.25rem/1.08 var(--serif); letter-spacing: -.015em; margin-bottom: 1.5rem; }
.answer { font: 400 1.4375rem/1.45 var(--serif); }
.answer + .answer { margin-top: -.25em; }
.body { margin-top: 3rem; }
.body h2 { font: 400 1.75rem/1.2 var(--serif); letter-spacing: -.005em; margin: 3rem 0 .75rem; scroll-margin-top: 1.5rem; }
.body > h2:first-child { margin-top: 0; }
.body h3 { font: 600 1.125rem/1.35 var(--sans); margin: 1.75rem 0 .35rem; }
/* Link option 1: underline in the text colour. */
.lk { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.lk:hover { text-decoration-color: currentColor; }
.tbl { overflow-x: auto; margin: 0 0 1.5rem; }
.tbl table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--rule); }
.tbl th { font-weight: 600; color: var(--quiet); }

/* A source's mark: there if you look for it. */
.run { white-space: nowrap; }
.m { position: relative; top: -.72em; color: var(--faint); font-size: .62em; line-height: 1; font-variant-numeric: tabular-nums; margin-left: .12em; cursor: pointer; }
.m::after { content: ""; position: absolute; inset: -1em -.45em; }
.m:hover, .m[aria-expanded="true"] { color: var(--ink); }

/* A source, when asked for. */
.card { position: absolute; z-index: 20; width: min(22rem, calc(100vw - 2.5rem)); padding: .25rem 1rem; background: var(--lift); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 14px 30px -16px rgba(26, 25, 23, .5); font-size: .9375rem; line-height: 1.4; }
.card a { display: block; padding: .7rem 0; }
.card a + a { border-top: 1px solid var(--rule); }
.card b { display: inline; font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.card span { display: block; color: var(--quiet); font-size: .875rem; margin-top: .1rem; }
.card a:hover b { text-decoration-color: currentColor; }

/* Lists at the end of a page, and on a shelf. */
.ends { margin-top: 3.5rem; }
.ends > h2 { font: 400 1.75rem/1.2 var(--serif); letter-spacing: -.005em; margin-bottom: .75rem; }
.srcs { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.4; }
.srcs li { margin: 0 0 .75rem; }
.srcs a { display: grid; grid-template-columns: 2rem 1fr; }
.srcs a:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.srcs b { font-weight: 400; }
.srcs i { display: block; font-style: normal; font-size: .875rem; color: var(--quiet); }
.srcs .n { color: var(--quiet); font-variant-numeric: tabular-nums; }
.dated { margin: 2.5rem 0 0; font-size: .875rem; color: var(--quiet); }
.dated span { display: block; }
@media (max-width: 640px) {
  :root { --gutter: 1.25rem; }
  body { font-size: 1.0625rem; }
  .top-nav { gap: 1.1rem; }
  .title { font-size: 2.5rem; }
  .answer { font-size: 1.25rem; }
  .path { margin-top: 1.25rem; }
  .body h2, .ends > h2 { font-size: 1.5rem; }
}

/* Door and shelf from the approved navy-board prototype. */
.lamp { position: relative; height: 24rem; background: var(--night) url("/images/at-the-lamp.jpg") 50% 30% / cover no-repeat; color: var(--cream); }
.lamp::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 88% 135% at 0% 100%, rgba(6, 10, 20, .94) 0, rgba(6, 10, 20, .86) 48%, rgba(6, 10, 20, .55) 68%, rgba(6, 10, 20, 0) 100%); }
.lamp-words { position: absolute; z-index: 1; text-shadow: 0 1px 3px rgba(6, 10, 20, .7); left: 0; right: 0; bottom: 2.25rem; max-width: 68rem; margin: auto; padding: 0 2rem; }
.lamp-words h1 { font-size: 2.9rem; letter-spacing: -.015em; max-width: 34rem; }
.lamp-words p { max-width: 34rem; margin: 1rem 0 0; font-size: 1.15rem; line-height: 1.45; }
.board { background: var(--night); padding: 2.5rem 0 3.5rem; color: var(--cream); }
.board-in { max-width: 68rem; margin: auto; padding: 0 2rem; }
.part + .part { margin-top: 2.75rem; }
.part h2 { font: 400 1.25rem/1.3 var(--serif); margin-bottom: 1.5rem; opacity: .82; }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: 1.75rem 1.5rem; }
.slip, .urgent { position: relative; padding: 1rem .95rem .85rem; border-radius: 3px; text-decoration: none; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .9), 0 2px 6px rgba(0, 0, 0, .3); transform: rotate(var(--tilt, -.8deg)); transition: transform .2s ease; }
.slip { display: grid; grid-template-columns: 3rem 1fr; gap: .1rem .8rem; align-items: start; background: var(--cream); color: #2e2a26; }
.slip:nth-child(3n+2) { --tilt: .7deg; }
.slip:nth-child(3n) { --tilt: -.4deg; }
.slip::before { content: ""; position: absolute; top: -.5rem; left: 50%; width: 3rem; height: .95rem; transform: translateX(-50%) rotate(calc(var(--tilt, 0deg) * -2)); background: var(--tape); }
.slip:hover, .urgent:hover { transform: translateY(-2px) rotate(0); }
.slip .mark { grid-row: 1 / 3; width: 3rem; height: 3rem; }
.slip b { font: 700 1.1rem/1.2 var(--serif); }
.slip span { font-size: .8125rem; line-height: 1.4; color: #6a6258; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.urgent { display: flex; flex-direction: column; justify-content: space-between; gap: .5rem; background: var(--amber); color: #2e2a26; }
.urgent b { font: 700 1.1rem/1.2 var(--serif); }
.urgent i { font: 500 .8125rem/1.3 var(--sans); font-style: normal; }
.shelfv { max-width: 44rem; margin: auto; padding: 1rem 1.25rem 3.5rem; }
.shelf-head { display: flex; align-items: center; gap: 1rem; margin: .5rem 0 1.75rem; }
.mark.big { width: 4.5rem; height: 4.5rem; }
.shelf-head h1 { font-size: 2.9rem; letter-spacing: -.015em; }
.shelf-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.shelf-list li { margin: 0; }
.shelf-list a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.shelf-list b { display: block; font: 400 1.25rem/1.2 var(--serif); }
.shelf-list a:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.shelf-list span { display: block; margin-top: .15rem; font-size: .9375rem; line-height: 1.4; color: var(--quiet); }

.shelf-head h1, .lamp-words h1 { font-family: var(--serif); font-weight: 400; line-height: 1.12; }
.shelfv { font-size: 1.0625rem; line-height: 1.6; }
.mark { display: block; object-fit: contain; }
.shelfv .path { margin: 0 0 .875rem; font-size: .875rem; }
.shelfv .path a { text-decoration: underline; text-underline-offset: .17em; }
.body a, .srcs b { overflow-wrap: anywhere; }
.body pre { overflow-x: auto; }
@media (max-width: 640px) {
  .science-door .top, .science-shelf .top { padding: .75rem 1.25rem; }
  .lamp { height: 21rem; background-position: 62% 30%; }
  .lamp::after { background: linear-gradient(180deg, rgba(6, 10, 20, 0) 12%, rgba(14, 26, 42, .72) 42%, rgba(14, 26, 42, .94) 72%, var(--night) 100%); }
  .lamp-words { padding: 0 1.25rem; bottom: 1rem; }
  .lamp-words p { font-size: 1.0625rem; }
  .board-in { padding: 0 1.25rem; }
  .slips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .slip { display: flex; flex-direction: column; gap: .35rem; }
  .slip span { display: none; }
  .shelf-head h1 { font-size: 2.25rem; }
}
@media (prefers-reduced-motion: reduce) { .slip, .urgent { transition: none; } }
.card { max-height: calc(100vh - 1rem); overflow-y: auto; }
.science-door .top, .science-shelf .top { max-width: none; padding: .9rem max(2rem, calc((100vw - 68rem) / 2)); }
.science-door .legal, .science-shelf .legal { padding: 1.5rem max(1.25rem, env(safe-area-inset-left)); }
.shelfv .path { font-size: .9375rem; margin-bottom: 1em; }
.shelfv .path a { text-decoration: none; }
.shelfv .path a:hover { text-decoration: underline; }
@media (max-width: 640px) { .science-door .top, .science-shelf .top { padding: .75rem 1.25rem; } }
@media (prefers-color-scheme: dark) {
  .science-shelf, .science-door { --quiet: #988d7c; --rule: #403d35; }
}

.science-door .top-nav { gap: 1.5rem; }
@media (max-width: 640px) { .lamp-words h1 { font-size: 2.25rem; } }
