/* Heartwood: palette, type, council theme, layout, the Continue bar, the flip card.
   Type and colours follow the ship's own page: Cinzel for headings, Spectral for prose, Fira Code for small labels;
   void, gold and parchment, with the visitor's council colour as an accent only. */

@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/cinzel-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/cinzel-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/cinzel-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/spectral-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/spectral-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/spectral-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/fira-code-latin-400-normal.woff2) format('woff2'); }
/* Mathematical letters (U+1D400 to U+1D7FF), which one of the crew's first words uses: Noto Sans Math, @fontsource, OFL */
@font-face { font-family: 'Heartwood Math'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/noto-sans-math-latin-400-normal.woff2) format('woff2'); unicode-range: U+1D400-1D7FF; }
@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/fira-code-latin-500-normal.woff2) format('woff2'); }

:root {
  --void: #07080f;
  --deep: #0b0f1e;
  --field: #0d1225;
  --panel: #141b33;
  --line: #2a3a5a;
  --line-ctl: #66799e;      /* 4.6:1 on void: control borders */
  --gold: #c9b87a;          /* 10.1:1 on void */
  --gold-hi: #e8d9a0;       /* 14.2:1 on void */
  --parchment: #F6F1E4;     /* 17.7:1 on void */
  --steel: #8a9ab8;         /* 7.0:1 on void */
  --ink: #231d15;           /* 14.8:1 on parchment */
  --ink-soft: #5a4a32;      /* 7.6:1 on parchment */
  --ember: #f08a8a;         /* 8.3:1 on void: errors */

  /* --council and --council-ink are set on <html> by js/theme.js; gold until a Faction is chosen */
  --accent: var(--council, var(--gold));
  --accent-ink: var(--council-ink, var(--void));

  --display: 'Cinzel', 'Heartwood Math', Georgia, 'Times New Roman', serif;
  --body: 'Spectral', 'Heartwood Math', Georgia, 'Times New Roman', serif;
  --mono: 'Fira Code', 'Heartwood Math', ui-monospace, Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bar-h: 0px;
  --focus: var(--gold-hi);
  color-scheme: dark;
}

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

/* --bar-h is the Continue bar's height, kept current by js/main.js; focus and scrollIntoView keep clear of it */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--void); scroll-padding-bottom: calc(var(--bar-h, 0px) + 1rem); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(246, 241, 228, .55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(246, 241, 228, .4), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 72%, rgba(232, 217, 160, .35), transparent 60%),
    radial-gradient(1px 1px at 30% 84%, rgba(246, 241, 228, .3), transparent 60%),
    radial-gradient(1px 1px at 90% 58%, rgba(246, 241, 228, .35), transparent 60%),
    radial-gradient(1px 1px at 46% 36%, rgba(246, 241, 228, .25), transparent 60%),
    radial-gradient(ellipse 120% 70% at 50% -10%, #111a33 0%, transparent 60%),
    var(--void);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: var(--body);
  font-size: clamp(17px, 0.9rem + 0.45vw, 19px);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

[hidden] { display: none !important; }

/* Focus: a ring that reads on void, on the council colour and on parchment */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.skip {
  position: absolute; left: var(--gutter); top: .75rem; z-index: 20;
  transform: translateY(-200%);
  background: var(--parchment); color: var(--void);
  font-family: var(--mono); font-size: .85rem; letter-spacing: .06em;
  padding: .55rem .9rem; border-radius: 6px; text-decoration: none;
}
.skip:focus { transform: none; outline: 3px solid var(--gold); outline-offset: 2px; }

/* The page: masthead, the stage, and the Continue bar held to the foot of the window */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.masthead {
  position: relative; z-index: 1; /* over the close step's sky */
  padding: 1.1rem var(--gutter) 0;
  display: flex; align-items: center; justify-content: center;
}
.wordmark {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: .85rem;
  letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; color: var(--gold);
}
/* The title step's card carries the wordmark: the masthead keeps its place in the page (the banner, its words for
   assistive technology) but takes no room and shows nothing there */
body[data-step="title"] .masthead { padding: 0; }
body[data-step="title"] .wordmark {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

#stage { flex: 1 0 auto; width: 100%; padding: clamp(1rem, 3.5vh, 3rem) var(--gutter) clamp(2rem, 5vh, 4rem); }
#stage:focus { outline: none; }
.step { max-width: 46rem; margin: 0 auto; }
.step-choose { max-width: 56rem; }
.step-choose .lede { max-width: none; }

.noscript { max-width: var(--measure); margin: 4rem auto; text-align: center; }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--gold-hi); line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: .05em; margin: 0 0 1rem; }
h2 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); letter-spacing: .04em; margin: 0 0 .75rem; }
p { margin: 0 0 1em; max-width: var(--measure); }

