
:root {
  --bg-deep:    #08090c;
  --bg:         #0d0f14;
  --bg-card:    #13161e;
  --bg-raised:  #191d28;
  --border:     #1e2333;
  --border-lit: #2a3048;
  --text-1:     #e4e6f0;
  --text-2:     #9498b0;
  --text-3:     #7e839c;
  --amber:      #e8a634;
  --amber-dim:  rgba(232, 166, 52, 0.12);
  --amber-mid:  rgba(232, 166, 52, 0.25);
  --teal:       #3ecfcf;
  --blue:       #5b8ef0;
  --coral:      #e07060;
  --green:      #6ab877;
  --purple:     #a07ae8;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --max-w:      1120px;
  --section-py:  140px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: var(--amber); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-1); }
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}
::selection { background: var(--amber-mid); color: var(--text-1); }
/* Skip navigation link — hidden until focused via keyboard */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--amber);
  color: var(--bg);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 8px 8px;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: none;
}
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 768px) { .wrap { padding: 0 24px; } }
section { padding: var(--section-py) 0; }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 9, 12, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--border); }
.nav-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.01em;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--amber); }

/* Mobile menu button — only visible at mobile breakpoint */
.nav-menu-btn {
  display: none;
  background: var(--amber-dim);
  border: 1px solid var(--border-lit);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  transition: border-color 0.2s, background 0.2s;
}
.nav-menu-btn:hover { border-color: var(--amber); background: var(--amber-mid); }
.nav-menu-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.nav-menu-lines {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 14px;
}
.nav-menu-lines span {
  display: block;
  height: 1.5px;
  background: var(--amber);
  border-radius: 1px;
}
.nav-menu-lines span:nth-child(1) { width: 100%; }
.nav-menu-lines span:nth-child(2) { width: 70%; }
.nav-menu-lines span:nth-child(3) { width: 85%; }

@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-name { display: none; }
  .nav-menu-btn { display: inline-flex; }
}

/* Slide-in navigation panel */
.nav-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100dvh;
  width: min(340px, 88vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border-lit);
  z-index: 150;
  padding: 24px 28px 40px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}
.nav-panel.is-open { transform: translateX(0); }
.nav-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-panel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.nav-panel-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px; height: 32px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}
.nav-panel-close:hover { border-color: var(--amber); color: var(--amber); }
.nav-panel-close:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.nav-panel-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.nav-panel-links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
}
.nav-panel-links a:hover,
.nav-panel-links a:focus-visible {
  color: var(--amber);
  border-bottom-color: var(--amber);
  padding-left: 10px;
  outline: none;
}
.nav-panel-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--amber);
  min-width: 20px;
}
.nav-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.nav-panel-backdrop.is-open { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

/* SECTION LABELS */
.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
  display: block;
}

/* HERO */
#hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
  padding-bottom: 40px;
  position: relative;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(232,166,52,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.08;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.hero-statement {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 300;
  color: var(--text-2);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 48px;
}
.hero-meta {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-meta-item {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.hero-meta-item span { color: var(--text-2); }
/* Scroll cue — flows naturally below hero content, never overlaps */
.scroll-cue {
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
  animation: pulse-down 2s ease-in-out infinite;
}
.scroll-cue-arrow {
  width: 22px;
  height: 22px;
  border-right: 2px solid var(--amber);
  border-bottom: 2px solid var(--amber);
  transform: rotate(45deg);
  opacity: 0.5;
}
@keyframes pulse-down {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(6px); }
}

/* ABOUT / METAMORPHOSIS */
#about { background: var(--bg-deep); }
.about-intro {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-2);
  max-width: 700px;
  margin-bottom: 64px;
  line-height: 1.7;
}
.about-intro strong { color: var(--text-1); font-weight: 500; }
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--amber), var(--border) 30%, var(--border) 70%, var(--teal));
}
.tl-item { position: relative; padding-bottom: 48px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -40px; top: 8px;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-deep);
  transition: border-color 0.3s, background 0.3s;
}
.tl-item:hover::before {
  border-color: var(--amber);
  background: var(--amber-dim);
}
.tl-item.current::before {
  border-color: var(--teal);
  background: rgba(62, 207, 207, 0.15);
  box-shadow: 0 0 12px rgba(62, 207, 207, 0.25);
}
.tl-era {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.tl-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}
.tl-org { font-size: 14px; color: var(--amber); margin-bottom: 10px; }
.tl-body { font-size: 15px; color: var(--text-2); max-width: 600px; line-height: 1.7; }

