/* ============================================================
   ANIS SLIMANI PORTFOLIO — style.css
   ============================================================
   Table of contents:
   1.  CSS Variables & Reset
   2.  Typography
   3.  Navigation
   4.  Starfield canvas
   5.  Hero
   6.  Stats strip
   7.  Work / Cases
   8.  About
   9.  Services
   10. Contact
   11. Footer
   12. Case study pages
   13. Utilities & Animations
   14. Responsive
   ============================================================ */


/* ── 1. VARIABLES & RESET ─────────────────────────────────── */

:root {
  color-scheme: dark;
  --bg:            #000000;
  --bg2:           #090909;
  --bg3:           #0e0e0e;
  --surface:       #111317;
  --surface2:      #16181e;

  /* Accent — #CCCCFF periwinkle */
  --accent:        #ccccff;
  --accent-rgb:    204,204,255;
  --accent-dim:    rgba(204,204,255,0.06);
  --accent-mid:    rgba(204,204,255,0.14);
  --accent-border: rgba(204,204,255,0.18);
  --accent-glow:   rgba(204,204,255,0.05);
  --card-glow:     0 0 24px rgba(204,204,255,0.06), 0 0 60px rgba(204,204,255,0.03);
  --card-glow-hover: 0 4px 32px rgba(204,204,255,0.10), 0 0 72px rgba(204,204,255,0.05);

  --text:          #eeeef8;
  --text-mid:      rgba(238,238,248,0.90);
  --text-muted:    rgba(238,238,248,0.70);

  --border:        rgba(255,255,255,0.07);
  --border-light:  rgba(255,255,255,0.12);

  --radius:        10px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --max-w:         1080px;
  --pad-x:         48px;

  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-numeric:  'DM Sans', sans-serif;

  --header-bg:     rgba(0,0,0,1);
  --header-bg-solid: rgba(0,0,0,1);
  --header-border: var(--border);
  --header-shadow: none;
  --header-link:   var(--text-muted);
  --header-link-hover: var(--text);
  --header-control-bg: var(--accent-dim);
  --header-control-border: var(--accent-border);
  --header-control-text: var(--accent);
  --header-control-hover-bg: var(--accent-mid);
  --header-control-hover-border: rgba(204,204,255,0.45);

  --scrollbar-thumb: rgba(204,204,255,0.26);
  --scrollbar-thumb-hover: rgba(204,204,255,0.40);
  --scrollbar-track: transparent;
}

/* ── Light mode ── */
[data-theme="light"] {
  color-scheme: only light;
  filter: none !important;
  --bg:            #ffffff;
  --bg2:           #ffffff;
  --bg3:           #f7f7fc;
  --surface:       #f0f0f6;
  --surface2:      #e8e8f0;

  /* Cooler indigo tuned to the periwinkle accent */
  --accent:        #4b59bb;
  --accent-rgb:    75,89,187;
  --accent-dim:    rgba(var(--accent-rgb),0.05);
  --accent-mid:    rgba(var(--accent-rgb),0.10);
  --accent-border: rgba(var(--accent-rgb),0.16);
  --accent-glow:   rgba(var(--accent-rgb),0.04);
  --card-glow:     0 2px 16px rgba(var(--accent-rgb),0.05), 0 0 48px rgba(var(--accent-rgb),0.03);
  --card-glow-hover: 0 12px 48px rgba(var(--accent-rgb),0.16), 0 0 80px rgba(var(--accent-rgb),0.08);

  --text:          #0e0a1f;
  --text-mid:      rgba(14,10,31,0.78);
  --text-muted:    rgba(14,10,31,0.60);

  --border:        rgba(var(--accent-rgb),0.08);
  --border-light:  rgba(var(--accent-rgb),0.12);

  --header-bg:     rgba(255,255,255,1);
  --header-bg-solid: rgba(255,255,255,1);
  --header-border: rgba(var(--accent-rgb),0.08);
  --header-shadow: 0 1px 8px rgba(var(--accent-rgb),0.04);
  --header-link:   rgba(14,10,31,0.62);
  --header-link-hover: rgba(14,10,31,0.96);
  --header-control-bg: rgba(var(--accent-rgb),0.05);
  --header-control-border: rgba(var(--accent-rgb),0.16);
  --header-control-text: rgba(var(--accent-rgb),0.94);
  --header-control-hover-bg: rgba(var(--accent-rgb),0.10);
  --header-control-hover-border: rgba(var(--accent-rgb),0.30);

  --scrollbar-thumb: rgba(var(--accent-rgb),0.24);
  --scrollbar-thumb-hover: rgba(var(--accent-rgb),0.38);
  --scrollbar-track: transparent;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 64px;
  overflow-x: hidden;
  overscroll-behavior: none;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
body {
  animation: page-fade-in 0.45s ease forwards;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}
body.mobile-nav-open {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
img { display: block; max-width: 100%; content-visibility: auto; }
a { color: inherit; text-decoration: none; }

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: transparent;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button {
  background: transparent;
}

/* Focus states for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}



/* ── Light mode overrides ── */

/* Navigation */
[data-theme="light"] .nav,
[data-theme="light"] nav.work-header {
  background: var(--header-bg);
  border-bottom-color: var(--header-border);
  box-shadow: var(--header-shadow);
}

[data-theme="light"] .mobile-nav-overlay {
  background: var(--bg);
}
[data-theme="light"] .nav-burger span,
[data-theme="light"] .mobile-nav-close span { background: var(--text); }

/* Buttons — primary CTA gets night sky treatment */
[data-theme="light"] .btn-primary {
  background:
    radial-gradient(circle at 12% 38%, rgba(255,255,255,0.92) 0, rgba(255,255,255,0.92) 0.8px, transparent 0.8px),
    radial-gradient(circle at 47% 72%, rgba(255,255,255,0.60) 0, rgba(255,255,255,0.60) 0.6px, transparent 0.6px),
    radial-gradient(circle at 79% 24%, rgba(255,255,255,0.88) 0, rgba(255,255,255,0.88) 0.9px, transparent 0.9px),
    radial-gradient(circle at 88% 64%, rgba(255,255,255,0.70) 0, rgba(255,255,255,0.70) 0.7px, transparent 0.7px),
    radial-gradient(circle at 33% 82%, rgba(255,255,255,0.45) 0, rgba(255,255,255,0.45) 0.5px, transparent 0.5px),
    radial-gradient(circle at 64% 44%, rgba(255,255,255,0.55) 0, rgba(255,255,255,0.55) 0.6px, transparent 0.6px),
    radial-gradient(circle at 56% 14%, rgba(255,255,255,0.75) 0, rgba(255,255,255,0.75) 0.7px, transparent 0.7px),
    linear-gradient(135deg, #000000 0%, #020208 60%, #04040c 100%) !important;
  color: #eeeef8 !important;
  border: 1px solid rgba(204,204,255,0.18) !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s !important;
}
[data-theme="light"] .btn-primary::before,
[data-theme="light"] .btn-primary::after {
  content: '';
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 0 2px 1px rgba(200,200,255,0.28);
  pointer-events: none;
}
[data-theme="light"] .btn-primary::before {
  top: 30%; left: 18%;
  animation: btn-star-twinkle 2.5s 0.4s ease-in-out infinite;
}
[data-theme="light"] .btn-primary::after {
  top: 62%; left: 72%;
  animation: btn-star-twinkle 3.2s 1.5s ease-in-out infinite;
}
[data-theme="light"] .btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb),0.16), 0 0 8px rgba(204,204,255,0.06) inset;
}
[data-theme="light"] .btn-secondary {
  background: rgba(var(--accent-rgb),0.04);
}

