/* ==========================================================================
   Benchwave — site styles
   Apple-style: calm, spacious, content-forward. System font stack, no web fonts.
   Light default + dark via prefers-color-scheme, with a manual [data-theme] override.
   ========================================================================== */

/* ---- Design tokens (light) ---- */
:root {
  --bg: #f5f7f6;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --text: #0e1513;
  --text-muted: #586460;
  --hairline: rgba(0, 0, 0, 0.10);
  --hairline-strong: rgba(0, 0, 0, 0.16);
  --accent: #14b46a;
  --accent-strong: #0e9a59;
  --accent-ink: #04130b;
  --link: #0a7d4f;
  --nav-bg: rgba(245, 247, 246, 0.58);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10), 0 24px 64px rgba(0,0,0,.12);
  --glow: 0 0 0 transparent;

  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --scope-green: #5cf0a0;
  --maxw: 1120px;
  --maxw-narrow: 760px;
  --radius: 16px;
  --radius-lg: 22px;
  --space: clamp(1rem, 2.5vw, 1.5rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);
}

/* ---- Dark tokens: follow system unless user forced light ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f0e;
    --bg-elev: #111614;
    --surface: #141b18;
    --text: #e9f1ec;
    --text-muted: #9aa6a0;
    --hairline: rgba(255, 255, 255, 0.10);
    --hairline-strong: rgba(255, 255, 255, 0.16);
    --accent: #3fe08a;
    --accent-strong: #65ff9b;
    --accent-ink: #04130b;
    --link: #6fe6a8;
    --nav-bg: rgba(11, 15, 14, 0.48);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55), 0 30px 80px rgba(0,0,0,.6);
    --glow: 0 0 40px rgba(63, 224, 138, 0.18);
  }
}
/* ---- Manual override wins regardless of system ---- */
:root[data-theme="dark"] {
  --bg: #0b0f0e; --bg-elev: #111614; --surface: #141b18;
  --text: #e9f1ec; --text-muted: #9aa6a0;
  --hairline: rgba(255,255,255,0.10); --hairline-strong: rgba(255,255,255,0.16);
  --accent: #3fe08a; --accent-strong: #65ff9b; --accent-ink: #04130b; --link: #6fe6a8;
  --nav-bg: rgba(11,15,14,0.66);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55), 0 30px 80px rgba(0,0,0,.6);
  --glow: 0 0 40px rgba(63,224,138,0.18);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 100;
  background: var(--surface); color: var(--text); padding: .6rem 1rem;
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.skip-link:focus { left: .5rem; }

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space); }
.narrow { max-width: var(--maxw-narrow); }
.center { text-align: center; }
.center-cta { justify-content: center; }
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 500;
  color: var(--accent-strong); margin: 0 0 .7rem;
}
.accent-text { color: var(--accent); }
.muted { color: var(--text-muted); }
.section-title { margin-bottom: 1.2rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; line-height: 1;
  padding: .85rem 1.5rem; border-radius: 980px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hairline-strong); }
.btn-ghost:hover { background: var(--bg-elev); transform: translateY(-1px); }
.btn-sm { padding: .55rem 1.05rem; font-size: .95rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn.is-disabled { opacity: .5; pointer-events: none; cursor: default; box-shadow: none; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--hairline);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-size: 1.1rem; }

.primary-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-list { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--text-muted); font-size: .96rem; font-weight: 500; }
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: .9rem; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hairline-strong);
  background: transparent; cursor: pointer; display: inline-grid; place-items: center; padding: 0;
  transition: background-color .2s ease, border-color .2s ease;
}
.theme-toggle:hover { background: var(--bg-elev); }
.theme-toggle-icon { width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-strong), var(--accent)); box-shadow: var(--glow); }

/* CSS-only mobile menu */
.nav-burger { display: none; }
.nav-toggle { position: absolute; }