/* WORK */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .work-grid { grid-template-columns: 1fr; } }
.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  transition: border-color 0.3s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.work-card:hover { border-color: var(--border-lit); transform: translateY(-2px); }
.work-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.work-card[data-accent="amber"]::before  { background: var(--amber); }
.work-card[data-accent="teal"]::before   { background: var(--teal); }
.work-card[data-accent="blue"]::before   { background: var(--blue); }
.work-card[data-accent="coral"]::before  { background: var(--coral); }
.work-card[data-accent="green"]::before  { background: var(--green); }
.work-card[data-accent="purple"]::before { background: var(--purple); }
.work-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.work-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
}
.work-impact { font-size: 14px; color: var(--amber); font-weight: 400; margin-bottom: 14px; }
.work-desc { font-size: 14px; color: var(--text-2); line-height: 1.7; }
/* Featured card sits in the 2-column grid like the others.
   The expandable case-study panel still spans full width (see .case-study-panel). */

/* CAPABILITIES */
#capabilities { background: var(--bg-deep); }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 768px) { .cap-grid { grid-template-columns: 1fr; } }
.cap-pillar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 28px;
  transition: border-color 0.3s;
}
.cap-pillar:hover { border-color: var(--border-lit); }
.cap-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  color: var(--bg);
}
.cap-icon.amber { background: var(--amber); }
.cap-icon.teal  { background: var(--teal); }
.cap-icon.blue  { background: var(--blue); }
.cap-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 16px;
}
.cap-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.cap-list li {
  font-size: 14px; color: var(--text-2);
  padding-left: 16px; position: relative; line-height: 1.6;
}
.cap-list li::before { content: '\2014'; position: absolute; left: 0; color: var(--text-3); }

/* RECOMMENDATIONS */
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 900px) { .rec-grid { grid-template-columns: 1fr; } }
.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 20px;
  transition: border-color 0.3s;
}
.rec-card:hover { border-color: var(--border-lit); }
.rec-quote-mark {
  font-family: var(--font-display);
  font-size: 48px; line-height: 1;
  color: var(--amber); opacity: 0.4;
  user-select: none;
}
.rec-body { font-size: 14px; color: var(--text-2); line-height: 1.75; flex: 1; }
.rec-body em { color: var(--text-1); font-style: normal; font-weight: 500; }
.rec-attribution {
  display: flex; align-items: center; gap: 14px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.rec-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; color: var(--amber);
  flex-shrink: 0;
}
.rec-name { font-size: 14px; font-weight: 500; color: var(--text-1); display: block; line-height: 1.3; }
.rec-role { font-size: 12px; color: var(--text-3); line-height: 1.3; }

/* CONTACT */
#contact, footer#contact { padding-top: var(--section-py); padding-bottom: 80px; text-align: center; }
.contact-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  color: var(--text-1);
  margin-bottom: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.contact-sub {
  font-size: 17px; color: var(--text-2);
  max-width: 520px; margin: 0 auto 48px;
  font-weight: 300; line-height: 1.7;
}
.contact-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.contact-link {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-weight: 400;
  color: var(--text-2); transition: all 0.2s;
}
.contact-link:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-1px); }
.contact-link-label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.footer-line {
  margin-top: 80px; padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}