/* Typography — sky gradient clipped to all heading text (no stars) */
[data-theme="light"] h1, [data-theme="light"] h2,
[data-theme="light"] h3, [data-theme="light"] h4 {
  background: linear-gradient(135deg, #000000 0%, #020208 60%, #04040c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #04040c;
}
/* Outline em elements — white fill so outline stays clean */
[data-theme="light"] h1 em,
[data-theme="light"] h2 em {
  background: var(--bg);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.2px var(--accent);
}

/* Hero title — starry fill stays scoped to the filled hero line */
[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #000000 0%, #020208 60%, #04040c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #04040c;
}
[data-theme="light"] .hero-title-fill {
  color: transparent;
  background: linear-gradient(135deg, #000000 0%, #020208 60%, #04040c 100%);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .hero-title-fill::before,
[data-theme="light"] .hero-title-fill::after {
  content: none;
}
[data-theme="light"] .stat-num,
[data-theme="light"] .case-metric-val,
[data-theme="light"] .page-stat-val,
[data-theme="light"] .outcome-val,
[data-theme="light"] .score-table td:last-child,
[data-theme="light"] .decision-num {
  color: rgba(14,10,31,0.88);
}

/* Light mode — starfield stays visible (JS draws light particles) */
[data-theme="light"] .hero-photo-glow { display: none; }

/* Portrait theme swap — CSS-driven, no JS src change needed */
.hero-photo .portrait-light { display: none; }
[data-theme="light"] .hero-photo .portrait-dark  { display: none; }
[data-theme="light"] .hero-photo .portrait-light { display: block; }

/* Light mode hero photo — fade only the bottom edge */
[data-theme="light"] .hero-photo img {
  -webkit-mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}

/* Starfield visible in light mode — JS draws glows + particles */

/* Sections transparent so canvas shows through */
[data-theme="light"] section,
[data-theme="light"] .page-hero,
[data-theme="light"] .case-content-wrap {
  background: transparent;
}

/* Cards & surfaces */
[data-theme="light"] .case-card,
[data-theme="light"] .service-block,
[data-theme="light"] .contact-left,
[data-theme="light"] .contact-form,
[data-theme="light"] .work-stats-embed,
[data-theme="light"] .outcome-card,
[data-theme="light"] .partner-card,
[data-theme="light"] .decision-item {
  background: #ffffff;
  border-color: var(--accent-border);
  box-shadow: 0 1px 4px rgba(var(--accent-rgb),0.04);
}
[data-theme="light"] .case-card:hover,
[data-theme="light"] .service-block:hover,
[data-theme="light"] .outcome-card:hover,
[data-theme="light"] .partner-card:hover {
  box-shadow: var(--card-glow-hover);
}
[data-theme="light"] .case-visual {
  background: var(--bg3);
}
[data-theme="light"] .case-mock {
  background: #ffffff;
  border-color: var(--border-light);
  box-shadow: 0 16px 48px rgba(var(--accent-rgb),0.08);
}

/* Mock internals */
[data-theme="light"] .mock-sidebar { background: rgba(var(--accent-rgb),0.03); border-right-color: var(--border); }
[data-theme="light"] .mock-sb-row { background: rgba(var(--accent-rgb),0.06); }
[data-theme="light"] .mock-sb-row.active { background: var(--accent-dim); border-color: var(--accent-border); }
[data-theme="light"] .mock-heading { background: rgba(var(--accent-rgb),0.09); }
[data-theme="light"] .mock-line { background: rgba(var(--accent-rgb),0.05); }
[data-theme="light"] .mock-input { background: rgba(var(--accent-rgb),0.03); border-color: var(--border-light); }
[data-theme="light"] .mock-btn-a { background: linear-gradient(135deg, #000000, #04040c); opacity: 0.8; }
[data-theme="light"] .mock-funnel-row { background: rgba(var(--accent-rgb),0.06); border-color: rgba(var(--accent-rgb),0.14); }
[data-theme="light"] .mock-chip { background: rgba(var(--accent-rgb),0.03); border-color: var(--border); }
[data-theme="light"] .mock-chip.a { background: var(--accent-dim); border-color: var(--accent-border); }

/* Forms */
[data-theme="light"] .form-field input,
[data-theme="light"] .form-field textarea {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text);
}
[data-theme="light"] .form-field input:focus,
[data-theme="light"] .form-field textarea:focus { border-color: rgba(var(--accent-rgb),0.35); }
[data-theme="light"] .form-field input::placeholder,
[data-theme="light"] .form-field textarea::placeholder { color: rgba(14,10,31,0.30); }
[data-theme="light"] .form-field label { color: rgba(14,10,31,0.42); }

/* Tags & chips */
[data-theme="light"] .tag {
  background: rgba(var(--accent-rgb),0.05);
  border-color: rgba(var(--accent-rgb),0.14);
}
[data-theme="light"] .tech-chip {
  background: #ffffff;
  border-color: var(--border-light);
}
[data-theme="light"] .section-label {
  background: rgba(var(--accent-rgb),0.05);
  border-color: rgba(var(--accent-rgb),0.14);
}
[data-theme="light"] .hero-eyebrow {
  background: rgba(var(--accent-rgb),0.05);
  border-color: rgba(var(--accent-rgb),0.14);
}

/* Sections */
[data-theme="light"] .stats-strip { background: var(--bg2); }
[data-theme="light"] .stat-item + .stat-item::before {
  background: linear-gradient(to bottom, transparent, rgba(var(--accent-rgb),0.10) 40%, rgba(var(--accent-rgb),0.10) 60%, transparent);
}
[data-theme="light"] .case-visual::before {
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.04), transparent 70%);
}
[data-theme="light"] footer {
  background: rgba(248,248,255,0.98);
  border-top: 1px solid rgba(var(--accent-rgb),0.06);
}
[data-theme="light"] .score-table td { background: #ffffff; }
[data-theme="light"] .score-table th { border-bottom-color: var(--border-light); }

/* Contact links */
[data-theme="light"] .contact-link {
  background: rgba(var(--accent-rgb),0.03);
  border-color: var(--accent-border);
}
[data-theme="light"] .contact-link:hover {
  background: rgba(var(--accent-rgb),0.07);
}
[data-theme="light"] .contact-link-icon {
  background: rgba(var(--accent-rgb),0.06);
  border-color: rgba(var(--accent-rgb),0.14);
}

/* Case study pages */
[data-theme="light"] .page-stat-strip {
  background: #ffffff;
  border-color: var(--border-light);
}
[data-theme="light"] .page-stat-item {
  background: #ffffff;
  border-right-color: var(--border);
}
[data-theme="light"] .callout {
  background: rgba(var(--accent-rgb),0.04);
  border-color: rgba(var(--accent-rgb),0.14);
}
[data-theme="light"] .insight {
  background: rgba(var(--accent-rgb),0.03);
  border-left-color: var(--accent);
}
[data-theme="light"] .case-confidential {
  background: rgba(var(--accent-rgb),0.04);
  border-color: rgba(var(--accent-rgb),0.14);
}
[data-theme="light"] .progress-bar { opacity: 0.85; }

/* Tech strip */
[data-theme="light"] .tech-strip {
  background: #ffffff;
  border-color: var(--accent-border);
}

/* Service block lists */
[data-theme="light"] .service-block ul li::before {
  background: var(--accent);
  opacity: 0.6;
}

/* Smooth theme transition — full page crossfade */
.theme-fading {
  opacity: 0;
  transition: opacity 0.25s ease !important;
}
.theme-revealing {
  opacity: 1;
  transition: opacity 0.3s ease !important;
}

/* ── 2. TYPOGRAPHY ────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}
h1 { font-size: clamp(44px, 6.5vw, 82px); }
h2 { font-size: clamp(28px, 3.8vw, 46px); }
h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 700; }

/* In Syne, use outline/stroke treatment instead of italic for accent */
h1 em, h2 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--accent);
}

.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  opacity: 0.65;
}

