/* ─────────────────────────────────────────────────────────────────
   Folio — Editorial / serif-led design system
   Aesthetic: warm off-white, magazine-like, deep ink, terracotta accent
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Type — Newsreader (editorial serif), Instrument Sans (humanist sans),
     JetBrains Mono (data/labels) */
  --font-serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-sans: "Instrument Sans", "Söhne", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Warm paper palette */
  --paper:        oklch(0.972 0.012 80);   /* warm off-white background */
  --paper-2:      oklch(0.945 0.015 80);   /* slightly deeper card bg */
  --paper-3:      oklch(0.915 0.018 80);
  --ink:          oklch(0.20 0.018 60);    /* warm near-black */
  --ink-2:        oklch(0.34 0.015 60);
  --ink-3:        oklch(0.50 0.012 60);
  --ink-4:        oklch(0.66 0.010 60);
  --rule:         oklch(0.86 0.014 70);
  --rule-2:       oklch(0.78 0.014 70);

  /* Accent — terracotta */
  --accent:       oklch(0.62 0.14 40);
  --accent-deep:  oklch(0.52 0.15 38);
  --accent-soft:  oklch(0.92 0.04 50);

  /* Density — overridable from JS */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --container: 1200px;
  --container-narrow: 880px;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  /* Subtle paper grain via repeating gradient */
  --grain: radial-gradient(transparent 0, rgba(0,0,0,0.012) 1px, transparent 1.5px) 0 0/3px 3px;
}

[data-theme="dark"] {
  --paper:        oklch(0.18 0.012 60);
  --paper-2:      oklch(0.22 0.014 60);
  --paper-3:      oklch(0.27 0.014 60);
  --ink:          oklch(0.94 0.010 80);
  --ink-2:        oklch(0.82 0.012 80);
  --ink-3:        oklch(0.66 0.012 70);
  --ink-4:        oklch(0.50 0.012 70);
  --rule:         oklch(0.32 0.014 60);
  --rule-2:       oklch(0.40 0.014 60);
  --accent-soft:  oklch(0.32 0.05 45);
}

[data-density="compact"] {
  --space-5: 18px; --space-6: 24px; --space-7: 36px;
  --space-8: 48px; --space-9: 72px; --space-10: 96px;
}
[data-density="spacious"] {
  --space-5: 28px; --space-6: 40px; --space-7: 56px;
  --space-8: 80px; --space-9: 120px; --space-10: 160px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-image: var(--grain);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Editorial typography */
.serif { font-family: var(--font-serif); font-optical-sizing: auto; }
.sans  { font-family: var(--font-sans); }
.mono  { font-family: var(--font-mono); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  font-optical-sizing: auto;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration: none; }
a.underline { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 0.5px; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

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

/* Small caps editorial label — used everywhere */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.rule { height: 0.5px; background: var(--rule); width: 100%; border: 0; }
.rule-thick { height: 1px; background: var(--ink); width: 100%; border: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1),
              background 180ms ease,
              color 180ms ease,
              box-shadow 180ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px -12px rgba(0,0,0,0.3);
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 0.5px solid var(--rule-2);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}
.btn-accent {
  background: var(--accent);
  color: var(--paper);
}
.btn-accent:hover { background: var(--accent-deep); transform: translateY(-1px); }

.btn .arr {
  display: inline-block;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1);
}
.btn:hover .arr { transform: translateX(3px); }

/* Keep decorative landing layers from covering mobile CTA hit targets. */
.hero-video-wrap,
.hero-video-wrap * {
  pointer-events: none;
}

#root > div > header {
  pointer-events: none;
}

#root > div > header a,
#root > div > header button {
  pointer-events: auto;
}

a[href="#/goal"] {
  scroll-margin-top: 96px;
}

@media (max-width: 760px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  #root > div > header nav {
    display: none !important;
  }

  #root > div > header .container {
    gap: 12px;
  }

  #root > div > header .btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .hero-video-wrap {
    margin-bottom: 32px !important;
  }

  .hero-video-wrap + div {
    display: flex !important;
    flex-direction: column !important;
    gap: 28px !important;
    margin-top: 32px !important;
  }

  .hero-video-wrap + div h1 {
    font-size: 56px !important;
    max-width: 100% !important;
  }

  .hero-video-wrap + div > div:last-child {
    padding-top: 0 !important;
  }

  .hero-video-wrap + div > div:last-child > div {
    flex-wrap: wrap;
  }

  .original-editor-grid {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }

  .original-editor-panel {
    border-left: 0 !important;
    border-top: 0.5px solid var(--rule) !important;
    min-height: 520px;
  }

  .original-editor-preview {
    padding: 16px !important;
  }

  .original-preview-shell {
    padding: 34px 22px !important;
  }
}

/* Cards */
.card {
  background: var(--paper);
  border: 0.5px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color 180ms ease, transform 180ms ease;
}
.card:hover { border-color: var(--rule-2); }
.card-flat {
  border-radius: 0;
  border: 0;
  border-top: 0.5px solid var(--rule);
}

/* Drop cap */
.dropcap::first-letter {
  font-family: var(--font-serif);
  font-size: 4.6em;
  float: left;
  line-height: 0.85;
  margin: 0.08em 0.08em 0 -0.04em;
  font-weight: 400;
  color: var(--accent);
}

/* Scroll behavior */
html { scroll-behavior: smooth; }

/* Page shell */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle entry animation utility */
@keyframes slide-up-fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.entrance { animation: slide-up-fade 600ms cubic-bezier(.2,.8,.2,1) both; }
.entrance.d1 { animation-delay: 60ms; }

@keyframes hero-glow-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1.0;  transform: scale(1.04); }
}
.entrance.d2 { animation-delay: 140ms; }
.entrance.d3 { animation-delay: 220ms; }
.entrance.d4 { animation-delay: 320ms; }
.entrance.d5 { animation-delay: 440ms; }

/* Form controls — editorial, restrained */
.input {
  width: 100%;
  padding: 14px 16px;
  border: 0.5px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.input:focus { border-color: var(--ink); background: var(--paper); }
.input::placeholder { color: var(--ink-4); }

/* Mono badge / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 0.5px solid var(--rule-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper);
}
.chip.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.chip.live::before { background: oklch(0.65 0.16 145); }

/* Section number — oversized editorial marker */
.section-num {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-3);
  font-feature-settings: "lnum";
}

/* Loading pulse */
@keyframes pulse-soft {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.pulse { animation: pulse-soft 1.6s ease-in-out infinite; }

/* Spinning circle for AI loading */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.4s linear infinite; }

/* Marquee for testimonial / partner row */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Scrollbar — subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule-2);
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