/* ═══════════════════════════════════════════════════════
   LIGHT MODE TOKENS
   Applied when <html data-theme="light">
   ═══════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-deep:    #ede9e0;
  --bg:         #f5f3ee;
  --bg-card:    #edeae3;
  --bg-raised:  #e6e2d8;
  --border:     #d4cfc4;
  --border-lit: #b8b2a6;
  --text-1:     #0f1117;
  --text-2:     #3d3f4e;
  --text-3:     #6b6e82;
  --amber:      #b8720e;
  --amber-dim:  rgba(184, 114, 14, 0.1);
  --amber-mid:  rgba(184, 114, 14, 0.2);
  --teal:       #1a9e9e;
  --blue:       #2d5fc4;
  --coral:      #c44a38;
  --green:      #3d7a44;
  --purple:     #6b44c8;
}

/* Smooth transition when switching themes */
[data-theme-transition] *,
[data-theme-transition] *::before,
[data-theme-transition] *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* Light mode specific overrides */
[data-theme="light"] nav {
  background: rgba(245, 243, 238, 0.85);
}
[data-theme="light"] #hero::before {
  background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(184,114,14,0.06) 0%, transparent 70%);
}
[data-theme="light"] .skip-link {
  color: #f5f3ee;
}
[data-theme="light"] .tl-item::before {
  background: var(--bg-deep);
}
[data-theme="light"] .tl-item.current::before {
  background: rgba(26, 158, 158, 0.15);
}
[data-theme="light"] .replay-btn {
  background: rgba(245, 243, 238, 0.85);
}

/* Toggle button */
.theme-toggle {
  background: var(--bg-raised);
  border: 1px solid var(--border-lit);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-1);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.theme-toggle:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.theme-toggle-icon { font-size: 13px; line-height: 1; }

/* SCROLL ANIMATIONS */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }
.reveal-d5 { transition-delay: 0.5s; }

/* HERO PHOTO — morph canvas */
.hero-inner {
  display: flex;
  align-items: center;
  gap: 64px;
}
.hero-photo-wrap {
  width: 360px;
  flex-shrink: 0;
  position: relative;
}
.hero-photo-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}
.morph-label {
  text-align: center;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: opacity 0.4s;
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.replay-btn {
  position: absolute;
  bottom: 36px;
  right: 0;
  background: rgba(8, 9, 12, 0.75);
  border: 1px solid rgba(126, 131, 156, 0.3);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
}
.replay-btn.visible { opacity: 1; pointer-events: auto; }
.replay-btn:hover { border-color: var(--amber); color: var(--amber); }
@media (max-width: 900px) {
  .hero-inner { flex-direction: column-reverse; gap: 40px; }
  .hero-photo-wrap { width: 260px; }
  .hero-content { text-align: center; }
  .hero-meta { justify-content: center; }
}


/* ── CASE STUDY TOGGLE ── */
.case-study-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--amber);
  transition: color 0.2s, gap 0.2s;
}
.case-study-toggle:hover { color: var(--text-1); gap: 12px; }
.case-study-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}
.toggle-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.3s, border-color 0.3s;
}
.case-study-toggle:hover .toggle-arrow { border-color: var(--amber); }
.case-study-toggle[aria-expanded="true"] .toggle-arrow { transform: rotate(180deg); }

/* ── CASE STUDY PANEL ── */
.case-study-panel {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: csReveal 0.4s ease;
}
@keyframes csReveal {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.cs-inner { padding: 40px 36px; max-width: 900px; }
.cs-section { margin-bottom: 40px; }
.cs-section-last { margin-bottom: 0; }
.cs-heading {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 14px;
}
.cs-section p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 12px;
}
.cs-section p:last-child { margin-bottom: 0; }

/* ── CASE STUDY META (role / scope / team) ── */
.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px 32px;
  padding: 20px 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.cs-meta-item {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.cs-meta-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* ── CASE STUDY INLINE FIGURES ── */
.cs-figure {
  margin: 32px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}
.cs-figure img {
  width: 100%;
  display: block;
}
.cs-figure figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  text-align: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* ── CASE STUDY LISTS ── */
.cs-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-list li {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}
.cs-list li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--amber);
}
.cs-list li strong { color: var(--text-1); font-weight: 500; }