.eyebrow {
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem;
}
.lede { font-size: 1.08em; color: var(--parchment); }

.step-head { margin-bottom: clamp(1.1rem, 3vh, 2rem); }
.step-head .lede { margin-bottom: 0; }

/* Buttons */
.btn {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-family: var(--mono); font-weight: 500; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase;
  min-height: 48px; padding: .7rem 1.4rem; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn-primary:disabled {
  background: transparent; color: var(--steel); border-color: var(--line); border-style: dashed; cursor: not-allowed;
}
.btn-ghost { background: transparent; color: var(--parchment); border-color: var(--line-ctl); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Title: the Title Card (css/titlecard.css), as wide as the column allows up to its own 72rem and never so tall that Begin
   leaves the window (7.5rem: the card's outline above and below, Begin and the room around it); then the framing */
.step-title { max-width: 72rem; text-align: center; }
.step-title .hw-card {
  max-width: min(72rem, calc((100vh - clamp(1rem, 3.5vh, 3rem) - 7.5rem) * 16 / 9));
  max-width: min(72rem, calc((100dvh - clamp(1rem, 3.5vh, 3rem) - 7.5rem) * 16 / 9));
}
/* The card and its parts keep the artifact's own line spacing (its page left line-height at normal), not the page's 1.65 */
.hw-card, .hw-pause { line-height: normal; }
.btn-begin { display: block; margin: 1.2rem auto 0; font-size: 1rem; padding: .85rem 2.6rem; letter-spacing: .3em; }
.title-intro { font-size: 1.1em; line-height: 1.7; margin: 2.2rem auto 0; max-width: 36rem; text-align: left; }

/* Choose: the four councils as radio cards, then the name */
.factions { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.field-label {
  display: block; padding: 0; margin: 0 0 .6rem;
  font-family: var(--mono); font-size: .8rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.faction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.faction-card { position: relative; display: block; cursor: pointer; }
.faction-radio { position: absolute; z-index: 2; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.faction-body {
  display: flex; flex-direction: column; gap: .35rem; height: 100%;
  padding: .85rem 2.6rem .9rem 1.3rem;
  background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-radius: 8px;
  position: relative; overflow: hidden;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.faction-mark { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); opacity: .85; }
.faction-label { display: flex; flex-direction: column; gap: .15rem; }
.faction-name { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: .1em; color: var(--c); line-height: 1.25; }
.faction-charge { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; color: var(--steel); }
.faction-line { font-style: italic; color: var(--parchment); font-size: .95em; line-height: 1.45; margin-top: .2rem; }
.faction-line .q { color: var(--steel); }
.faction-card:hover .faction-body { border-color: var(--line-ctl); }
.faction-radio:checked + .faction-body {
  border-color: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, #0d1225), #0d1225);
  box-shadow: 0 0 0 1px var(--c) inset;
}
@supports not (background: color-mix(in srgb, red 10%, blue)) {
  .faction-radio:checked + .faction-body { background: #111a33; }
}
.faction-radio:checked + .faction-body .faction-mark { width: 6px; opacity: 1; }
.faction-body::after {
  content: ''; position: absolute; top: .95rem; right: .95rem; width: 1rem; height: 1rem; border-radius: 50%;
  border: 1px solid var(--line-ctl); box-sizing: border-box;
}
.faction-radio:checked + .faction-body::after {
  border: 1px solid var(--c); background: radial-gradient(circle, var(--c) 0 40%, transparent 45%);
}
.faction-radio:focus-visible + .faction-body { outline: 3px solid var(--focus); outline-offset: 3px; }

.field { margin: 0; max-width: 26rem; }
.text-input {
  display: block; width: 100%;
  font: inherit; font-family: var(--body); font-size: 1.1em; color: var(--parchment);
  background: var(--field); border: 1px solid var(--line-ctl); border-radius: 6px;
  padding: .7rem .9rem; min-height: 48px;
}
.text-input:hover { border-color: var(--steel); }
.text-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.text-input[aria-invalid="true"] { border-color: var(--ember); }
.field-error { color: var(--ember); font-size: .92em; margin: .55rem 0 0; }

/* The Continue bar */
.bar {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--void);
  border-top: 1px solid var(--line);
}
.bar-progress { height: 2px; background: var(--line); position: relative; }
.bar-progress::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--done, 0) * 100%); background: var(--accent); transition: width .35s ease;
}
.bar-inner {
  max-width: 64rem; margin: 0 auto; padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem;
}
.bar-meta { text-align: center; min-width: 0; }
.bar-count { margin: 0 auto; font-family: var(--mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--steel); }
.bar-who {
  margin: .1rem auto 0; font-style: italic; font-size: .92rem; color: var(--parchment); line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.bar-who[hidden] { display: none !important; }
#bar-back { grid-column: 1; }
#bar-continue { grid-column: 3; }
#bar-continue[hidden] { display: none !important; }

/* The flip card: a front from the step, a parchment back that says what produced it */
.flip { margin: 1.5rem 0; }
.flip-faces { transform-origin: 50% 50%; }
.flip-face { border-radius: 10px; }
.flip-back {
  background: var(--parchment); color: var(--ink);
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3.5vw, 2.25rem);
  border-top: 4px solid var(--accent);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
.flip-back p { color: var(--ink); }
.flip-back p:last-child { margin-bottom: 0; }
.flip-kicker { font-family: var(--mono); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft) !important; margin: 0 0 .4rem; }
.flip-title { color: var(--ink); }
.flip-back :focus-visible { outline-color: var(--ink); }
.flip-toggle {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .9rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 999px;
  background: transparent; color: var(--gold-hi); border: 1px solid var(--line-ctl);
  font-family: var(--mono); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.flip-toggle:hover { border-color: var(--gold); }
.flip-glyph { font-size: 1.1em; line-height: 1; color: var(--accent); }

/* The Bridge tour: five stops. Record text keeps its own line breaks (white-space: pre-wrap) and is never re-flowed. */
.step-tour { max-width: 52rem; }
.kicker {
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--steel); margin: 0 0 .5rem;
}
.cond-text, .scenario-text, .ll-text, .consult-text, .greeting-text, .sheet-note { white-space: pre-wrap; }

/* Stop 1: the Hologram */
.holo-figure { margin: 0 0 1.75rem; }
.holo-stage {
  position: relative; overflow: hidden; height: clamp(240px, 46vh, 440px);
  background: radial-gradient(120% 90% at 68% 30%, #0b1526 0%, #060b16 55%, #04070e 100%);
  border: 1px solid var(--line); border-radius: 10px;
}
.holo-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.holo-canvas:active { cursor: grabbing; }
.holo-pins { position: absolute; inset: 0; pointer-events: none; }
.holo-pin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: .45rem; margin: -11px 0 0 -11px; }
.holo-pin .pn, .cond-badge {
  --sev: #e8c547;
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font: 500 .66rem/1 var(--mono); color: var(--gold-hi); background: rgba(8, 13, 26, .86); border: 1px solid var(--gold);
  box-shadow: 0 0 0 3px var(--sev), 0 0 0 5px var(--gold);
}
[data-state="active"] > .pn, [data-state="active"] .cond-badge { --sev: #e0862f; }
[data-state="crit"] > .pn, [data-state="crit"] .cond-badge { --sev: #e05858; }
.holo-pin .pn { animation: pinflag 2.4s ease-out infinite; }
@keyframes pinflag {
  0% { box-shadow: 0 0 0 3px var(--sev), 0 0 0 5px var(--gold), 0 0 0 5px rgba(217, 196, 138, .55); }
  70% { box-shadow: 0 0 0 3px var(--sev), 0 0 0 5px var(--gold), 0 0 0 15px rgba(217, 196, 138, 0); }
  100% { box-shadow: 0 0 0 3px var(--sev), 0 0 0 5px var(--gold), 0 0 0 5px rgba(217, 196, 138, 0); }
}
.holo-caption { margin-top: .75rem; }
.holo-key { list-style: none; margin: 0; padding: .35rem 0 0 6px; display: flex; flex-wrap: wrap; gap: .55rem 1.4rem; }
.holo-key-item { display: flex; align-items: center; gap: .7rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; color: var(--parchment); }
.holo-hint { margin: .55rem 0 0; font-size: .9rem; font-style: italic; color: var(--steel); }
@media (hover: none) { .holo-hint { display: none; } }
.holo-list-head { margin-top: 0; }
.cond-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); gap: 1rem; }
.cond {
  background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.15rem 1.1rem;
}
.cond-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: .6rem; }
.cond-head .cond-badge { margin: .3rem .1rem 0 .2rem; }
.cond-titles { min-width: 0; }
.cond-name { font-size: 1.1rem; letter-spacing: .06em; margin: 0 0 .2rem; }
.cond-meta { margin: 0; font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--steel); }
.cond-state { color: #e8c547; }
.cond[data-state="active"] .cond-state { color: #e0862f; }
.cond-text { margin: 0; font-size: .95em; line-height: 1.6; }

/* Stop 2: the Desk */
.desk-council { border-left: 4px solid var(--accent); padding: .2rem 0 .2rem 1.1rem; margin: 0 0 1.6rem; }
.desk-label { display: flex; flex-direction: column; gap: .15rem; margin: 0 0 .5rem; }
.desk-name { font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: .1em; color: var(--accent); }
.desk-charge { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; color: var(--steel); }
.desk-proclamation { font-style: italic; margin: 0; }
.desk-proclamation .q { color: var(--steel); }
.desk-voices { margin: 0 0 1.4rem; }
.greetings { display: grid; gap: .9rem; }
.greeting { margin: 0; padding: .9rem 1.1rem; background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-radius: 8px; }
.greeting-quote { margin: 0; }
.greeting-text { margin: 0 0 .45rem; font-size: 1.05em; }
.greeting-ship { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; color: var(--accent); }
.scenario { background: var(--deep); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; padding: clamp(1.1rem, 3vw, 2rem) clamp(1.1rem, 3.5vw, 2.4rem); }
.scenario-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 0 0 1rem; }
.scenario-text { max-width: 36em; font-size: 1.04em; line-height: 1.75; }

/* Stop 3: Loose Leafs, on parchment (the ship's paper: ink #231d15 14.8:1, second ink #5b4f3d 7.6:1) */
:root { --council-paper: var(--ink); }
:root[data-faction="keepers"] { --council-paper: #8a4b10; }
:root[data-faction="tenders"] { --council-paper: #2e6b44; }
:root[data-faction="architects"] { --council-paper: #12667a; }
:root[data-faction="cartographers"] { --council-paper: #5a3e9c; }
.ll-paper {
  --ll-ink: #231d15; --ll-ink2: #5b4f3d; --ll-rule: #cfc2a6;
  background: var(--parchment); color: var(--ll-ink); border-radius: 4px; border-top: 4px solid var(--council-paper);
  padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1.1rem, 3.5vw, 2.2rem) 1.6rem; box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}
.ll-paper p { color: var(--ll-ink); max-width: none; }
.ll-mast { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1.5rem; padding: 0 0 .55rem; margin: 0 0 1.15rem; border-bottom: 4px double var(--ll-ink); }
.ll-paper .ll-name { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 1rem + 3.4vw, 3rem); line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--ll-ink); }
.ll-paper .ll-folio { margin: 0; font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--council-paper); font-weight: 600; }
.ll-art { margin: 0 0 1.4rem; }
.ll-h { margin: 0; font-family: var(--body); font-weight: 600; font-size: 1.35rem; line-height: 1.2; letter-spacing: 0; color: var(--ll-ink); }
.ll-paper .ll-by { margin: .3rem 0 .7rem; font-style: italic; color: var(--ll-ink2); }
.ll-text { font-size: 1rem; line-height: 1.62; color: var(--ll-ink); }
.ll-lead { padding: 0 0 1.15rem; border-bottom: 2px solid var(--ll-ink); }
.ll-lead .ll-h { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.1; }
.ll-lead .ll-text { font-size: 1.06rem; }
.ll-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 0 2.2rem; padding-top: .9rem; }
.ll-dispatch { border-top: 1px solid var(--ll-ink); padding-top: .8rem; }
.ll-notice { border: 2px solid var(--ll-ink); outline: 1px solid var(--ll-ink); outline-offset: 3px; padding: .9rem 1rem .85rem; margin: 4px 4px 1.4rem; }
.ll-notice .ll-h { font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.ll-notice .ll-by { text-align: center; }

/* Stop 4: a question for OBE */
.consult { display: grid; gap: 1rem; }
.consult .kicker { margin: 0; }
.consult-q, .consult-a { border-radius: 10px; padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 3vw, 1.8rem); }
.consult-q { background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-left: 4px solid var(--c); }
.consult-a { background: var(--deep); border: 1px solid var(--gold); }
.consult-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; margin: 0 0 .7rem; }
.consult-asker { font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: .06em; color: var(--gold-hi); }
.consult-council { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; color: var(--steel); }
.consult-q .consult-council { color: var(--c); }
.consult-text { margin: 0; max-width: 36em; line-height: 1.7; }
.consult-question { font-style: italic; }

