/* The lifecycle film (homepage #fits; js/film.js). Prompt 17A built the engine; Prompt 17B gave it its look ("a technical
   drawing that comes alive": ink linework on white surfaces, drawn in js/film.js); Prompt 18 made Operate the AI Brain
   finale. Prompt 19: the stepper runs across the top of the frame (Skip at its right end); below it the left panel
   (about 36%: the stage name, the headline, Today, Now and How it works, all at once, never scrolling) and the canvas
   (about 64%). In the canvas: the one AI moment card beside its subject (a thin pointer line), the soft spotlight that
   follows the subject of each move, and the finale's nodes and cards. Phones: the stepper scrolls sideways along the
   top, the canvas, then the panel under it, all in one screen. */

.lf { padding-bottom: var(--pad-sec); }
/* Prompt 21: the film is dark from start to finish, in both site themes. The section continues the bridge's ink (its top
   #040F33, the colour the bridge ends on, so there is no seam) and deepens to #071B53 by the end of the track, where the
   frame releases; the faint white grid at 4% throughout. The frame sits above the section's grain. */
.lf.on-ink, [data-theme="dark"] .lf.on-ink {
  background-color: #071B53;
  background-image: linear-gradient(180deg, #040F33 0, #071B53 320px, #0A2668 100%);
  background-size: 100% 100%;
}
.lf .film-track { z-index: 1; }
.lf .sec-head + .film-track { margin-top: var(--g-content); }

/* the track: the frame's own height plus 60% of the screen per slice (50% on phones): nine stages and the finale (1.5).
   The frame fills the screen below the nav exactly (dvh where supported, so no band shows when a phone's bars move). */
.film-track { position: relative; height: calc(100vh - var(--nav-h) + 1550vh); height: calc(100svh - var(--nav-h) + 1550svh); }   /* Prompt 31: nine stage slices of 150% and the AI Brain finale of 200% (js/film.js storyAt); the film follows the scroll */
.film-frame {
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h));
  overflow: hidden; isolation: isolate;
  background-color: #071B53;
  background-image: linear-gradient(180deg, #071B53 0%, #0A2668 100%);
  background-size: 100% 100%;
  --bar: 56px; --side: 36%; --fk: 1;
  --glass-shadow: 0 16px 40px -16px rgba(0, 0, 0, .55);
}

/* ---------- the stepper bar across the top: dots joined by lines that fill blue up to the current stage ---------- */
.film-bar {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: var(--bar);
  display: flex; align-items: center; gap: 24px; padding: 0 32px; border-bottom: 1px solid var(--line);
}
.film-rail { flex: 1 1 auto; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.film-rail::-webkit-scrollbar { display: none; }
.film-rail-l { display: flex; align-items: center; height: 100%; min-width: max-content; }
.film-rail-l > li { flex: 1 1 0; display: flex; align-items: center; min-width: max-content; }
.film-rail-l > li::after { content: ""; flex: 1 1 auto; min-width: 12px; height: 1px; margin: 0 12px; background: var(--tick); transition: background-color .3s ease, box-shadow .3s ease; }
.film-rail-l > li:last-child { flex: none; }
.film-rail-l > li:last-child::after { display: none; }
.film-rail-l > li.is-past::after { background: linear-gradient(90deg, var(--signal), #A6DBFF); box-shadow: 0 0 6px rgba(108, 196, 254, .45); }
.film-st { position: relative; display: flex; align-items: center; gap: 8px; height: 32px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); opacity: .72; transition: opacity .25s ease; white-space: nowrap; }
.film-st:hover { opacity: .9; }
.film-dot { position: relative; z-index: 1; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ring); }
.film-st.is-past .film-dot { background: var(--signal); border-color: var(--signal); }
.film-st.is-active { opacity: 1; }
.film-st.is-active .film-dot { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft), 0 0 10px rgba(108, 196, 254, .55); }
.film-st.is-active .film-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 12px 2px rgba(108, 196, 254, .45); opacity: .35; }
@media (prefers-reduced-motion: no-preference) { .film-st.is-active .film-dot::after { animation: lc-breathe 2.4s ease-in-out infinite; } }
/* the finale's item: a small blue dot, always */
.film-st--ai .film-dot { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 6px rgba(108, 196, 254, .55); }
.film-skip { flex: none; color: var(--muted); padding: 6px 0; white-space: nowrap; }
.film-skip:hover { color: var(--ink); }
.film-skip-s { display: none; }
@media (max-width: 1439.98px) { .film-rail-l > li::after { margin: 0 8px; min-width: 8px; } }
@media (max-width: 1099.98px) { .film-rail-l > li::after { margin: 0 5px; min-width: 6px; } .film-st { gap: 6px; } }
@media (max-width: 1199.98px) { .film-bar { padding: 0 24px; gap: 16px; } .film-rail-l > li::after { margin: 0 8px; min-width: 8px; } .film-skip-l { display: none; } .film-skip-s { display: inline; } }

/* ---------- the canvas area: right of the panel, under the bar ---------- */
.film-stage { position: absolute; top: var(--bar); right: 0; bottom: 0; left: 0; z-index: 0; overflow: hidden; }   /* Prompt 21: full bleed under the bar */
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.film-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.film-lines line { stroke: var(--glass-ink); stroke-opacity: .4; stroke-width: 1.5; }
.film-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.glass { background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); }

/* ---------- the left panel: everything at once, set compactly (js/film.js steps --fk down a little if a stage would
   not fit, so it never scrolls) ---------- */