/* ── CASE STUDY STATS ROW ── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.cs-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  background: var(--bg-card);
}
.cs-stat-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--amber);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.cs-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-top: 10px;
}

/* ── CASE STUDY PULL QUOTES ── */
.cs-quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.cs-quote {
  border-left: 3px solid var(--amber);
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
}
.cs-quote p {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.45;
  color: var(--text-1);
  font-style: italic;
  margin: 0;
}
.cs-quote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  font-style: normal;
}

/* ── CASE STUDY SUB-STUDY HEADER ── */
.cs-substudy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

/* ── CASE STUDY WORKFLOW STEPS ── */
.cs-workflow { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
ol.cs-workflow { padding-left: 1.5em; }
ol.cs-workflow li { padding-left: 4px; }

/* Diagram figures — cap width on desktop so tall aspect-ratio images don't dominate */
@media (min-width: 769px) {
  .cs-figure-diagram { max-width: 560px; margin-left: auto; margin-right: auto; }
}
.cs-step { display: flex; gap: 16px; align-items: flex-start; }
.cs-step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-dim);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.cs-step-content { flex: 1; }
.cs-step-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}
.cs-step-body { font-size: 13px; color: var(--text-2); line-height: 1.65; }

/* ── CASE STUDY CAROUSEL ── */
.cs-carousel { margin: 32px auto; position: relative; max-width: 75%; }
.cs-carousel-viewport {
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}
.cs-carousel-track { display: flex; width: 100%; transition: transform 0.4s ease; }
.cs-carousel-slide { flex: 0 0 100%; overflow: hidden; }
.cs-carousel-slide img { width: 100%; height: 320px; display: block; object-fit: contain; background: var(--bg-raised); }
.cs-carousel-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  text-align: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 640px) {
  .cs-carousel-caption { font-size: 10px; padding: 10px 12px; }
}
.cs-carousel-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 14px;
}
.cs-carousel-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.cs-carousel-btn:hover { border-color: var(--amber); color: var(--amber); }
.cs-carousel-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.cs-carousel-dots { display: flex; gap: 8px; align-items: center; }
.cs-carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); border: none; padding: 0;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.cs-carousel-dot[aria-selected="true"] { background: var(--amber); transform: scale(1.25); }
.cs-carousel-dot:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.cs-carousel-counter {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--text-3);
}

/* Hide screenshot column from featured card */
.featured-right { display: none; }

/* ── PHONE-FRAME GALLERY (GotNXT case study) ── */
.phone-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 24px;
  margin-top: 24px;
  justify-items: center;
}
.phone {
  width: 200px;
  aspect-ratio: 9 / 19.5;
  padding: 7px;
  background: linear-gradient(145deg, #1a1d24 0%, #0a0c10 100%);
  border: 1px solid #2a2d38;
  border-radius: 34px;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.04) inset,
    0 20px 40px rgba(0,0,0,0.5),
    0 4px 12px rgba(0,0,0,0.4);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  display: block;
}
.phone:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.05) inset,
    0 28px 56px rgba(0,0,0,0.55),
    0 8px 20px rgba(0,0,0,0.45),
    0 0 0 1px var(--coral);
}
.phone:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 6px;
}
@media (max-width: 640px) {
  .phone-gallery { gap: 24px 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .phone { width: 160px; border-radius: 28px; padding: 6px; }
  .phone img { border-radius: 22px; }
}

/* ── CAROUSEL EXPAND BUTTON ── */
.cs-carousel-slide { position: relative; }
.cs-expand-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.2s, color 0.2s, background 0.2s;
  opacity: 0.45;
  pointer-events: auto;
  z-index: 10;
}
.cs-carousel-slide:hover .cs-expand-btn { opacity: 1; }
.cs-expand-btn:hover { border-color: var(--amber); color: var(--amber); background: rgba(0,0,0,0.92); }
.cs-expand-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; opacity: 1; }

