/* Footer (direction-v2 §8, v3). At 1280 and up the rows sit at fixed tops over a full-bleed canvas, one
   screen tall; below 1280 they flow and the canvas fills whatever height that makes. Columns come from a
   12-column grid. Breakpoints: >=1280 desktop, 768-1279 tablet layout (60 px name to 1024), <768 phone.
   Type and colour come from the tokens in base.css; radius 0, no shadows. */

.site-footer {
  /* One full screen of scene, then the bottom bar's strip below the fold. The anchor lands at the very top. */
  --sf-legal: 76px; scroll-margin-top: calc(-1 * (var(--anchor) + var(--sf-land, 0px))); /* --sf-land: footer.js, below 1280 */
  position: relative; height: calc(max(900px, 100svh) + var(--sf-legal)); overflow: hidden; background: var(--void);
  color: var(--ink); isolation: isolate;
}
.sf-scene, .sf-scrim { position: absolute; inset: 0; pointer-events: none; }
.sf-canvas { width: 100%; height: 100%; }
.sf-dim { position: absolute; inset: 0; background: #000; opacity: 0; }

/* No WebGL / context lost: a CSS horizon. Top of the circle is the apex (54%, footer.js apexUp). */
.sf-horizon { display: none; position: absolute; --r: var(--hz-r, 1656px);
  left: calc(54% - var(--r) - 60px); top: calc(var(--apex-y, 540px) - 60px);
  width: calc(2 * var(--r) + 120px); height: calc(2 * var(--r) + 120px);
  background: radial-gradient(circle var(--r) at 50% 50%, var(--void) 99.2%,
    var(--atmo) 99.75%, color-mix(in srgb, var(--atmo) 30%, transparent) 100.25%, transparent 101.2%); }
.site-footer.is-fallback .sf-horizon { display: block; }
.site-footer.is-fallback .sf-canvas { display: none; }

.sf-scrim-top { bottom: var(--sf-legal); background: linear-gradient(to bottom, rgba(5,7,10,.78) 0, rgba(5,7,10,0) 46%); }
.sf-scrim-bottom { background: linear-gradient(to top, rgba(5,7,10,.82) 0, rgba(5,7,10,0) 160px); }

.sf-grid {
  position: relative; height: 100%; margin-inline: auto;
  max-width: calc(var(--max) + 2 * var(--gutter)); padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
}
.sf-grid > * { position: absolute; left: 0; right: 0; margin: 0; }
.sf-grid p, .sf-grid ul, .sf-grid h2 { margin: 0; }
.sf-grid ul { list-style: none; padding: 0; }

/* Lockup, full form (§2.7): mark 24, 10, wordmark, 12, rake line, 12, hull plate. Never animates. */
.sf-lockup { display: flex; align-items: center; height: 24px; color: var(--ink); white-space: nowrap; }
.sf-mark { flex: none; }
.sf-word { margin-left: 10px; font: 500 15px/24px var(--f-type); font-stretch: var(--w-display);
  letter-spacing: .08em; text-transform: uppercase; margin-right: -.08em; }
.sf-rake { flex: none; width: 1px; height: 20px; margin-inline: 12px; background: var(--ink-3); transform: rotate(18deg); }
.sf-tagline { margin-top: var(--s16) !important; font: 400 17px/26px var(--f-type); color: var(--ink-2); }
/* Beside the columns the brand shares their baselines: FARHOLD on the headings, the tagline on the first link row. */
@media (min-width: 768px) {
  .sf-lockup { margin-top: -2px !important; }
  .sf-tagline { margin-top: 10px !important; }
}

/* Dispatches (v3): a sitemap-style column. Heading, a short paragraph, then one ruled line to write on, like a
   field in a drawing's title block: field and action on one 48 px line over a 1 px rule. No box, no fill.
   The line reaches 12 px past the column on both sides so the focus ring clears the text; the rule does not. */
.sf-news h2 { font: 500 15px/20px var(--f-type); color: var(--ink); }
.sf-news-body { margin-top: var(--s16) !important; font: 400 14px/20px var(--f-type); color: var(--ink-2); text-wrap: pretty; }
.sf-news-row { position: relative; display: flex; height: var(--h-ctl); margin: var(--s16) -12px 0; padding-inline: 12px; }
.sf-news-row::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 1px; background: var(--edge);
  transition: background-color var(--t-fb) var(--ease); pointer-events: none; }
