/* M3 r2: ARCHITECT premium design spec (docs/M3-PREMIUM-DESIGN-SPEC.md) P1 + P3.
   Sections 1 (tokens), 2 H2/H3/H4/H9/H10, 3 (motion M1-M8, M13, M14), 7 (mobile).
   Motion uses transform and opacity only. Content is visible without JS; .js / .motion classes on <html> opt in. */

:root {
  --ink-raised: #1B2A37;
  --ink-deep: #0B1218;
  --grad-stage: linear-gradient(180deg, #0B1218 0%, #14202B 55%, #123A38 100%);
  --highlight: #3FB8AF;
  --grid-dark: #2A3947;
  --fs-display-xxl: clamp(2.75rem, 1.4rem + 5.4vw, 5.75rem);
  --fs-stat: clamp(2.5rem, 1.8rem + 2.9vw, 4rem);
  --lh-display: 1.02;
  --track-display: -0.012em;
  --section-y: clamp(64px, 4rem + 4vw, 128px);
  --radius-card: 12px;
  --radius-panel: 24px;
  --container-wide: 1320px;
  --dur-1: 150ms; --dur-2: 240ms; --dur-3: 480ms; --dur-4: 700ms; --dur-count: 1200ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --rise: 24px;
}
@media (max-width: 820px) { :root { --rise: 16px; } }

/* m3 polish (QUALITY 94 defect 1, DECISIONS 67): one shared container on home. .container-wide now has the
   exact content box of .container (site.css), so header, hero, proof, showcase and every section share one
   left edge at every width. */
.container-wide { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s5); }
@media (min-width: 820px) { .container-wide { padding-inline: var(--s7); } }
/* Hide JS-only controls when JS is absent; with JS each control keeps its own display (grid, flex). */
html:not(.js) .js-only { display: none !important; }

/* H1 header state (M14): a border layer fades in after 64px of scroll */
.site-header { isolation: isolate; }
.site-header::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--line); opacity: 0; transition: opacity var(--dur-2) var(--ease-out); pointer-events: none; }
.site-header.is-scrolled::after { opacity: 1; }

/* H2 hero */
.hero-stage { background: var(--grad-stage); color: var(--on-dark); padding-block: var(--s8) var(--section-y); }
.hero-stage .eyebrow { color: var(--eyebrow-on-dark); letter-spacing: 0.08em; }
.hero-stage h1 { font-size: var(--fs-display-xxl); line-height: var(--lh-display); letter-spacing: var(--track-display); max-width: 15ch; text-wrap: balance; color: var(--on-dark); }
.hero-stage .lead { color: var(--on-dark); max-width: 56ch; }
.hero-stage .btn-primary { background: var(--accent-dark-bg); color: var(--ink); }
.hero-stage .btn-primary:hover { background: var(--on-dark); color: var(--ink); }
.hero-stage .btn-secondary { color: var(--on-dark); border-color: var(--on-dark); }
.hero-stage .btn-secondary:hover { background: var(--on-dark); color: var(--ink); }
.hero-stage :focus-visible { outline-color: var(--focus-on-dark); }
.hero-stage .hero-top { display: grid; gap: var(--s7); align-items: center; }