/* ── LIGHTBOX ── */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 9, 12, 0.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
  display: none;
}
.cs-lightbox.is-open {
  display: flex;
  animation: lbFadeIn 0.2s ease;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cs-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-lit);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  object-fit: contain;
}
.cs-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  transition: border-color 0.2s, color 0.2s;
}
.cs-lightbox-close:hover { border-color: var(--amber); color: var(--amber); }
.cs-lightbox-close:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ── CASE STUDY BOTTOM CLOSE BUTTON ── */
.cs-close-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 36px;
  padding: 12px 18px;
  background: var(--amber-dim);
  border: 1px solid var(--border-lit);
  border-radius: 999px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.cs-close-bottom:hover {
  background: var(--amber-mid);
  border-color: var(--amber);
  transform: translateY(-1px);
}
.cs-close-bottom:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ══════════════════════════════════════════════════════════
   MOBILE-FIRST AUDIT (2026-04-22)
   Applied in response to mobile-first review. Overrides
   desktop defaults for viewports ≤ 768px and below.
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root { --section-py: 72px; }

  /* Hero — scale photo proportionally to viewport */
  .hero-photo-wrap { width: min(260px, 80vw); }

  /* Section headings */
  .cs-heading { font-size: 18px; }
  .cs-section p { font-size: 15px; line-height: 1.7; }

  /* Case study panel — reclaim horizontal space */
  .cs-inner { padding: 32px 22px; }
  .cs-meta { padding: 16px 0 24px; margin-bottom: 24px; gap: 16px 24px; }

  /* Carousel — let it breathe full width and shorten images */
  .cs-carousel { max-width: 100%; }
  .cs-carousel-slide img { height: 240px; }

  /* Touch targets */
  .cs-carousel-btn { width: 44px; height: 44px; font-size: 18px; }
  .nav-panel-close { width: 40px; height: 40px; font-size: 15px; }
  .cs-carousel-dot {
    width: 10px; height: 10px;
    position: relative;
  }
  /* Invisible 44×44 hit area for dots */
  .cs-carousel-dot::before {
    content: '';
    position: absolute;
    inset: -17px;
  }
}

@media (max-width: 640px) {
  /* Scroll cue overlaps hero on short landscape phones */
  .scroll-cue { display: none; }
}

@media (max-width: 480px) {
  :root { --section-py: 60px; }


  /* Phone gallery — single column feels less cramped */
  .phone-gallery { grid-template-columns: 1fr; justify-items: center; }
  .phone { width: min(220px, 70vw); }
}

/* === Metamorphosis hidden quest: sprite walk + campfire === */

.quest-sprite {
  position: absolute;
  left: -21px;
  top: 0;
  width: 56px;
  height: 56px;
  z-index: 4;
  pointer-events: auto;
  cursor: pointer;
  transition: top 2.2s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.4s ease;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(232, 166, 52, 0.55)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}
.quest-sprite[data-active="true"] { opacity: 1; }
.quest-sprite svg { width: 100%; height: 100%; image-rendering: pixelated; }
.quest-sprite .qs-frame-b { display: none; }
.quest-sprite.is-walking .qs-frame-a { animation: qsFrameA 0.5s steps(1) infinite; }
.quest-sprite.is-walking .qs-frame-b { animation: qsFrameB 0.5s steps(1) infinite; display: block; }
.quest-sprite.is-walking svg { animation: qsBob 0.5s steps(1) infinite; }
@keyframes qsFrameA { 0%, 49% { display: block; } 50%, 100% { display: none; } }
@keyframes qsFrameB { 0%, 49% { display: none; } 50%, 100% { display: block; } }
@keyframes qsBob { 0%, 49% { transform: translateY(0); } 50%, 100% { transform: translateY(-1px); } }

