/**
 * abd.works — site.css
 * Shared styles for all marketing site pages.
 *
 * Brand tokens aligned to abd-brand.css and abd-works-brand/brand-guidelines.html.
 * Dual-mode: Executive (light default) / Engineering (dark).
 * Mode applied via html[data-theme="engineering"] — set by js/nav.js.
 * Fonts: Inter + JetBrains Mono via Google Fonts.
 */

/* ═══════════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════════ */
*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */

/* ── Executive / light (default) ── */
:root {
  --bg:           #F6F5F3;
  --surface:      #FFFFFF;
  --raised:       #F0ECE4;
  --faint:        #EFECE6;
  --border:       #DDD8CF;
  --border-sub:   #E7E1D6;
  --text:         #111113;
  --muted:        #595A61;
  --accent:       #E5531A;
  --accent-deep:  #C64514;
  --accent-soft:  #F2A07A;
  --accent-glow:  #FF6A2E;
  --accent-dim:   rgba(229,83,26,0.08);
  --accent-dim2:  rgba(229,83,26,0.18);
  --ai-accent:    #4FC3F7;
  --nav-active-bg: var(--accent);
  --nav-active-text: #0B0B0B;
  --nav-active-ring: rgba(198, 69, 20, 0.36);
  --success:      #22C55E;
  --warning:      #F59E0B;
  --error:        #EF4444;
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --max-width:    1100px;

  /* Type scale — 7-step fluid, no raw px below */
  --text-xs:   clamp(10px, 1.2vw, 11px);
  --text-sm:   clamp(12px, 1.4vw, 13px);
  --text-base: clamp(14px, 1.7vw, 15px);
  --text-md:   clamp(16px, 2vw, 18px);
  --text-lg:   clamp(20px, 2.5vw, 26px);
  --text-xl:   clamp(28px, 3.8vw, 34px);
  --text-2xl:  clamp(34px, 5.5vw, 60px);

  /* Radius scale — 4-step */
  --radius-none: 0;
  --radius-sm:   4px;
  --radius-md:   12px;
  --radius-pill: 999px;

  /* Spacing scale — 9-step */
  --space-2xs: 4px;
  --space-xs:  8px;
  --space-sm:  12px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
}

/* ── Engineering / dark ── */
html[data-theme="engineering"] {
  --bg:           #0B0B0B;
  --surface:      #111113;
  --raised:       #1B1B20;
  --faint:        #161618;
  --border:       #2A2A2A;
  --border-sub:   #1A1A1E;
  --text:         #E8E8ED;
  --muted:        #9B9BA8;
  --nav-active-bg: rgba(79, 195, 247, 0.26);
  --nav-active-text: #E8F7FF;
  --nav-active-ring: rgba(79, 195, 247, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════ */
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="engineering"] { color-scheme: dark; }

body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover { color: var(--accent-deep); }

/* ═══════════════════════════════════════════════════════════════
   NAV — injected by js/nav.js
   Desktop: logo + nav links visible, hamburger hidden.
   Mobile:  nav links hide, hamburger + CTA visible (Vercel-style).
   ═══════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 110;
  background: rgba(246, 245, 243, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid transparent;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 280ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1),
              padding 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="engineering"] .site-nav {
  background: rgba(11, 11, 11, 0.88);
}

.site-nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.02),
              0 4px 16px -2px rgba(0, 0, 0, 0.08);
  padding-top: 14px;
  padding-bottom: 14px;
}

html[data-theme="engineering"] .site-nav.is-scrolled {
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.04),
              0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-logo:hover {
  opacity: 0.72;
  transform: translateY(-1px);
}

.nav-logo:active {
  transform: translateY(0);
}

.nav-logo img {
  display: block;
  height: clamp(32px, 3.8vw, 56px);
  width: auto;
  transition: height 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-nav.is-scrolled .nav-logo img {
  height: clamp(28px, 3.5vw, 48px);
}

/* ── Nav links — visible at desktop, hidden on mobile ───── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin-left: 56px;
}

.nav-links li {
  opacity: 0;
  transform: translateY(-8px);
  animation: nav-link-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-links li:nth-child(1) { animation-delay: 40ms; }
.nav-links li:nth-child(2) { animation-delay: 80ms; }

@keyframes nav-link-enter {
  to { opacity: 1; transform: translateY(0); }
}

.nav-links a {
  position: relative;
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 14px;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-none);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--accent);
}

html[data-theme="engineering"] .nav-links a[aria-current="page"]::after {
  background: var(--accent);
}

/* ── Right-hand actions group (CTA + hamburger), pushed right ─ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Nav "Let's talk" CTA button ─────────────────────────── */
.nav-talk-trigger {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.1s ease;
}

.nav-talk-trigger:hover {
  background: var(--accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

html[data-theme="engineering"] .nav-talk-trigger {
  background: var(--accent);
  color: #fff;
}

html[data-theme="engineering"] .nav-talk-trigger:hover {
  background: var(--accent-deep);
  color: #fff;
}

/* ── Hamburger menu icon — hidden at desktop, shown on mobile ─ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  z-index: 110;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-none);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 200ms ease;
}

.nav-hamburger span + span {
  margin-top: 5px;
}

.nav-hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile drawer ────────────────────────────────────────── */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.nav-drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 106;
  width: 280px;
  max-width: 80vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.nav-drawer.is-visible {
  transform: translateX(0);
}

.nav-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 88px 24px 32px;
  min-height: 100%;
}

.nav-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-drawer-links a {
  display: block;
  padding: 14px 12px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 200ms ease, color 200ms ease;
  border-left: 2px solid transparent;
}

.nav-drawer-links a:hover {
  background: var(--raised);
  color: var(--accent);
}

.nav-drawer-links a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--raised);
  color: var(--accent);
}