.section-desc {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-mid);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: 52px;
}


/* ── 3. NAVIGATION ────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 0 var(--pad-x);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  will-change: transform;
  transform: translateZ(0);
  box-shadow: var(--header-shadow);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-logo-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 13px;
  font-weight: 300;
  color: var(--header-link);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--header-link-hover); }
.nav-links a.active { color: var(--header-link-hover); }
.nav-links a.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 2px auto 0;
}

.btn-nav {
  font-size: 12px;
  font-weight: 600;
  padding: 0 18px;
  border-radius: 6px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  border: none;
  color: #07070f;
  background: var(--accent);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(204,204,255,0.12);
}
[data-theme="light"] .btn-nav,
[data-theme="light"] a.btn-nav {
  background:
    radial-gradient(circle at 18% 35%, rgba(255,255,255,0.90) 0, rgba(255,255,255,0.90) 0.7px, transparent 0.7px),
    radial-gradient(circle at 55% 70%, rgba(255,255,255,0.60) 0, rgba(255,255,255,0.60) 0.5px, transparent 0.5px),
    radial-gradient(circle at 82% 28%, rgba(255,255,255,0.75) 0, rgba(255,255,255,0.75) 0.6px, transparent 0.6px),
    linear-gradient(135deg, #000000 0%, #020208 55%, #04040c 100%) !important;
  color: #eeeef8 !important;
  border: 1px solid rgba(204,204,255,0.15) !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s !important;
}
[data-theme="light"] a.btn-nav::before {
  content: '';
  position: absolute;
  width: 1.5px; height: 1.5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.74);
  box-shadow: 0 0 2px 1px rgba(200,200,255,0.24);
  top: 38%; left: 22%;
  pointer-events: none;
  animation: btn-star-twinkle 2.8s 0.9s ease-in-out infinite;
}
[data-theme="light"] .btn-nav:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb),0.14);
}
.lang-toggle {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--header-control-text);
  background: var(--header-control-bg);
  border: 1px solid var(--header-control-border);
  border-radius: 6px;
  height: 34px;
  padding: 0 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-toggle svg { flex-shrink: 0; border-radius: 1px; }
.lang-toggle:hover {
  background: var(--header-control-hover-bg);
  border-color: var(--header-control-hover-border);
}

.theme-toggle {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--header-control-text);
  background: var(--header-control-bg);
  border: 1px solid var(--header-control-border);
  border-radius: 6px;
  height: 34px;
  padding: 0 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  background: var(--header-control-hover-bg);
  border-color: var(--header-control-hover-border);
}
/* Hide the inactive label */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; align-items: center; gap: 6px; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline-flex; align-items: center; gap: 6px; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.theme-toggle svg { flex-shrink: 0; display: block; }
[data-theme="light"] .lang-toggle:hover,
[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .btn-nav:hover,
[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .contact-link:hover,
[data-theme="light"] .mobile-nav-btn:hover {
  border-color: rgba(var(--accent-rgb),0.3);
}
[data-theme="light"] .lang-toggle:hover,
[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .mobile-nav-btn:hover {
  background: var(--accent-mid);
}

/* ── 4. STARFIELD ─────────────────────────────────────────── */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
section, footer, .page-hero, .case-content-wrap {
  position: relative;
  z-index: 1;
  overflow-x: clip;
}


/* ── 5. HERO ──────────────────────────────────────────────── */

#hero {
  min-height: 80vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 0;
  padding: 80px var(--pad-x) 40px;
  max-width: calc(var(--max-w) + var(--pad-x) * 2);
  margin: 0 auto;
  width: 100%;
}

.hero-left {
  display: flex;
  flex-direction: column;
  padding-right: 48px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 24px;
  width: fit-content;
  opacity: 0.8;
  animation: fadeInLeft 0.9s ease both;
}
.hero-eyebrow-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  margin-bottom: 20px;
  animation: fadeInLeft 0.9s 0.1s ease both;
}
.hero-title-fill {
  position: relative;
  display: inline-block;
  line-height: inherit;
}
.hero-word-carousel {
  display: inline-block;
  white-space: nowrap;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.35s ease,
    filter    0.35s ease;
}
.hero-word-carousel.is-out {
  transform: translateY(-7px);
  opacity: 0;
  filter: blur(6px);
  transition:
    transform 0.18s ease-in,
    opacity   0.16s ease-in,
    filter    0.16s ease-in;
}
.hero-word-carousel.is-in {
  transform: translateY(7px);
  opacity: 0;
  filter: blur(6px);
  transition: none !important;
}
.hero-sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 480px;
  animation: fadeInLeft 0.9s 0.2s ease both;
}
.hero-sub strong { color: var(--text); font-weight: 500; }

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInLeft 0.9s 0.3s ease both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: var(--accent);
  color: #07070f;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(204,204,255,0.14);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
  font-size: 14px;
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover {
  background: var(--accent-mid);
  border-color: rgba(204,204,255,0.45);
}