/* Stop 5: the Constellation Sheets */
.sheets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.sheet { display: flex; flex-direction: column; background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 8px; overflow: hidden; }
.sheet-sky { display: block; width: 100%; aspect-ratio: 4 / 3; background: #03040a; }
.sheet-body { padding: .8rem 1rem 1rem; }
.sheet-name { font-size: 1.08rem; letter-spacing: .05em; margin: 0 0 .25rem; }
.sheet-meta { margin: 0 0 .5rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--steel); }
.sheet-council { color: var(--c); }
.sheet-when { white-space: nowrap; }
.sheet-note { margin: 0; font-size: .95em; line-height: 1.55; }

/* The descent: the crew's first words on Kepler */
.descent-text { max-width: var(--measure); }
.first-words-wrap { margin: 1.8rem 0 1.4rem; }
.first-words-head { font-size: 1.15rem; letter-spacing: .12em; margin: 0 0 .9rem; color: var(--gold-hi); }
.first-words { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.fw { padding: .85rem 1.1rem; background: rgba(13, 18, 37, .82); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--gold)); border-radius: 8px; }
.fw-quote { margin: 0; }
.fw-text { margin: 0 0 .45rem; font-size: 1.06em; white-space: pre-wrap; }
.fw-by { margin: 0; display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: baseline; }
.fw-ship { font-family: var(--display); font-weight: 600; letter-spacing: .06em; color: var(--gold-hi); }
.fw-council { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c, var(--steel)); }
.descent-after { font-style: italic; color: var(--gold); }