.nav-drawer-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.nav-drawer-footer .mode-switch {
  display: flex;
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 3px;
}

.nav-drawer-footer .mode-switch .mode-btn {
  flex: 1;
  justify-content: center;
  padding: 10px 12px;
  font-size: var(--text-sm);
}

.nav-drawer-footer .mode-switch .mode-text {
  position: static;
  opacity: 1;
  transform: none;
  max-width: none;
  overflow: visible;
  pointer-events: auto;
}

.nav-drawer-footer .mode-switch .mode-icon {
  display: inline-block;
}

.mode-label {
  display: none;
}

/* ── Mode switch base (used in drawer + footer) ──────────── */
.mode-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

html[data-theme="engineering"] .mode-switch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mode-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1;
  padding: 7px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              color 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 120ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-icon {
  font-size: var(--text-base);
  line-height: 1;
}

.mode-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.mode-btn:active {
  transform: translateY(0);
}

.mode-btn.is-active {
  background: var(--accent);
  color: #0B0B0B;
  box-shadow: 0 2px 6px rgba(229, 83, 26, 0.24),
              0 0 0 1px rgba(198, 69, 20, 0.2);
  transform: translateY(-1px);
}

html[data-theme="engineering"] .mode-btn.is-active {
  background: var(--accent);
  color: #0B0B0B;
  box-shadow: 0 2px 8px rgba(229, 83, 26, 0.32),
              0 0 0 1px rgba(229, 83, 26, 0.3);
}

.mode-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

.section-block {
  padding: 96px 0;
}

/* ═══════════════════════════════════════════════════════════════
   HOME SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.home-section {
  border-bottom: none;
  padding: 120px 0;
}

/* Alternate sections use --surface for section rhythm.
   The tonal shift is barely perceptible but the eye registers it. */
.home-section--alt,
.section-block--alt {
  background: var(--surface);
}

/* Inverted beliefs section uses a staged dark panel.
   Scroll progress variables are set by js/scroll-reveal.js for reversible motion.
   Background fades from light to dark during scroll for seamless transition. */
.home-section--inverted {
  /* Section bg stays neutral — the dark plane is the inset .belief-stage only.
     A full-section dark gradient created a visible band between sections. */
  background: var(--bg);
  padding-top: clamp(96px, 11vw, 148px);
  padding-bottom: clamp(96px, 11vw, 148px);
  overflow: clip;
  --belief-progress: 0;
  --belief-inset: clamp(24px, 8vw, 96px);
  --belief-radius: 32px;
  --belief-lift: 64px;
  --belief-scale: 0.88;
  --belief-opacity: 0.5;
  --belief-shadow-opacity: 0.12;
  --belief-item-shift: -24px;
}