/* Prompt 21: the panel floats over the left of the full-bleed canvas as glass: ink at 55% with a 16px blur, a thin
   gradient border (::before), and a right edge that fades into the scene (a mask over its last 56px; the text keeps
   clear of it). Every shot is composed to the right of it (js/film.js). */
.film-side {
  position: absolute; z-index: 3; left: 16px; top: calc(var(--bar) + 16px); bottom: 16px; width: calc(var(--side) - 16px); overflow: hidden;
  border-radius: 20px; background: rgba(7, 27, 83, .88);
  -webkit-backdrop-filter: blur(16px) saturate(130%); backdrop-filter: blur(16px) saturate(130%);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0, 0, 0, .55) calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0, 0, 0, .55) calc(100% - 20px), transparent);
}
.film-side::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(108, 196, 254, .5), rgba(166, 219, 255, .18) 45%, rgba(255, 255, 255, .06) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.film-card { height: 100%; padding: calc(28px * var(--fk)) 72px 20px 28px; }
.film-text-in { transition: opacity .25s ease, transform .25s var(--ease); }
.film-text-in.is-out { opacity: 0; transform: translateY(8px); transition: opacity .15s ease, transform .15s ease; }
.film-card-k { color: var(--muted); }
.film-card-h { margin-top: calc(8px * var(--fk)); font-size: calc(28px * var(--fk)); font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; text-wrap: balance; }
.film-today, .film-now { position: relative; margin-top: calc(12px * var(--fk)); padding-left: 16px; font-size: calc(15px * var(--fk)); line-height: 1.45; text-wrap: pretty; max-width: 34em; }
.film-today { color: var(--muted); }
.film-now { color: var(--ink); font-weight: 500; }
.film-today::before, .film-now::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 2px; }
.film-today::before { background: var(--amber); }
.film-now::before { background: var(--signal); }
.film-how-p { margin-top: calc(24px * var(--fk)); padding-top: calc(16px * var(--fk)); border-top: 1px solid var(--line); }
.film-how-k { color: var(--muted); }
.film-uc { margin-top: calc(12px * var(--fk)); display: grid; gap: calc(16px * var(--fk)); }
.film-uc .rd-card-t { display: block; font-size: calc(14.5px * var(--fk)); font-weight: 600; line-height: 1.3; }
.film-uc .rd-rows { margin: calc(6px * var(--fk)) 0 0; display: grid; gap: calc(4px * var(--fk)); }
.film-uc .rd-rows > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.film-uc .rd-rows dt { padding-top: calc(2px * var(--fk)); font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.film-uc .rd-rows dd { margin: 0; font-size: calc(13.5px * var(--fk)); line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 1365.98px) { .film-card { padding: calc(24px * var(--fk)) 64px 18px 24px; } .film-card-h { font-size: calc(24px * var(--fk)); } .film-today, .film-now { font-size: calc(14px * var(--fk)); } .film-uc .rd-rows dd { font-size: calc(13px * var(--fk)); } }

/* ---------- the AI moment card: the only floating card; amber marker for the problem, blue for AI ---------- */
.flab {
  position: absolute; left: 0; top: 0; max-width: 300px; padding: 10px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.4; font-weight: 500; opacity: 0; visibility: hidden;
}
.flab.is-on { visibility: visible; }
.flab-k { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-family: var(--f-mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--glass-muted); }
.flab-k b { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.flab-k b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blu); box-shadow: 0 0 0 3px rgba(108, 196, 254, .16); }
.flab--amber .flab-k b::before { background: var(--amb); box-shadow: 0 0 0 3px rgba(138, 147, 166, .16); }
.flab--q .flab-k b::before { background: var(--glass-muted); box-shadow: none; }
.flab-q { margin-top: 2px; font-weight: 400; color: var(--glass-muted); }
.flab-a { margin-top: 6px; }
.flab-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.flab-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid rgba(108, 196, 254, .35); color: var(--blu); font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.flab--table { width: 252px; }
.flab-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.flab-t td { padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-weight: 400; opacity: .14; transition: opacity .25s ease; }
.flab-t tr.is-in td { opacity: 1; }
.flab-t td + td { text-align: right; font-family: var(--f-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
/* the quantity tags lifting off the bid sheets into the table */
.ftag {
  position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--glass); border: 1px solid rgba(108, 196, 254, .35); color: var(--blu);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; visibility: hidden;
}
.ftag.is-on { visibility: visible; }
/* small mono tags beside the amber marks (Check) */
.fmark { position: absolute; left: 0; top: 0; padding: 2px 8px; border-radius: 6px; background: var(--glass); border: 1px solid rgba(138, 147, 166, .35); color: var(--amb-t); font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; opacity: 0; visibility: hidden; }
.fmark.is-on { visibility: visible; }
/* the AI lock: a thin glowing blue outline with a soft halo (never a fat ring) */
.fring { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 1.5px solid var(--blu); box-shadow: 0 0 0 5px rgba(108, 196, 254, .08), 0 0 14px rgba(108, 196, 254, .45); opacity: 0; visibility: hidden; }
.fring.is-on { visibility: visible; }
/* the plotter's pen tip (Plan): a glowing cyan-to-blue point, its tail drawn in the line shader */
.fpen { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle, #EAF2FF 0 18%, #A6DBFF 32%, rgba(108, 196, 254, .45) 52%, rgba(108, 196, 254, 0) 72%); opacity: 0; }

/* ---------- the AI Brain finale: nodes (each label on a small dark pill, placed clear of the lines and of each other by
   js/film.js), the race pulses with gradient tails, the question card and then the answer card at the top centre ---------- */
.fnode { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; }
.fnode.is-on { visibility: visible; }
.fnode i { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #6CC4FE; box-shadow: 0 0 0 3px rgba(108, 196, 254, .18), 0 0 12px rgba(108, 196, 254, .8); }
.fnode span {
  position: absolute; left: 0; top: 0; white-space: nowrap; padding: 3px 7px; border-radius: 999px;
  background: rgba(4, 15, 51, .88); border: 1px solid rgba(108, 196, 254, .22);
  font-family: var(--f-mono); font-size: 9.5px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .82);
}
.fnode--d i { left: -5.5px; top: -5.5px; width: 11px; height: 11px; background: #071B53; border: 1.5px solid #FFFFFF; box-shadow: 0 0 10px rgba(108, 196, 254, .55); }
.fnode--d span { font-size: 10.5px; color: #FFFFFF; border-color: rgba(255, 255, 255, .2); }
.fpulse { position: absolute; left: 0; top: -2px; width: 44px; height: 4px; margin-left: -40px; border-radius: 6px; transform-origin: 40px 2px;
  background: linear-gradient(90deg, rgba(108, 196, 254, 0), rgba(108, 196, 254, .55) 55%, #A6DBFF 88%, #EAF2FF);
  box-shadow: 0 0 10px 1px rgba(166, 219, 255, .45); opacity: 0; }
.flab--qa { width: 276px; max-width: 276px; }   /* Prompt 21: narrower, so the cards sit beside the core and the diagram can fill the canvas */
.flab-q2 { margin-top: 2px; font-weight: 500; }
.flab--qa .flab-a { margin-top: 0; font-weight: 400; color: var(--glass-ink); }
.flab .tw-rest, .flab .tw-hide { visibility: hidden; }

/* ---------- phones and narrow frames: the stepper scrolls sideways along the top; the canvas; the panel under it.
   js/film.js sets --panel to the tallest stage's panel, so both fit one screen and nothing moves between stages ---------- */
@media (max-width: 899.98px) {
  /* Prompt 28H: phones use the same 80% slices */
  .film-frame { --bar: 48px; --side: 0px; --panel: 46%; }
  .film-bar { padding: 0 0 0 4px; gap: 0; background: var(--bg); }
  .film-rail-l { padding: 0 12px 0 8px; }
  .film-rail-l > li { flex: none; }
  .film-rail-l > li::after { min-width: 10px; width: 10px; flex: none; margin: 0 4px; }
  .film-st { height: 30px; padding: 0 10px; border-radius: 999px; }
  .film-st.is-active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
  .film-skip { display: none; }
  .film-stage { top: var(--bar); bottom: 0; left: 0; }                    /* the canvas runs under the panel; the camera centres on what shows above it */
  .film-side { transition: transform .5s var(--ease); }
  .film-frame.is-fin .film-side { transform: translateY(calc(var(--panel) - var(--panel-fin, 104px))); }   /* the finale: the panel slides down to its headline */
  .film-side { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: var(--panel); border-radius: 20px 20px 0 0; background: rgba(7, 27, 83, .9); -webkit-mask-image: none; mask-image: none; }
  .film-card { padding: 16px; }
  .film-card-h { margin-top: 4px; font-size: calc(19px * var(--fk)); }
  .film-today, .film-now { margin-top: calc(8px * var(--fk)); font-size: calc(13px * var(--fk)); line-height: 1.4; }
  .film-how-p { margin-top: calc(12px * var(--fk)); padding-top: calc(10px * var(--fk)); }
  .film-uc { margin-top: calc(8px * var(--fk)); gap: calc(8px * var(--fk)); }
  .film-uc .rd-card-t { font-size: calc(13px * var(--fk)); }
  .film-uc .rd-rows > div:not(.rd-does) { display: none; }       /* phones: each card's Does line only */
  .film-uc .rd-rows > div { grid-template-columns: minmax(0, 1fr); }
  .film-uc .rd-rows dt { display: none; }
  .film-uc .rd-rows dd { font-size: calc(12.5px * var(--fk)); }
  .flab { max-width: 210px; padding: 8px 10px; font-size: 12px; border-radius: 12px; }
  .flab--table { width: 196px; }
  .flab--qa { width: 300px; max-width: calc(100vw - 24px); }
  .flab-t { font-size: 11.5px; }
  .fnode:not(.fnode--d) span { display: none; }
  .fnode--d span { font-size: 8.5px; padding: 2px 6px; white-space: normal; width: max-content; max-width: 78px; text-align: center; line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) { .film-text-in, .film-text-in.is-out { transition: none; opacity: 1; transform: none; } }

/* ---------- stages 6 to 9 (Prompt 17 overnight) ---------- */
/* the "Approved" stamp that lands on the shop drawings (blue: the AI check passed) */
.fstamp { position: absolute; left: 0; top: 0; padding: 6px 14px; border: 1.5px solid var(--blu); border-radius: 6px; color: var(--blu); background: rgba(7, 27, 83, .7); font-family: var(--f-mono); font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; box-shadow: 0 0 0 4px rgba(108, 196, 254, .1), 0 0 18px rgba(108, 196, 254, .35); opacity: 0; visibility: hidden; transform-origin: 50% 50%; }
.fstamp.is-on { visibility: visible; }
/* the dashboard card's bar: 18 of 24 racks built */
.flab-bar { margin-top: 8px; height: 4px; border-radius: 2px; background: rgba(108, 196, 254, .14); overflow: hidden; }
.flab-bar i { display: block; width: 75%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #6CC4FE, #6CC4FE); }
.flab-chip--amb { border-color: rgba(138, 147, 166, .4); color: var(--amb-t); }
/* the frame's UI on ink: light text, the light glass, blue #6CC4FE for AI and amber #8A97B5 for problems */
/* Prompt 21: the frame carries .is-dusk from the start (in the markup): the film is dark throughout, in both themes. AI marks glow cyan-blue, problems amber with a soft glow */
.film-frame.is-dusk {
  --ink: #FFFFFF; --ink-2: #E2EAF8; --muted: #C4CDE3; --tick: rgba(255, 255, 255, .18); --ring: rgba(255, 255, 255, .35); --bg: #071B53;
  --surface: rgba(255, 255, 255, .04); --line: rgba(255, 255, 255, .12);
  --signal: #6CC4FE; --signal-soft: rgba(108, 196, 254, .16); --on-signal: #071B53; --amber: #8A97B5;
  --glass: rgba(10, 32, 92, .9); --glass-line: rgba(255, 255, 255, .12); --glass-ink: #FFFFFF; --glass-muted: #C4CDE3;
  --amb: #8A97B5; --amb-t: #8A97B5; --blu: #6CC4FE;
  color: #FFFFFF;
}
.film-frame.is-dusk .film-skip { color: #C4CDE3; }

/* Prompt 19 (recaptured dark in Prompt 21, 75 KB, the full-bleed stage with the sheet right of the panel): without WebGL (or if three.js fails) the canvas shows a still of the completed Plan sheet, captured from the
   live renderer at 2x (img/film/film-plan.webp), never an empty frame; the panel and the stepper work as usual */
.film-frame.is-no3d .film-stage { background: url(../img/film/film-plan.webp) 70% 50% / cover no-repeat; }

/* Prompt 21: on the dark film, the AI cards carry a faint cyan-blue glow and the problem cards a soft amber one */
.flab--blue { box-shadow: var(--glass-shadow), 0 0 0 1px rgba(108, 196, 254, .22), 0 0 28px -8px rgba(108, 196, 254, .45); }
.flab--amber { box-shadow: var(--glass-shadow), 0 0 0 1px rgba(138, 151, 181, .26), 0 0 28px -8px rgba(138, 151, 181, .4); }
.flab--q { box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255, 255, 255, .08); }
.fring { box-shadow: 0 0 0 5px rgba(108, 196, 254, .1), 0 0 16px rgba(108, 196, 254, .6); }
.fmark { box-shadow: 0 0 14px -2px rgba(138, 151, 181, .45); }

/* ---------- Prompt 22: the film's connection to "Where the days go" ---------- */
/* the stage's fact under Today and Now (amber, with its source marker; js/facts.js renders it from the data file) */
.film-fact:empty { display: none; }
.film-fact-l { position: relative; margin-top: calc(12px * var(--fk)); padding-left: 16px; font-size: calc(13.5px * var(--fk)); line-height: 1.45; color: #C4CDE3; text-wrap: pretty; max-width: 34em; }
.film-fact-l::before { content: ""; position: absolute; left: 3px; top: .35em; width: 1px; height: calc(100% - .5em); background: linear-gradient(180deg, #8A97B5, rgba(138, 151, 181, 0)); }
.film-fact-l .src-m { color: #C4CDE3; border-color: rgba(138, 151, 181, .45); }
@media (max-width: 899.98px) { .film-fact-l { margin-top: calc(6px * var(--fk)); font-size: calc(12px * var(--fk)); line-height: 1.4; } }
/* the waiting meter: a thin bar under the stepper, one segment per stage, amber (waiting) then blue (resolved) */
.film-meter { position: absolute; left: 32px; right: 32px; bottom: -2px; height: 3px; display: flex; gap: 4px; pointer-events: none; z-index: 1; }
.film-meter i { position: relative; flex: 1; height: 100%; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.film-meter b, .film-meter u { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); border-radius: 2px; }
.film-meter b { background: linear-gradient(90deg, #8A97B5, #8A97B5); box-shadow: 0 0 8px rgba(138, 151, 181, .55); }
.film-meter u { background: linear-gradient(90deg, #6CC4FE, #A6DBFF); box-shadow: 0 0 8px rgba(108, 196, 254, .55); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .film-meter.is-settled i { animation: meter-settle 1.2s var(--ease) 1; } }
@keyframes meter-settle { 0% { box-shadow: none; } 40% { box-shadow: 0 0 12px 1px rgba(108, 196, 254, .6); } 100% { box-shadow: none; } }
@media (max-width: 1199.98px) { .film-meter { left: 24px; right: 24px; } }
@media (max-width: 899.98px) { .film-meter { left: 12px; right: 12px; gap: 3px; height: 2px; } }
/* the end card over the finale, just before the frame releases */
.film-end {
  position: absolute; z-index: 5; right: 48px; top: 50%; width: min(440px, calc(64% - 96px)); margin-top: -150px; padding: 28px 28px 24px; border-radius: 20px;
  background: rgba(7, 27, 83, .9); border: 1px solid rgba(255, 255, 255, .12); color: #FFFFFF;
  -webkit-backdrop-filter: blur(16px) saturate(130%); backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(108, 196, 254, .08);
  opacity: 0; visibility: hidden; pointer-events: none;
}
.film-end.is-on { visibility: visible; pointer-events: auto; }
.film-end-h { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.film-end-r { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.film-end-r a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); font-size: 13px; color: #E2EAF8; transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.film-end-r a:hover, .film-end-r a:focus-visible { color: #FFFFFF; border-color: rgba(108, 196, 254, .6); background: rgba(108, 196, 254, .1); outline: none; }
.film-end-a { display: inline-block; margin-top: 24px; font-size: 17px; font-weight: 600; color: #8A97B5; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; text-shadow: 0 0 12px rgba(138, 151, 181, .55), 0 0 30px rgba(138, 151, 181, .28); }
.film-end-a:hover { text-decoration-thickness: 2px; }
@media (max-width: 899.98px) { .film-end { left: 12px; right: 12px; width: auto; top: auto; bottom: calc(var(--panel-fin, 104px) + 16px); margin-top: 0; padding: 20px; } .film-end-r a { height: 28px; font-size: 12px; padding: 0 10px; } .film-end-a { margin-top: 16px; font-size: 15px; } }

/* ==========================================================================================================
   Prompt 23: the film in the colour law. Lines #EAF2FF on a navy gradient (#071B53 to #0A2668) with azure light pools;
   problem cards become grey dashed "waiting" cards; AI moments are azure and each resolution lands with a small lime
   tick; the Approved stamp (a resolution) is lime; the waiting meter goes grey, then azure, then lime.
   ========================================================================================================== */
.film-frame.is-dusk { --glass: rgba(10, 32, 92, .86); --glass-line: rgba(255, 255, 255, .12); --glass-ink: #FFFFFF; --glass-muted: #E2EAF8; --amb: #8A97B5; --amb-t: #E2EAF8; --blu: #6CC4FE; }
.flab--amber { background: rgba(7, 27, 83, .9); border: 1px dashed rgba(138, 151, 181, .75); box-shadow: 0 16px 36px -18px rgba(2, 8, 30, .6); }
.flab--amber .flab-k b::before { background: transparent; border: 1px dashed #8A97B5; box-shadow: none; width: 8px; height: 8px; }
.flab--blue { box-shadow: 0 16px 40px -16px rgba(2, 8, 30, .6), 0 0 0 1px rgba(108, 196, 254, .22), 0 0 32px -10px rgba(108, 196, 254, .4); }
.flab--blue .flab-k b::before { background: #6CC4FE; box-shadow: 0 0 0 3px rgba(108, 196, 254, .18), 0 0 10px rgba(108, 196, 254, .6); }
/* the resolution: a small lime tick lands on each AI card once it has settled in */
.flab--blue .flab-k::after {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: #E3FB99 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.6 8.4 7 10.6l4.4-5' fill='none' stroke='%23071B53' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: 0 0 10px rgba(227, 251, 153, .35); transform: scale(0); opacity: 0;
}
.flab--blue.is-on .flab-k::after { animation: f-tick .45s var(--ease) .35s both; }
@keyframes f-tick { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flab--blue.is-on .flab-k::after { animation: none; transform: none; opacity: 1; } }
.fmark { background: rgba(7, 27, 83, .9); border: 1px dashed rgba(138, 151, 181, .75); color: #E2EAF8; box-shadow: none; }
.fstamp { border-color: #E3FB99; color: #FFFFFF; background: rgba(7, 27, 83, .9); box-shadow: 0 0 0 4px rgba(227, 251, 153, .08), 0 0 18px rgba(227, 251, 153, .28); }
.flab-chip { border-color: rgba(108, 196, 254, .4); color: #6CC4FE; }
.flab-chip--amb { border: 1px dashed rgba(138, 151, 181, .7); color: #E2EAF8; }
.flab-bar { background: rgba(108, 196, 254, .14); }
.flab-bar i { background: linear-gradient(90deg, #6CC4FE, #A6DBFF); }
/* the stage's fact: white text, an azure rule */
.film-fact-l { color: #EAF2FF; }
.film-fact-l::before { background: linear-gradient(180deg, #6CC4FE, rgba(108, 196, 254, 0)); }
.film-fact-l .src-m { color: #E2EAF8; border-color: rgba(255, 255, 255, .25); }
/* the waiting meter: grey (waiting), azure (AI working), lime (resolved) */
.film-meter b { background: #8A97B5; box-shadow: none; opacity: .75; }
.film-meter u { background: #6CC4FE; box-shadow: 0 0 6px rgba(108, 196, 254, .5); }
.film-meter s { position: absolute; inset: 0; transform-origin: 0 50%; border-radius: 2px; background: #E3FB99; box-shadow: 0 0 6px rgba(227, 251, 153, .45); opacity: 0; }
@keyframes meter-settle { 0% { box-shadow: none; } 40% { box-shadow: 0 0 12px 1px rgba(227, 251, 153, .45); } 100% { box-shadow: none; } }
/* the end card's link: a primary lime pill (the one way on to the page) */
.film-end-a { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px; background: #E3FB99; color: #071B53; text-decoration: none; text-shadow: none; font-size: 15px; box-shadow: 0 0 22px -4px rgba(227, 251, 153, .45); transition: transform .2s var(--ease), background-color .2s ease; }
.film-end-a:hover { background: #EBFDB3; transform: translateY(-2px); text-decoration: none; }
.film-end-r a:hover, .film-end-r a:focus-visible { border-color: rgba(108, 196, 254, .6); background: rgba(108, 196, 254, .1); }
.film-st.is-active .film-dot { box-shadow: 0 0 0 3px rgba(108, 196, 254, .18), 0 0 10px rgba(108, 196, 254, .55); }
.film-rail-l > li.is-past::after { background: linear-gradient(90deg, #6CC4FE, #A6DBFF); box-shadow: 0 0 6px rgba(108, 196, 254, .35); }
.film-side { background: rgba(7, 27, 83, .88); }
.film-side::before { background: linear-gradient(150deg, rgba(108, 196, 254, .45), rgba(108, 196, 254, .12) 45%, rgba(255, 255, 255, .05) 80%); }
.film-today::before { background: transparent; border: 1px dashed #8A97B5; }
.film-now::before { background: #6CC4FE; }

/* ==========================================================================================================
   Prompt 25: the film follows the site theme. In light (js/film.js sets .is-light on the frame and .on-white on the
   section; dark keeps .is-dusk and .on-ink, unchanged) the whole film is light: an ice-white-to-white ground with a low
   azure pool behind the subject, navy linework, white surfaces, AI marks in a deeper azure #2E8FD6 with a soft halo,
   waiting grey #8A93A6 dashed, resolved lime with a navy tick; white glass for the panel and the cards; no dusk.
   ========================================================================================================== */
.lf.on-white { background: #FFFFFF; }
.film-frame.is-light {
  --ink: #071B53; --ink-2: #42506E; --muted: #5A6680; --tick: rgba(7, 27, 83, .16); --ring: rgba(7, 27, 83, .3); --bg: #FFFFFF;
  --surface: #FFFFFF; --line: #E3EAF3;
  --signal: #2E8FD6; --signal-soft: rgba(46, 143, 214, .14); --on-signal: #FFFFFF; --amber: #8A93A6;
  --glass: rgba(255, 255, 255, .9); --glass-line: #E3EAF3; --glass-ink: #071B53; --glass-muted: #42506E;
  --amb: #8A93A6; --amb-t: #42506E; --blu: #2E8FD6;
  --glass-shadow: 0 16px 40px -18px rgba(7, 27, 83, .22);
  color: #071B53;
  background-color: #F3F8FD;
  background-image: linear-gradient(180deg, #F3F8FD 0%, #FFFFFF 100%);
}
/* the details panel: white glass, a #E3EAF3 hairline, navy text */
.film-frame.is-light .film-side { background: rgba(255, 255, 255, .88); box-shadow: 0 16px 40px -22px rgba(7, 27, 83, .2); }
.film-frame.is-light .film-side::before { background: #E3EAF3; }
.film-frame.is-light .film-today::before { border-color: #8A93A6; }
.film-frame.is-light .film-now::before { background: #2E8FD6; }
.film-frame.is-light .film-fact-l { color: #42506E; }
.film-frame.is-light .film-fact-l::before { background: linear-gradient(180deg, #2E8FD6, rgba(46, 143, 214, 0)); }
.film-frame.is-light .film-fact-l .src-m { color: #42506E; border-color: rgba(7, 27, 83, .25); }
/* the stepper and the waiting meter: navy labels, the active stage's azure glow; grey, then azure, then lime */
.film-frame.is-light .film-rail-l > li.is-past::after { background: linear-gradient(90deg, #2E8FD6, #6CC4FE); box-shadow: none; }
.film-frame.is-light .film-st.is-active .film-dot { box-shadow: 0 0 0 3px rgba(46, 143, 214, .16), 0 0 10px rgba(108, 196, 254, .7); }
.film-frame.is-light .film-st--ai .film-dot { box-shadow: 0 0 6px rgba(108, 196, 254, .7); }
.film-frame.is-light .film-meter i { background: rgba(7, 27, 83, .08); }
.film-frame.is-light .film-meter b { background: #8A93A6; opacity: 1; }
.film-frame.is-light .film-meter u { background: #2E8FD6; box-shadow: 0 0 6px rgba(108, 196, 254, .6); }
.film-frame.is-light .film-meter s { box-shadow: inset 0 0 0 1px rgba(7, 27, 83, .14); }
/* the cards: white glass; waiting cards dashed grey; AI cards with an azure edge and the lime tick */
.film-frame.is-light .flab--amber { background: rgba(255, 255, 255, .9); border-color: #8A93A6; box-shadow: 0 16px 36px -20px rgba(7, 27, 83, .25); }
.film-frame.is-light .flab--amber .flab-k b::before { border-color: #8A93A6; }
.film-frame.is-light .flab--blue { box-shadow: 0 16px 40px -18px rgba(7, 27, 83, .22), 0 0 0 1px rgba(46, 143, 214, .3), 0 0 28px -10px rgba(108, 196, 254, .5); }
.film-frame.is-light .flab--blue .flab-k b::before { background: #2E8FD6; box-shadow: 0 0 0 3px rgba(46, 143, 214, .16); }
.film-frame.is-light .flab--blue .flab-k::after { box-shadow: inset 0 0 0 1px rgba(7, 27, 83, .12); }
.film-frame.is-light .flab--q { box-shadow: var(--glass-shadow), 0 0 0 1px #E3EAF3; }
.film-frame.is-light .flab-chip { border-color: rgba(46, 143, 214, .45); color: #071B53; }
.film-frame.is-light .flab-chip--amb { border-color: #8A93A6; color: #42506E; }
.film-frame.is-light .flab-t td { border-top-color: #E3EAF3; }
.film-frame.is-light .flab-bar { background: rgba(46, 143, 214, .14); }
.film-frame.is-light .flab-bar i { background: #2E8FD6; }
.film-frame.is-light .ftag { border-color: rgba(46, 143, 214, .45); color: #071B53; }
.film-frame.is-light .fmark { background: rgba(255, 255, 255, .92); border-color: #8A93A6; color: #42506E; }
.film-frame.is-light .fring { border-color: #2E8FD6; box-shadow: 0 0 0 5px rgba(46, 143, 214, .08), 0 0 14px rgba(108, 196, 254, .6); }
.film-frame.is-light .fpen { background: radial-gradient(circle, #2E8FD6 0 18%, #6CC4FE 34%, rgba(108, 196, 254, .4) 54%, rgba(108, 196, 254, 0) 72%); }
/* the Approved stamp: navy on white, ringed by a lime band (the resolution) */
.film-frame.is-light .fstamp { background: #FFFFFF; border-color: #071B53; color: #071B53; box-shadow: 0 0 0 4px #E3FB99, 0 10px 24px -12px rgba(7, 27, 83, .3); }
/* the AI Brain finale: navy nodes, white pills, azure pulses (the core and threads are drawn in js/film.js) */
.film-frame.is-light .fnode i { background: #071B53; box-shadow: 0 0 0 3px rgba(46, 143, 214, .18), 0 0 10px rgba(108, 196, 254, .6); }
.film-frame.is-light .fnode span { background: rgba(255, 255, 255, .92); border-color: #E3EAF3; color: #071B53; }
.film-frame.is-light .fnode--d i { background: #FFFFFF; border-color: #071B53; box-shadow: 0 0 10px rgba(108, 196, 254, .6); }
.film-frame.is-light .fnode--d span { color: #071B53; border-color: #E3EAF3; }
.film-frame.is-light .fpulse { background: linear-gradient(90deg, rgba(46, 143, 214, 0), rgba(46, 143, 214, .6) 55%, #2E8FD6 88%, #6CC4FE); box-shadow: 0 0 10px 1px rgba(108, 196, 254, .5); }
/* the end card: white glass */
.film-frame.is-light .film-end { background: rgba(255, 255, 255, .9); border-color: #E3EAF3; color: #071B53; box-shadow: 0 24px 60px -28px rgba(7, 27, 83, .3); }
.film-frame.is-light .film-end-r a { border-color: rgba(7, 27, 83, .16); background: #FFFFFF; color: #42506E; }
.film-frame.is-light .film-end-r a:hover, .film-frame.is-light .film-end-r a:focus-visible { color: #071B53; border-color: #2E8FD6; background: #F3F8FD; }
.film-frame.is-light .film-end-a { box-shadow: 0 1px 2px rgba(7, 27, 83, .12), 0 8px 18px -8px rgba(7, 27, 83, .3); }
@media (max-width: 899.98px) { .film-frame.is-light .film-side { background: rgba(255, 255, 255, .92); } }
/* without WebGL in light: the light capture of the completed Plan sheet (2x, Prompt 25) */
.film-frame.is-light.is-no3d .film-stage { background-image: url(../img/film/film-plan-light.webp); }
/* Prompt 28: the Approved stamp is a lime fill with navy text (dark and light); the end card's link follows the button
   rule (lime on the dark film, navy with a lime ring on hover on the light film) */
.fstamp, .film-frame.is-light .fstamp { background: #E3FB99; border-color: #E3FB99; color: #071B53; }
.film-frame.is-light .fstamp { box-shadow: 0 0 0 1px rgba(7, 27, 83, .14), 0 10px 24px -12px rgba(7, 27, 83, .3); }
.film-frame.is-light .film-end-a { background: #071B53; color: #FFFFFF; }
.film-frame.is-light .film-end-a:hover { background: #0A2668; box-shadow: 0 0 0 2px #E3FB99, 0 8px 18px -8px rgba(7, 27, 83, .3); }
@media (prefers-reduced-motion: no-preference) { .film-st.is-active .film-dot::after { animation: none; } }   /* Prompt 28: no idle loops */

/* Prompt 28: the phone pass. The stepper chips are 44px tap targets; the panel text is at least 15px (labels 12px), so
   on phones the panel keeps the stage name, headline, Today, Now and the fact, and leaves How it works to the desktop */
@media (max-width: 899.98px) {
  .film-frame { --bar: 52px; }
  .film-st { height: 44px; }
  .film-today, .film-now, .film-fact-l { font-size: 15px; }
  .film-how-p { display: none; }
  .flab, .flab-a, .flab-q { font-size: 15px; }
  .flab-k, .flab-chip, .ftag, .fmark, .fnode span, .fnode--d span, .film-card-k { font-size: 12px; }
  .flab-t { font-size: 15px; }
  .flab-t td + td { font-size: 12px; }
  .fstamp { font-size: 13px; }
}

/* Prompt 28B: at the right end of the stepper, a small lime pill with navy text to Where the days go, with a soft,
   steady lime glow (no pulse); in both film themes */
.film-days { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  background: #E3FB99; color: #071B53; font-size: 13px; font-weight: 600; letter-spacing: -0.005em; text-decoration: none;
  box-shadow: 0 0 16px -2px rgba(227, 251, 153, .55); transition: background-color .2s ease, transform .2s var(--ease); }
.film-days:hover { background: #EBFDB3; transform: translateY(-1px); }
.film-days:focus-visible { outline: 2px solid #6CC4FE; outline-offset: 2px; }
.film-frame.is-light .film-days { box-shadow: 0 0 0 1px rgba(7, 27, 83, .1), 0 0 16px -2px rgba(227, 251, 153, .9); }
@media (max-width: 899.98px) { .film-days { height: 44px; margin: 0 6px; padding: 0 14px; font-size: 13px; } }

/* Prompt 28B: the film headline is the section statement: H1 size, wrapping naturally on phones; from 1024px one line
   across the content width (js/film.js sets the size, at most 120px) */
.fits-h { font-size: var(--fs-h1); line-height: 1.02; max-width: none; letter-spacing: -0.035em; }
@media (min-width: 1024px) { .fits-h { white-space: nowrap; } }

/* ==========================================================================================================
   Prompt 28F: "Skip to next section". A small mono link in an outline pill at the frame's bottom right (24px in), over
   the whole film; it fades as the frame releases (js/film.js). It uses the site's instant jump (a short veil, a jump, the
   veil fades; the film holds its rendering meanwhile) to What we build, the heading 32px under the nav. Not lime.
   Phones: smaller, just above the stage panel (and above its headline in the finale), so it never covers either.
   ========================================================================================================== */
.film-next { position: absolute; z-index: 6; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .3); background: rgba(7, 27, 83, .55);
  transition: transform .2s var(--ease), border-color .2s ease, background-color .2s ease, opacity .2s ease; }
.film-next:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .75); }
.film-next:focus-visible { outline: 2px solid #6CC4FE; outline-offset: 3px; }
.film-frame.is-light .film-next { color: #071B53; border-color: rgba(7, 27, 83, .4); background: rgba(255, 255, 255, .7); }
.film-frame.is-light .film-next:hover { border-color: #071B53; }
@media (max-width: 899.98px) {
  .film-next { right: 12px; bottom: calc(var(--panel, 46%) + 12px); height: 32px; padding: 0 11px; font-size: 12px; letter-spacing: .04em; }
  .film-frame.is-fin .film-next { bottom: calc(var(--panel-fin, 104px) + 12px); }
}
@media (max-width: 899.98px) { .film-frame:has(.film-end.is-on) .film-next { top: calc(var(--bar) + 12px); bottom: auto; } }   /* phones: clear of the end card */

/* ==========================================================================================================
   Prompt 28H. THE END CARD: solid (white on the light film, navy on the dark), never see-through; the diagram behind
   it dims to about 30% as it comes in (js/film.js sets --end-o); its action is a lime pill with navy text and a soft
   lime glow (the film's main action). THE BRIGHTER LIME (light theme only): the lime used for fills and glows on white
   (the meter's resolved segments, the end card's pill, the "Where the days go" pill, resolved ticks and stamps) is
   #C6EE3E with a fine #A6CC2A edge and a soft glow; the dark theme keeps #E3FB99. Inactive meter segments #E3EAF3.
   ========================================================================================================== */
.film-frame .film-canvas, .film-frame .film-labels, .film-frame .film-lines { opacity: calc(1 - .7 * var(--end-o, 0)); }
.film-end { background: #071B53; -webkit-backdrop-filter: none; backdrop-filter: none; }
.film-frame.is-light .film-end { background: #FFFFFF; }
.film-end-a, .film-frame.is-light .film-end-a { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px; background: #E3FB99; color: #071B53; text-decoration: none; font-weight: 600; box-shadow: 0 0 22px -4px rgba(227, 251, 153, .55); }
.film-end-a:hover, .film-frame.is-light .film-end-a:hover { background: #EBFDB3; transform: translateY(-2px); }
html:not([data-theme="dark"]) .film-frame.is-light .film-end-a { background: #C6EE3E; box-shadow: 0 0 0 1px #A6CC2A, 0 0 10px rgba(198, 238, 62, .6); }
html:not([data-theme="dark"]) .film-frame.is-light .film-end-a:hover { background: #D2F45E; box-shadow: 0 0 0 1px #A6CC2A, 0 0 14px rgba(198, 238, 62, .7); }
html:not([data-theme="dark"]) .film-frame.is-light .film-days { background: #C6EE3E; box-shadow: 0 0 0 1px #A6CC2A, 0 0 10px rgba(198, 238, 62, .6); }
html:not([data-theme="dark"]) .film-frame.is-light .film-days:hover { background: #D2F45E; }
html:not([data-theme="dark"]) .film-frame.is-light .film-meter i { background: #E3EAF3; }
html:not([data-theme="dark"]) .film-frame.is-light .film-meter s { background: #C6EE3E; box-shadow: inset 0 0 0 1px #A6CC2A, 0 0 10px rgba(198, 238, 62, .6); }
html:not([data-theme="dark"]) .film-frame.is-light .flab--blue .flab-k::after { background-color: #C6EE3E; box-shadow: inset 0 0 0 1px #A6CC2A, 0 0 10px rgba(198, 238, 62, .6); }
html:not([data-theme="dark"]) .film-frame.is-light .fstamp { background: #C6EE3E; border-color: #A6CC2A; box-shadow: 0 0 10px rgba(198, 238, 62, .6), 0 10px 24px -12px rgba(7, 27, 83, .3); }
@keyframes meter-settle { 0% { box-shadow: none; } 40% { box-shadow: 0 0 12px 1px rgba(198, 238, 62, .6); } 100% { box-shadow: none; } }