/* ---- Hero: full-bleed scope graticule ---- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: clamp(540px, 84vh, 860px);
  background: #05080a; color: #eaf3ee;
}
/* the graticule — full bleed, drifts slowly + parallax (transform set by JS) */
.hero-grid {
  position: absolute; inset: -12% -3%; z-index: 0; pointer-events: none;
  background-color: #05080a;
  background-image:
    linear-gradient(rgba(125, 230, 175, .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 230, 175, .085) 1px, transparent 1px),
    linear-gradient(rgba(125, 230, 175, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 230, 175, .04) 1px, transparent 1px);
  background-size: 132px 132px, 132px 132px, 33px 33px, 33px 33px;
  will-change: transform;
  animation: grid-drift 70s linear infinite;
}
@keyframes grid-drift { to { background-position: 132px 132px, 132px 132px, 33px 33px, 33px 33px; } }
/* vignette so the message reads and the right side falls off softly */
.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(115% 95% at 16% 42%, rgba(5,8,10,.62) 0%, rgba(5,8,10,.18) 46%, transparent 76%),
    linear-gradient(to bottom, rgba(5,8,10,.4) 0%, transparent 22%, transparent 64%, rgba(5,8,10,.72) 100%);
}
.hero-content { position: relative; z-index: 2; padding-block: clamp(3rem, 9vh, 6.5rem); }
.hero-kicker { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #84ecb8; margin: 0 0 1.15rem; }
.hero-content h1 { font-size: clamp(2.5rem, 6.4vw, 4.4rem); margin: 0 0 1rem; color: #f4f9f6; letter-spacing: -.025em; line-height: 1.04; }
.hero-lede { color: rgba(214, 226, 220, 0.84); font-size: clamp(1.05rem, 1.9vw, 1.28rem); max-width: 34rem; margin: 0 0 1.8rem; }
.hero-cta { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.hero-cta.center-cta { justify-content: center; }
.hero-spec { font-family: var(--font-mono); font-size: .82rem; color: rgba(190, 212, 200, 0.74); }

/* app window beneath the hero — its drop shadow is baked into the image */
.appwin-section { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.hero-appwin { max-width: 1100px; margin: 0 auto; padding: 0 var(--space); }
.hero-appwin img { width: 100%; height: auto; display: block; }
.app-caption { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); text-align: center; margin: 1rem 0 0; }

/* ---- Screenshots: no extra frame; the Xnip shadow lives in the image ---- */
.frame { position: relative; }
.frame img { width: 100%; height: auto; display: block; }
.frame-lg { max-width: 1100px; margin-inline: auto; }

/* subtle 3D tilt toward the cursor (transform set by JS) */
[data-tilt] { transition: transform .35s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; will-change: transform; }
@media (prefers-reduced-motion: reduce) { [data-tilt] { transition: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero-grid { animation: none; }
}

/* ---- Feature rows ---- */
.features { padding: var(--section-y) 0 0; }
.feature-row {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center; padding: var(--section-y) 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--hairline); }
.feature-row:nth-child(even) .feature-text { order: 2; }
.feature-text h2 { margin-bottom: .6rem; }
.feature-text p { color: var(--text-muted); font-size: 1.08rem; max-width: 46ch; }

/* ---- Roadmap ---- */
.roadmap { padding: var(--section-y) 0; background: var(--bg-elev); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .98rem; }

/* ---- Promise + CTA bands ---- */
.promise { padding: var(--section-y) 0; }
.promise-inner { max-width: 60ch; }
.promise-inner p { color: var(--text-muted); font-size: 1.1rem; }
.cta-band { padding: var(--section-y) 0; text-align: center; border-top: 1px solid var(--hairline); }
.cta-inner h2 { margin-bottom: .3rem; }
.cta-inner > p { color: var(--text-muted); margin-bottom: 1.4rem; }

/* ---- Inner pages ---- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.page-head.tall { padding: clamp(4rem, 12vw, 8rem) 0; }
.page-title { margin: .2rem 0 .6rem; }
.page-lede { color: var(--text-muted); font-size: 1.15rem; }
.page-body { padding: 1rem 0 var(--section-y); }
.page-body h2 { margin-top: 2.2rem; }
.spec-list { padding-left: 1.2rem; }
.spec-list li { margin-bottom: .6rem; color: var(--text-muted); }
.spec-list li strong { color: var(--text); }
.page-foot-link { margin-top: 2.5rem; font-weight: 600; }

.download-card {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-lg); margin: 2rem auto 0; max-width: 620px; text-align: left;
}
.download-card img { width: 96px; height: 96px; border-radius: 20px; }
.download-cta { flex: 1 1 280px; }
.download-cta .muted { font-size: .9rem; margin: .8rem 0 0; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--hairline); background: var(--bg-elev); padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.6fr 1fr; gap: 2rem; align-items: start; }
.footer-brand img { width: 40px; height: 40px; border-radius: 10px; margin-bottom: .8rem; }
.footer-tagline { color: var(--text-muted); font-size: .95rem; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 .8rem; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--text); font-size: .95rem; }
.footer-links a:hover { color: var(--accent); }
.footer-privacy { color: var(--text-muted); font-size: .9rem; align-self: center; }
.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.footer-base p { color: var(--text-muted); font-size: .85rem; margin: 0; }

/* ---- Reveal-on-scroll (progressive enhancement; visible by default) ---- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn:hover { transition: none; transform: none; }
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .feature-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature-row:nth-child(even) .feature-text { order: 0; }
  .feature-media { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-privacy { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .nav-burger {
    display: inline-grid; place-items: center; width: 40px; height: 40px; cursor: pointer;
    border: 1px solid var(--hairline-strong); border-radius: 10px; background: transparent;
  }
  .nav-burger-bars, .nav-burger-bars::before, .nav-burger-bars::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s ease;
  }
  .nav-burger-bars { position: relative; }
  .nav-burger-bars::before { position: absolute; top: -6px; }
  .nav-burger-bars::after { position: absolute; top: 6px; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 1rem;
    background: var(--bg-elev); border-bottom: 1px solid var(--hairline);
    padding: 1.2rem var(--space) 1.6rem; box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  }
  .nav-toggle:checked ~ .primary-nav { opacity: 1; transform: none; pointer-events: auto; }
  .nav-list { flex-direction: column; align-items: stretch; gap: .2rem; }
  .nav-list a { display: block; padding: .6rem 0; font-size: 1.05rem; }
  .nav-actions { justify-content: space-between; padding-top: .6rem; border-top: 1px solid var(--hairline); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}