.home-section--inverted .belief-stage {
  background: #0F1014;
  --text:    #ECECF0;
  --muted:   #A9A9B4;
  --border:  rgba(255, 255, 255, 0.09);
  --surface: #1A1B22;
  --raised:  #232532;
  border: 1px solid rgba(255, 255, 255, 0.11);
  margin-inline: var(--belief-inset);
  border-radius: var(--belief-radius);
  opacity: var(--belief-opacity);
  transform: translateY(var(--belief-lift)) scale(var(--belief-scale));
  transform-origin: center top;
  /* soften shadow to avoid visible band at viewport edge */
  box-shadow: 0 18px 48px rgba(0, 0, 0, var(--belief-shadow-opacity));
  will-change: transform, opacity, margin-inline, border-radius;
}

.home-section--inverted .belief-stage .wrap {
  padding-top: clamp(64px, 8vw, 96px);
  padding-bottom: clamp(64px, 8vw, 96px);
}

html[data-theme="engineering"] .home-section--inverted .belief-stage {
  background: #12141C;
  border-color: rgba(79, 195, 247, 0.14);
}

/* Logos section — same inverted shell, but no overflow clip */
#logos.home-section--inverted {
  overflow: visible;
}
.home-section--inverted .logos-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-inline: var(--logos-inset, clamp(24px, 8vw, 96px));
  border-radius: var(--logos-radius, 32px);
  opacity: var(--logos-opacity, 0.5);
  transform: translateY(var(--logos-lift, 64px)) scale(var(--logos-scale, 0.88));
  transform-origin: center top;
  box-shadow: 0 18px 48px rgba(0, 0, 0, var(--logos-shadow-opacity, 0.12));
  will-change: transform, opacity, margin-inline, border-radius;
  transition: none;
  overflow: visible;
}

/* Force light bg in both modes so logos are always readable */
html[data-theme="engineering"] .home-section--inverted .logos-stage {
  background: #FFFFFF;
  border-color: #DDD8CF;
  --text:  #111113;
  --muted: #595A61;
}
html[data-theme="engineering"] .home-section--inverted .logos-stage .s-label .s-name {
  color: #595A61;
}
html[data-theme="engineering"] .home-section--inverted .logos-stage .s-label .s-name::after {
  color: #E5531A;
}

.home-section--inverted .logos-stage .wrap {
  padding-top: clamp(64px, 8vw, 96px);
  padding-bottom: clamp(64px, 8vw, 96px);
}