.sf-news input { flex: 1; min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0;
  font: 400 15px/20px var(--f-type); color: var(--ink); caret-color: var(--sun); }
.sf-news input::placeholder { color: var(--ink-3); opacity: 1; }
/* autofill keeps the void, not the browser's pale fill */
.sf-news input:-webkit-autofill { -webkit-text-fill-color: var(--ink); transition: background-color 600000s 0s; }
/* one ring for the whole line while the field has focus */
.sf-news input:focus-visible { outline: none; }
/* drawn inside the line so it stays clear of the text above and below, and replaces the rule rather than doubling it */
.sf-news-row:has(input:focus-visible) { outline: 2px solid var(--sun); outline-offset: -2px; }
.sf-news-row:has(input[aria-invalid="true"])::after { background: var(--ink); }
.sf-news-row:has(input:focus-visible)::after { background: transparent; }
.sf-news button { flex: none; padding: 0 0 0 var(--s16); background: transparent; border: 0; cursor: pointer;
  font: 500 15px/20px var(--f-type); color: var(--ink); transition: color var(--t-fb) var(--ease), transform var(--t-fb) var(--ease); }
.sf-news button:active { transform: scale(.97); }
.sf-news-msg { margin-top: var(--s8) !important; min-height: 20px; font: 400 14px/20px var(--f-type); color: var(--ink-3); text-wrap: balance; }
.sf-news-msg[data-state="ok"], .sf-news-msg[data-state="error"] { color: var(--ink); }
@media (hover: hover) {
  .sf-news button:hover { color: #fff; }
  .sf-news-row:hover::after { background: var(--ink-2); }
}

/* Sitemap */
.sf-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
.sf-col summary { display: block; list-style: none; cursor: default; }
.sf-col summary::-webkit-details-marker { display: none; }
.sf-col h2 { font: 500 15px/20px var(--f-type); color: var(--ink); }
.sf-chev { display: none; }
.sf-col ul { margin-top: var(--s16); display: grid; row-gap: var(--s8); font-size: 15px; line-height: 20px; } /* no taller strut: rows are 20 + 8 */
.sf-col a, .sf-legal a { text-decoration: none; transition: color var(--t-fb) var(--ease), text-decoration-color var(--t-fb) var(--ease); }
.sf-col a { display: inline-block; padding: 4px 6px; margin: -4px -6px; /* 28 px targets, even ring gap */
  font: 500 15px/20px var(--f-type); color: var(--ink-2); }
.sf-col a:hover { color: var(--ink); }

/* Station panel (§8.4, v3). The name changes width only (squash and stretch); nothing beside it moves.
   The planet line sits straight under the stop line in the same style, so the two read as one paragraph;
   footer.js holds its height at the longest planet's, so the panel never shifts on a jump. */
.sf-loc { right: auto !important; width: max-content; max-width: 100%; }
.sf-state { font: 500 15px/20px var(--f-type); color: var(--ink-2); }
.sf-name { margin-top: var(--s8) !important; height: 60px; white-space: nowrap;
  font: 300 60px/60px var(--f-type); font-stretch: var(--w-display); color: var(--ink); }
.sf-stop { text-wrap: balance; margin-top: var(--s12) !important; font: 400 17px/26px var(--f-type); color: var(--ink-2); }
.sf-line { width: 36em; max-width: 100%; font: 400 17px/26px var(--f-type); color: var(--ink-2); }
.sf-ctl { display: flex; align-items: center; gap: var(--s16); margin-top: var(--s24); }

/* Ghost button: text only; min-width so "Hold on" does not resize it */
.sf-jump { position: relative; flex: none; min-width: 208px; height: var(--h-ctl); padding-inline: var(--pad-ctl);
  cursor: pointer; background: transparent; border: 1px solid var(--edge);
  font: 500 15px/20px var(--f-type); color: var(--ink);
  transition: border-color var(--t-fb) var(--ease), transform var(--t-fb) var(--ease); }
.sf-jump:hover { border-color: var(--ink-2); }
.sf-jump:active { transform: scale(.98); }
.sf-jump[aria-disabled="true"] { cursor: default; color: var(--ink-3); border-color: var(--edge); transform: none; }

/* Pause / play for the automatic jumps: no border, so it stays quieter than the jump button. 20 px glyphs
   (the four-glyph style: 1.5 px stroke, square caps), 44 px target; the two glyphs cross-fade in place. */
.sf-pause { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-2);
  transition: color var(--t-fb) var(--ease), transform var(--t-fb) var(--ease); }
