/* ============================================================================
   GitGrove — landing page
   Calm, cinematic, brand-coherent. Dark default, two themes, the green→blue→
   indigo gradient used as a signature accent (never wallpaper). See CLAUDE.md:
   "the full power of git, a silly-simple UI."
   ========================================================================== */

/* ---- Fonts (self-hosted, latin subset, font-display: swap) ---------------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/inter-800.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/jbmono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/jbmono-500.woff2') format('woff2'); }

/* ---- Tokens --------------------------------------------------------------- */
:root {
  /* Brand gradient — the signature. */
  --grad: linear-gradient(120deg, #34d399 0%, #2f8ef6 52%, #4f5bff 100%);
  --grad-soft: linear-gradient(120deg, #34d39933 0%, #2f8ef633 52%, #4f5bff33 100%);
  --green: #34d399;
  --blue: #2f8ef6;
  --indigo: #4f5bff;
  --accent: #5b8cff;
  --accent-glow: rgba(91, 140, 255, 0.16);

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1180px;
  --radius: 18px;
  --radius-lg: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* Dark (default) — matches the app. */
:root, [data-theme='dark'] {
  --bg: #0c0d10;
  --bg-grad-1: rgba(52, 211, 153, 0.10);
  --bg-grad-2: rgba(79, 91, 255, 0.12);
  --panel: #121319;
  --panel-2: #181a22;
  --panel-3: #1f2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e9edf4;
  --muted: #aeb7c6;
  --faint: #6b7689;
  --shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  --window-bar: #1b1e27;
  --grain-opacity: 0.035;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #ffffff;
  --bg-grad-1: rgba(52, 211, 153, 0.10);
  --bg-grad-2: rgba(79, 91, 255, 0.10);
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --panel-3: #eef1f6;
  --border: rgba(12, 18, 32, 0.10);
  --border-strong: rgba(12, 18, 32, 0.16);
  --text: #0d1320;
  --muted: #56627a;
  --faint: #8a94a6;
  --shadow: 0 40px 80px -34px rgba(20, 40, 90, 0.30);
  --window-bar: #eef1f6;
  --grain-opacity: 0.02;
  color-scheme: light;
}

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Grain overlay — barely-there texture for depth, not noise. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Layout helpers ------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
section { position: relative; z-index: 2; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin: 14px 0 16px; }
.section-head p { color: var(--muted); font-size: 18px; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  color: #08131f;
  background: var(--grad);
  box-shadow: 0 10px 30px -10px rgba(47, 142, 246, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -10px rgba(47, 142, 246, 0.7); }
.btn-ghost {
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--panel-3); }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }

/* ============================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 4px 10px rgba(47, 142, 246, 0.35)); }
.nav-links { display: flex; gap: 30px; margin-left: 18px; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* theme toggle */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--panel-2);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--panel-3); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme='dark'] .theme-toggle .moon { display: block; }
[data-theme='dark'] .theme-toggle .sun { display: none; }

.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-2); }
.nav-toggle svg { width: 20px; height: 20px; margin: auto; }

/* ============================================================================
   HERO
   ========================================================================== */