/* Hero photo */
.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInRight 0.9s 0.15s ease both;
}

.hero-photo-wrap {
  position: relative;
  width: 100%;
  min-width: 280px;
  max-width: 420px;
}

.hero-photo-glow {
  position: absolute;
  bottom: -40px; left: 50%;
  transform: translateX(-50%);
  width: 80%; height: 200px;
  background: radial-gradient(ellipse, rgba(204,204,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  image-rendering: auto;
  -webkit-mask-image: radial-gradient(ellipse 90% 95% at 50% 50%, black 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 95% at 50% 50%, black 60%, transparent 100%);
}

.hero-photo-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 40px;
  min-height: 400px;
}
.hero-photo-placeholder-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}


/* ── 6. STATS STRIP ───────────────────────────────────────── */

/* Used standalone between work header and cards */
.stats-strip {
  background: var(--bg2);
}
.stats-strip-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--pad-x);
}
.stat-item {
  padding: 36px 28px;
  text-align: center;
  position: relative;
}
.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(204,204,255,0.15) 40%, rgba(204,204,255,0.15) 60%, transparent);
}
.stat-num {
  font-family: var(--font-numeric);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-label {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.55;
  font-weight: 400;
}


/* ── 7. WORK / CASES ──────────────────────────────────────── */

#work { padding: 140px var(--pad-x); }
.work-inner { max-width: var(--max-w); margin: 0 auto; }
.work-header { margin-bottom: 0; }

/* Stats embedded between header and cards */
.work-stats-embed {
  margin: 40px 0 52px;
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.work-stats-embed .stats-strip {
  border: none;
  border-radius: 0;
}
.work-stats-embed .stats-strip-inner {
  max-width: 100%;
  padding: 0;
}

.cases-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  background: var(--bg2);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  backface-visibility: hidden;
}
.case-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: var(--card-glow-hover);
}
.case-card.flipped { direction: rtl; }
.case-card.flipped > * { direction: ltr; }

.case-body {
  padding: 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}
.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
  opacity: 0.8;
}
.tag.accent {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}
.case-body h3 { margin-bottom: 14px; }
.case-body p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 300;
  flex: 1;
  margin-bottom: 24px;
}
.case-metrics { display: flex; gap: 22px; flex-wrap: wrap; }
.case-metric-val {
  font-family: var(--font-numeric);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.case-metric-key {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 3px;
}
.case-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 18px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.case-card:hover .case-link { opacity: 1; }

.case-visual {
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.case-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 2;
}
.case-visual-img[src=""] { display: none; }
.case-visual-img--lower { object-position: center 56%; }
.case-visual-img--night { }
.case-visual-img--day   { display: none; }
[data-theme="light"] .case-visual-img--night { display: none; }
[data-theme="light"] .case-visual-img--day   { display: block; }

.case-visual-img--float {
  object-fit: contain;
  object-position: center;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
}
.case-visual--dark { background: var(--bg3); }
.mock-dimmed { opacity: 0.15; transform: translateY(-6px); }
.case-visual::before {
  content: '';
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%,-50%);
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(204,204,255,0.06), transparent 70%);
  pointer-events: none;
}
.case-mock {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 16/10;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 24px 56px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
}

