@import url("/site-tokens.css");

/* Anaphora public site — Part II, "The Fleet". DESIGN.md §10–17.
   Fonts, colours and type faces come from ui/tokens.css (shared with the working
   register). What stays here is the public register's own layout: the rail and gutter
   widths, the section and block rhythm, a narrower measure, and the ease. These
   override tokens.css's working-register values because this sheet loads after it.
   The public ground is its own: deep purple, the mark's violet at its darkest. */

:root {
  --ground: #1a0f3a;
  --raised: #231552;
  --rule: rgba(255, 255, 255, 0.16);
  --rail: 200px;
  --gutter: clamp(24px, 6vw, 120px);
  --section: clamp(96px, 14vh, 200px);
  --block: clamp(48px, 6vh, 88px);
  --measure: 62ch;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ground); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: clamp(19px, 1.35vw, 22px);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--lime); color: var(--ground); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
input, textarea { caret-color: var(--lime); }
html { scrollbar-color: var(--ink-quiet) var(--ground); scrollbar-width: thin; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px;
  background: var(--ground); color: var(--ink); font: 500 15px/1 var(--font-ui);
  border: 1px solid var(--ink); border-radius: 4px;
}

/* The mark (shared with every surface) */
.white { color: var(--ink); stroke: currentColor; }
.purple { color: var(--violet); stroke: currentColor; }
.lime { color: var(--lime); stroke: currentColor; }
.mark-sm { width: 24px; height: 27px; overflow: visible; display: block; }
.mark-sm use { fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-width: 8.5; }

/* ---------- The field ---------- */

.fleet {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: block; pointer-events: none;
}
.fleet-fallback {
  display: none;
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%; object-fit: cover;
}
html.no-webgl .fleet { display: none; }
html.no-webgl .fleet-fallback { display: block; }

/* ---------- Rail ---------- */

.rail {
  position: fixed; z-index: 20; top: 0; left: 0; bottom: 0;
  width: var(--rail);
  padding: 32px 0 32px var(--gutter);
  display: flex; flex-direction: column;
  font-family: var(--font-ui);
  pointer-events: none;
}
.rail > * { pointer-events: auto; }
.rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) - 24px);
  width: 1px; background: var(--rule);
}
.brand { display: inline-flex; width: fit-content; }
.menu-toggle { display: none; }

.rail-nav {
  display: flex; flex-direction: column; justify-content: space-between; flex: 1;
  margin-top: 44px;
}
.rail-nav ul { list-style: none; margin: 0; padding: 0; }
.rail-nav li { margin: 0; }
/* The way in: one link at the foot of the rail, above its own hairline. */
.rail-foot {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  width: calc(100% - var(--gutter) + 24px);
}
.rail-nav a {
  position: relative; display: block; width: fit-content;
  padding: 7px 0; color: var(--ink-quiet);
  font: 500 15px/1.2 var(--font-ui); text-decoration: none;
  transition: color 300ms var(--ease);
}
.rail-nav a::before {
  content: ""; position: absolute; top: 50%; left: calc(-24px); width: 1px; height: 22px;
  transform: translateY(-50%) scaleY(0); background: var(--lime);
  transition: transform 300ms var(--ease);
}
.rail-nav a:hover, .rail-nav a:focus-visible { color: var(--ink); }
.rail-nav a[aria-current="page"] { color: var(--lime); }
.rail-nav a[aria-current="page"]::before { transform: translateY(-50%) scaleY(1); }

/* ---------- Links ---------- */

.link, .foot-links a, .reading a {
  color: inherit; text-decoration: none;
}
.link {
  position: relative; display: inline-block;
  font: 500 15px/1 var(--font-ui); color: var(--ink);
  padding: 6px 0;
}
.link::after, .foot-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--lime); transform: scaleX(0); transform-origin: left;
  transition: transform 220ms var(--ease);
}
.link:hover::after, .link:focus-visible::after,
.foot-links a:hover::after, .foot-links a:focus-visible::after { transform: scaleX(1); }
.link.live { color: var(--lime); }
.links { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 28px 0 0; }