/* Logos keep their default grayscale treatment on the light stage */
.home-section--inverted .logos-stage .client-logo img {
  filter: grayscale(1) opacity(0.55);
  transition: filter 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-section--inverted .logos-stage .client-logo:hover img {
  filter: grayscale(0) opacity(1);
}

/* Numbers punch in accent against the dark panel */
.home-section--inverted .belief-num {
  color: var(--accent);
}

/* Section kicker — accent dot + tiny mono label, no chrome */
.home-kicker {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

/* Trailing underscore cursor — the brand's own motif from the logo */
.home-kicker::after {
  content: '_';
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-left: 2px;
  animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Trailing underscore on inner-page section labels and hero labels —
   the same brand cursor motif, consistent across every page type. */
.s-name::after {
  content: '_';
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  margin-left: 1px;
  animation: cursor-blink 1.1s step-end infinite;
}

/* Generic label row — inner pages */
.s-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.s-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.s-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.s-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL — Intersection Observer driven
   ═══════════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay:   0ms; }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay:  90ms; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 180ms; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 270ms; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 360ms; }
[data-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: 450ms; }
[data-reveal-stagger].is-visible > *:nth-child(7) { transition-delay: 540ms; }
[data-reveal-stagger].is-visible > *:nth-child(8) { transition-delay: 630ms; }

[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}

/* Hero enters immediately on load — no observer needed */
.hero-headline {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero .body-lead {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
}
.hero-mission {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 200ms both;
}

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-stagger] > * { transition: none; }
  [data-reveal], [data-reveal-stagger] > * { opacity: 1; transform: none; }
  .hero-headline, .hero .body-lead, .hero-mission { animation: none; }
  .page-headline, .page-hero .body-lead { animation: none; }
  .data-stat { clip-path: none !important; animation: none !important; }
  .explore-card::before, .explore-card::after,
  .thinking-card::before { transition: none; }
  .home-kicker::after,
  .s-name::after,
  .hero-mission .accent-word { background-image: none; transition: none; }
  .home-section--inverted {
    --belief-progress: 1;
    background: #0F1014;
  }
  .home-section--inverted .belief-stage {
    margin-inline: 0;
    border-radius: var(--radius-none);
    opacity: 1;
    transform: none;
    box-shadow: none;
    will-change: auto;
  }
  .nav-logo,
  .mode-btn,
  .nav-hamburger span { transition: none; }
  .client-logo img { filter: grayscale(0) opacity(1); transition: none; }
  .home-section--inverted .logos-stage {
    margin-inline: 0;
    border-radius: var(--radius-none);
    opacity: 1;
    transform: none;
    box-shadow: none;
    will-change: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BELIEF ITEM MOTION LAYER
   Belief items move on a separate axis so the section feels composited.
   The container morph and item reveal are both reversible on scroll.
   ═══════════════════════════════════════════════════════════════ */
.home-section--inverted .belief-item[data-reveal] {
  transform: translateX(calc(var(--belief-item-shift) - 22px)) translateY(8px) scale(0.985);
}

.home-section--inverted .belief-item[data-reveal].is-visible {
  transform: translateX(var(--belief-item-shift));
}

@media (prefers-reduced-motion: reduce) {
  .home-section--inverted .belief-item[data-reveal],
  .home-section--inverted .belief-item[data-reveal].is-visible {
    transform: none;
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
.hero-headline {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 32px;
}

.hero-headline .accent { color: var(--accent); }
.accent { color: var(--accent); }

.page-headline {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.section-headline {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}

.body-lead {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 32px;
  text-wrap: pretty;
}

.body-lead strong { color: var(--text); font-weight: 600; }

.proof-section-intro {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  max-width: none;
}

.proof-section-intro strong {
  color: var(--text);
  font-weight: 700;
}

.proof-section-intro strong.accent-word {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   HERO — home page only
   ═══════════════════════════════════════════════════════════════ */
.hero {
  padding: 96px 0 88px;
  border-bottom: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

/* Proof chip */
.hero-proof {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 40px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hero-proof-stat {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
}

.hero-proof-label {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Mission statement */
.hero-mission {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 8px;
  max-width: 640px;
  text-wrap: pretty;
}

.accent-word {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-mission .accent-word {
  color: var(--accent);
  /* Underline draws left-to-right on hover — rewards attention */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-mission:hover .accent-word,
.accent-word:hover {
  background-size: 100% 1px;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HERO — inner pages
   ═══════════════════════════════════════════════════════════════ */
.page-hero {
  padding: 64px 0 56px;
}

.page-hero .body-lead {
  font-size: var(--text-md);
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 160ms both;
}

/* ═══════════════════════════════════════════════════════════════
   DATA GRID — evidence stats
   ═══════════════════════════════════════════════════════════════ */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.data-card {
  background: var(--surface);
  padding: 24px;
}

.data-stat {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.data-label {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
}

/* Stat numbers: clip-path roll-up when section scrolls into view.
   animation-fill-mode:both holds the 'from' state during stagger delay. */
.data-grid.is-visible .data-card:nth-child(1) .data-stat { animation: stat-clip 0.48s cubic-bezier(0.16, 1, 0.3, 1)  40ms both; }
.data-grid.is-visible .data-card:nth-child(2) .data-stat { animation: stat-clip 0.48s cubic-bezier(0.16, 1, 0.3, 1) 130ms both; }
.data-grid.is-visible .data-card:nth-child(3) .data-stat { animation: stat-clip 0.48s cubic-bezier(0.16, 1, 0.3, 1) 220ms both; }
.data-grid.is-visible .data-card:nth-child(4) .data-stat { animation: stat-clip 0.48s cubic-bezier(0.16, 1, 0.3, 1) 310ms both; }

@keyframes stat-clip {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0% 0 0 0); }
}

/* ═══════════════════════════════════════════════════════════════
   FINDING BLOCK — evidence interpretation
   No container — whitespace + a top rule do the work.
   Traits mini-grid echoes the data-grid pattern above.
   ═══════════════════════════════════════════════════════════════ */
.finding-block {
  margin-top: 56px;
}

.finding-intro {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.finding-intro .accent-word {
  color: var(--accent);
}

.finding-traits {
  list-style: none;
  margin: 20px 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finding-trait {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding-left: 40px;
  position: relative;
}

.finding-trait::before {
  content: '\2014\00a0';
  position: absolute;
  left: 16px;
  color: var(--accent);
  font-weight: 700;
}

.finding-conclusion {
  margin-top: 48px;
}

.finding-punchline {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.finding-punchline .accent-word {
  color: var(--accent);
}

.finding-sub {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.villain-body {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.65;
  margin-top: 16px;
}

.villain-body strong { color: var(--accent); font-weight: 600; }

/* ── Data source attribution ──────────────────────────────── */
.data-source {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: right;
  margin-top: 0;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  line-height: 1.5;
}
.data-source a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.data-source a:hover {
  border-bottom-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   BELIEF LIST
   ═══════════════════════════════════════════════════════════════ */
.belief-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.belief-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 28px;
  align-items: start;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.belief-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  padding-top: 8px;
}

.belief-text {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.belief-text em {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   CONTEXT DIAGNOSTIC — Likert scale self-assessment
   ═══════════════════════════════════════════════════════════════ */
.diagnostic {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Scoreboard — starts display:none (no dead space), JS slides it in */
.diag-scoreboard {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.diag-scoreboard.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.diag-scoreboard-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.diag-score-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-none);
  overflow: hidden;
}

.diag-score-progress {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.diag-score-fill {
  height: 100%;
  border-radius: var(--radius-none);
  transition: width 0.35s ease;
  background: var(--accent);
}

/* Question cards */
.diag-questions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.diag-item {
  padding: 20px 24px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-left-color 0.3s ease;
}

/* Left-border color reflects answered state */
.diag-item.is-answered { border-left-color: var(--accent); }

/* Question header: number + text */
.diag-item-hd {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.diag-item-num {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  line-height: 1.3;
}

.diag-q {
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.diag-q strong {
  display: inline;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.diag-q em {
  font-style: italic;
}

/* 4-level choice cards — replaces Likert scale */
.diag-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.diag-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
  user-select: none;
}

/* Spectrum hint tints — visible before any selection */
.diag-choice[data-hint="red"]   { background: rgba(239, 68, 68, 0.04); }
.diag-choice[data-hint="amber"] { background: rgba(245, 158, 11, 0.04); }
.diag-choice[data-hint="green"] { background: rgba(34, 197, 94, 0.04); }
.diag-choice[data-hint="blue"]  { background: rgba(79, 195, 247, 0.04); }

.diag-choice[data-hint="red"]:hover {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.10);
  transform: translateY(-1px);
}
.diag-choice[data-hint="amber"]:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.10);
  transform: translateY(-1px);
}
.diag-choice[data-hint="green"]:hover {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.10);
  transform: translateY(-1px);
}
.diag-choice[data-hint="blue"]:hover {
  border-color: rgba(79, 195, 247, 0.3);
  background: rgba(79, 195, 247, 0.10);
  transform: translateY(-1px);
}

.diag-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selected — solid fill per spectrum color */
.diag-choice.is-selected { transform: translateY(-1px); }

.diag-choice.is-selected[data-hint="red"] {
  border-color: var(--error);
  background: var(--error);
}
.diag-choice.is-selected[data-hint="red"] .diag-choice-label,
.diag-choice.is-selected[data-hint="red"] .diag-choice-desc { color: #fff; }

.diag-choice.is-selected[data-hint="amber"] {
  border-color: var(--warning);
  background: var(--warning);
}
.diag-choice.is-selected[data-hint="amber"] .diag-choice-label,
.diag-choice.is-selected[data-hint="amber"] .diag-choice-desc { color: #0B0B0B; }

.diag-choice.is-selected[data-hint="green"] {
  border-color: var(--success);
  background: var(--success);
}
.diag-choice.is-selected[data-hint="green"] .diag-choice-label,
.diag-choice.is-selected[data-hint="green"] .diag-choice-desc { color: #fff; }

.diag-choice.is-selected[data-hint="blue"] {
  border-color: var(--ai-accent);
  background: var(--ai-accent);
}
.diag-choice.is-selected[data-hint="blue"] .diag-choice-label,
.diag-choice.is-selected[data-hint="blue"] .diag-choice-desc { color: #0B0B0B; }

.diag-choice-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: color 0.15s ease;
}

.diag-choice-desc {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--muted);
  transition: color 0.15s ease;
}

.diag-item.is-answered {
  border-left-color: var(--accent);
}

/* Endpoint labels — no longer needed with choice cards */
.diag-labels { display: none; }

/* ── Survey responsive ─────────────────────────────────────── */
@media (max-width: 680px) {
  .diag-choices {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .diag-item {
    padding: 16px 16px 14px;
  }

  .diag-item-hd {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .diag-choices {
    grid-template-columns: 1fr;
  }

  .diag-choice {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .diag-choice-label {
    min-width: 90px;
    flex-shrink: 0;
  }

  .diag-choice-desc {
    font-size: var(--text-sm);
  }
}

/* ── Survey stage — blurs behind overlays ─────────────────── */
.diag-survey-stage {
  transition: filter 0.5s ease;
}

.diag-survey-stage.is-blurred {
  filter: blur(4px);
  pointer-events: none;
}

/* ── Reveal popover — fixed, centered, overlays everything ── */
.diag-reveal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.diag-reveal-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.diag-reveal-card {
  text-align: center;
  max-width: 400px;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.diag-reveal-overlay.is-visible .diag-reveal-card {
  transform: translateY(0) scale(1);
}

.diag-reveal-headline {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.15;
}

.diag-reveal-sub {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.diag-reveal-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.diag-reveal-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.diag-reveal-skip {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}

.diag-reveal-skip:hover {
  color: var(--text);
}

/* ── Results overlay — same pattern, scrollable within ── */
.diag-results-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.diag-results-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.diag-results-panel {
  width: 90vw;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 44px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.diag-results-panel.is-blurred {
  filter: blur(4px);
  pointer-events: none;
}

@media (max-width: 820px) {
  .diag-results-panel {
    width: 96vw;
    padding: 24px 16px;
    max-height: 94vh;
    border-radius: var(--radius-sm);
  }
}

.diag-results-overlay.is-visible .diag-results-panel {
  transform: translateY(0) scale(1);
}

.diag-results-header {
  margin-bottom: 32px;
}

.diag-results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.diag-result-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Brand cursor underscore on results heading */
.diag-result-title::after {
  content: '_';
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  margin-left: 2px;
  animation: cursor-blink 1.1s step-end infinite;
}

.diag-results-cta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

@media (max-width: 820px) {
  .diag-results-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .diag-results-cta {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: var(--text-sm);
  }
}

.diag-results-cta:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

/* Footer — retake button on the right */
.diag-results-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 24px;
  margin-top: 4px;
}

.diag-results-close {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.diag-results-close:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

/* Result table */
.diag-result {
  padding: 24px 0 0;
  margin-top: 12px;
  animation: diag-reveal 0.4s ease;
}

@keyframes diag-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.diag-result-table-wrap {
  overflow-x: auto;
}

@media (max-width: 820px) {
  .diag-result-table-wrap {
    overflow-x: visible;
  }
  .diag-result-table thead {
    display: none;
  }
  .diag-result-table,
  .diag-result-table tbody,
  .diag-result-table tr {
    display: block;
  }
  .diag-result-table tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .diag-result-table tr:last-child {
    border-bottom: none;
  }
  .diag-result-table td {
    display: block;
    padding: 3px 0;
    border: none;
    width: auto !important;
  }
  .diag-result-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1px;
  }
  .col-dim, .col-amp, .col-fw {
    width: auto !important;
  }
}

.diag-result-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--text-sm);
}

.diag-result-table thead th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}

.diag-result-table tbody tr {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  border-bottom: 1px solid var(--border);
}

.diag-result-table tbody tr.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.diag-result-table tbody td {
  padding: 12px;
  vertical-align: top;
  line-height: 1.55;
  word-wrap: break-word;
}

.col-dim { width: 24%; }
.col-amp { width: 40%; }
.col-fw  { width: 36%; }

.r-dim {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.r-dim strong {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.r-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-none);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.r-amp {
  color: var(--text);
  line-height: 1.6;
}

.r-amp strong {
  font-weight: 700;
  color: var(--text);
  display: inline;
}

.r-amp br {
  display: block;
  content: '';
  margin-top: 4px;
}

.r-fw {
  color: var(--muted);
}

/* Reset — inline inside scoreboard */
.diag-reset {
  flex-shrink: 0;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.diag-reset:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

.diag-reset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Contact form overlay ──────────────────────────────────── */
.diag-form-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.diag-form-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.diag-form-panel {
  position: relative;
  width: 90vw;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 48px 44px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 820px) {
  .diag-form-panel {
    width: 96vw;
    padding: 36px 20px 28px;
    max-height: 94vh;
    border-radius: var(--radius-sm);
  }
  .diag-form-row {
    grid-template-columns: 1fr;
  }
}

.diag-form-overlay.is-visible .diag-form-panel {
  transform: translateY(0) scale(1);
}

.diag-form-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: var(--text-md);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.diag-form-close:hover {
  color: var(--text);
}

.diag-form-header {
  text-align: left;
  margin-bottom: 32px;
}

.diag-form-headline {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.diag-form-headline::after {
  content: '_';
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  margin-left: 2px;
  animation: cursor-blink 1.1s step-end infinite;
}

.diag-form-headline .accent {
  color: var(--accent);
}

.diag-form-sub {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  max-width: 400px;
}

.diag-form-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
  max-width: 400px;
}

.diag-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diag-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.diag-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-form-field label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diag-form-field .required,
.diag-form-checkbox .required {
  color: var(--accent);
}

.diag-form-field input,
.diag-form-field textarea {
  width: 100%;
  padding: 10px 0 8px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  transition: border-color 0.15s ease;
  outline: none;
}

.diag-form-field input:focus,
.diag-form-field textarea:focus {
  border-bottom-color: var(--accent);
}

.diag-form-field input::placeholder,
.diag-form-field textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.diag-form-field--full {
  grid-column: 1 / -1;
}

.diag-form-field textarea {
  resize: vertical;
  min-height: 60px;
}

.diag-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}

.diag-form-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.diag-form-checkbox label {
  color: var(--muted);
}

.diag-form-link {
  color: var(--accent);
  text-decoration: underline;
}

.diag-form-link:hover {
  color: var(--accent-deep);
}

.diag-form-submit {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 4px;
}

.diag-form-submit:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.diag-form-submit:disabled {
  background: var(--muted);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  opacity: 0.55;
}

.diag-form-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: -4px;
}

/* ═══════════════════════════════════════════════════════════════
   TALK OVERLAY — inline contact form (replaces talk page)
   ═══════════════════════════════════════════════════════════════ */
.talk-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.talk-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.talk-panel {
  position: relative;
  width: 90vw;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 48px 44px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.talk-overlay.is-visible .talk-panel {
  transform: translateY(0) scale(1);
}

.talk-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: var(--text-md);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.talk-close:hover {
  color: var(--text);
}

.talk-header {
  text-align: left;
  margin-bottom: 32px;
}

.talk-headline {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.talk-headline::after {
  content: '_';
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  margin-left: 2px;
  animation: cursor-blink 1.1s step-end infinite;
}

.talk-headline .accent {
  color: var(--accent);
}

.talk-sub {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  max-width: 400px;
}

.talk-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
  max-width: 400px;
}

.talk-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.talk-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.talk-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.talk-form-field label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.talk-form-field .required,
.talk-form-checkbox .required {
  color: var(--accent);
}

.talk-form-field input,
.talk-form-field textarea {
  width: 100%;
  padding: 10px 0 8px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  transition: border-color 0.15s ease;
  outline: none;
}

.talk-form-field input:focus,
.talk-form-field textarea:focus {
  border-bottom-color: var(--accent);
}

.talk-form-field input::placeholder,
.talk-form-field textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.talk-form-field--full {
  grid-column: 1 / -1;
}

.talk-form-field textarea {
  resize: vertical;
  min-height: 60px;
}

.talk-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}

.talk-form-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.talk-form-checkbox label {
  color: var(--muted);
}

.talk-form-link {
  color: var(--accent);
  text-decoration: underline;
}

.talk-form-link:hover {
  color: var(--accent-deep);
}

.talk-form-submit {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 4px;
}

.talk-form-submit:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.talk-form-submit:disabled {
  background: var(--muted);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  opacity: 0.55;
}

/* Keep <a> elements styled as talk-form-submit from inheriting global a:hover */
a.talk-form-submit:hover {
  color: #fff;
  text-decoration: none;
}

.talk-form-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: -4px;
}

@media (max-width: 820px) {
  .talk-panel {
    width: 96vw;
    padding: 36px 20px 28px;
    max-height: 94vh;
    border-radius: var(--radius-sm);
  }
  .talk-form-row {
    grid-template-columns: 1fr;
  }
}

/* ── Main content blur when talk overlay is open ─────────── */
#main-content.is-blurred {
  filter: blur(4px);
  pointer-events: none;
  transition: filter 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════════
   DIMENSIONS — What We Build grid
   ═══════════════════════════════════════════════════════════════ */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.dimension-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 200ms ease;
}

.dimension-card:hover {
  background: var(--raised);
}

.dimension-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

.dimension-desc {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS — evidence cards
   ═══════════════════════════════════════════════════════════════ */
.evidence-hero {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.evidence-stat {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.evidence-src {
  font-size: var(--text-base);
  color: var(--muted);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-card {
  background: var(--surface);
  padding: 24px;
}

.result-client {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.result-context {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.result-outcome {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.65;
}

.result-outcome .stat {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
}

.placeholder-note {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--raised);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.placeholder-note p {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════
   CLIENT LOGOS — grayscale wall, color on hover
   ═══════════════════════════════════════════════════════════════ */
.client-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 24px;
  align-items: center;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 8px 12px;
  transition: filter 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.client-logo img {
  display: block;
  max-width: 120px;
  max-height: 36px;
  width: auto;
  height: auto;
  filter: grayscale(1) opacity(0.55);
  transition: filter 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.client-logo:hover img {
  filter: grayscale(0) opacity(1);
}

/* ═══════════════════════════════════════════════════════════════
   THINKING — IP framework cards
   ═══════════════════════════════════════════════════════════════ */
.thinking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.thinking-card {
  position: relative;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition:
    background 200ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top accent line — draws left-to-right on hover, matching explore-card */
.thinking-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.thinking-card:hover {
  background: var(--raised);
  border-color: var(--accent-dim2);
}

.thinking-card:hover::before { transform: scaleX(1); }

.thinking-card-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.thinking-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.thinking-card:hover .thinking-card-title { color: var(--accent); }

.thinking-card-body {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   EXPLORE GRID — home → inner pages
   ═══════════════════════════════════════════════════════════════ */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.explore-card {
  display: block;
  position: relative;
  background: var(--surface);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top accent line — draws left-to-right on hover */
.explore-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Arrow — fades and slides in on hover */
.explore-card::after {
  content: '\2192';
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: var(--text-base);
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-card:is(:hover, :focus-visible) { background: var(--raised); color: inherit; }
.explore-card:is(:hover, :focus-visible)::before { transform: scaleX(1); }
.explore-card:is(:hover, :focus-visible)::after { opacity: 1; transform: translateX(0); }

.explore-card-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.explore-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-card:is(:hover, :focus-visible) .explore-card-title { color: var(--accent); }

.explore-card-body {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   TALK / CTA
   ═══════════════════════════════════════════════════════════════ */
.invitation-headline {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 600px;
}

.invitation-body {
  font-size: var(--text-md);
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 36px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #0B0B0B;
  background: var(--accent);
  border: none;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.cta-btn:hover { background: var(--accent-deep); color: #0B0B0B; }
.cta-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER — injected by js/nav.js
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: none;
  padding: 32px 48px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-logo {
  flex-shrink: 0;
}

.footer-logo img {
  display: block;
  height: 20px;
  width: auto;
  opacity: 0.6;
}

.footer-mode {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--muted);
  font-style: italic;
}

.footer-mode .mode-btn {
  padding: 4px 8px;
  font-size: var(--text-xs);
  gap: 3px;
}

.footer-mode .mode-icon {
  font-size: var(--text-sm);
}

.footer-mode .mode-switch {
  padding: 2px;
  gap: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .site-nav     { padding: 18px 32px; }
  .hero-inner,
  .wrap         { padding: 0 32px; }
}

/* ≤ 900px: nav links hidden, hamburger visible */
@media (max-width: 900px) {
  .nav-links         { display: none; }
  .nav-hamburger     { display: flex; }
  .site-nav          { padding: 14px 20px; }
  .nav-logo img      { height: clamp(24px, 5vw, 36px); }
  .hero,
  .page-hero         { padding: 72px 0 64px; }
  .hero-inner,
  .wrap              { padding: 0 24px; }
  .section-block     { padding: 72px 0; }
  .home-section      { padding: 88px 0; }
  .home-kicker       { margin-bottom: 20px; }
  .site-footer       { padding: 24px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .data-grid         { grid-template-columns: 1fr 1fr; }
  .dimensions-grid   { grid-template-columns: 1fr; gap: 12px; }
  .results-grid      { grid-template-columns: 1fr; }
  .client-logos      { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 14px; }
  .client-logo       { height: 56px; }
  .client-logo img   { max-width: 100px; max-height: 30px; }
  .thinking-grid     { grid-template-columns: 1fr; }
  .explore-grid      { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 479px) {
  .data-grid    { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .client-logos { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px 10px; }
  .client-logo { height: 48px; }
  .client-logo img { max-width: 80px; max-height: 26px; }
  .hero-headline { font-size: var(--text-2xl); }
}