/* Mock internals */
.mock-sidebar {
  position: absolute;
  left:0; top:0; bottom:0; width:30%;
  background: rgba(255,255,255,0.025);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.mock-sb-row {
  height: 8px; border-radius: 2px;
  background: rgba(255,255,255,0.05);
}
.mock-sb-row.active {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}
.mock-main-area {
  position: absolute;
  left:30%; right:0; top:0; bottom:0;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.mock-heading { height: 11px; border-radius: 3px; background: rgba(255,255,255,0.09); width: 65%; }
.mock-line { height: 6px; border-radius: 2px; background: rgba(255,255,255,0.04); }
.mock-input-row { display: flex; gap: 5px; margin-top: 4px; }
.mock-input { flex:1; height: 20px; border-radius: 4px; background: rgba(255,255,255,0.04); border: 1px solid var(--border-light); }
.mock-btn-a { width: 48px; height: 20px; border-radius: 4px; background: var(--accent); opacity: 0.7; }

/* Funnel mock */
.mock-funnel { padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; justify-content: center; height: 100%; }
.mock-funnel-row { height: 20px; border-radius: 4px; background: rgba(204,204,255,0.07); border: 1px solid rgba(204,204,255,0.14); margin: 0 auto; }

/* Components mock */
.mock-components { padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 5px; height: 100%; }
.mock-chip { height: 26px; border-radius: 5px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.mock-chip.a { background: var(--accent-dim); border-color: var(--accent-border); }


/* ── 8. ABOUT ─────────────────────────────────────────────── */

#about {
  padding: 140px var(--pad-x);
}
.about-inner { max-width: var(--max-w); margin: 0 auto; }

.about-top-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: stretch;
}

.about-left-col {
  display: flex;
  flex-direction: column;
}

.about-photo {
  flex: 1;
  min-height: 420px;
  width: 100%;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.about-text { padding-top: 8px; }
.about-text h2 { margin-bottom: 24px; }
.about-text p {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about-text p strong { color: var(--text); font-weight: 500; }
.about-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }


/* ── 9. SERVICES ──────────────────────────────────────────── */

#services { padding: 140px var(--pad-x); }
.services-inner { max-width: var(--max-w); margin: 0 auto; }

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.services-grid > .tech-strip {
  grid-column: 1 / -1;
}
.service-block {
  display: block;
  padding: 24px 22px;
  background: var(--bg2);
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.service-block:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: var(--card-glow-hover);
}
.service-block-num {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.45;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.service-block h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.3;
}
.service-block p { font-size: 15px; color: var(--text-muted); line-height: 1.65; font-weight: 300; }
.service-block-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.5;
  transition: opacity 0.2s;
}
.service-block:hover .service-block-link { opacity: 1; }
.service-block ul { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.service-block ul li {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 12px;
  position: relative;
  line-height: 1.5;
}
.service-block ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* Tech strip */
.tech-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  background: var(--bg2);
}
.tech-strip-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.tech-strip-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.tech-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  color: var(--text-mid);
  background: var(--bg3);
  white-space: nowrap;
}
.tech-strip-arrow { display: none; }


/* ── 10. CONTACT ──────────────────────────────────────────── */

#contact {
  padding: 140px var(--pad-x);
}
.contact-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.contact-left {
  background: var(--bg2);
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}
.contact-left h2 { margin-bottom: 16px; }
.contact-left p {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 28px;
}
.contact-links { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  transition: background 0.2s, border-color 0.2s;
}
.contact-link:hover { background: var(--accent-mid); border-color: rgba(204,204,255,0.45); }
.contact-link-icon {
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-link-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.contact-link-val { font-size: 13px; color: var(--text); margin-top: 1px; }

.contact-form {
  background: var(--bg2);
  border: 1px solid rgba(204,204,255,0.10);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}
.contact-form form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}
.form-submit-btn {
  margin-top: 0;
}
.contact-form h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: 0;
  line-height: 1.3;
}
.contact-form > p { font-size: 15px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.6; }
.form-group { display: flex; flex-direction: column; gap: 18px; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: rgba(238,238,248,0.38);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}
.form-field input:focus,
.form-field textarea:focus { border-color: rgba(204,204,255,0.4); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(238,238,248,0.38); }

.form-submit-btn {
  border: none;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}
.form-submit-btn:disabled {
  cursor: wait;
  opacity: 0.82;
}
.form-submit-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}
.form-status {
  margin-top: 12px;
  font-size: 13px;
}
.form-status[hidden] { display: none; }
.form-status--success { color: var(--accent); }
.form-status--error { color: #cc4444; }
.field-optional {
  opacity: 0.5;
  font-weight: 400;
}

/* ── 11. FOOTER ───────────────────────────────────────────── */

footer {
  padding: 22px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
}
.footer-left { font-size: 12px; color: var(--text-muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 12px; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }


/* ── 12. CASE STUDY PAGES ─────────────────────────────────── */

.page-hero {
  padding: 116px var(--pad-x) 88px;
  max-width: calc(var(--max-w) + var(--pad-x) * 2);
  margin: 0 auto;
}
.page-hero .case-tags { margin-bottom: 20px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 60px); margin-bottom: 18px; }
.page-hero-sub {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-mid);
  max-width: 580px;
  line-height: 1.75;
  margin-bottom: 40px;
}
.page-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.page-stat-strip {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 72px;
}
.page-stat-item {
  flex: 1;
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  background: var(--bg2);
}
.page-stat-item:last-child { border-right: none; }
.page-stat-val { font-family: var(--font-numeric); font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 5px; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; }
.page-stat-key { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }

.case-content-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px var(--pad-x) 110px;
}
.case-confidential {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 48px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.case-confidential-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
  opacity: 0.7;
}