.reading a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.reading a:hover { text-decoration-color: var(--lime); }

/* ---------- Type ---------- */

.statement {
  margin: 0;
  font: 300 clamp(48px, 7.4vw, 124px) / 0.95 var(--font-reading);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.statement .line { display: block; text-wrap: balance; }
h2.statement { font-size: clamp(44px, 6.4vw, 112px); }
.close .statement { font-size: clamp(40px, 4.8vw, 84px); }
.headline {
  margin: 0;
  font: 400 clamp(36px, 4.6vw, 72px) / 1 var(--font-reading);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.lede {
  margin: 28px 0 0; max-width: var(--measure);
  font-size: clamp(19px, 1.35vw, 22px); line-height: 1.5;
}
.reading { max-width: var(--measure); }
.reading p { margin: 0 0 1.4em; }
.reading p:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */

main { position: relative; z-index: 1; }
.screen {
  position: relative;
  padding-left: calc(var(--rail) + var(--gutter));
  padding-right: var(--gutter);
}

/* The homepage is ten snapped screens, each bottom-left: the hero, the two
   rooms, the fleet, one per build step, the futures, the close. */
html.snap { scroll-snap-type: y mandatory; }
html.snap .screen { scroll-snap-align: start; scroll-snap-stop: always; padding-bottom: clamp(56px, 10vh, 120px); }
html.snap .foot { scroll-snap-align: end; }

.screen { min-height: 100dvh; display: flex; align-items: flex-end; }
.screen > .pitch { max-width: min(1180px, 100%); }
.hero { padding-bottom: clamp(56px, 10vh, 120px); }

/* Two rooms: the statement and three paragraphs on one screen. A short viewport
   lets the screen grow rather than clip. */
.rooms h2.statement { font-size: clamp(40px, 5vw, 84px); }
.rooms .reading { margin-top: clamp(20px, 3vh, 32px); font-size: clamp(17px, 1.2vw, 20px); }
.rooms .reading p:not(:last-child) { margin-bottom: 1.1em; }

/* The fleet screen: one line over the cursors at work. The nouns stand upright at
   statement size; the connectors are small italics in quiet white on the same baseline. */
.fleet-line { max-width: 1180px; }
.fleet-line em { font-style: normal; font-weight: 300; color: var(--ink); }
.fleet-line .q { font-size: 0.55em; font-style: italic; font-weight: 300; color: var(--ink-quiet); letter-spacing: 0; }

/* The build: the first step carries the sandbox statement and lede above it. */
.step .statement { margin-bottom: 0; }
.step .lede { margin-top: 20px; }
.step .lede + .headline { margin-top: clamp(32px, 5vh, 56px); }
.step .reading { margin-top: 28px; }
.step-words {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin: 36px 0 0; font: 500 15px/1 var(--font-ui);
}
.step-words span { color: var(--ink-quiet); }
.step-words span.done { color: var(--ink); }
.step-words span.now { color: var(--lime); }

/* The futures: five ruled rows, each a link to its story. */
.future h2.statement { font-size: clamp(40px, 5vw, 84px); margin-bottom: clamp(24px, 4vh, 48px); }
.future-list { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.future-list li { border-top: 1px solid var(--rule); }
.future-list li:last-child { border-bottom: 1px solid var(--rule); }
.future-list a {
  display: block;
  padding: clamp(12px, 2vh, 20px) 0; color: inherit; text-decoration: none;
}
.future-list .headline { font-size: clamp(22px, 2vw, 32px); line-height: 1.1; transition: color 300ms var(--ease); }
.future-list p { margin: 8px 0 0; max-width: 66ch; color: var(--ink-quiet); font-size: clamp(16px, 1.1vw, 17px); line-height: 1.45; }
.future-list a:hover .headline, .future-list a:focus-visible .headline { color: var(--lime); }
.future-list a:focus-visible { outline-offset: 8px; }

/* Screens whose text may stand taller than a short viewport grow instead of clipping. */
@media (max-height: 820px) {
  html.snap .rooms, html.snap .future { height: auto; min-height: 100dvh; padding-top: clamp(40px, 6vh, 64px); }
}

.close {
  align-items: center;
  border-top: 1px solid var(--rule);
}
.close .pitch .links { margin-top: 36px; }

/* ---------- Footer ---------- */

.foot {
  position: relative; z-index: 1;
  padding: 0 var(--gutter) 40px calc(var(--rail) + var(--gutter));
  font-family: var(--font-ui);
}
.strip {
  list-style: none; margin: 0; padding: 22px 0;
  display: flex; flex-wrap: wrap; gap: 14px 36px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font: 500 13px/1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase;
}
.strip li { display: inline-flex; align-items: center; gap: 12px; }
.sample { width: 28px; height: 12px; stroke: var(--ink); fill: none; stroke-linecap: square; }
.sample.square { stroke: var(--lime); }
.sample.check { width: 18px; height: 18px; stroke: var(--lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.foot-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 22px; }
.foot-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { position: relative; display: inline-block; padding: 4px 0; font: 500 15px/1 var(--font-ui); color: var(--ink-quiet); transition: color 220ms var(--ease); }
.foot-links a:hover, .foot-links a:focus-visible { color: var(--ink); }
.foot-meta { margin: 0; display: flex; gap: 24px; font: 400 14px/1 var(--font-ui); color: var(--ink-quiet); align-items: center; }
.foot-meta a { color: var(--ink-quiet); }

/* ---------- Reveal ---------- */

/* Text enters on a speed ramp: a fast start, a long deceleration, 80ms later per
   item (--i, set by site.js). Leaving is instant, so a screen that snaps back in
   ramps again. `.reveal` is only ever added by JavaScript. */
.reveal { opacity: 0; transform: translateY(32px); transition: none; }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 720ms cubic-bezier(0.05, 0.85, 0.1, 1), transform 720ms cubic-bezier(0.05, 0.85, 0.1, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .rail-nav a, .rail-nav a::before, .link::after, .foot-links a::after, .future-list .headline { transition: none; }
}

/* ---------- Narrow ---------- */

@media (max-width: 960px) {
  :root { --rail: 0px; }
  .rail {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto;
    width: auto; height: 64px;
    padding: 0 var(--gutter);
    flex-direction: row; align-items: center; justify-content: space-between;
    background: var(--ground);
    border-bottom: 1px solid var(--rule);
  }
  .rail::before { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; color: var(--ink); cursor: pointer;
  }
  .menu-toggle .icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; }
  .menu-toggle .icon-close { display: none; }
  body.menu-open .menu-toggle .icon-open { display: none; }
  body.menu-open .menu-toggle .icon-close { display: block; }

  .rail-nav {
    position: fixed; inset: 64px 0 0 0; margin: 0;
    padding: var(--block) var(--gutter);
    background: var(--ground);
    display: none;
    justify-content: flex-start;
  }
  body.menu-open .rail-nav { display: flex; }
  body.menu-open { overflow: hidden; }
  .rail-nav a { font-size: clamp(26px, 2.4vw, 36px); font-family: var(--font-reading); font-weight: 400; padding: 12px 0; }
  .rail-nav a::before { left: -18px; height: 28px; }
  /* In the menu the way in is one more row of the list, under its own rule. */
  .rail-foot { width: auto; margin-top: 24px; padding-top: 24px; }

  .screen, .foot { padding-left: var(--gutter); }
  html.snap .screen { padding-top: 64px; }
  .statement { font-size: clamp(44px, 12vw, 96px); }
  h2.statement { font-size: clamp(40px, 10vw, 84px); }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .links { flex-direction: column; gap: 4px; }
  .strip { gap: 12px 24px; }
}

/* ---------- Pages ---------- */

/* The document pages (/memo, /contact) and the story screens (/future):
   same tokens, hairline rules only. */

.doc, .story, .common, .contact-foot {
  position: relative;
  padding-left: calc(var(--rail) + var(--gutter));
  padding-right: var(--gutter);
}

.doc {
  padding-bottom: var(--section);
}
/* The document header is a hero screen: statement bottom-left over the mark,
   so the field never runs under the title. */
.doc-head {
  min-height: 100dvh;
  display: flex; align-items: flex-end;
  padding-bottom: clamp(56px, 10vh, 120px);
}
@media (min-width: 961px) {
  .doc-head .statement { max-width: 58vw; }
}
.doc .caption {
  margin: 26px 0 0; max-width: var(--measure);
  font: italic 400 15px/1.5 var(--font-reading);
  color: var(--ink-quiet);
}
.doc .doc-section {
  margin-top: var(--block);
  padding-top: var(--block);
  border-top: 1px solid var(--rule);
}
.doc .doc-section h2.headline {
  position: relative;
  font-size: clamp(30px, 3.4vw, 52px);
  margin-bottom: 0.6em;
}
.doc .doc-section h2.headline::before {
  content: ""; position: absolute; left: -36px; top: 0.32em;
  width: 8px; height: 8px; background: var(--violet);
}
.doc .doc-section h3 {
  margin: 1.6em 0 0.6em;
  font: 400 clamp(22px, 1.6vw, 26px)/1.25 var(--font-reading);
}
.doc .doc-section .reading { margin-top: 1em; }
.doc .links.doc-end { margin-top: var(--block); padding-top: var(--block); border-top: 1px solid var(--rule); }

/* /future: one story per screen, statement-sized headline, vertically centred. */
.story {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--section); padding-bottom: var(--section);
  border-top: 1px solid var(--rule);
}
.story .headline { margin-bottom: 0.5em; }

/* /future closing list and the memo's closing links. */
.common { padding-top: var(--section); padding-bottom: var(--section); border-top: 1px solid var(--rule); }
.common h2.headline { font-size: clamp(30px, 3.4vw, 52px); margin-bottom: var(--block); }
.common ul { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.common li { padding: 1.1em 0; border-top: 1px solid var(--rule); }
.common li:last-child { border-bottom: 1px solid var(--rule); }
.common .links { margin-top: 36px; }

.contact-foot { border-top: 1px solid var(--rule); padding-top: 22px; padding-bottom: 22px; }

/* The gate dialog, Part II: a ground panel with one rule, links not buttons. */
dialog#signin {
  margin: auto; padding: clamp(32px, 5vw, 56px);
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 0;
}
dialog#signin::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#signin h2 {
  margin: 0 0 0.7em;
  font: 400 clamp(26px, 2.4vw, 36px)/1.1 var(--font-reading);
  letter-spacing: -0.015em;
}
dialog#signin p { margin: 0 0 1.4em; font-size: 17px; color: var(--ink-quiet); }
dialog#signin label {
  display: block; margin-bottom: 10px;
  font: 500 15px/1 var(--font-ui);
}
dialog#signin input[type="password"] {
  display: block; width: 100%; height: 48px;
  padding: 0 14px; margin-bottom: 22px;
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 4px;
  font: 400 17px/1 var(--font-ui);
}
dialog#signin input[type="password"]:focus { outline: 2px solid var(--lime); outline-offset: 2px; }
dialog#signin .error { color: var(--lime); margin: -10px 0 16px; font-size: 15px; }
dialog#signin .gate-actions { display: flex; gap: 32px; align-items: center; }
button.link {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font: 500 15px/1 var(--font-ui); color: var(--ink);
}

@media (max-width: 960px) {
  .doc, .story, .common, .contact-foot { padding-left: var(--gutter); }
  .doc-head { padding-top: 64px; }
  .doc .doc-section h2.headline::before { position: static; display: inline-block; margin-right: 14px; }
}