.hero { position: relative; padding: 92px 0 64px; overflow: hidden; }
/* ambient gradient glow */
.hero-glow {
  position: absolute; z-index: 0; pointer-events: none;
  top: -180px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 760px;
  background:
    radial-gradient(closest-side, var(--bg-grad-1), transparent 70%) -260px 40px / 760px 620px no-repeat,
    radial-gradient(closest-side, var(--bg-grad-2), transparent 70%) 320px -40px / 820px 680px no-repeat;
  filter: blur(28px);
  opacity: 0.9;
}
/* the "grove" git-graph motif, drawn behind the hero */
.hero-grove { position: absolute; z-index: 0; inset: 0; pointer-events: none; opacity: 0.5; }
.hero-grove svg { position: absolute; width: 100%; height: 100%; }
.hero-grove path, .hero-grove line { stroke: url(#groveGrad); fill: none; }
.grove-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hero-grove circle { fill: var(--bg); stroke: url(#groveGrad); }

.hero .wrap { position: relative; z-index: 2; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); margin-bottom: 26px;
}
.hero-badge b { color: var(--text); font-weight: 600; }
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }

.hero h1 { font-size: clamp(44px, 7.2vw, 88px); letter-spacing: -0.035em; }
.hero .tagline {
  font-family: var(--font-mono); font-weight: 500; font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted);
  margin: 22px 0 16px;
}
.hero .sub { font-size: clamp(18px, 2.4vw, 23px); color: var(--muted); max-width: 600px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; align-items: center; }
.hero-cta .req { font-size: 13px; color: var(--faint); margin-left: 4px; }
.hero-cta .req code { font-family: var(--font-mono); color: var(--muted); }

/* hero app window with live loop */
.hero-stage { position: relative; z-index: 2; margin-top: 64px; }
.app-window {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-window::after { /* gradient edge glow */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px; background: var(--grad); opacity: 0.5;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; background: var(--window-bar); border-bottom: 1px solid var(--border);
}
.window-bar .lights { display: flex; gap: 7px; }
.window-bar .lights span { width: 12px; height: 12px; border-radius: 50%; }
.window-bar .lights span:nth-child(1) { background: #ff5f57; }
.window-bar .lights span:nth-child(2) { background: #febc2e; }
.window-bar .lights span:nth-child(3) { background: #28c840; }
.window-bar .title { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin: 0 auto; }
.app-window video, .app-window img { width: 100%; display: block; }

/* play full demo button overlaid on hero loop */
.watch-demo {
  position: absolute; bottom: 18px; right: 18px; z-index: 3;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}
.watch-demo:hover { transform: scale(1.04); }
.watch-demo .play { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; }
.watch-demo .play svg { width: 10px; height: 10px; fill: #08131f; }

/* ---- Trust strip ---------------------------------------------------------- */
.trust { border-block: 1px solid var(--border); padding: 26px 0; }
.trust .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 30px; }
.trust span { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); font-weight: 500; }
.trust span svg { width: 16px; height: 16px; color: var(--green); }
.trust .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); opacity: 0.5; }

/* ============================================================================
   FEATURES
   ========================================================================== */
.features { padding: 110px 0 40px; }
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
  padding: 56px 0;
}
.feature:nth-child(even) .feature-text { order: 2; }
.feature-text .eyebrow { display: block; margin-bottom: 14px; }
.feature-text h3 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 16px; }
.feature-text p { color: var(--muted); font-size: 17.5px; }
.feature-text .kicker { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 12px; padding: 5px 11px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}

.feature-media { position: relative; }
.feature-media .app-window { transform-style: preserve-3d; cursor: zoom-in; }
/* expand affordance — mirrors the hero "watch demo" pill */
.feature-media .app-window > .zoom-badge {
  position: absolute; z-index: 4; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); color: var(--text);
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
}
.feature-media .app-window > .zoom-badge svg { width: 18px; height: 18px; }
.feature-media .app-window:hover > .zoom-badge,
.feature-media .app-window:focus-visible > .zoom-badge { opacity: 1; transform: none; }
.feature-media figcaption { margin-top: 12px; font-size: 13px; color: var(--faint); font-family: var(--font-mono); }
/* soft glow behind each media */
.feature-media::before {
  content: ''; position: absolute; inset: -8% -6%; z-index: -1;
  background: var(--grad-soft); filter: blur(60px); opacity: 0.55; border-radius: 50%;
}

/* ============================================================================
   TWO THEMES — drag-to-compare
   ========================================================================== */
.themes { padding: 100px 0; }
.themes .section-head { margin-inline: auto; text-align: center; }
.compare {
  position: relative; max-width: 1000px; margin: 0 auto;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  user-select: none; touch-action: pan-y;
}
.compare img { display: block; width: 100%; pointer-events: none; }
.compare .after { position: absolute; inset: 0; overflow: hidden; width: 50%; }
.compare .after img { width: var(--cmp-w, 1000px); max-width: none; height: 100%; object-fit: cover; object-position: left; }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: var(--grad); transform: translateX(-50%); z-index: 3;
}
.compare .handle::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: var(--grad);
  box-shadow: 0 6px 20px -4px rgba(0,0,0,0.5);
}
.compare .handle::after {
  content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #08131f; font-size: 18px; font-weight: 700; z-index: 1;
}
.compare .tag {
  position: absolute; top: 16px; z-index: 4;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 7px; backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--border-strong); color: var(--text);
}
.compare .tag-dark { left: 16px; }
.compare .tag-light { right: 16px; }

