/* The homepage only (SITE-3D-PLAN.md; look from mockup v7). Other pages keep styles.css, so this file can't break them.
 * CSP is style-src 'self': no style attributes or <style> blocks, every style lives here.
 * Looks: light by default, dark when the device asks and no choice is saved, or when html[data-look="dark"] (js/look.js).
 * Dark = warm graphite (David, 17 Nov 2026): lighter bands every second section, orange labels and main buttons.
 * The hero panel is dark in both looks, so the floor and its still render are the same picture in each.
 * Layout (SITE-LAYOUT-PLAN.md, 16 Nov): one 12-column grid, every section below the hero = a head row (label + H2 in
 *   columns 1–6, an optional line in 8–12) then content across all 12; one column on phones (<= 820 px).
 * Motion: only the WebGL canvases, and the section fades (html.fx, set by js/tier.js unless the tier is Still). */

:root {
  --bg: #F3F1EC; --fg: #111111; --muted: #57554F; --rule: #D9D5CC; --pill: #E6E2D9; --panel: #141518;
  --band: transparent; --label: var(--muted); --count: var(--fg); --btn: var(--fg); --btn-fg: var(--bg); --glow: rgba(240, 80, 26, .14);
  --display: "Excon", "Arial Black", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --gut: max(clamp(20px, 6.25vw, 80px), env(safe-area-inset-left, 0px));
  --nav-h: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-look="light"]) { --bg: #1A1917; --fg: #F3F1EC; --muted: #A8A49C; --rule: #34322E; --pill: #2A2826; --panel: #111111; --band: rgba(255, 240, 220, .04); --label: #F36A38; --count: #F36A38; --btn: var(--orange); --btn-fg: #111111; --glow: rgba(240, 80, 26, .30); color-scheme: dark; }
}
:root[data-look="dark"] { --bg: #1A1917; --fg: #F3F1EC; --muted: #A8A49C; --rule: #34322E; --pill: #2A2826; --panel: #111111; --band: rgba(255, 240, 220, .04); --label: #F36A38; --count: #F36A38; --btn: var(--orange); --btn-fg: #111111; --glow: rgba(240, 80, 26, .30); color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
a { color: var(--fg); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
::selection { background: var(--orange); color: #111111; }
.dot { color: var(--orange); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.gut { padding-left: var(--gut); padding-right: max(clamp(20px, 6.25vw, 80px), env(safe-area-inset-right, 0px)); }
/* SITE-LAYOUT-PLAN.md: content 1,120 px wide (1,280 with the 80 px margins), on one 12-column grid with 32 px gaps. */
.inner { max-width: 1120px; margin: 0 auto; width: 100%; }
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--label); }

/* The page-layer canvas (bending pictures) and the orange glow sit behind the copy. */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
main, .footer { position: relative; z-index: 1; }

/* ---------- Shell ---------- */
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }

.nav { position: fixed; left: 0; right: 0; top: 0; z-index: 9; transition: background-color .3s, box-shadow .3s; }
.nav.is-solid { background: var(--bg); box-shadow: 0 1px 0 var(--rule); }
.nav .inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--nav-h); }
html:not(.js) .nav { position: absolute; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.nav-links { display: flex; gap: 28px; margin-left: auto; margin-right: 16px; font-size: 15px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 12px 18px; font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; border: 0; cursor: pointer; color: var(--fg); background: var(--pill); }
.pill.solid { background: var(--fg); color: var(--bg); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); display: inline-block; }
.look[hidden] { display: none; }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-fg); font: 500 17px/1.2 var(--body); text-decoration: none; cursor: pointer; }
.btn svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.footer { border-top: 1px solid var(--rule); padding: 48px var(--gut) calc(48px + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.footer-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer .wordmark { font-size: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: 15px; }
.footer .legal { width: 100%; font-size: 13px; color: var(--muted); }
.footer-guides { width: 100%; align-items: baseline; }
.footer-label { font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Type ---------- */
.hero h1 { font-family: var(--display); font-weight: 500; font-size: 64px; line-height: 1; letter-spacing: -0.03em; }
.h2 { font-family: var(--display); font-weight: 500; font-size: 44px; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
.lede { font-size: 19px; line-height: 1.5; color: var(--muted); }

/* ---------- Hero: one screen. Copy in columns 1–5, the floor panel in 6–12. ---------- */
.hero { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 88px; }
.hero .inner { row-gap: 40px; align-items: center; }
.hero-l { grid-column: 1 / span 5; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.hero-l .lede { max-width: 30ch; }
.hero-l .btn { margin-top: 8px; }
.promise { font-size: 15px; }
.panel { grid-column: 6 / span 7; position: relative; height: 470px; border-radius: 20px; overflow: hidden; background: var(--panel); touch-action: pan-y; }
.panel-still, .panel-still img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* contain, like the live camera, which fits the floor by the panel's tighter side: the hand-off never jumps */
.panel-still img { object-fit: contain; transition: opacity .4s ease; }
.panel.live .panel-still img { opacity: 0; }
.panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.panel .tag { position: absolute; left: 22px; bottom: 20px; color: #A3A19B; z-index: 2; }
.panel .tag[hidden] { display: none; }
.flab { position: absolute; left: 0; top: 0; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(20, 21, 24, .78); color: #D9D6CF; font-size: 11px; white-space: nowrap; pointer-events: none; transition: opacity .5s, color .3s; will-change: transform; }
.flab i { width: 6px; height: 6px; border-radius: 50%; background: #55565A; transition: background .3s; }
.flab.on { color: #F3F1EC; }
.flab.on i { background: var(--orange); }

/* A bending picture: the <img> shows until WebGL has it as a texture, then WebGL draws it (html.gl-on). */
.bend { position: relative; border-radius: 14px; overflow: hidden; }
.bend img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.gl-on .bend.gl-ready img { opacity: 0; }

/* ---------- Sections: a rule above each, 96 px apart, a head row, then content on the 12 columns ---------- */
.sec { padding-block: 96px; border-top: 1px solid var(--rule); }
.head { margin-bottom: 48px; align-items: end; }
.head-t { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: 16px; }
.head-side { grid-column: 8 / span 5; }
.p, .work-line, .ba dd, .case-list li, .what-list p, .steps p, .faq-list p, .who-text p { color: var(--muted); }
h3 { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }

/* Our work: picture (7) + text (5), TEEEM then Fossick swapped; the stat (3) beside Rob's quote (9); our own software. */
.case { align-items: center; }
.case-media { grid-column: 1 / span 7; }
.case-text { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: 14px; }
.case-flip { margin-top: 72px; }
.case-flip .case-media { grid-column: 6 / span 7; grid-row: 1; }
.case-flip .case-text { grid-column: 1 / span 5; grid-row: 1; }
.work-title { font-size: 28px; line-height: 1.15; }
.work-title a { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.work-title a:hover { text-decoration: underline; }
.work-title svg, .calc-link svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.work-lead { font-size: 19px; line-height: 1.5; color: var(--fg); }
/* Before and after: what the client did by hand, and what the software does now. */
.ba { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.ba div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.ba dt { font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg); }
.ba div + div dt::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--orange); vertical-align: middle; }
.ba dd { margin: 0; }
.case-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.case-list li { position: relative; padding-left: 24px; }
.case-list li::before { content: ""; position: absolute; left: 0; top: .78em; width: 12px; height: 2px; background: var(--orange); }
.proof-row { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--rule); align-items: start; }
.case-stat { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 8px; }
.case-num { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.case-note { font-size: 15px; color: var(--muted); }
.quote { grid-column: 4 / span 9; display: flex; flex-direction: column; gap: 14px; }
.quote blockquote p { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.28; letter-spacing: -0.01em; }
.quote footer { margin-top: 14px; color: var(--muted); }
.ours { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--rule); align-items: start; }
.ours-t { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 12px; }
.ours-t p { font-size: 15px; color: var(--muted); }
.ours-shots { grid-column: 4 / span 9; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.ours-shots figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.ours-shots .bend { border: 1px solid var(--rule); border-radius: 12px; }
.ours-shots img { height: auto; }

/* The clips play flat in their frames (only their posters bend, SITE-3D-PLAN.md §3). */
.loop-frame { position: relative; overflow: hidden; border-radius: 14px; background: var(--panel); }
.loop-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: opacity .3s; }
/* The poster is a lazy <img> under the video (a poster attribute downloads at first paint). With JS the video stays
   hidden until it first plays, so no browser shows an empty black frame over it; WebGL bends the <img> meanwhile. */
.loop-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.loop-video { position: relative; }
html.js .loop-frame:not(.played) .loop-video, .gl-on .loop-frame.gl-ready:not(.played) .loop-poster { opacity: 0; }
.loop-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: inline-flex; align-items: center; gap: 12px; padding: 16px 24px; border: 0; border-radius: 999px; background: #F3F1EC; color: #111111; font: 600 17px/1.2 var(--body); cursor: pointer; }
.loop-play[hidden] { display: none; }
.loop-play::before { content: ""; width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.loop-play.is-playing { left: auto; top: auto; right: 16px; bottom: 16px; transform: none; gap: 8px; padding: 10px 16px; background: rgba(17, 17, 17, .72); color: #F3F1EC; font-size: 14px; }
.loop-play.is-playing::before { width: 8px; height: 11px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }

/* Your week: number (1) / problem (2–6) / fix (8–12). */
.rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.rows li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; padding-block: 28px; border-top: 1px solid var(--rule); }
.rows .n { grid-column: 1; padding-top: 5px; font: 500 12px var(--mono); color: var(--fg); }
.rows .n::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--orange); vertical-align: middle; }
.rows .pain { grid-column: 2 / span 5; }
.rows .fix { grid-column: 8 / span 5; }
.rows p { margin-top: 6px; color: var(--muted); }
.rows .fix h3 { display: flex; gap: 8px; }
.rows .fix svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.calc-link a { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; }

/* What we do, and How it works: three up. */
.what-list, .steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.what-list li, .steps li { border-top: 1px solid var(--rule); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps .n { font: 500 12px var(--mono); color: var(--fg); }

/* David: photo (5) + heading and text (7). */
.who-body { align-items: center; }
.who-photo { grid-column: 1 / span 5; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 14px; }
.who-text { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 16px; }
.who-text .who-lead { margin-top: 8px; color: var(--fg); }

/* Questions: a 2 × 2 grid. */
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.faq-list > div { border-top: 1px solid var(--rule); padding-block: 24px; display: flex; flex-direction: column; gap: 8px; }

/* Book a call: heading (7) + intro, button and links (5). */
.cta .inner { align-items: end; row-gap: 24px; }
.cta h2 { grid-column: 1 / span 7; font-family: var(--display); font-weight: 500; font-size: 64px; line-height: 1; letter-spacing: -0.03em; text-wrap: balance; }
.book-text { grid-column: 8 / span 5; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.book-alt { font-size: 15px; color: var(--muted); }

/* Section fades (once each, transform + opacity only). js/home.js adds .pre only to sections still below the screen. */
.fx .pre { opacity: 0; transform: translateY(28px); }
.fx .fade-in { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
/* Heading decode (js/home.js): the real letter holds its place, invisible; a random mono glyph sits centred over it. */
.dw { display: inline-block; }
.dc { position: relative; -webkit-text-fill-color: transparent; }
.dc::after { content: attr(data-s); position: absolute; inset: 0 -.5em; display: flex; align-items: center; justify-content: center; font: 500 .8em/1 var(--mono); color: var(--orange); -webkit-text-fill-color: var(--orange); pointer-events: none; }
.dc-wait::after { content: ""; }

/* Section bands (dark look only: --band is transparent in light). */
.week, .how, .faq { background: var(--band); }

/* Problem -> fix rows (js/home.js adds .rows-pre, then .on row by row): the problem is struck out and dims, the fix
 * slides in and its tick draws. Without .fx (Reduce Motion) nothing here applies and the rows just show. */
.fx .rows-pre .pain h3 { display: inline; background: linear-gradient(var(--orange), var(--orange)) 0 58% / 0% 2px no-repeat; transition: background-size .45s ease, opacity .5s ease; }
.fx .rows-pre .pain p { display: block; transition: opacity .5s ease; }
.fx .rows-pre .fix { opacity: 0; transform: translateX(-40px); transition: opacity .5s ease .35s, transform .6s cubic-bezier(.2, .7, .2, 1) .35s; }
.fx .rows-pre .fix svg path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .45s ease .8s; }
.fx .rows-pre li.on .pain h3 { background-size: 100% 2px; opacity: .5; }
.fx .rows-pre li.on .pain p { opacity: .4; }
.fx .rows-pre li.on .fix { opacity: 1; transform: none; }
.fx .rows-pre li.on .fix svg path { stroke-dashoffset: 0; }

/* "15–20 hours": counts up (js/home.js); orange in dark (#F36A38 = the orange lifted for 4.5:1 text on the graphite bands). */
.count { color: var(--count); font-weight: 600; font-variant-numeric: tabular-nums; }

/* The orange glow: fixed behind everything, drifts to the section being read (js/home.js sets --gx / --gy). */
.glow { position: fixed; z-index: 0; left: 0; top: 0; width: 80vmax; height: 80vmax; border-radius: 50%; pointer-events: none; display: none;
  background: radial-gradient(closest-side, var(--glow), transparent);
  transform: translate(var(--gx, 88vw), var(--gy, 30vh)) translate(-50%, -50%); transition: transform 1.8s cubic-bezier(.3, .7, .2, 1); }
.fx .glow { display: block; }
@media (prefers-reduced-motion: reduce) { .fx .pre { opacity: 1; transform: none; } .panel-still img, .nav { transition: none; } }

/* Between phone and laptop: the hero H1 steps down so its five columns still hold it. */
@media (max-width: 1100px) and (min-width: 821px) { .hero h1 { font-size: 52px; } .cta h2 { font-size: 52px; } }
@media (max-width: 380px) { .pill { padding: 9px 11px; letter-spacing: .03em; } .wordmark { font-size: 20px; } }
@media (max-width: 820px) {
  :root { --nav-h: 64px; --gut: max(20px, env(safe-area-inset-left, 0px)); }
  .gut { padding-right: max(20px, env(safe-area-inset-right, 0px)); }
  .wordmark { font-size: 22px; }
  .nav-links { display: none; }
  .pill { padding: 10px 14px; font-size: 11px; }
  .nav-right { gap: 6px; }
  .pill.book i { display: none; }
  .g12 { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .hero { padding-top: calc(var(--nav-h) + 28px); padding-bottom: 64px; }
  .hero .inner { row-gap: 28px; }
  .hero-l { gap: 18px; }
  .hero-l .btn { margin-top: 2px; padding: 15px 22px; font-size: 16px; }
  .hero h1 { font-size: 40px; line-height: 1.02; }
  .hero-l .lede { font-size: 17px; }
  .promise { font-size: 14px; }
  /* the whole hero (copy and panel) on the first screen at 390 × 844 */
  .panel { height: clamp(260px, calc(100svh - 540px), 380px); border-radius: 16px; }
  .h2 { font-size: 32px; }
  .cta h2 { font-size: 40px; }
  .sec { padding-block: 72px; }
  .hero-l, .panel, .head-t, .head-side, .case-media, .case-text, .case-flip .case-media, .case-flip .case-text, .case-stat, .quote,
  .ours-t, .ours-shots, .who-photo, .who-text, .cta h2, .book-text { grid-column: 1 / -1; grid-row: auto; }
  .head { margin-bottom: 32px; }
  .head-side { margin-top: -4px; }
  .quote blockquote p { font-size: 22px; }
  .ours-shots, .what-list, .steps, .faq-list { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .what-list, .steps { row-gap: 24px; }
  .rows li { grid-template-columns: 28px minmax(0, 1fr); row-gap: 12px; padding-block: 22px; }
  .rows .n { grid-column: 1; padding-top: 4px; }
  .rows .pain, .rows .fix { grid-column: 2; }
  .rows .n::before { display: none; }
  .rows h3 { font-size: 20px; }
}