.case-section { margin-bottom: 64px; }
.case-section h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.case-section p {
  font-size: 19px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 14px;
  max-width: 660px;
}
.case-copy-gap { margin-top: 28px; }
.case-section p strong { color: var(--text); font-weight: 500; }
.case-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0;
  max-width: 660px;
}
.case-section ul li {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-mid);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}
.case-section ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}
.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.outcome-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  transition: border-color 0.2s, transform 0.2s;
}
.outcome-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--card-glow-hover); }
.outcome-val { font-family: var(--font-numeric); font-size: 28px; color: var(--accent); line-height: 1; margin-bottom: 5px; font-variant-numeric: lining-nums tabular-nums; }
.outcome-label { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.img-block { margin: 32px 0; }
.case-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.case-img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.case-img + .case-img-placeholder { display: none; }
.case-img--bare {
  display: block;
  width: 100%;
}
.case-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
}
.img-placeholder-tool {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
}
.img-placeholder-title {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  max-width: 420px;
  line-height: 1.5;
}
.img-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.6;
  padding-left: 2px;
  font-style: italic;
}
.img-placeholder {
  width: 100%;
  background: var(--surface, #EDEAE3);
  border: 1px dashed var(--border, #D4CFC8);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6B6560);
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}
.img-placeholder--standard { min-height: 360px; }
.img-placeholder--wide     { min-height: 480px; }
.case-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.case-system-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.case-system-item h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.case-system-item p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.case-quote {
  border-left: 2px solid var(--accent);
  padding: 16px 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}
.case-cta-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 460px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0;
  border: 1px solid var(--border);
}
.case-cta-split__img {
  overflow: hidden;
}
.case-cta-split__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.case-cta-split__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 56px;
  background: var(--surface);
}
.case-cta-split__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s, gap 0.2s;
}
.btn-ghost:hover {
  color: var(--text-muted);
  gap: 10px;
}
.case-cta-split__body h3 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 28px;
}
@media (max-width: 768px) {
  .case-cta-split { grid-template-columns: 1fr; }
  .case-cta-split__img { min-height: 280px; }
  .case-cta-split__body { padding: 36px 28px; }
}

.score-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.score-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}
.score-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-mid);
  font-weight: 300;
}
.score-table td:last-child { color: var(--accent); font-family: var(--font-numeric); font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }
.score-table tr:last-child td { border-bottom: none; }

/* AI workflow page */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 28px 0;
}
.pipeline-step {
  flex: 1;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
  transition: background 0.2s;
}
.pipeline-step:last-child { border-right: none; }
.pipeline-step:hover { background: var(--surface2); }
.pipeline-step::after {
  content: '\2192';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--accent);
  z-index: 2;
  background: var(--bg2);
  padding: 2px 0;
}
.pipeline-step:last-child::after { display: none; }
.pipeline-tool {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.pipeline-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.pipeline-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.tool-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.tool-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.tool-card-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.tool-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 24px 0;
}
.workflow-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  transition: background 0.2s;
}
.workflow-step:last-child { border-bottom: none; }
.workflow-step:hover { background: var(--surface); }
.workflow-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-numeric);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.4;
  border-right: 1px solid var(--border);
  padding: 20px 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.workflow-step-body {
  padding: 20px 24px;
}
.workflow-step-body h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0;
  line-height: 1.3;
}
.workflow-step-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}
.workflow-step-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Reading progress bar */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 201;
  transition: width 0.08s linear;
  opacity: 0.7;
  pointer-events: none;
}

/* Case study section navigator */

/* Unified work page header — replaces .nav + .case-nav on case study pages */
nav.work-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  gap: 24px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
}
.work-header-sections {
  display: flex;
  align-items: stretch;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.work-header-sections::-webkit-scrollbar { display: none; }
.work-header-link {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--header-link);
  padding: 0 12px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.work-header-link:hover { color: var(--header-link-hover); }
.work-header-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.back-to-work {
  position: fixed;
  top: 72px;
  left: var(--pad-x);
  z-index: 150;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, color 0.2s;
}
.back-to-work.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-work:hover { color: var(--text); }


/* Callout / highlight block */
.callout {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 22px 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.75;
  max-width: 660px;
}
.callout strong { color: var(--accent); }

/* Decision list */
.decision-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}
.decision-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}
.decision-item:hover { border-color: var(--accent-border); box-shadow: var(--card-glow-hover); }
.decision-num {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  font-family: var(--font-numeric);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.4;
  border-right: 1px solid var(--border);
  font-variant-numeric: lining-nums tabular-nums;
}
.decision-body { padding: 16px 20px; }
.decision-body h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: 0;
}
.decision-item .decision-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  font-weight: 300;
  max-width: none;
  margin-bottom: 0;
}


/* Partner grid (co-branded section) */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.partner-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.partner-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--card-glow-hover); }
.partner-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.partner-scope {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}
.partner-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}


/* Insight quote */
.insight {
  padding: 20px 24px;
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin: 22px 0;
  font-size: 15px;
  font-style: italic;
  color: var(--text);
  line-height: 1.75;
  max-width: 620px;
  font-weight: 300;
}


/* ── 13. UTILITIES & ANIMATIONS ───────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes btn-star-twinkle {
  0%, 65%, 100% { opacity: 1; transform: scale(1); }
  35%           { opacity: 0.08; transform: scale(0.5); }
}

/* ── SCROLL ANIMATIONS ────────────────────────────────────── */

/* Base reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1), transform 0.85s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.reveal.visible { opacity: 1; transform: translateY(0); will-change: auto; }
.reveal-d1 { transition-delay: 0.12s; }

/* Card slide-in from sides */
.reveal-left {
  opacity: 0;
  transform: translateX(-48px) translateY(12px);
  transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.reveal-right {
  opacity: 0;
  transform: translateX(48px) translateY(12px);
  transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
  will-change: auto;
}

/* Scale-up for stat items */
.reveal-scale {
  opacity: 0;
  transform: scale(0.93) translateY(16px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.reveal-scale.visible { opacity: 1; transform: scale(1) translateY(0); will-change: auto; }

/* Stagger children */
.stagger-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.16,1,0.3,1), transform 0.65s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.stagger-child.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}



/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .stagger-child {
    opacity: 1;
    transform: none;
  }
  #starfield { display: none; }
  /* Carousel: no blur/slide, just instant swaps */
  .hero-word-carousel,
  .hero-word-carousel.is-out,
  .hero-word-carousel.is-in {
    transition: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}


/* ── 14. RESPONSIVE ───────────────────────────────────────── */

/* -- Hamburger button (hidden on desktop) -- */
.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 301;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  position: absolute;
  left: 10px;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.25s;
}
.nav-burger span:nth-child(1) { top: 13px; }
.nav-burger span:nth-child(2) { top: 19px; }
.nav-burger span:nth-child(3) { top: 25px; }

