/* homecloud scroll film - grey-box stage + placeholder copy zones. */

/* The site's two faces (PLAN_INTERACTIVE.md rule 7: "keep the fonts consistent throughout"), from the bundled library.
   Declared here so every page and every panel / card / layer (Shadow DOM included) can use them; a face is only
   downloaded when some text uses it. */
@font-face { font-family: "Instrument Sans"; src: url("fonts/library/instrument-sans/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/library/inter/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }

/* registered so getComputedStyle(...).getPropertyValue('--hdr-h') reads a resolved length ("103px"), not the
   calc(56px + env(...)) text: engine/copy.js and engine/cue.js read it */
@property --hdr-h { syntax: "<length>"; inherits: true; initial-value: 48px; }

:root {
  --bg: #0b0d10;
  --ink: #f2f4f7;
  --ink-dim: #aab2bd;
  --line: #2a3038;
  --zone: #ffb14a;           /* placeholder zone colour (the test frames bake #ff8c00) */
  --zone-fill: rgba(8, 10, 14, 0.34);
  --focus: #7cc4ff;
  --hdr-h: 48px;             /* the header's height: anchors, the stills' top padding (phones: the taller bar, below) */
  --stage-h: 100vh;          /* one "vh" of pacing = one stage height */
  --stage-h: 100svh;         /* small viewport where supported: notch.js stops touch scrolling, so iOS Safari's toolbar
                                never collapses and 100vh (= the large viewport) would put the stage's bottom under it */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;   /* rule 7: Inter */
  --mono: "Inter", system-ui, sans-serif;   /* rule 7: one type system - the old monospace stack is retired */
  --ui-font-display: "Instrument Sans", system-ui, sans-serif;   /* headings, titles, big numbers (panels, cards, layers) */
  --ui-font-text: "Inter", system-ui, sans-serif;                /* everything else; tabular-nums for data */
  color-scheme: dark;

  /* Copy box style. layout.json "style" overrides any of these (the engine sets them on :root; edit.html's
     Style panel writes them). The defaults below are the placeholder look; README "CSS variables" lists them.
     *-scale values multiply the viewport-relative size and its px floor and ceiling (1 = as designed). */
  --copy-bg: var(--zone-fill);
  --copy-backdrop: none;                 /* a backdrop-filter, e.g. blur(12px) */
  --copy-border-width: 2px;
  --copy-border-style: dashed;
  --copy-border-color: var(--zone);
  --copy-radius: 0px;
  --copy-shadow: none;
  --copy-pad-scale: 1;
  --copy-font: var(--font);
  --copy-heading-font: var(--copy-font);  /* font-family of the heading, line, button and tag (uploaded fonts too) */
  --copy-line-font: var(--copy-font);
  --copy-button-font: var(--copy-font);
  --copy-tag-font: var(--mono);
  --copy-align: start;                   /* text-align */
  --copy-items: normal;                  /* align-items of the text column (center / flex-end with centred / right text) */
  --copy-justify: center;                /* vertical placement: flex-start / center / flex-end */
  --copy-heading-scale: 1;
  --copy-heading-weight: 700;
  --copy-heading-color: var(--ink);
  --copy-heading-tracking: -0.01em;
  --copy-heading-leading: 1.04;
  --copy-heading-case: none;             /* text-transform */
  --copy-line-scale: 1;
  --copy-line-weight: 400;
  --copy-line-color: rgba(242, 244, 247, 0.9);
  --copy-line-measure: 34ch;
  --copy-button-scale: 1;
  --copy-button-pad: 0.55em 1.15em;
  --copy-button-border: 1.5px solid currentColor;
  --copy-button-radius: 999px;
  --copy-button-bg: rgba(0, 0, 0, 0.2);
  --copy-button-bg-hover: rgba(255, 255, 255, 0.14);
  --copy-button-color: var(--ink);
  --copy-button-weight: 600;
  --copy-button-tracking: normal;
  --copy-button-case: none;
  --copy-button-decoration: none;        /* underline for a text-link button */
  --copy-tag-display: flex;              /* none hides the "COPY ZONE" tag */
  --copy-tag-bg: var(--zone);
  --copy-tag-color: #16120a;
  --copy-fade-distance: 14px;            /* px the text slides while it fades (read by engine/copy.js) */
  --copy-text-shadow: none;              /* text-shadow of the heading, line and button (e.g. 0 1px 12px rgba(0,0,0,.5)) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(to bottom, rgba(11, 13, 16, 0.72), rgba(11, 13, 16, 0));
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand { order: 0; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: none; flex: none; width: 28px; height: 22px; }   /* the phone header only */
.wordmark {
  order: 0; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; font-size: 17px;
}
.status-pill {
  order: 1; font: 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px;
}
.skip-link {
  order: 2; margin-left: auto;
  font-size: 14px; text-decoration: none; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(242, 244, 247, 0.12); border: 1px solid rgba(242, 244, 247, 0.35);
  backdrop-filter: blur(6px);
}
.skip-link::after { content: " \2193"; }
.skip-link:hover { background: rgba(242, 244, 247, 0.22); }
.skip-link.is-past { visibility: hidden; }
.mode-stills .skip-link::after { content: ""; }
.menu-btn, .next-btn { display: none; }   /* the phone header only (below) */

/* ---------------------------------------------------------------- phone header (device.js PHONE_UI_Q: phones either way up)
   The brand symbol + wordmark on the left, a 44 px menu button on the right, on a translucent blurred bar over the film;
   solid once the film has scrolled away (html.hc-film-past, engine/main.js), in the stills view and without the film.
   The skip link and the scene nav move into the menu (engine/menu.js, engine/scenenav.js 'menu' mode). Without JS the
   skip link stays: it is the way past the (hidden) film. The query string is device.js PHONE_UI_Q. */
@media (max-width: 640px), (max-height: 500px) and (hover: none) {
  :root { --hdr-h: calc(56px + env(safe-area-inset-top)); --foot-h: calc(110px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: var(--hdr-h); }
  html, body { overscroll-behavior-y: none; }   /* no iOS rubber band: the film starts at 0, a flight never bounces */   /* "Skip to the end", the stills' scene jumps: below the bar */
  /* the after-film section and the footer (one line: 110 px) fill the window below the bar: "Skip to the end" and the
     page's end show them alone, never the film's last text box half under the (solid) bar. A longer footer only eats
     into the section's 96 px top padding. */
  .after { min-height: calc(var(--stage-h) - var(--hdr-h) - var(--foot-h)); }
  .site-footer { min-height: var(--foot-h); }
  .site-header {
    height: var(--hdr-h); gap: 10px;
    padding: env(safe-area-inset-top) max(4px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    pointer-events: auto;
    background: rgba(11, 13, 16, 0.5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07);
  }
  html.hc-film-past .site-header, .mode-stills .site-header, .no-js .site-header, .boot-failed .site-header {
    background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .no-js .site-header { padding-right: max(16px, env(safe-area-inset-right)); }   /* the skip link at the right */
  .skip-link { min-height: 44px; line-height: 28px; }   /* (no JS only) a 44 px tap target: 28 + 2 x 7 padding + 2 x 1 border */
  .brand-mark { display: block; }
  .status-pill { display: none; }
  .js .site-header .skip-link { display: none; }
  .js .menu-btn {
    order: 3; display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: 0 0 0 auto; padding: 0;
    border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  /* "Next": on to the next pause point (engine/main.js nextBtn; hidden at the last one and once the film is past) */
  .js .next-btn:not([hidden]) {
    order: 2; display: inline-flex; align-items: center; gap: 4px; flex: none; height: 44px; margin: 0 0 0 auto; padding: 0 10px 0 14px;
    border: 0; border-radius: 12px; background: none; color: var(--ink); font: 600 15px/1 var(--ui-font-text); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .js .next-btn:not([hidden]) ~ .menu-btn { margin-left: 2px; }
  html.hc-film-past .next-btn, .mode-stills .next-btn { display: none !important; }
  .next-btn svg { display: block; width: 20px; height: 20px; fill: none; stroke: #ffb14a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .next-btn:active, .menu-btn:active { background: rgba(255, 255, 255, 0.08); }
  .next-btn:focus-visible { outline-offset: -2px; }
  .menu-btn:focus-visible { outline-offset: -2px; }
  /* no site menu (engine/menu.js not running): the compact "Scenes" button stays in the bar, clear of the menu button */
  .js .hc-scenes.is-compact.is-right { right: calc(max(4px, env(safe-area-inset-right)) + 52px); top: calc(env(safe-area-inset-top) + 14px); }
}
.menu-btn svg, .hc-menu-close svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* ---------------------------------------------------------------- the phone menu (engine/menu.js)
   A modal <dialog> over the whole window (its own top layer: above the panels; the page behind is inert). The sheet
   drops from the top: a bar matching the header (the ✕ where the menu button was), the scene list (SceneNav moves its
   <nav> into the slot), then the links. A tap below the sheet closes it. The sheet scrolls on its own when it has to. */
.hc-menu-dlg {
  position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--ink); overflow: hidden; overscroll-behavior: contain;
  font: 16px/1.4 var(--ui-font-text);
}
.hc-menu-dlg::backdrop { background: rgba(5, 7, 10, 0.5); }
.hc-menu-sheet {
  max-height: 100%; overflow: auto; overscroll-behavior: contain;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: rgba(11, 13, 17, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 0 0 18px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.hc-menu-dlg[open] .hc-menu-sheet { animation: hc-menu-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hc-menu-dlg[open]::backdrop { animation: hc-menu-fade 0.22s ease; }
@keyframes hc-menu-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes hc-menu-fade { from { opacity: 0; } }
.hc-menu-bar {
  display: flex; align-items: center; gap: 10px; height: var(--hdr-h);
  padding: env(safe-area-inset-top) max(4px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.hc-menu-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: 0.02em; font-size: 17px; font-family: var(--font); }
.hc-menu-brand .brand-mark { display: block; }
.hc-menu-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; border-radius: 12px;
  background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hc-menu-close:active { background: rgba(255, 255, 255, 0.08); }
.hc-menu-close:focus-visible { outline-offset: -2px; }
.hc-menu-scenes, .hc-menu-links { margin-left: max(12px, env(safe-area-inset-left)); margin-right: max(12px, env(safe-area-inset-right)); }
.hc-menu-h {
  margin: 6px 0 4px; padding: 0 10px;
  font: 600 11.5px/1.3 var(--ui-font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim);
}
.hc-menu-links { list-style: none; margin-top: 10px; margin-bottom: 0; padding: 8px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.hc-menu-links a, .hc-menu-links button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; margin: 0;
  padding: 0 12px 0 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; text-decoration: none;
  font: 600 16px/1.25 var(--ui-font-text); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hc-menu-links a:active, .hc-menu-links button:active { background: rgba(255, 255, 255, 0.07); }
.hc-menu-links a:focus-visible, .hc-menu-links button:focus-visible { outline-offset: -2px; }
.hc-menu-arrow { color: #ffb14a; font-weight: 700; }
/* a landscape phone: four columns of scenes and the links in one row, so the menu fits 390 px of height */
@media (min-width: 641px) {
  .hc-menu-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
}

/* ---------------------------------------------------------------- scene nav + "Back to the start" (engine/scenenav.js)
   Under the wordmark: one tick per pause point and the scene's short name (hover / focus a tick to read its name).
   Compact (phones, or a window where the rail would touch a text box): a "Scenes" button beside the wordmark that opens
   the list. Dark glass like the interactive UI; Inter only (rule 7). */
.hc-scenes {
  position: absolute; left: 12px; top: 42px;
  display: flex; align-items: center; gap: 8px;
  padding: 2px 11px 2px 5px; border-radius: 999px;
  background: rgba(11, 13, 17, 0.42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font: 500 12px/1 var(--ui-font-text); color: var(--ink-dim);
}
.hc-scenes-toggle { display: none; font: inherit; }
.hc-scenes-list { display: flex; margin: 0; padding: 0; list-style: none; }
.hc-scenes-list > li { display: block; }
.hc-scene {
  position: relative; display: block; width: 12px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 4px;
  background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hc-scene-tick {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 8px; margin: -4px 0 0 -1px; border-radius: 1px;
  background: rgba(242, 244, 247, 0.36); transition: height 0.18s ease, margin 0.18s ease, background-color 0.18s ease;
}
.hc-scene.is-past .hc-scene-tick { background: rgba(242, 244, 247, 0.62); }
.hc-scene:hover .hc-scene-tick, .hc-scene:focus-visible .hc-scene-tick { height: 12px; margin-top: -6px; background: var(--ink); }
.hc-scene[aria-current] .hc-scene-tick { width: 3px; height: 14px; margin: -7px 0 0 -1.5px; background: #ffb14a; box-shadow: 0 0 8px rgba(255, 177, 74, 0.6); }
.hc-scene:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.hc-scene-num, .hc-scene-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hc-scenes-label { color: var(--ink); font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.hc-scenes.is-preview .hc-scenes-label { color: var(--ink-dim); }

.hc-scenes.is-compact {
  position: relative; left: auto; top: auto; order: 1; display: block; padding: 0;
  background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hc-scenes.is-compact .hc-scenes-label { display: none; }
.hc-scenes.is-compact .hc-scenes-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 11px 0 12px; border: 0; border-radius: 999px;
  background: rgba(11, 13, 17, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--ink); font: 600 12.5px/1 var(--ui-font-text); cursor: pointer; white-space: nowrap;
}
.hc-scenes-toggle-n { color: var(--ink-dim); font-weight: 500; font-variant-numeric: tabular-nums; }
.hc-scenes-chev::before {
  content: ""; display: block; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.18s ease;
}
.hc-scenes.is-open .hc-scenes-chev::before { transform: translateY(1px) rotate(-135deg); }
.hc-scenes.is-compact .hc-scenes-list {
  position: absolute; left: 0; top: 34px; flex-direction: column; width: 232px; max-height: calc(var(--stage-h) - 84px); overflow: auto;
  padding: 6px; border-radius: 15px; background: rgba(11, 13, 17, 0.88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.hc-scenes.is-compact .hc-scene, .hc-scenes.is-menu .hc-scene {
  display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 9px 10px; border-radius: 9px; text-align: left;
  font: 500 14px/1.25 var(--ui-font-text); color: var(--ink);
}
.hc-scenes.is-compact .hc-scene:hover { background: rgba(255, 255, 255, 0.07); }
.hc-scenes.is-compact .hc-scene-tick, .hc-scenes.is-compact .hc-scene:hover .hc-scene-tick,
.hc-scenes.is-menu .hc-scene-tick, .hc-scenes.is-menu .hc-scene:hover .hc-scene-tick { position: static; flex: none; width: 3px; height: 14px; margin: 0; }
.hc-scenes.is-compact .hc-scene-num, .hc-scenes.is-compact .hc-scene-name,
.hc-scenes.is-menu .hc-scene-num, .hc-scenes.is-menu .hc-scene-name { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.hc-scenes.is-compact .hc-scene-num, .hc-scenes.is-menu .hc-scene-num { color: var(--ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.hc-scenes.is-compact .hc-scene[aria-current], .hc-scenes.is-menu .hc-scene[aria-current] { background: rgba(255, 177, 74, 0.12); }
/* a very wide, short window lifts the top text boxes under the header row too: the button goes to the top right */
.hc-scenes.is-compact.is-right { position: absolute; left: auto; right: 12px; top: 8px; }
.hc-scenes.is-compact.is-right .hc-scenes-list { left: auto; right: 0; }
@media (max-width: 380px) { .hc-scenes-toggle-n { display: none; } }
/* inside the phone menu: the whole list, two columns (four on a landscape phone), rows of 44 px or more. A grid that
   fills row by row, so the scene order reads left to right like the keys move (scenenav.js: Left / Right step one
   scene, Up / Down one row) */
.hc-scenes.is-menu {
  position: static; display: block; padding: 0; border-radius: 0;
  background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hc-scenes.is-menu .hc-scenes-toggle, .hc-scenes.is-menu .hc-scenes-label { display: none; }
.hc-scenes.is-menu .hc-scenes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px; }
.hc-scenes.is-menu .hc-scene { min-height: 44px; padding: 6px 8px 6px 10px; font-size: 15px; -webkit-tap-highlight-color: transparent; }
.hc-scenes.is-menu .hc-scene:active { background: rgba(255, 255, 255, 0.07); }
.hc-scenes.is-menu .hc-scene:focus-visible { outline-offset: -2px; }
@media (min-width: 641px) { .hc-scenes.is-menu .hc-scenes-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hc-tostart, .hc-tostart-after {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; cursor: pointer;
  font: 600 14px/1 var(--ui-font-text); color: var(--ink); white-space: nowrap;
}
.hc-tostart {
  position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5;
  height: 40px; padding: 0 17px 0 14px; border: 0;
  background: rgba(11, 13, 17, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.hc-tostart.is-on { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }
.hc-tostart:hover { background: rgba(24, 27, 33, 0.88); }
.hc-tostart-after { height: 38px; padding: 0 16px 0 13px; border: 1px solid rgba(242, 244, 247, 0.28); background: transparent; }
.hc-tostart-after:hover { background: rgba(255, 255, 255, 0.08); }
.hc-tostart-arrow { color: #ffb14a; font-weight: 700; }
.after-tostart { margin-top: 18px; }
/* the phone UI: 44 px tap targets (the brand link, both "Back to the start" buttons) */
@media (max-width: 640px), (max-height: 500px) and (hover: none) {
  .brand { min-height: 44px; }
  .hc-tostart, .hc-tostart-after { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .hc-scene-tick, .hc-scenes-chev::before, .hc-tostart, .hc-tostart.is-on { transition: none; }
  .hc-menu-dlg[open] .hc-menu-sheet, .hc-menu-dlg[open]::backdrop { animation: none; }
}

/* ---------------------------------------------------------------- swipe cue (engine/cue.js)
   The phone opening: a chevron over a short track, a dot rising along it, just above "welcome home." (placed by JS with
   a transform). Fades in after the heading lands; reduced motion: the same picture, still. */
.hc-cue {
  position: absolute; left: 0; top: 0; z-index: 3; width: 30px; height: 46px; pointer-events: none;
  color: var(--ink); filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.55));
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.hc-cue.is-on { opacity: 1; visibility: visible; transition: opacity 0.6s ease 0.8s; }
.hc-cue svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.hc-cue-chev { stroke-width: 2; animation: hc-cue-chev 2.4s ease-in-out infinite; }
.hc-cue-track { stroke-width: 1.5; stroke-opacity: 0.4; }
.hc-cue-dot { fill: currentColor; stroke: none; animation: hc-cue-swipe 2.4s cubic-bezier(0.45, 0, 0.25, 1) infinite; }
.hc-cue-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes hc-cue-swipe {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translateY(-22px); opacity: 0; }
  100% { transform: translateY(-22px); opacity: 0; }
}
@keyframes hc-cue-chev { 0%, 30% { transform: translateY(0); } 48% { transform: translateY(-3px); } 70%, 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .hc-cue-chev, .hc-cue-dot { animation: none; }
  .hc-cue-dot { transform: translateY(-11px); }
}

/* ---------------------------------------------------------------- film */
.no-js .film { display: none; }
.film { position: relative; overflow-x: clip; }
/* Track = stage height + pinned travel. --travel (in stage heights) is set from the manifest. */
.film-track {
  position: relative;
  height: calc(var(--stage-h) * (1 + var(--travel, 0)));
}
.film-stage {
  position: sticky; top: 0;
  height: var(--stage-h);
  overflow: hidden;
  background: #15181d;
}
.film-poster, .film-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.film-poster { object-fit: cover; object-position: 50% 50%; }
.film-canvas { opacity: 0; }
.film-stage.is-live .film-canvas { opacity: 1; }

.film-notice {
  position: absolute; left: 50%; bottom: max(24px, calc(8px + env(safe-area-inset-bottom))); transform: translateX(-50%); z-index: 4;
  max-width: min(560px, calc(100% - 32px)); margin: 0; padding: 10px 14px;
  background: rgba(0, 0, 0, 0.72); border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; text-align: center;
}

/* ---------------------------------------------------------------- copy zones */
.copy-layer {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  --fu: 7.2px; /* 1% of the cover-fitted film height; set from JS */
}
.copy-block {
  position: absolute;
  border: var(--copy-border-width) var(--copy-border-style) var(--copy-border-color);
  border-radius: var(--copy-radius);
  background: var(--copy-bg);
  -webkit-backdrop-filter: var(--copy-backdrop);
  backdrop-filter: var(--copy-backdrop);
  box-shadow: var(--copy-shadow);
  color: var(--ink);
  font-family: var(--copy-font);
}
.copy-layer .copy-block { visibility: hidden; }
.copy-layer .copy-block[data-state="fading"],
.copy-layer .copy-block[data-state="active"] { visibility: visible; }
.copy-layer .copy-block[data-state="active"] .copy-inner a { pointer-events: auto; }

.copy-tag {
  position: absolute; left: calc(-1 * var(--copy-border-width)); bottom: 100%;
  display: var(--copy-tag-display); flex-wrap: wrap; gap: 0 10px; align-items: baseline;
  max-width: calc(100% + 2 * var(--copy-border-width));
  padding: 3px 8px 2px;
  background: var(--copy-tag-bg); color: var(--copy-tag-color);
  font: 700 11px/1.3 var(--copy-tag-font); letter-spacing: 0.07em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}
.copy-tag-role { font-weight: 500; text-transform: none; letter-spacing: 0.02em; opacity: 0.8; }

.copy-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: var(--copy-justify);
  align-items: var(--copy-items); text-align: var(--copy-align);
  padding: clamp(calc(10px * var(--copy-pad-scale)), calc(var(--fu) * 2.6 * var(--copy-pad-scale)), calc(36px * var(--copy-pad-scale)));
  will-change: transform;
}
.copy-heading {
  margin: 0;
  font-size: clamp(calc(22px * var(--copy-heading-scale)), calc(var(--fu) * 5.2 * var(--copy-heading-scale)), calc(76px * var(--copy-heading-scale)));
  line-height: var(--copy-heading-leading); font-weight: var(--copy-heading-weight);
  letter-spacing: var(--copy-heading-tracking); text-transform: var(--copy-heading-case);
  color: var(--copy-heading-color); font-family: var(--copy-heading-font);
  text-wrap: balance;
}
.copy-line {
  margin: 0.55em 0 0; max-width: var(--copy-line-measure);
  font-size: clamp(calc(14px * var(--copy-line-scale)), calc(var(--fu) * 2.05 * var(--copy-line-scale)), calc(26px * var(--copy-line-scale))); line-height: 1.35;
  font-weight: var(--copy-line-weight); font-family: var(--copy-line-font);
  color: var(--copy-line-color);
}
.copy-actions { margin: clamp(10px, calc(var(--fu) * 1.8), 26px) 0 0; }
.copy-action, .button {
  display: inline-block; text-decoration: none;
  padding: 0.55em 1.15em; border-radius: 999px;
  border: 1.5px solid currentColor;
  font-size: clamp(13px, calc(var(--fu) * 1.75), 21px); font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}
.copy-action:hover, .button:hover { background: rgba(255, 255, 255, 0.14); }
/* The film's action button follows the --copy-button-* variables (the after-film .button keeps the rule above). */
.copy-action {
  padding: var(--copy-button-pad);
  border: var(--copy-button-border);
  border-radius: var(--copy-button-radius);
  background: var(--copy-button-bg);
  color: var(--copy-button-color);
  font-size: clamp(calc(13px * var(--copy-button-scale)), calc(var(--fu) * 1.75 * var(--copy-button-scale)), calc(21px * var(--copy-button-scale)));
  font-weight: var(--copy-button-weight); font-family: var(--copy-button-font);
  letter-spacing: var(--copy-button-tracking);
  text-transform: var(--copy-button-case);
  text-decoration: var(--copy-button-decoration); text-underline-offset: 0.22em;
}
.copy-action:hover { background: var(--copy-button-bg-hover); }
.copy-heading, .copy-line, .copy-action { text-shadow: var(--copy-text-shadow); }
/* the phone UI (device.js PHONE_UI_Q): the type follows --fu (the window's height), so a short phone (375 x 667: the
   line 13.4 px) would get small text; the heading and the line stop at 24 / 15 px (taller phones are above that
   already). The box's button is a 44 px tap target (its text centred) whatever its font size. */
@media (max-width: 640px), (max-height: 500px) and (hover: none) {
  .copy-heading { font-size: max(24px, clamp(calc(22px * var(--copy-heading-scale)), calc(var(--fu) * 5.2 * var(--copy-heading-scale)), calc(76px * var(--copy-heading-scale)))); }
  .copy-line { font-size: max(15px, clamp(calc(14px * var(--copy-line-scale)), calc(var(--fu) * 2.05 * var(--copy-line-scale)), calc(26px * var(--copy-line-scale)))); }
  .copy-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
}
.copy-clip[hidden] { display: none; }
.copy-clip {
  display: var(--copy-tag-display); /* a zone label: shown only with the COPY ZONE tags */
  position: absolute; top: 100%; margin-top: 18px; /* below the ?debug=1 canvas label */
  font: 11px/1.3 var(--mono); color: #16120a; background: #ffd89a; padding: 2px 6px;
  white-space: nowrap;
}

/* ?zones=all */
.zone-outline {
  position: absolute; border: 1px solid rgba(255, 177, 74, 0.95);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.zone-outline span {
  position: absolute; right: 0; top: 0; padding: 1px 5px;
  font: 10px/1.3 var(--mono); background: rgba(255, 177, 74, 0.9); color: #16120a;
}

/* ---------------------------------------------------------------- debug HUD */
/* Top centre: the one region no copy_zone uses, so the HUD never hides a zone. */
.hud {
  position: fixed; left: 50%; top: 52px; transform: translateX(-50%); z-index: 30; margin: 0;
  padding: 6px 10px; max-width: calc(100vw - 24px); overflow: hidden;
  font: 11px/1.4 var(--mono); color: #b8f5c4;
  background: rgba(0, 0, 0, 0.78); border: 1px solid #1f3b2a; border-radius: 6px;
  pointer-events: none; white-space: pre;
}

/* ---------------------------------------------------------------- reduced motion: stills */
.stills { padding: calc(var(--hdr-h) + 24px) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.stills-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1100px;
  display: grid; gap: 56px;
}
.still-figure { margin: 0; }
.still-figure img, .still-missing {
  display: block; width: 100%; height: auto;
  background: #1a1e24; border-radius: 6px;
}
/* the image keeps its own shape (its width / height attributes: a portrait film's stills are portrait), but never runs
   taller than the screen: portrait stills kept through a rotation to landscape are centred at screen height */
.still-figure img { max-height: calc(100svh - var(--hdr-h, 48px) - 48px); width: auto; max-width: 100%; margin-inline: auto; }
.still-missing { aspect-ratio: 16 / 9; }
.still-missing {
  display: grid; place-items: center; color: var(--ink-dim); font: 14px var(--mono);
}
.still-caption { margin-top: 8px; font: 12px/1.4 var(--mono); color: var(--ink-dim); }
.copy-block--flow {
  position: relative; margin-top: 30px; padding: 0;
  --fu: 7.2px;
}
.copy-block--flow .copy-inner { position: static; padding: 22px 24px; }
.stills-notice { margin: calc(var(--hdr-h) + 24px) auto 0; max-width: 720px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); color: var(--ink-dim); }

/* ---------------------------------------------------------------- after the film */
.after {
  border-top: 1px solid var(--line);
  padding: 96px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left));
  outline: none;
}
.after-inner { max-width: 760px; margin: 0 auto; }
.after h2 { font-family: var(--ui-font-display); font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0 0 12px; }
.after p { color: var(--ink-dim); }
.chapters-title { margin: 56px 0 8px; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.chapters { margin: 0; padding: 0 0 0 1.4em; display: grid; gap: 18px; }
.chapters h3 { margin: 0; font-size: 20px; }
.chapters p { margin: 4px 0 0; }
.chapter-meta { font: 12px/1.4 var(--mono); opacity: 0.7; }
.site-footer { padding: 24px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  text-align: center; color: var(--ink-dim); font-size: 13px; }
/* the phone UI: "Contact us" is a 44 px tap target */
@media (max-width: 640px), (max-height: 500px) and (hover: none) {
  .button { display: inline-flex; align-items: center; min-height: 44px; }
}
/* a landscape phone (the short half of PHONE_UI_Q): the section's padding and the footer shrink so the whole section
   and the footer fit below the bar (844 x 390: 334 px), so the page's end shows the heading below the solid bar, as
   upright; the .after min-height rule (the phone header block) then fills the rest */
@media (max-height: 500px) and (hover: none) {
  :root { --foot-h: calc(36px + env(safe-area-inset-bottom)); }
  .after { padding-top: 24px; padding-bottom: 24px; }
  .site-footer { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .site-footer p { margin: 0; }
}
.noscript { margin: calc(var(--hdr-h) + 24px) auto 0; max-width: 720px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

@media (max-width: 640px) {
  .status-pill { display: none; }
  .copy-tag-role { display: none; }
}