/* Highlight marker (M2): ink text on #3FB8AF (contrast recorded in tests/m3-r2-results.md) */
.hl { position: relative; z-index: 0; color: var(--ink); white-space: nowrap; padding-inline: 0.08em; }
.hl::before { content: ""; position: absolute; z-index: -1; inset: 0.12em -0.04em 0.02em; background: var(--highlight); border-radius: 2px; transform-origin: left center; }
.motion .hl::before { animation: hl-draw var(--dur-4) var(--ease-out) 200ms both; }
@keyframes hl-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* M1: supporting hero copy rises after first paint; H1 is never animated */
.motion .hero-copy > .eyebrow, .motion .hero-copy > .lead, .motion .hero-copy > .cta-row { animation: rise-in var(--dur-3) var(--ease-out) both; }
.motion .hero-copy > .lead { animation-delay: 60ms; }
.motion .hero-copy > .cta-row { animation-delay: 120ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Division stage */
.division-stage { display: grid; gap: var(--s4); min-width: 0; }
.division-tabs { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x mandatory; border-bottom: 1px solid var(--line-dark); }
.division-tabs::-webkit-scrollbar { display: none; }
.division-tabs button { scroll-snap-align: start; min-height: 48px; padding: var(--s3) var(--s4); background: none; border: 0; color: var(--on-dark); font: 600 var(--fs-small)/1.2 var(--font-body); text-align: left; cursor: pointer; opacity: 0.72; transition: opacity var(--dur-2) var(--ease-out); }
.division-tabs button[aria-selected="true"] { opacity: 1; }
.division-tabs button:hover { opacity: 1; }
.division-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100px; background: var(--accent-dark-bg); transform-origin: left center; transform: translateX(var(--bar-x, 0px)) scaleX(var(--bar-s, 0)); transition: transform var(--dur-2) var(--ease-in-out); }
.stage-card { position: relative; border-radius: var(--radius-card); background: var(--ink-raised); border: 1px solid var(--line-dark); padding: var(--s4); }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 480 / 330; }
.scene-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s2); color: var(--on-dark); font-weight: 600; }
.scene-panel[hidden] { display: none; }
.scene-panel.is-entering { animation: rise-in var(--dur-2) var(--ease-out) both; }
.replay { position: absolute; top: var(--s3); right: var(--s3); width: 44px; height: 44px; display: none; place-items: center; border-radius: 50%; border: 1px solid var(--line-dark); background: var(--ink-deep); color: var(--on-dark); cursor: pointer; }
.js .replay { display: grid; }
.replay svg { width: 20px; height: 20px; }
/* M4: SVG groups step in once, rest on the end frame (total under 3.2s) */
.scene.is-playing [data-step] { animation: step-in var(--dur-3) var(--ease-out) both; animation-delay: calc(var(--n) * 300ms); transform-box: fill-box; }
@keyframes step-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hero-stage .paths { border-top-color: var(--line-dark); margin-top: var(--s8); }
.hero-stage .path-num { color: var(--accent-dark-bg); }
.hero-stage .path-title { color: var(--on-dark); }
.hero-stage .path p { color: var(--on-dark); }
.hero-stage .row-link { color: var(--on-dark); }
.hero-stage .path { border-bottom-color: var(--line-dark); }