/* The survey map: the sheet, and six markers laid over its map rectangle */
.step-map, .step-walk { max-width: 76rem; }
.step-map .lede, .step-walk .lede { max-width: var(--measure); }
.map-figure { margin: 0 0 1rem; }
.map-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 6px; box-shadow: 0 18px 48px rgba(0, 0, 0, .45); background: #eadfc4; }
.map-sheet { position: relative; width: 100%; }
.map-sheet > svg { display: block; width: 100%; height: auto; }
.map-area { position: absolute; }
.map-marker {
  position: absolute; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: #3b2a1a; cursor: pointer; transform: translate(-7px, -50%); white-space: nowrap;
}
.map-marker-l { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -50%); }
.map-marker-b { flex-direction: column; gap: 3px; transform: translate(-50%, -7px); }
.map-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #F6F1E4; border: 2.5px solid #8a2f1c; box-shadow: 0 0 0 1.5px #F6F1E4; }
.map-tag {
  position: relative; font-family: var(--mono); font-size: .68rem; line-height: 1.2; letter-spacing: .02em; padding: 2px 5px;
  background: rgba(246, 241, 228, .92); border: 1px solid rgba(59, 42, 26, .55); border-radius: 3px; color: #231d15;
}
.map-marker:hover .map-tag { border-color: #231d15; }
.map-marker[aria-pressed="true"] .map-dot { background: #8a2f1c; box-shadow: 0 0 0 2px #F6F1E4, 0 0 0 4px #8a2f1c; }
.map-marker[aria-pressed="true"] .map-tag { background: #231d15; color: #F6F1E4; border-color: #231d15; }
.map-marker:focus-visible { outline: none; }
.map-marker:focus-visible .map-tag { outline: 3px solid #12667a; outline-offset: 2px; }
.map-fallback { background: var(--parchment); color: var(--ink); border-radius: 6px; padding: 1rem 1.2rem; }
.map-fallback p { color: var(--ink); max-width: var(--measure); }
.map-fallback-note { font-style: italic; color: var(--ink-soft) !important; }
.map-list { display: flex; flex-wrap: wrap; gap: .6rem .9rem; }
.map-marker-list { position: static; transform: none; }
.map-credit { margin: .55rem 0 0; font-style: italic; font-size: .92em; color: var(--steel); }
.map-note { min-height: 5.5rem; margin: 0 0 1.4rem; padding: .9rem 1.1rem; background: var(--deep); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; max-width: var(--measure); }
.map-note p { margin: 0 0 .45rem; }
.map-note p:last-child { margin-bottom: 0; }
.map-note-where { font-family: var(--mono); font-size: .86rem; letter-spacing: .06em; color: var(--accent); }
.map-note-hint { font-style: italic; color: var(--steel); }
.map-note-own { margin: .7rem 0 0; padding: .6rem 0 0; border-top: 1px solid var(--line); }
.map-note-own blockquote { margin: 0; font-style: italic; }
.map-note-own figcaption { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--steel); margin-top: .3rem; }
.map-words { max-width: var(--measure); }
.map-words-head { font-size: 1rem; letter-spacing: .12em; color: var(--gold); margin: 0 0 .4rem; }

/* The walk, with its words beside it */
.walk-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); gap: 1.2rem; align-items: start; }
.walk-frame { display: block; width: 100%; height: clamp(300px, calc(100vh - var(--bar-h) - 15rem), 620px); height: clamp(300px, calc(100dvh - var(--bar-h) - 15rem), 620px); border: 1px solid var(--line); border-radius: 8px; background: #03040a; }
.walk-text { padding: .9rem 1.1rem; background: var(--deep); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; }
.walk-text-head { font-size: 1rem; letter-spacing: .12em; margin: 0 0 .4rem; color: var(--gold-hi); }
.walk-where { font-family: var(--mono); font-size: .86rem; color: var(--accent); margin: 0 0 .5rem; }
.walk-note { margin: 0 0 .8rem; }
.walk-panel-head { font-family: var(--mono); font-weight: 400; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--steel); margin: 0 0 .35rem; }
.walk-panel { margin: 0; }
.walk-panel dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--gold); }
.walk-panel dd { margin: 0 0 .45rem; }

