/* ─── v2 CASE STUDIES ────────────────────────────────────────────
   The case study pages keep their v1 markup and project.css (so the
   heroes and content stay as they are). This file sits on top and
   maps the v1 design tokens onto the v2 palette, type and shapes,
   for both light and dark themes.
   ─────────────────────────────────────────────────────────────── */

[data-theme="light"] {
  --bg-primary:      #F5F5F2;
  --bg-secondary:    #EEEEEA;
  --bg-tertiary:     #E7E7E2;
  --surface:         #FFFFFF;
  --surface-hover:   #F8F8F5;

  --accent:          #121212;
  --accent-dim:      #3A3A3A;
  --accent-ghost:    rgba(75, 83, 32, 0.08);
  --accent-border:   rgba(75, 83, 32, 0.32);
  --accent-glow:     rgba(75, 83, 32, 0.10);

  --text-primary:    #121212;
  --text-secondary:  #55554F;
  --text-muted:      #6B6B65;
  --text-inverse:    #F5F5F2;

  --border:          rgba(0, 0, 0, 0.08);
  --border-strong:   rgba(0, 0, 0, 0.14);

  --shadow-sm:       0 1px 2px rgba(0,0,0,0.04), 0 6px 16px -10px rgba(0,0,0,0.12);
  --shadow-md:       0 1px 2px rgba(0,0,0,0.04), 0 10px 30px -14px rgba(0,0,0,0.16);
  --shadow-lg:       0 2px 4px rgba(0,0,0,0.05), 0 18px 40px -18px rgba(0,0,0,0.24);
}

[data-theme="dark"] {
  --bg-primary:      #0C0C0D;
  --bg-secondary:    #111113;
  --bg-tertiary:     #18181A;
  --surface:         #161618;
  --surface-hover:   #1C1C1F;

  --accent:          #EDEDEA;
  --accent-dim:      #BDBDB7;
  --accent-ghost:    rgba(140, 154, 85, 0.10);
  --accent-border:   rgba(140, 154, 85, 0.40);
  --accent-glow:     rgba(140, 154, 85, 0.12);

  --text-primary:    #EDEDEA;
  --text-secondary:  #A6A6A0;
  --text-muted:      #8A8A84;
  --text-inverse:    #0C0C0D;

  --border:          rgba(255, 255, 255, 0.08);
  --border-strong:   rgba(255, 255, 255, 0.14);
}

:root {
  --font-display:    'Geist', system-ui, sans-serif;
  --font-body:       'Geist', system-ui, sans-serif;
  --font-mono:       'Geist Mono', ui-monospace, monospace;
  --radius-sm:       4px;
  --radius-md:       6px;
  --radius-lg:       6px;
  --radius-xl:       8px;
}

/* v2 body type: regular weight, no grain overlay */
body { font-weight: 400; }
body::before { display: none; }

/* Headings take the v2 display treatment */
.cs-title,
.cs-section h1,
.cs-section h2,
.cs-section h3 { letter-spacing: -0.035em; font-weight: 600; }
.cs-label,
.cs-section__label { font-size: 11px !important; letter-spacing: 0.1em; }

/* Section labels and the active sidebar link pick up the army green */
.cs-label,
.cs-section__label,
.cs-eyebrow { color: var(--accent-ink) !important; font-family: var(--mono); }
.cs-sidebar__nav a.is-active { color: var(--text-primary); }
.cs-sidebar__nav a.is-active::before { background: var(--accent-ink) !important; }

/* Cards: soft v2 shadows instead of hairline borders */
.cs-content [class*="card"],
.cs-content [class*="__frame"],
.cs-content figure {
  border-color: transparent;
}
.cs-content [class*="card"] { box-shadow: var(--shadow-soft); }

/* Back link and "next project" read as v2 controls */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #121212 !important;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 300ms var(--spring);
}
.cs-back:hover { transform: translateX(-3px); }
.cs-next__link { border-radius: var(--radius-lg) !important; }

/* The v1 page reserved space for the old top bar; v2 uses the dock */
.cs-hero { margin-top: 0 !important; }

/* Mobile "jump to section" button sits above the dock */
@media (max-width: 1024px) {
  .cs-mobile-jump { bottom: 88px !important; }
}

/* Keep the v2 footer clear of the case study's fixed elements */
.footer { position: relative; z-index: 1; }

/* Slide-in animations start off to the side; never let them widen the page */
main#top { overflow-x: clip; }

/* ─── GROVE: phones over a backdrop, in the same spirit as TRU ── */

.cs-hero--phones {
  position: relative;
  min-height: min(78vh, 720px);
  padding: 32px clamp(20px, 4vw, 48px) 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  isolation: isolate;
  background: none;
}
/* Earthy, grainy field that matches Grove's palette */
.cs-hero--phones .cs-hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 15% 0%, #C9D3A8 0%, transparent 60%),
    radial-gradient(80% 60% at 90% 20%, #E7DDC4 0%, transparent 55%),
    radial-gradient(120% 90% at 50% 120%, #2F3A1F 0%, transparent 60%),
    linear-gradient(160deg, #8C9A63 0%, #5A6838 55%, #3B4626 100%);
}
.cs-hero--phones .cs-hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
}
.cs-hero--phones .cs-hero__top { width: min(100%, var(--container)); margin-inline: auto; margin-bottom: 28px; }
.cs-hero--phones .cs-hero__phones {
  flex: 1;
  width: min(100%, var(--container));
  margin-inline: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}
.cs-hero--phones .cs-hero__phone {
  width: min(230px, 22vw);
  aspect-ratio: 375 / 812;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  background: #FFFFFF;
}
.cs-hero--phones .cs-hero__phone--2 { translate: 0 28px; }
.cs-hero--phones .cs-hero__phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* The title and meta that used to sit in Grove's hero now open the page */
.cs-intro-hero {
  padding: clamp(48px, 6vw, 80px) clamp(20px, 4vw, 48px) 0;
}
.cs-intro-hero .cs-hero__title { font-weight: 600; letter-spacing: -0.04em; }

@media (max-width: 900px) {
  .cs-hero--phones .cs-hero__phone--3 { display: none; }
  .cs-hero--phones .cs-hero__phone { width: min(260px, 32vw); }
}
@media (max-width: 640px) {
  .cs-hero--phones { height: 66vh; min-height: 460px; max-height: 700px; }
  .cs-hero--phones .cs-hero__phones { gap: 0; min-height: 0; }
  .cs-hero--phones .cs-hero__phone { height: 100%; max-height: 420px; width: auto; translate: none; }
  .cs-hero--phones .cs-hero__phone--2 { display: none; }
}

/* Chevrons on the back pill and "next project" */
.cs-back .chev { margin: 0 2px 0 -4px; width: 16px; height: 16px; }
.cs-back:hover .chev { transform: translateX(-3px); }
.cs-next__arrow .chev { width: 1em; height: 1em; margin: 0; }