/* H3 proof facts */
.proof-facts { background: var(--ink-deep); color: var(--on-dark); padding-block: var(--s8); }
.proof-groups { display: grid; gap: var(--s6); }
.proof-group + .proof-group { border-top: 1px solid var(--line-dark); padding-top: var(--s6); }
.proof-group .eyebrow { color: var(--eyebrow-on-dark); font-size: var(--fs-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-body); margin-bottom: var(--s4); }
.proof-row { display: grid; gap: var(--s6); }
.stat { display: grid; gap: var(--s2); align-content: start; margin: 0; }
.stat-figure { display: inline-block; font: 600 var(--fs-stat)/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--on-dark); }
.stat-label { font-weight: 600; font-size: 1rem; color: var(--on-dark); }
.stat-caption { font-size: var(--fs-small); line-height: 1.5; color: #C9CED3; max-width: 46ch; }
.motion .stat.is-counting .stat-caption { animation: fade-in var(--dur-2) var(--ease-out) var(--dur-count) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* H4 marquee (P3) */
.marquee { position: relative; display: flex; align-items: center; height: 56px; background: var(--paper-2); border-block: 1px solid var(--line); overflow: hidden; }
.marquee-viewport { flex: 1; overflow: hidden; min-width: 0; }
.marquee-track { display: flex; width: max-content; }
.marquee-track span { display: inline-flex; align-items: center; gap: var(--s4); padding-inline: var(--s4); white-space: nowrap; font: 600 var(--fs-small)/1 var(--font-body); color: var(--ink); }
.marquee-track span::before { content: ""; width: 6px; height: 6px; background: var(--accent-light-bg); }
.motion .marquee.is-running .marquee-track { animation: marquee 40s linear infinite; }
.marquee.is-paused .marquee-track, .marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused !important; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-toggle { flex: none; width: 44px; height: 44px; margin-inline: var(--s2); display: none; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); color: var(--ink); cursor: pointer; }
.js .marquee-toggle { display: grid; }
.marquee-toggle svg { width: 18px; height: 18px; }
.no-motion .marquee-track { flex-wrap: wrap; width: auto; }

/* M6 scroll reveal: hidden only after JS marks the page ready */
.reveal-ready [data-reveal]:not(.is-revealed) { opacity: 0; transform: translateY(var(--rise)); }
/* m3b r1 review (7): a section reached by anchor (#hash) shows at full strength at once, never faded */
.reveal-ready :target [data-reveal], .reveal-ready [data-reveal]:target { opacity: 1; transform: none; transition: none; }
.reveal-ready [data-reveal] { transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }

/* M7 rising panel on the growth plan builder (scroll-linked where supported) */
.gp-section { border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
@supports (animation-timeline: view()) {
  .motion .gp-section > .container { animation: panel-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  @keyframes panel-rise { from { transform: translateY(48px) scale(0.98); } to { transform: none; } }
}

/* H9 closing */
.closing.closing-stage { background: var(--grad-stage); }
.closing.closing-stage h2 { font-size: var(--fs-display-l); line-height: 1.05; max-width: 22ch; text-wrap: balance; }
.closing .hl { white-space: normal; }

/* H10 mobile sticky CTA (390 and 820 only) */
.sticky-cta { position: fixed; z-index: 40; inset: auto 0 0 0; display: none; gap: var(--s3); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--ink); border-top: 1px solid var(--line-dark); transform: translateY(110%); transition: transform var(--dur-2) var(--ease-out); }
.sticky-cta .btn { flex: 1; justify-content: center; min-height: 44px; }
.sticky-cta .btn-primary { background: var(--accent-dark-bg); color: var(--ink); }
.sticky-cta .btn-secondary { color: var(--on-dark); border-color: var(--on-dark); }
.sticky-cta :focus-visible { outline-color: var(--focus-on-dark); }
@media (max-width: 1023px) { .js .sticky-cta { display: flex; } }
.sticky-cta.is-visible { transform: none; }
.sticky-cta[inert] { visibility: hidden; }

/* Layout: 820 */
@media (min-width: 700px) {
  .proof-groups { grid-template-columns: 2fr 1fr; gap: 0; }
  .proof-group + .proof-group { border-top: 0; border-left: 1px solid var(--line-dark); padding-top: 0; padding-left: var(--s6); }
  .proof-group:first-child { padding-right: var(--s6); }
  .proof-row { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .proof-groups { grid-template-columns: 1fr; }
  .proof-group + .proof-group { border-left: 0; border-top: 1px solid var(--line-dark); padding-left: 0; padding-top: var(--s6); }
  .proof-group:first-child { padding-right: 0; }
}
/* Layout: 1440 */
@media (min-width: 1024px) {
  .hero-stage { min-height: min(88svh, 860px); }
  .hero-stage .hero-top { grid-template-columns: 6fr 6fr; }
  .hero-stage .hero-art { display: none; }
}
/* m3 polish + rework r1 defect 4 (Home 390: third tab off-screen): at every width the three division tabs
   share the stage width equally and labels wrap at spaces, so no tab sits outside the viewport. */
.division-tabs { grid-auto-columns: minmax(0, 1fr); overflow-x: visible; }
.division-tabs button { overflow-wrap: break-word; }
@media (max-width: 639px) {
  .division-tabs button { padding-inline: var(--s2); }
}
@media (max-width: 1023px) {
  .hero-stage { padding-top: var(--s6); }
  .hero-stage .cta-row .btn { width: 100%; justify-content: center; }
  .scene { aspect-ratio: 480 / 330; }
}
@media (min-width: 600px) and (max-width: 1023px) { .hero-stage .cta-row .btn { width: auto; } }

/* Reduced motion: final states, no movement */
@media (prefers-reduced-motion: reduce) {
  .hl::before, .hero-copy > *, .scene [data-step], .scene-panel, .stat-caption, .marquee-track, .gp-section > .container { animation: none !important; transform: none !important; }
  .reveal-ready [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .sticky-cta, .division-bar, .site-header::after { transition: none; }
  .marquee-track { flex-wrap: wrap; width: auto; }
}

/* H6 advertising showcase (r2 step 6): rising dark panel on --grad-stage, branded dashboard inside */
.ad-showcase { background: var(--grad-stage); color: var(--on-dark); padding-block: var(--section-y); border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
.ad-showcase h2 { color: var(--on-dark); max-width: 20ch; text-wrap: balance; }
.ad-showcase .eyebrow { color: var(--eyebrow-on-dark); }
.ad-showcase .lead, .ad-showcase .check-list li, .ad-showcase .small { color: #D5DADE; }
.ad-showcase h2 + .lead { margin-top: var(--s4); }
.ad-showcase a:not(.btn) { color: var(--accent-dark-bg); }
.ad-showcase .ads-head { margin-bottom: var(--s8); }
.ad-showcase .ads-cta { margin: var(--s8) 0 0; }
@supports (animation-timeline: view()) {
  .motion .rising-panel > .container-wide { animation: panel-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}
@media (max-width: 820px) { .ad-showcase { border-radius: 16px 16px 0 0; } }

/* ---- m3b r1 (QUALITY D1): photographic, layered hero. Layers: ad still (back), poster chips (middle),
   division stage card (front). Every image has width/height, so nothing shifts when it decodes (CLS). ---- */
.hero-visual { position: relative; min-width: 0; display: grid; gap: var(--s4); }
.hv-photo { position: relative; margin: 0; border-radius: var(--radius-card); overflow: hidden; background: var(--ink-raised); }
.hv-photo picture { display: block; }
.hv-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 18%; }
.hv-photo figcaption { position: absolute; inset: auto 0 0 0; padding: var(--s5) var(--s3) var(--s2); font-size: var(--fs-small); line-height: 1.35; color: #FFFFFF; background: linear-gradient(to top, rgba(8, 14, 20, .88), rgba(8, 14, 20, 0)); }
.hv-chip { display: none; }
@media (min-width: 1024px) {
  .hero-stage .hero-visual { display: block; padding-top: 250px; }
  .hv-photo { position: absolute; top: 0; right: 0; width: 60%; z-index: 0; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .65); }
  .hv-photo img { aspect-ratio: 1 / 1; object-position: 50% 8%; }
  .hv-photo figcaption { inset: auto auto 0 0; top: 206px; bottom: auto; width: auto; max-width: calc(100% - var(--s4)); margin-left: var(--s2); padding: 3px var(--s2); font-size: .75rem; line-height: 1.3; border-radius: 6px; background: rgba(8, 14, 20, .82); }
  .hv-chip { display: block; position: absolute; z-index: 1; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 3px solid var(--ink); box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .7); }
  .hv-chip-a { width: 150px; height: 150px; top: 20px; left: 2%; rotate: -4deg; }
  .hv-chip-b { width: 104px; height: 104px; top: 70px; left: 31%; rotate: 3deg; z-index: 2; }
  .hero-visual .division-stage { position: relative; z-index: 3; padding: var(--s4); border-radius: var(--radius-card); background: var(--ink); border: 1px solid var(--line-dark); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .75); }
}

/* ---- m3b r1 (QUALITY D5): no forced hero height; the empty band under the 1440 hero came from
   min-height: min(88svh, 860px) plus the s8 gap before the divisions list. ---- */
@media (min-width: 1024px) {
  .hero-stage { min-height: 0; padding-bottom: var(--s8); }
  .hero-stage .paths { margin-top: var(--s7); }
}

/* ---- m3b r1 (QUALITY D1): proof grid. Ad stills + two SAMPLE tiles, on the verified-figures band. ---- */
.pgrid { margin-top: var(--s8); padding-top: var(--s6); border-top: 1px solid var(--line-dark); }
.pgrid-head { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.pgrid-head .eyebrow { color: var(--eyebrow-on-dark); margin: 0; }
.pgrid-note { margin: 0; max-width: 70ch; font-size: var(--fs-small); color: #C9CED3; }
.pgrid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .pgrid-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 479px) { .pgrid-list { grid-template-columns: 1fr; } }
.pgrid-tile a { display: grid; gap: var(--s2); height: 100%; padding: var(--s2); border-radius: var(--radius-card); background: var(--ink-raised); border: 1px solid var(--line-dark); color: var(--on-dark); text-decoration: none; transition: border-color var(--dur-2) var(--ease-out), translate var(--dur-2) var(--ease-out); }
.pgrid-tile a:hover { border-color: var(--accent-dark-bg); translate: 0 -2px; }
.pgrid-tile img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.pgrid-label { font-size: var(--fs-small); line-height: 1.45; color: #D5DADE; padding: 0 var(--s1) var(--s1); }
.pgrid-label strong { display: block; color: var(--on-dark); }
.pgrid-text a { align-content: start; padding: var(--s4); }
.pgrid-kicker { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .08em; color: var(--accent-dark-bg); }
@media (prefers-reduced-motion: reduce) { .pgrid-tile a { transition: none; } .pgrid-tile a:hover { translate: none; } }

/* r1 owner direction 2026-11-29 08:33 CT: ads live on /work/#ads; home keeps a clear link */
.ads-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4, 1rem);
  margin-top: var(--s6, 2rem); padding: var(--s5, 1.5rem); border: 1px solid rgba(63, 184, 175, .35); border-radius: 14px; }
.ads-more-text { margin: 0; max-width: 46ch; }
.pgrid-ads .pgrid-kicker { color: var(--accent-dark-bg); } /* claude: #17716A on #1B2A37 was 2.5:1 */

/* r1 owner 2026-11-29: hero without ad stills. Two offset decorative panels behind the stage keep the layered
   depth; pure CSS, fixed size, no images, so nothing loads or shifts. Shown at >=1024 px only. */
.hv-depth { display: none; }
@media (min-width: 1024px) {
  .hero-stage .hero-visual { padding-top: var(--s6, 2rem); }
  .hv-depth { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
  .hv-depth span { position: absolute; border-radius: var(--radius-card); border: 1px solid rgba(63, 184, 175, .28); }
  .hv-depth span:first-child { inset: 0 -18px 40px 48px; background: linear-gradient(150deg, rgba(23, 113, 106, .38), rgba(20, 32, 43, .2)); rotate: 2.5deg; }
  .hv-depth span:last-child { inset: 14px 26px 24px -10px; background: linear-gradient(200deg, rgba(234, 217, 190, .14), rgba(20, 32, 43, 0)); rotate: -2deg; }
}