/* ============================================================================
   DOWNLOAD
   ========================================================================== */
.download { padding: 100px 0; }
.download .section-head { margin-inline: auto; text-align: center; }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; }
.dl-card {
  position: relative; padding: 30px 26px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  transition: transform 0.22s var(--ease), border-color 0.22s, background 0.22s;
}
.dl-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.dl-card.detected { border-color: transparent; background:
  linear-gradient(var(--panel), var(--panel)) padding-box,
  var(--grad) border-box; }
.dl-card.detected::after {
  content: 'Your OS'; position: absolute; top: -10px; right: 18px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px; color: #08131f; background: var(--grad);
}
.dl-card .os-icon { width: 36px; height: 36px; color: var(--text); margin-bottom: 16px; }
.dl-card h4 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.dl-card .variants { font-size: 13px; color: var(--faint); font-family: var(--font-mono); margin-bottom: 20px; }
.dl-card .btn { width: 100%; justify-content: center; }
.dl-card .dl-alt {
  display: block; text-align: center; margin-top: 12px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  transition: color 0.2s;
}
.dl-card .dl-alt:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.dl-version {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent);
  letter-spacing: 0; margin-left: 4px;
}
.dl-note { text-align: center; margin-top: 28px; font-size: 14px; color: var(--muted); }
.dl-note code { font-family: var(--font-mono); color: var(--text); background: var(--panel-2); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); }
.dl-note a { color: var(--accent); font-weight: 600; }

/* ============================================================================
   FOOTER
   ========================================================================== */
.footer { border-top: 1px solid var(--border); padding: 56px 0 44px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
.footer .brand { margin-bottom: 14px; }
.footer .f-left p { color: var(--muted); font-size: 14px; max-width: 320px; }
.footer .f-links { display: flex; gap: 60px; }
.footer .f-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); font-family: var(--font-mono); margin-bottom: 14px; font-weight: 500; }
.footer .f-col a { display: block; color: var(--muted); font-size: 14.5px; margin-bottom: 9px; transition: color 0.2s; }
.footer .f-col a:hover { color: var(--text); }
.footer .copyright {
  border-top: 1px solid var(--border); margin-top: 40px; padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; align-items: center;
  color: var(--faint); font-size: 13px;
}
.footer .copyright .self-update { display: inline-flex; align-items: center; gap: 7px; }
.footer .copyright .self-update svg { width: 14px; height: 14px; color: var(--green); }

/* ============================================================================
   LIGHTBOX (full demo with sound)
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 24px;
  background: rgba(4, 6, 10, 0.82); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-inner { width: min(1100px, 96vw); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 50px 120px -20px #000; transform: scale(0.96); transition: transform 0.3s var(--ease); }
.lightbox.open .lightbox-inner { transform: scale(1); }
.lightbox video { width: 100%; display: block; background: #000; }
.lightbox-inner--img { width: min(1500px, 95vw); border: 1px solid var(--border-strong); }
.lightbox-inner--img img { width: 100%; display: block; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  display: grid; place-items: center; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ============================================================================
   SCROLL REVEAL
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .grove-draw { stroke-dashoffset: 0 !important; }
  .app-window video { display: none; }
}

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 860px) {
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: block; }
  .nav.menu-open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px 24px; gap: 18px; margin: 0;
  }
  .feature { grid-template-columns: 1fr; gap: 32px; padding: 44px 0; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .feature-media { order: -1; }
  .dl-grid { grid-template-columns: 1fr; max-width: 420px; }
  .hero { padding: 56px 0 40px; }
  .hero-stage { margin-top: 44px; }
  .footer .f-links { gap: 36px; }
}
@media (max-width: 460px) {
  .wrap { padding-inline: 18px; }
  .footer .f-links { flex-direction: column; gap: 24px; }
}