/* The visitor's first words, and the reply */
.words-field { max-width: 36rem; }
.words-input { width: 100%; resize: vertical; min-height: 6.5rem; line-height: 1.5; }
.words-meta { display: flex; justify-content: space-between; gap: 1rem; margin: .4rem 0 0; font-size: .86em; color: var(--steel); }
.words-count { font-family: var(--mono); font-size: .9em; }
.reply { background: var(--deep); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; padding: clamp(1.1rem, 3vw, 2rem) clamp(1.1rem, 3.5vw, 2.4rem); }
.reply-text { margin: 0; max-width: 36em; font-size: 1.06em; line-height: 1.75; white-space: pre-wrap; }

/* Consequences: a resolution as the ship's page sets one, a glowing panel with its label, title and telling */
.step-telling { max-width: 50rem; }
.telling {
  background: linear-gradient(180deg, var(--panel) 0%, var(--field) 100%);
  border: 1px solid rgba(201, 184, 122, .55); border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(201, 184, 122, .14), 0 12px 40px rgba(0, 0, 0, .5);
  padding: clamp(1.1rem, 3vw, 2rem) clamp(1.1rem, 3.5vw, 2.4rem) clamp(1.1rem, 3vw, 1.6rem);
}
.telling-label {
  display: flex; align-items: center; gap: .55rem; margin: 0 0 .7rem;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--steel);
}
.telling-label::before { content: ''; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); flex: none; }
.telling-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); letter-spacing: .04em; margin: 0 0 1.1rem; }
.telling .flip { margin: 0; }
.telling-body {
  padding-top: 1.1rem; border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, #3a4a6a, transparent) 1;
}
.telling-body p { max-width: 38em; font-size: 1.04em; line-height: 1.78; overflow-wrap: anywhere; }
.telling-body p:last-child { margin-bottom: 0; }
.telling-body .telling-words {
  font-style: italic; font-size: 1.12em; color: var(--gold-hi);
  margin: 1.3em 0 1.3em 0; padding: .1em 0 .1em 1.1em; border-left: 3px solid var(--accent);
}