.sf-pause:active { transform: scale(.94); }
.sf-ico { grid-area: 1 / 1; transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
.sf-ico-play, .sf-pause[aria-pressed="true"] .sf-ico-pause { opacity: 0; transform: scale(.8); }
.sf-pause[aria-pressed="true"] .sf-ico-play { opacity: 1; transform: none; }
@media (hover: hover) { .sf-pause:hover { color: var(--ink); } }

/* Bottom bar: the legal line, the type credit, links out and the fiducial plate, centred on one line at
   1440 and up (it needs about 1,320 px). Links are 28 px targets (the sitemap's), the plate 28 px tall. */
.sf-legal { display: flex; align-items: center; column-gap: var(--s32);
  top: auto !important; bottom: var(--s24); grid-column: 1 / -1;
  font: 400 14px/20px var(--f-type); color: var(--ink-3); }
.sf-legal-text { display: flex; column-gap: var(--s24); }
.sf-legal-text span, .sf-elsewhere a { white-space: nowrap; }
.sf-legal-text a { color: var(--ink-2); text-decoration: underline 1px var(--edge); text-underline-offset: 3px; }
.sf-elsewhere { display: flex; column-gap: var(--s24); margin-left: auto !important; }
.sf-elsewhere a { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 28px;
  padding-inline: 6px; margin-inline: -6px; color: var(--ink-2); }
@media (hover: hover) {
  .sf-legal a:hover { color: var(--ink); }
  .sf-legal-text a:hover { text-decoration-color: var(--ink-2); }
}
/* Mourier's blocks sit low in their line box: up 2 px puts their middle on the text's (measured at 3x) */
.sf-fiducial { position: relative; top: -2px; font-size: 28px; line-height: 28px; }

/* Desktop >= 1280: brand | sitemap | dispatches on one row; the panel 32 px above the horizon (apexUp 320) */
.sf-brand { grid-column: 1 / 4; top: 56px; }
.sf-links { grid-column: 4 / 10; top: 56px; }
.sf-news { grid-column: 10 / 13; top: 56px; }
.sf-loc { grid-column: 1 / 7; top: auto !important; bottom: calc(352px + var(--sf-legal)); }

/* Below 1440 the bottom bar takes two rows: the two sentences on one line, then the links and the plate
   centred on one line. Below 1024 the sentences take a line each. */
@media (max-width: 1439px) {
  .site-footer { --sf-legal: 108px; }
  .sf-legal { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s12); }
  .sf-legal-text { grid-column: 1 / -1; }
  .sf-elsewhere { margin-left: 0 !important; }
}

/* 768-1279: the rows flow. Brand | dispatches, then the sitemap, then the panel; bottom padding is
   apexUp 300 + 32. */
@media (max-width: 1279px) {
  /* At least a screen above the bottom bar, so Voyages never shows the bar. --sf-bar: footer.js. */
  .site-footer { --sf-legal: 0px; height: auto; min-height: calc(100svh + var(--sf-bar, 0px) + 12px); }
  .sf-grid { height: auto; min-height: inherit; grid-template-rows: auto auto 1fr; padding-top: 56px; padding-bottom: 332px; }
  .sf-grid > * { position: static; }
  .sf-brand { grid-column: 1 / 7; grid-row: 1; }
  .sf-news { grid-column: 7 / 13; grid-row: 1; }
  .sf-links { grid-column: 1 / 13; grid-row: 2; margin-top: var(--s64) !important; }
  .sf-loc { grid-column: 1 / 13; grid-row: 3; align-self: end; margin-top: var(--s64) !important; }
  .sf-legal { position: absolute !important; } /* left and right 0: its grid area is the content box */
}

