/* ===========================================================================
   HURRICANE HORACE — page.css
   The page is the character. A column of wind stands behind every word and
   turns while the reader scrolls. Nothing else moves on its own.
   COLOUR RULE: EYE CYAN IS A FACE. Cyan lands only where a face is present
   — the lit eye, the four designs that have one, the features in the rigs.
   Saffron is the shelter gem, and it marks every control a reader can press.
   Violet and teal are weather: they carry no text anywhere.
   =========================================================================== */

.story-page {
  /* Horace's own style-reference palette, read off the approved sheet. */
  --ink: #20243B;          /* shared ink — the ground */
  --deep: #141729;         /* the close, one step deeper */
  --prose: #D8EEE9;        /* hurricane pale — every word */
  --muted: #A8C3C4;        /* hurricane grey — credits, base matter */
  --teal: #4F8F91;         /* hurricane teal — weather only */
  --violet: #8452BD;       /* storm violet — weather only */
  --cyan: #35F0EE;         /* eye cyan — a face, and nothing else */
  --saffron: #DDB54F;      /* shelter saffron — controls */
  --hair: #3A4260;

  --frame: 720px;
  --measure: 600px;

  --furniture: "Trebuchet MS", "Lucida Grande", Verdana, Tahoma, sans-serif;
  --book: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;

  /* The service draws the masthead; the page only sets its face and size. */
  --scoop-masthead-font-family: var(--furniture);
  --scoop-masthead-colour: #D8EEE9;
  --scoop-masthead-scale: 0.94;

  position: relative;
  background: var(--ink);
  color: var(--prose);
  font-family: var(--furniture);
}

/* --- the column -------------------------------------------------------- */
/* Horace stands behind the whole page. The canvas is fixed, so the column
   holds its place while the article travels over it. */
.column {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(16, 19, 35, 0) 0%, rgba(16, 19, 35, 0.62) 26%, rgba(16, 19, 35, 0.62) 74%, rgba(16, 19, 35, 0) 100%),
    radial-gradient(130% 70% at 50% 0%, #2B3457 0%, rgba(43, 52, 87, 0) 62%),
    linear-gradient(180deg, #232943 0%, #20243B 46%, #171B2F 100%);
  pointer-events: none;
}

.story-page main,
.story-page .masthead-well {
  position: relative;
  z-index: 1;
}

.story-page .masthead-well {
  width: calc(100% - 32px);
  max-width: var(--frame);
  margin: 0 16px;
}

.story-page .masthead {
  width: auto;
  min-height: 72px;
}

/* --- frame and measure -------------------------------------------------- */
.story,
.well,
.shipped {
  width: calc(100% - 32px);
  max-width: var(--frame);
  margin: 0 16px;
}

.story { padding-bottom: 8px; }
.well, .shipped { width: 100%; margin: 0; }

.hero__kicker,
.hero h1,
.story-page__byline,
.story-page__dateline,
.prose,
.close__gloss,
.shipped > * > .rig__title,
.rule,
[data-scoop="closing"] {
  max-width: var(--measure);
  margin-inline: auto;
}

/* --- hero --------------------------------------------------------------- */
.hero { padding-top: 8px; }

.hero__kicker {
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px auto 0;
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  overflow-wrap: break-word;
}

.hero__legend {
  display: grid;
  max-width: var(--frame);
  margin: 28px auto 0;
  padding: 0;
  gap: 2px;
  grid-template-columns: 1fr;
  list-style: none;
}

.hero__legend li {
  padding: 12px 14px;
  background: rgba(13, 16, 30, 0.58);
  border-left: 3px solid var(--teal);
  color: var(--prose);
  font-size: 16px;
  line-height: 1.45;
}

.hero__legend b {
  display: block;
  color: var(--prose);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
}

/* --- poster ------------------------------------------------------------- */
.poster {
  max-width: var(--frame);
  margin: 32px auto 0;
}

.poster img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #1A1F36;
}

/* --- byline, dateline, prose -------------------------------------------- */
.well {
  position: relative;
  margin-top: 36px;
  padding: 28px 0 32px;
}

/* The article sits in the open centre of the storm. The panel is the calm;
   everything outside it is weather. */
.well::before {
  position: absolute;
  z-index: -1;
  inset: 0 -24px;
  background: rgba(19, 22, 40, 0.93);
  border-top: 2px solid var(--teal);
  content: "";
}

.foot {
  position: relative;
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
  padding: 0 16px 8px;
  background: var(--deep);
}

.foot__inner {
  width: 100%;
  max-width: var(--frame);
  margin: 0 auto;
}

.story-page .story-page__byline,
.story-page .story-page__dateline {
  color: var(--prose);
  font-family: var(--furniture);
}

.story-page .story-page__byline { margin-top: 0; }
.story-page .story-page__dateline { color: var(--muted); }