/* The ship schematic: the owner's sheet in a frame as tall as the sheet, and a skip link to Continue, shown on focus */
.step-schematic { max-width: 80rem; position: relative; }
.schematic-frame { display: block; width: 100%; height: 100vh; border: 0; background: #07080f; }
/* Out of the flow focused or not, at its place under the heading: shown on focus over the sheet's top, so the frame never
   moves as focus comes and goes */
.schematic-skip {
  position: absolute; z-index: 5; margin: 0;
  background: var(--parchment); color: var(--void);
  font-family: var(--mono); font-size: .85rem; letter-spacing: .06em;
  padding: .55rem .9rem; border-radius: 6px; text-decoration: none;
}
.schematic-skip:not(:focus) {
  width: 1px; height: 1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.schematic-skip:focus { outline: 3px solid var(--gold); outline-offset: 2px; }

/* The close: the credit, then two panels in one frame treatment (the Novella's code, the site's code), each with its
   link under it, then Start again. The panels' headings sit on their top hairline. */
.step-close { max-width: 64rem; }
.close-head { margin-bottom: 1.6rem; }
.close-head h1 { margin-bottom: .5rem; }
.close-credit { font-size: 1.1em; line-height: 1.7; margin-bottom: 0; }
.close-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.2rem; margin-bottom: 1.6rem; }
.close-panel {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 16rem; margin: 0; padding: 1.3rem .75rem 1rem; text-align: center;
  border: 1px solid rgba(201, 184, 122, .6); border-top-color: transparent; border-radius: 8px;
}
/* The top hairline is drawn by the heading, either side of its words, so the break in it has no box over the starry
   page. The heading spans the panel's outer width; each side's line keeps the panel's corner: it draws the corner's
   upper half, the panel's side border the lower half (the panel's top border is transparent) */
.close-panel h2 {
  position: absolute; top: -.66em; left: -1px; right: -1px; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; white-space: nowrap;
  font-size: .95rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi);
}
.close-panel h2::before, .close-panel h2::after {
  content: ''; height: 10px; margin-top: calc(.66em - 1px); border-top: 1px solid rgba(201, 184, 122, .6);
}
.close-panel h2::before { margin-right: calc(.7rem + .2em); border-left: 1px solid transparent; border-top-left-radius: 8px; }
.close-panel h2::after { margin-left: .7rem; border-right: 1px solid transparent; border-top-right-radius: 8px; }
.close-novella-link, .close-caption a {
  font-family: var(--mono); font-size: .92rem; letter-spacing: .08em; color: var(--gold-hi);
  text-underline-offset: 4px; display: inline-block; padding: .35rem 0; overflow-wrap: anywhere;
}
.close-novella-link::before { content: '→'; content: '→' / ''; color: var(--accent); margin-right: .6rem; text-decoration: none; display: inline-block; }
.close-novella-link:hover, .close-caption a:hover { color: var(--parchment); }
.close-code { margin: 0 auto; width: 100%; max-width: 30rem; }
.close-frame, .close-book { display: block; width: 100%; height: 34rem; border: 0; border-radius: 6px; background: #07080f; }
.close-caption { margin: .5rem auto 0; }
.close-again { display: block; margin: 0 auto; }
/* The Title Card's motion (css/titlecard.css, js/titlecard.js). The step is its own stacking context, so the sky (fixed to
   the window, first in the step) sits behind everything in it, and the masthead and the bar stay over it; the code's frame
   is opaque. The ship crosses a lane under the panels, clipped, with the one Pause at the lane's right end. */
.step-close { isolation: isolate; }
.close-sky.hw-stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.close-ship { position: relative; container-type: inline-size; margin: 0 0 1.4rem; }
.close-ship .hw-lane { position: relative; top: auto; height: max(12cqw, calc(44px + 2.8cqw + 8px)); container-type: size; overflow: hidden; }
.close-ship:hover .hw-pause { opacity: 1; }
.close-paused .close-sky *, .close-paused .close-ship * { animation-play-state: paused !important; }
/* From 56rem: two equal columns, and the credit beside the heading. The code's frame is as wide as fits above the bar
   with the credit and the panel headings over it (a projector at 1280x720 included), and never narrower than 20rem */
@media (min-width: 56rem) {
  .close-head { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'eyebrow credit' 'title credit'; column-gap: clamp(2rem, 5vw, 4rem); align-items: end; margin-bottom: 1rem; }
  .close-head .eyebrow { grid-area: eyebrow; margin-bottom: .3rem; }
  .close-head h1 { grid-area: title; margin-bottom: 0; }
  .close-credit { grid-area: credit; max-width: none; font-size: 1em; }
  .close-panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
  .close-panel { padding-top: 1.05rem; }
  .close-code { max-width: max(20rem, calc(100vh - var(--bar-h) - 19.5rem)); max-width: max(20rem, calc(100dvh - var(--bar-h) - 19.5rem)); }
}
@media (min-width: 56rem) and (max-height: 760px) {
  .close-code { max-width: max(20rem, calc(100vh - var(--bar-h) - 17.8rem)); max-width: max(20rem, calc(100dvh - var(--bar-h) - 17.8rem)); }
}

@media (max-width: 860px) {
  .walk-layout { grid-template-columns: minmax(0, 1fr); }
  .walk-frame { height: clamp(300px, 62vh, 560px); height: clamp(300px, 62dvh, 560px); }
}
@media (max-width: 640px) {
  .map-sheet { width: 900px; }
  .map-tag { font-size: .62rem; }
}

/* Short windows (a projector at 1280x720): the choose step fits above the bar */
@media (min-width: 641px) and (max-height: 760px) {
  .masthead { padding-top: .7rem; }
  #stage { padding-top: .9rem; }
  .step-head { margin-bottom: .9rem; }
  .step-head h1 { margin-bottom: .6rem; }
  .factions { margin-bottom: 1rem; }
  .faction-grid { gap: .75rem; }
}

/* Phones */
@media (max-width: 640px) {
  .holo-stage { height: clamp(200px, 34vh, 320px); }
  .faction-grid { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .bar-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'meta meta' 'back cont'; gap: .5rem .75rem; padding-top: .6rem; }
  .bar-meta { grid-area: meta; }
  #bar-back { grid-area: back; }
  #bar-continue { grid-area: cont; }
  .bar-count { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .btn-primary:disabled { border-style: dashed; }
  .faction-radio:checked + .faction-body { outline: 3px solid CanvasText; }
}

/* The novella page (novella/index.html) */
.step-novella { max-width: 40rem; padding-top: clamp(1rem, 8vh, 5rem); }
.step-novella cite { color: var(--gold-hi); }
/* Read it in the browser, or keep the file: two links of one height, side by side where there is room */
.novella-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin: 1.6rem 0 .7rem; }
.novella-actions .btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.novella-file { font-family: var(--mono); font-size: .82rem; letter-spacing: .08em; color: var(--steel); margin-bottom: 2.2rem; }
.novella-back {
  font-family: var(--mono); font-size: .92rem; letter-spacing: .08em; color: var(--gold-hi);
  text-underline-offset: 4px; display: inline-block; padding: .6rem 0;
}
.novella-back::before { content: '←'; content: '←' / ''; color: var(--accent); margin-right: .6rem; text-decoration: none; display: inline-block; }
.novella-back:hover { color: var(--parchment); }
@media (max-width: 30rem) { .novella-actions .btn { flex: 1 1 100%; } }