.nav-burger.active span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-burger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.active span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* -- Mobile nav overlay (hidden on desktop) -- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.35s cubic-bezier(0.16,1,0.3,1), visibility 0.35s;
  padding-top: 56px;
  padding-bottom: 94px;
}
.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: -0.02em;
  padding: 10px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  opacity: 0;
  transform: translateY(12px);
}
.mobile-nav-overlay.open .mobile-nav a {
  opacity: 1;
  transform: translateY(0);
  transition: color 0.2s, opacity 0.4s cubic-bezier(0.16,1,0.3,1), transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.mobile-nav-overlay.open .mobile-nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav-overlay.open .mobile-nav a:nth-child(2) { transition-delay: 0.1s; }
.mobile-nav-overlay.open .mobile-nav a:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav-overlay.open .mobile-nav a:nth-child(4) { transition-delay: 0.2s; }
.mobile-nav-overlay.open .mobile-nav a:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav a:hover { color: var(--accent); }

/* Header inside overlay — logo + close X */
.mobile-nav-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
}
.mobile-nav-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-close span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  position: absolute;
  left: 10px;
  top: 19px;
}
.mobile-nav-close span:nth-child(1) { transform: rotate(45deg); }
.mobile-nav-close span:nth-child(2) { transform: rotate(-45deg); }

/* Footer row in mobile nav — Hire me + FR side by side */
.mobile-nav-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 10px;
  padding: 24px var(--pad-x);
  border-top: 1px solid var(--border);
}
.mobile-nav-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 14px;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--header-control-border);
  color: var(--header-control-text);
  background: var(--header-control-bg);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.mobile-nav-btn:hover {
  background: var(--header-control-hover-bg);
  border-color: var(--header-control-hover-border);
  transform: translateY(-1px);
}
.mobile-nav-btn svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  display: block;
}
.mobile-nav-footer .lang-toggle,
.mobile-nav-footer .theme-toggle {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 14px;
  min-height: 46px;
  border-radius: 10px;
  gap: 8px;
}
.mobile-nav-footer .lang-toggle svg {
  width: 16px;
  height: 12px;
  border-radius: 2px;
}
.mobile-nav-footer .theme-toggle {
  padding-left: 12px;
  padding-right: 12px;
}
.mobile-nav-footer .theme-toggle .icon-moon,
.mobile-nav-footer .theme-toggle .icon-sun {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
}

@media (max-width: 1024px) {
  :root { --pad-x: 32px; }
}

@media (max-width: 860px) {
  :root { --pad-x: 20px; }

  /* ── Global mobile resets ── */
  h1 { font-size: clamp(28px, 8vw, 44px); word-break: break-word; }
  h1 em, h2 em { -webkit-text-stroke-width: 1px; }
  [data-theme="light"] h1 em, [data-theme="light"] h2 em { -webkit-text-stroke-width: 0.75px; }
  h2 { font-size: clamp(24px, 6vw, 36px); }
  .section-desc,
  .hero-sub,
  .about-text p,
  .page-hero-sub,
  .case-section p,
  .case-section ul,
  .callout,
  .insight { max-width: 100%; }

  /* Everything centered */
  .hero-left,
  .work-header:not(nav),
  .about-text,
  .contact-left,
  .services-inner > .reveal:not(.tech-strip) {
    text-align: center;
    align-items: center;
  }
  .work-header:not(nav),
  .about-text,
  .contact-left,
  .services-inner > .reveal:not(.tech-strip) {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .section-label { justify-content: center; }
  .hero-eyebrow { margin-left: auto; margin-right: auto; }
  .hero-cta-row,
  .about-cta-row,
  .case-metrics { justify-content: center; width: 100%; }
  .contact-links { align-items: center; width: 100%; }
  .contact-link { width: 100%; }
  .case-body { text-align: center; align-items: center; }
  .case-tags { justify-content: flex-start; }
  .case-metrics { flex-wrap: wrap; }
  .case-link { margin-left: auto; margin-right: auto; }

  /* ── Nav ── */
  .nav,
  nav.work-header {
    padding: 0 var(--pad-x);
    background: var(--header-bg-solid);
  }
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .nav > .lang-toggle { display: none; }
  .nav > .theme-toggle { display: none; }
  nav.work-header > .lang-toggle { display: none; }
  nav.work-header > .theme-toggle { display: none; }
  .nav-burger { display: flex; }

  /* ── Hero ── */
  #hero {
    grid-template-columns: 1fr;
    padding: 96px var(--pad-x) 48px;
    gap: 0;
    min-height: unset;
    max-width: 100%;
  }
  .hero-right { order: -1; position: relative; z-index: 1; }
  .hero-photo-wrap { max-width: 180px; margin: 0 auto; }
  .hero-photo { aspect-ratio: 3/4; }
  /* No bottom fade on mobile — image is small */
  [data-theme="light"] .hero-photo img {
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* Block canvas glow in hero on mobile light — glow starts from work section */
  [data-theme="light"] #hero {
    background: var(--bg);
  }
  .hero-left { padding-right: 0; align-items: center; text-align: center; position: relative; z-index: 2; }
  .hero-eyebrow { font-size: 10px; margin-top: 0; margin-bottom: 24px; }
  .hero-sub { font-size: 15px; }
  .hero-cta-row { flex-wrap: wrap; }

  /* ── Stats ── */
  .stats-strip-inner { grid-template-columns: repeat(2, 1fr); padding: 0; }
  .stat-item { padding: 22px 14px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 11px; }
  .stat-item:nth-child(2)::before { display: none; }
  .stat-item:nth-child(3) { border-top: 1px solid var(--border); }
  .stat-item:nth-child(4) { border-top: 1px solid var(--border); }
  .stat-item:nth-child(4)::before { display: none; }

  /* ── Work ── */
  #work { padding: 64px var(--pad-x); }
  .case-card { grid-template-columns: 1fr; min-height: unset; }
  .case-card.flipped { direction: ltr; }
  .case-visual { min-height: 180px; order: -1; }
  .case-body { padding: 24px 20px; }
  .case-body h3 { font-size: 18px; }
  .case-body p { font-size: 15px; }
  .case-metrics { gap: 16px; }
  .case-metric-val { font-size: 20px; }
  .case-mock { max-width: 200px; }
  .pipeline { flex-direction: column; }
  .pipeline-step { border-right: none; border-bottom: 1px solid var(--border); }
  .pipeline-step::after {
    content: '\2193';
    right: auto;
    left: 50%;
    top: auto;
    bottom: -12px;
    transform: translateX(-50%);
  }
  .pipeline-step:last-child { border-bottom: none; }
  .tools-grid { grid-template-columns: 1fr 1fr; }

  /* ── About ── */
  #about { padding: 64px var(--pad-x); }
  .about-top-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { aspect-ratio: 3/2; max-width: 100%; width: 100%; min-height: unset; flex: unset; }
  .about-text { padding-top: 0; }
  .about-text p { font-size: 15px; }

  /* ── Services ── */
  #services { padding: 64px var(--pad-x); }
  .services-grid { grid-template-columns: 1fr; }
  .service-block { padding: 24px 20px; }
  .tech-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(204,204,255,0.10);
    border-radius: var(--radius-lg);
    background: var(--bg2);
    overflow: hidden;
    margin-top: 24px;
    box-shadow: var(--card-glow);
  }
  .tech-strip-label {
    font-size: 10px;
    flex-shrink: 0;
    margin-right: 2px;
  }
  .tech-strip-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;

    gap: 6px;
    flex: 1;
    min-width: 0;
    align-items: center;
  }
  .tech-strip-scroll::-webkit-scrollbar { display: none; }
  .tech-chip {
    flex-shrink: 0;
  }
  .tech-strip-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding-left: 4px;
  }

  /* ── Contact ── */
  #contact { padding: 64px var(--pad-x); }
  .contact-inner { grid-template-columns: 1fr; gap: 36px; }
  .contact-left { padding: 24px 20px; }
  .contact-form { padding: 24px 20px; }

  /* ── Case study pages ── */
  .page-hero { padding: 80px var(--pad-x) 40px; }
  .page-hero h1 { font-size: clamp(24px, 7vw, 36px); }
  .page-hero-sub { font-size: 17px; }
  .page-stat-strip { flex-wrap: wrap; }
  .page-stat-item { flex: 0 0 50%; border-bottom: 1px solid var(--border); }
  .page-stat-val { font-size: 20px; }
  .case-content-wrap { padding: 16px var(--pad-x) 64px; }
  .case-section p { font-size: 17px; }
  .case-section ul { max-width: 100%; }
  .outcomes-grid { grid-template-columns: 1fr 1fr; }

  nav.work-header {
    height: 56px;
    padding: 0 var(--pad-x);
    gap: 10px;
  }
  nav.work-header .work-header-sections { display: none; }
  nav.work-header .nav-burger { display: flex; }

  .back-to-work { display: none; }

  /* ── Footer ── */
  footer { flex-direction: column; gap: 12px; text-align: center; padding: 20px var(--pad-x); }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }

  /* ── Card glow (permanent on mobile) ── */
  .case-card,
  .service-block,
  .contact-link,
  .contact-form,
  .outcome-card,
  .partner-card,
  .decision-item,
  .work-stats-embed {
    box-shadow: var(--card-glow);
  }

  /* ── Disable desktop hover transforms ── */
  .case-card:hover,
  .service-block:hover,
  .contact-link:hover,
  .outcome-card:hover,
  .partner-card:hover,
  .decision-item:hover {
    transform: none;
    box-shadow: var(--card-glow);
  }
  .btn-primary:hover { transform: none; box-shadow: none; }
}