/* Tablet (768): the type steps down, and the planet line narrows so the ship has room beside the panel */
@media (max-width: 1023px) {
  .sf-name { height: 44px; font-size: 44px; line-height: 44px; }
  .sf-line { width: 26em; }
  .sf-legal-text { flex-direction: column; }
}

/* Phone (390): one column, link groups fold, and the scene (ship, panel, horizon) sits at the bottom.
   ponytail: spec apexUp is 280; the bottom bar is about 170 tall here, so 300 keeps the lit band off it. */
@media (max-width: 767px) {
  .sf-grid { display: flex; flex-direction: column; }
  .sf-tagline { font-size: 16px; line-height: 24px; }
  .sf-news { margin-top: 40px !important; }
  .sf-news input { font-size: 16px; } /* 16 px: iOS zooms the page on focus below that */
  .sf-links { display: block; margin-top: 40px !important; border-bottom: 1px solid var(--line); }
  .sf-col { border-top: 1px solid var(--line); }
  .sf-col summary { display: flex; align-items: center; justify-content: space-between; height: 48px; cursor: pointer; }
  .sf-chev { display: block; color: var(--ink-2); transition: transform var(--t) var(--ease); }
  .sf-col[open] .sf-chev { transform: rotate(180deg); }
  .sf-col ul { margin: 0 0 var(--s8); row-gap: 0; }
  .sf-col a { display: flex; align-items: center; min-height: var(--tap); padding-block: 0; margin-block: 0; }
  .sf-loc { align-self: auto; margin-top: 240px !important; }
  .sf-name { height: 36px; font-size: 36px; line-height: 36px; }
  .sf-stop, .sf-line { font-size: 16px; line-height: 24px; }
  .sf-line { width: auto; }
  /* bottom bar: sentences balanced over their lines, then the links on a 3 x 2 grid of 44 px rows */
  .sf-legal { display: block; left: var(--gutter) !important; right: var(--gutter) !important; } /* flex parent: no grid area */
  .sf-legal-text { row-gap: var(--s8); }
  .sf-legal-text span { white-space: normal; text-wrap: balance; }
  .sf-elsewhere { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s16); margin-top: var(--s8) !important; }
  .sf-elsewhere a { justify-content: flex-start; min-height: var(--tap); }
  .sf-fiducial { display: none; }
}

/* The jump (v4): during the peak the text and controls give way to the light and come back. Opacity only, so
   nothing moves and everything stays operable. A control holding keyboard focus stays, on a plate of the void. */
.sf-scrim, .sf-grid > *, .sf-loc > .sf-state, .sf-loc > .sf-ctl, .sf-news > :not(.sf-news-row), .sf-links > * { transition: opacity 320ms var(--ease); }
.site-footer.is-lit .sf-scrim { opacity: 0; }
.site-footer.is-lit .sf-grid > :not(:focus-visible, :has(:focus-visible)),
.site-footer.is-lit .sf-grid > :has(:focus-visible) > :not(:focus-visible, :has(:focus-visible)),
.site-footer.is-lit .sf-ctl > :not(:focus-visible, :has(:focus-visible)) { opacity: 0 !important; }   /* beats the readout's inline fade */
.site-footer.is-lit .sf-grid :focus-visible { background: var(--void); box-shadow: 0 0 0 4px var(--void); color: var(--ink); }
.site-footer.is-lit .sf-news-row:has(input:focus-visible) { background: var(--void); }

@media (prefers-reduced-motion: reduce) {
  .sf-ico { transition: opacity 160ms var(--ease); }
  .sf-ico-play, .sf-pause[aria-pressed="true"] .sf-ico-pause { transform: none; }
}