.quest-dialog {
  position: absolute;
  left: 36px;
  top: -8px;
  z-index: 5;
  max-width: 260px;
  padding: 14px 16px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--amber);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(232, 166, 52, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, top 1.1s cubic-bezier(0.45, 0, 0.55, 1);
}
.quest-dialog[data-active="true"] { opacity: 1; transform: translateY(0); }
.quest-dialog::before {
  content: '';
  position: absolute;
  left: -8px; top: 14px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid var(--amber);
}
.quest-dialog-msg {
  margin: 0 0 10px;
  padding-right: 22px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-1);
}
.quest-dialog-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--amber);
  color: var(--bg-deep);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.quest-dialog-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.quest-dialog-close {
  position: absolute;
  top: 4px; right: 6px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.quest-dialog-close:hover { color: var(--text-1); }

/* Campfire panel */
.campfire {
  position: relative;
  margin-top: 80px;
  padding: 48px 40px 40px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-deep));
  border: 1px solid var(--border-lit);
  border-radius: 16px;
  box-shadow: 0 0 0 6px rgba(232, 166, 52, 0.04), 0 24px 48px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.campfire[data-active="true"] { opacity: 1; transform: translateY(0); }
.campfire-glow {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  padding: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 16px rgba(232, 166, 52, 0.5));
}
.campfire-svg { width: 100%; height: 100%; image-rendering: pixelated; animation: campfireFlicker 0.6s steps(2) infinite; }
@keyframes campfireFlicker { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.96); } }

.campfire-tag {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.campfire-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  text-align: center;
  color: var(--text-1);
}
.campfire-sub {
  margin: 0 0 28px;
  text-align: center;
  font-size: 15px;
  color: var(--text-2);
}
.campfire-prompts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.campfire-prompt {
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.campfire-prompt:hover { border-color: var(--amber); transform: translateY(-2px); }
.campfire-prompt[aria-expanded="true"] { border-color: var(--amber); background: var(--amber-dim); }
.campfire-prompt-q {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.campfire-prompt-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.1em;
}
.campfire-answer {
  grid-column: 1 / -1;
  background: var(--bg-deep);
  border: 1px solid var(--amber);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  animation: campfireReveal 0.35s ease;
}
.campfire-answer p { margin: 0 0 10px; }
.campfire-answer p:last-child { margin: 0; }
@keyframes campfireReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.campfire-actions { text-align: center; }
.campfire-done {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.campfire-done:hover {
  color: var(--bg-deep);
  background: var(--teal);
  box-shadow: 0 0 18px rgba(62, 207, 207, 0.3);
}

.quest-replay {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  cursor: pointer;
  background: transparent;
  border: 1px dashed var(--teal);
  border-radius: 999px;
  padding: 4px 10px;
  transition: background 0.2s ease, color 0.2s ease;
}
.quest-replay:hover { background: var(--teal); color: var(--bg-deep); }

@media (max-width: 640px) {
  .campfire { padding: 44px 20px 32px; margin-top: 64px; }
  .campfire-prompts { grid-template-columns: 1fr; }
  .quest-dialog {
    left: 52px;
    max-width: calc(100vw - 110px);
  }
  .quest-sprite { width: 64px; height: 64px; left: -25px; }
}

@media (prefers-reduced-motion: reduce) {
  .quest-sprite, .quest-dialog, .campfire { transition: opacity 0.2s ease; }
  .quest-sprite.is-walking svg .qs-frame { animation: none; }
  .campfire-svg { animation: none; }
}

/* Footer quest invite — alternative entry point */
.quest-footer-invite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
}
.quest-footer-sprite {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(232, 166, 52, 0.55)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
  animation: qsFooterBob 1.6s ease-in-out infinite;
}
.quest-footer-sprite svg { width: 100%; height: 100%; image-rendering: pixelated; }
@keyframes qsFooterBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.quest-footer-dialog {
  position: relative;
  max-width: 280px;
  padding: 14px 18px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--amber);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(232, 166, 52, 0.08);
}
.quest-footer-dialog::before {
  content: '';
  position: absolute;
  left: -8px; top: 22px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid var(--amber);
}
.quest-footer-msg {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-1);
}
.quest-footer-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--amber);
  color: var(--bg-deep);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.quest-footer-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

@media (max-width: 640px) {
  .quest-footer-invite { flex-direction: column; gap: 14px; padding-top: 28px; margin-top: 40px; }
  .quest-footer-dialog::before {
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    border-top: none;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 8px solid var(--amber);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quest-footer-sprite { animation: none; }
}