/* ── Small phones (iPhone SE etc.) ── */
@media (max-width: 520px) {
  :root { --pad-x: 16px; }

  h1 { font-size: clamp(22px, 7.5vw, 32px); }
  h2 { font-size: clamp(20px, 6vw, 28px); }

  /* Eyebrow — allow wrap, shrink text */
  .hero-eyebrow {
    font-size: 9px;
    padding: 5px 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.5;
  }

  .hero-sub { font-size: 14px; }
  .section-desc { font-size: 13px; margin-bottom: 24px; }

  .hero-cta-row,
  .about-cta-row { flex-direction: column; width: 100%; }
  .hero-cta-row .btn-primary,
  .hero-cta-row .btn-secondary,
  .about-cta-row .btn-primary,
  .about-cta-row .btn-secondary { width: 100%; justify-content: center; text-align: center; }
  .btn-primary, .btn-secondary { font-size: 13px; padding: 12px 20px; }
  .tools-grid { grid-template-columns: 1fr; }

  /* Stats */
  .stat-item { padding: 16px 8px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 10px; }

  /* Cards */
  .case-body { padding: 18px 14px; }
  .case-body h3 { font-size: 16px; }
  .case-body p { font-size: 14px; }
  .case-metric-val { font-size: 18px; }
  .case-visual { min-height: 120px; }
  .tag { font-size: 9px; padding: 2px 7px; }
  .case-mock { max-width: 160px; }

  /* Grids */
  .outcomes-grid { grid-template-columns: 1fr; }
  .partner-grid { grid-template-columns: 1fr; }
  .services-grid { gap: 10px; }
  .service-block { padding: 20px 16px; }
  .service-block h3 { font-size: 13px; }
  .service-block p { font-size: 12px; }

  /* Contact */
  .contact-left { padding: 20px 16px; }
  .contact-form { padding: 20px 16px; }
  .contact-link { padding: 12px 14px; }
  .contact-link-val { font-size: 12px; }

  /* Case study pages */
  .page-stat-item { flex: 0 0 100%; }
  .page-stat-strip { flex-direction: column; }
  .page-stat-val { font-size: 18px; }
  .decision-item { grid-template-columns: 32px 1fr; }

  /* Nav */
  .mobile-nav a { font-size: 22px; }
  .nav-logo { font-size: 13px; }
  .work-header-link { font-size: 9px; padding: 0 6px; }
  nav.work-header { padding: 0 var(--pad-x); gap: 10px; }

  /* About */
  .about-text p { font-size: 14px; }

  /* Footer */
  .footer-left { font-size: 11px; }
  .footer-links a { font-size: 11px; }
  .footer-links { gap: 12px; }
}