.story-page .story-page__byline a,
.story-page .prose a {
  color: var(--prose);
  text-decoration-color: var(--saffron);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.story-page a:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 3px;
}

.prose {
  margin-top: 32px;
  color: var(--prose);
  font-family: var(--book);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.prose > * { margin: 0; }
.prose > p + p { margin-top: 20px; }

.prose > h2 {
  margin-top: 46px;
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
}

.prose > h2 + p { margin-top: 18px; }
.prose .mark__hash { color: var(--teal); }

.seat:empty { display: none; }

/* --- rigs --------------------------------------------------------------- */
/* Every rig is authored at the body measure and steps out to the frame when
   the enhancement seats it, so the static tier stands exactly where the
   seated one does. */
.shipped { margin-top: 44px; }
.shipped > * + * { margin-top: 44px; }

.rig {
  padding: 20px 18px 22px;
  background: rgba(12, 15, 28, 0.72);
  border-top: 2px solid var(--teal);
}

.seat .rig {
  width: var(--frame);
  max-width: calc(100vw - 32px);
  margin-left: calc((var(--measure) - var(--frame)) / 2);
}

.rig__title {
  margin: 0;
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.rig__lede {
  margin: 10px 0 0;
  color: var(--prose);
  font-family: var(--book);
  font-size: 19px;
  line-height: 1.7;
}

.rig__lede q { color: var(--saffron); font-style: italic; }

/* readings — a plain label and a live number, everywhere the same */
.reads {
  display: grid;
  margin: 20px 0 0;
  padding: 0;
  gap: 2px;
  grid-template-columns: 1fr;
  list-style: none;
}

.read {
  display: flex;
  padding: 10px 12px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: rgba(32, 36, 59, 0.78);
}

.read__label {
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 15px;
  line-height: 1.35;
}

.read__value {
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.read--face .read__value { color: var(--cyan); }

/* --- rig 01: the note --------------------------------------------------- */
.note {
  display: grid;
  margin-top: 18px;
  gap: 18px;
  grid-template-columns: 1fr;
}

.note__stage {
  position: relative;
  padding: 10px;
  background: rgba(32, 36, 59, 0.7);
}

.note__stage svg { display: block; width: 100%; height: auto; }

.note__parts {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  grid-template-columns: 1fr;
  list-style: none;
}

.part {
  display: flex;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid var(--saffron);
  background: transparent;
  color: var(--prose);
  cursor: pointer;
  font-family: var(--furniture);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.part__state {
  color: var(--saffron);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.part[aria-pressed="true"] {
  background: var(--saffron);
  border-color: var(--saffron);
  color: #20243B;
  box-shadow: inset 0 0 0 3px #20243B, inset 0 0 0 5px var(--saffron);
}

.part[aria-pressed="true"] .part__state { color: #20243B; }

.part:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.part--restore {
  margin-top: 6px;
  border-style: dashed;
  color: var(--saffron);
  font-weight: 400;
}

/* The diagram answers the note. A removed part leaves nothing behind, and
   when all three are gone the torn sails are what came back. */
.hpart { transition: opacity 180ms linear; }
.gone { opacity: 0; }
.sails { opacity: 0; }
.note--bare .sails { opacity: 1; }

/* --- rig 02: the four notes --------------------------------------------- */
.notes {
  display: grid;
  margin: 18px 0 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.turn {
  padding: 0;
  background: rgba(32, 36, 59, 0.78);
  border-left: 3px solid var(--hair);
}

.turn--aim { border-left-color: var(--cyan); }

.turn__head {
  display: grid;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  gap: 4px 12px;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  border: 0;
  background: transparent;
  color: var(--prose);
  cursor: pointer;
  font-family: var(--furniture);
  text-align: left;
}

.turn__head:focus-visible { outline: 3px solid var(--saffron); outline-offset: -3px; }

.turn__when {
  color: var(--prose);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.turn__gap {
  color: var(--saffron);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.turn__what {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.turn--aim .turn__what { color: var(--cyan); }

.turn__bar {
  height: 10px;
  margin: 0 14px 12px;
  background: rgba(79, 143, 145, 0.35);
}

.turn__bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.turn--aim .turn__bar span { background: var(--cyan); }

.turn__said {
  margin: 0 14px 14px;
  padding: 12px 14px;
  background: rgba(13, 16, 30, 0.7);
  border-left: 3px solid var(--saffron);
  color: var(--prose);
  font-family: var(--book);
  font-size: 18px;
  font-style: italic;
  line-height: 1.6;
}

.turn__said[hidden] { display: none; }

/* --- figures ------------------------------------------------------------ */
.plate { margin: 0; }

.seat .plate {
  width: var(--frame);
  max-width: calc(100vw - 32px);
  margin-left: calc((var(--measure) - var(--frame)) / 2);
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  background: #1A1F36;
}

.plate figcaption {
  margin-top: 10px;
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 16px;
  line-height: 1.45;
}

.plate .credit {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* --- the close ---------------------------------------------------------- */
.close {
  position: relative;
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
  padding: 48px 16px 56px;
  background: linear-gradient(180deg, rgba(20, 23, 41, 0) 0%, rgba(20, 23, 41, 0.90) 16%, var(--deep) 86%);
}

.close__inner { max-width: var(--frame); margin: 0 auto; }

/* The last moment owns the screen: the face stands wider than the article. */
.close__stage {
  width: min(1040px, calc(100vw - 32px));
  margin-left: calc(50% - min(520px, calc(50vw - 16px)));
}

.close__title {
  margin: 0;
  color: var(--prose);
  font-family: var(--furniture);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.faces {
  display: grid;
  margin: 24px 0 36px;
  padding: 0;
  gap: 8px;
  grid-template-columns: 1fr;
  list-style: none;
}

.face-cell {
  display: grid;
  padding: 12px 14px;
  gap: 4px;
  background: rgba(32, 36, 59, 0.92);
  border-bottom: 3px solid var(--hair);
}

.face-cell--face { border-bottom-color: var(--cyan); }

.face-cell__when {
  color: var(--prose);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.face-cell__what { color: var(--muted); font-size: 14px; line-height: 1.4; }

.face-cell__mark {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.face-cell--face .face-cell__mark { color: var(--cyan); }

.close__stage svg { display: block; width: 100%; height: auto; }
.close .reads { margin-top: 36px; }

.close__gloss {
  margin: 28px auto 0;
  color: var(--prose);
  font-family: var(--book);
  font-size: 19px;
  line-height: 1.7;
}

.rule {
  width: 100%;
  height: 0;
  margin: 44px auto 0;
  border: 0;
  border-top: 1px solid var(--hair);
}

/* --- closing furniture -------------------------------------------------- */
/* The site pulls the assembly left to sit against a padded article column.
   This page has no such padding, so the pull is zeroed and the assembly
   starts where the article measure starts. */
.story-page [data-scoop="closing"] {
  max-width: var(--frame);
  margin: 0 auto;
}

body.story-page [data-scoop="closing"] > .reaction-assembly { margin-left: 0; }

.story-page [data-scoop="closing"] > nav a,
.story-page [data-scoop="closing"] > a {
  color: var(--prose);
  text-decoration-color: var(--saffron);
}

[data-scoop="closing"] > .base-matter,
[data-scoop="closing"] > .base-matter a { color: var(--muted); }

/* --- wide --------------------------------------------------------------- */
@media (min-width: 752px) {
  .story-page .masthead-well,
  .story { margin: 0 auto; }

  .hero { padding-top: 24px; }
  .hero h1 { font-size: 54px; }

  .hero__legend { grid-template-columns: repeat(4, 1fr); }

  .note { grid-template-columns: 300px 1fr; align-items: start; }

  .reads { grid-template-columns: repeat(3, 1fr); }
  .rig--note .reads { grid-template-columns: repeat(3, 1fr); }

  .read { flex-direction: column; justify-content: flex-start; gap: 4px; }
  .read__label { order: 2; }
  .read__value { order: 1; font-size: 32px; }

  .faces { grid-template-columns: repeat(5, 1fr); }

  .rig { padding: 26px 28px 28px; }
  .close { padding: 56px 16px 60px; }
}

/* The page's mobile measure is the fixed 320px reaction assembly: the frame
   runs the full 320, and the words are inset inside it exactly as the
   assembly insets its own. */
@media (max-width: 751px) {
  .story-page {
    --frame: 320px;
    --measure: 320px;
  }

  .story-page .masthead-well,
  .story {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .story-page .masthead-well { padding: 0 16px; }

  .seat .rig,
  .seat .plate { width: 100%; margin-left: 0; }

  .hero { padding: 8px 16px 0; }
  .poster { margin-top: 28px; }
  .well { padding: 22px 16px 26px; }
  .well::before { inset: 0; }

  .hero h1 { font-size: 32px; }
  .close { padding: 32px 16px 36px; }
  .close__inner { max-width: 320px; }
}

/* --- reduced motion ----------------------------------------------------- */
/* Nothing transforms, the column stops turning, and every rig stands at its
   true reading from the first paint. */
@media (prefers-reduced-motion: reduce) {
  .story-page * {
    animation: none !important;
    transition: none !important;
  }
}

/* --- forced colours ----------------------------------------------------- */
@media (forced-colors: active) {
  .part[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
    forced-color-adjust: auto;
  }

  .part,
  .turn__head { border: 2px solid ButtonBorder; }

  .turn--aim,
  .face-cell--face { outline: 2px solid Highlight; }

  .part[aria-pressed="false"] { border-style: dashed; }
}
