/* ────────────────────────────────────────────────────────────
   WhitenApp AI — shared design tokens & base styles
   ────────────────────────────────────────────────────────── */

:root {
  /* type */
  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* light, warm */
  --bg: #F4F1EA;
  --bg-elev: #FBF8F1;
  --bg-deep: #ECE7DB;
  --ink: #15130F;
  --ink-2: #2F2B25;
  --ink-3: #57534E;
  --ink-4: #8C857A;
  --ink-5: #B3ACA0;
  --line: #DCD5C5;
  --line-2: #E8E2D2;

  --accent: #FF4B12;      /* brand orange */
  --accent-ink: #B83310;
  --accent-soft: #FFE5DA;
  --teal: #2D5F5A;        /* brand teal */
  --teal-soft: #D4E0DE;

  /* density (tweakable) */
  --pad-section: 140px;
  --pad-x: clamp(20px, 4vw, 80px);
  --gap: 24px;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-lg: 28px;

  /* motion intensity (tweakable) — 0=off, 1=normal, 2=energetic */
  --motion: 1;

  /* scale */
  --t-display: clamp(48px, 7.4vw, 120px);
  --t-h1: clamp(40px, 5vw, 72px);
  --t-h2: clamp(32px, 3.6vw, 56px);
  --t-h3: clamp(22px, 2vw, 30px);
  --t-body: 17px;
  --t-small: 13px;
  --t-mono: 12px;
}

[data-theme="dark"] {
  --bg: #0E0D0A;
  --bg-elev: #15130F;
  --bg-deep: #08070A;
  --ink: #F4F1EA;
  --ink-2: #DCD5C5;
  --ink-3: #B3ACA0;
  --ink-4: #8C857A;
  --ink-5: #57534E;
  --line: #2A2620;
  --line-2: #1F1C18;
  --accent: #FF6A38;
  --accent-ink: #FFB089;
  --accent-soft: #2A1810;
  --teal: #6FA59E;
  --teal-soft: #1A2826;
}

/* palette: slate */
[data-palette="slate"] {
  --bg: #EEF0F2;
  --bg-elev: #F7F8FA;
  --bg-deep: #E2E5E9;
  --ink: #0D1117;
  --ink-2: #1F2937;
  --ink-3: #4B5563;
  --ink-4: #6B7280;
  --line: #D1D5DB;
  --line-2: #DDE1E6;
  --accent: #FF4B12;
  --teal: #1F4F7A;
}
[data-theme="dark"][data-palette="slate"] {
  --bg: #0A0D11;
  --bg-elev: #12161D;
  --bg-deep: #060709;
  --ink: #E5E9EE;
  --ink-2: #C5CAD1;
  --ink-3: #8A8F96;
  --line: #1F242B;
  --teal: #7FB6DD;
}

/* palette: forest (teal-primary) */
[data-palette="forest"] {
  --accent: #2D5F5A;
  --accent-ink: #1A3A36;
  --accent-soft: #D4E0DE;
  --teal: #FF4B12;
  --teal-soft: #FFE5DA;
}

/* palette: mono */
[data-palette="mono"] {
  --accent: #15130F;
  --accent-ink: #15130F;
  --accent-soft: #ECE7DB;
  --teal: #57534E;
}
[data-theme="dark"][data-palette="mono"] {
  --accent: #F4F1EA;
  --accent-ink: #F4F1EA;
  --accent-soft: #2A2620;
}

/* density */
[data-density="compact"] {
  --pad-section: 88px;
  --gap: 18px;
  --t-display: clamp(44px, 7vw, 104px);
  --t-h1: clamp(34px, 4.4vw, 58px);
  --t-h2: clamp(26px, 3vw, 44px);
}
[data-density="comfy"] {
  --pad-section: 180px;
  --gap: 32px;
  --t-display: clamp(64px, 9vw, 160px);
}

[data-motion="0"] *, [data-motion="0"] *::before, [data-motion="0"] *::after {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}
[data-motion="2"] { --motion-mult: 1.4; }

/* ─── base ─── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ─── type utility ─── */
.serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: -0.01em; }
.serif-i { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--f-mono); font-feature-settings: "ss01"; }
.kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.display {
  font-size: var(--t-display);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 600;
  font-family: var(--f-sans);
}
.h1 {
  font-size: var(--t-h1);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.h2 {
  font-size: var(--t-h2);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.h3 {
  font-size: var(--t-h3);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
}

/* ─── layout primitives ─── */
.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.section { padding: var(--pad-section) 0; position: relative; }
.section-tight { padding: calc(var(--pad-section) * 0.5) 0; }

.rule { height: 1px; background: var(--line); width: 100%; border: 0; margin: 0; }

/* ─── nav ─── */
.nav-host {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad-x);
  max-width: 1440px; margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; letter-spacing: -0.02em;
}
.nav-brand .mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal);
  display: grid; place-items: center;
  color: var(--bg-elev); font-family: var(--f-serif); font-size: 20px; font-style: italic;
  font-weight: 400; line-height: 1; padding-bottom: 4px;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--teal) 40%, transparent);
}
.nav-brand .wm { color: var(--accent); }
.nav-links {
  display: flex; gap: 4px; align-items: center;
  font-size: 14px; font-weight: 500;
}
.nav-links a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-links a:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink); }
.nav-links a.active { color: var(--ink); background: color-mix(in oklab, var(--ink) 8%, transparent); }
.nav-cta {
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .2s, background .2s;
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); background: var(--accent); color: #fff; }
.nav-cta .arr { transition: transform .2s; }
.nav-cta:hover .arr { transform: translateX(2px); }

/* announcement bar */
.ann {
  background: var(--ink); color: var(--bg);
  text-align: center; font-size: 12.5px; letter-spacing: 0.01em;
  padding: 8px 16px;
  font-family: var(--f-mono);
}
.ann .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80; margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 3px color-mix(in oklab, #4ADE80 30%, transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, #4ADE80 30%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, #4ADE80 0%, transparent); }
}

/* ─── buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink);
  cursor: pointer; transition: transform .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }

/* ─── cards ─── */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-2px); border-color: var(--ink-4); }

/* ─── footer ─── */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 100px var(--pad-x) 40px;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .footer { background: var(--bg-deep); border-top: 1px solid var(--line); }
.footer .ft-wm {
  font-size: clamp(60px, 13vw, 280px);
  font-weight: 700; line-height: .85; letter-spacing: -0.05em;
  margin: 80px 0 -10px;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  width: max-content;
}

/* ─── tags / chips ─── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--f-mono);
}
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ─── arrows / icons ─── */
.ico-arr {
  display: inline-block; width: 14px; height: 14px;
}

/* ─── reveal animation (scroll storytelling) ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2,.6,.2,1), transform .9s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--rd, 0s);
}
.reveal.in { opacity: 1; transform: none; }
[data-motion="0"] .reveal { opacity: 1; transform: none; transition: none; }

/* ─── marquee ─── */
.marquee {
  display: flex; gap: 56px;
  animation: scroll-x 40s linear infinite;
  width: max-content;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── grain (subtle) ─── */
.grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply; opacity: .5;
}

/* page transition (cross-document via View Transitions where available) */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: fade-out .25s ease both;
}
::view-transition-new(root) {
  animation: fade-in .35s ease both;
}
@keyframes fade-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }
