/* ================================================================
   towardist.com — site styles
   Editorial layout mirroring the clawventures-site precedent,
   reskinned to Towardist's indigo palette (constants/Colors.ts).
   Full light/dark theme via prefers-color-scheme.
   ================================================================ */

:root {
  color-scheme: light;
  --bg: #fafafa;              /* = canvas (light) */
  --bg-soft: #f1f0fb;         /* faint indigo-tinted wash */
  --card: #ffffff;            /* = surface (light) */
  --card-alt: #1e1b4b;        /* accent band — reuses ink as a dark card bg */
  --ink: #1e1b4b;             /* = text (indigo-950) */
  --muted: #6b7280;           /* = textSecondary (gray-500) */
  --faint: #94a3b8;           /* slate-400 */
  --line: #e5e7eb;            /* = border (gray-200) */
  --accent: #4f46e5;          /* = primary (indigo-600) */
  --accent-deep: #4338ca;     /* indigo-700 */
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-border: rgba(79, 70, 229, 0.25);
  --highlight: #00c4f0;       /* brand-cyan (logo gradient end stop) */

  --cream-on-dark: #e0e7ff;   /* text on the accent band */
  --muted-on-dark: #a5b4fc;

  --serif: "Fraunces", Georgia, "Iowan Old Style", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0d1a;             /* = canvas-dark */
    --bg-soft: #15132242;
    --card: #1e1b2e;           /* = surface-dark */
    --card-alt: #16132a;
    --ink: #e0e7ff;            /* = text-dark (indigo-100) */
    --muted: #9ca3af;          /* = textSecondary-dark (gray-400) */
    --faint: #64748b;
    --line: #374151;           /* = border-dark (gray-700) */
    --accent: #818cf8;         /* lighter indigo for AA contrast on dark bg */
    --accent-deep: #a5b4fc;
    --accent-soft: rgba(99, 102, 241, 0.16);
    --accent-border: rgba(99, 102, 241, 0.35);
    --highlight: #0ff078;      /* brand-green (logo gradient start stop) */
    --cream-on-dark: #e0e7ff;
    --muted-on-dark: #9ca3af;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 42rem at 85% -10%, rgba(0, 196, 240, 0.08), transparent 60%),
    radial-gradient(36rem 36rem at -10% 30%, rgba(79, 70, 229, 0.08), transparent 60%),
    var(--bg);
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

h1, h2, h3, .brand { font-family: var(--serif); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; column-gap: 1rem; row-gap: 0.125rem;
  min-height: 4.25rem; padding: 0.625rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.01em; color: var(--ink);
  white-space: nowrap; flex: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .mark { width: 1.5rem; height: 1.5rem; flex: none; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2rem; }
.nav-links a {
  position: relative; color: var(--muted); font-size: 0.9375rem; font-weight: 500;
  padding: 0.25rem 0; white-space: nowrap;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 36rem) {
  .wrap { padding: 0 1rem; }
  .btn.ghost { margin-left: 0; margin-top: 0.75rem; }
  nav { min-height: 3.5rem; padding: 0.5rem 0; }
  .brand { font-size: 1rem; gap: 0.4rem; }
  .brand .mark { width: 1.125rem; height: 1.125rem; }
  .nav-links { gap: 0.875rem; }
  .nav-links a { font-size: 0.84375rem; }
}
@media (max-width: 22.5rem) {
  .brand { font-size: 0.9375rem; }
  .nav-links { gap: 0.625rem; }
  .nav-links a { font-size: 0.8125rem; }
}

/* ---------- Hero ---------- */
.hero { padding: 7rem 0 4rem; text-align: left; position: relative; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.75rem;
}
.hero .kicker::before {
  content: ""; width: 2.25rem; height: 2px; background: var(--accent); display: inline-block;
}
.hero h1 {
  font-size: clamp(2.5rem, 7.5vw, 4.75rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.06;
  margin-bottom: 1.75rem; max-width: 44rem;
}
.hero h1 em {
  font-style: italic; font-weight: 500; color: var(--accent);
}
.hero p.sub {
  font-size: clamp(1.0625rem, 2.4vw, 1.3125rem);
  color: var(--muted); max-width: 38rem; margin-bottom: 2.25rem;
}
.btn {
  display: inline-block; font-weight: 600; font-size: 1rem;
  background: var(--ink); color: var(--bg);
  padding: 0.875rem 1.75rem; border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  background: var(--accent); color: #fff;
  transform: translateY(-2px); box-shadow: 0 10px 24px var(--accent-soft);
  text-decoration: none;
}
.btn.ghost {
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
  margin-left: 0.75rem;
}
.btn.ghost:hover { background: var(--ink); color: var(--bg); box-shadow: none; }
.cta-fallback { margin-top: 1rem; font-size: 0.9375rem; color: var(--muted); }
.cta-fallback a { font-weight: 600; }

/* ---------- Sections ---------- */
section { padding: 5rem 0; position: relative; }
section + section { border-top: 1px solid var(--line); }
.eyebrow {
  display: flex; align-items: baseline; gap: 0.875rem;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.eyebrow .num {
  font-family: var(--serif); font-size: 2.75rem; font-weight: 300; font-style: italic;
  color: var(--line); letter-spacing: 0; line-height: 1;
}
h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 600; letter-spacing: -0.015em; margin-bottom: 1.5rem; max-width: 40rem; }
.lead { color: var(--muted); max-width: 44rem; font-size: 1.0625rem; }
.lead + .lead { margin-top: 1rem; }

/* ---------- Accent band (features) ---------- */
.band {
  background: var(--card-alt); color: var(--cream-on-dark);
  border-top: 1px solid var(--accent-border) !important;
}
.band .eyebrow { color: var(--highlight); }
.band .eyebrow .num { color: rgba(224, 231, 255, 0.18); }
.band h2 { color: var(--cream-on-dark); }
.band .lead { color: var(--muted-on-dark); }

/* ---------- Feature cards ---------- */
.feature-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.375rem; margin-top: 2.5rem; }
.feature-list li {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--accent-border);
  border-radius: 1rem; padding: 1.625rem;
  transition: transform 0.28s ease, border-color 0.28s ease;
}
.feature-list li:hover { transform: translateY(-4px); border-color: var(--highlight); }
.feature-list strong {
  font-family: var(--serif); display: block; font-size: 1.1875rem; font-weight: 600;
  margin-bottom: 0.5rem; color: var(--cream-on-dark);
}
.feature-list span { color: var(--muted-on-dark); font-size: 0.9375rem; }

/* ---------- Who it's for ---------- */
.examples { list-style: none; margin-top: 1.75rem; display: grid; gap: 0.875rem; }
.examples li {
  padding: 1rem 1.25rem; border-radius: 0.875rem;
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  font-family: var(--serif); font-style: italic; color: var(--ink);
}

/* ---------- Contact / footer ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.75rem; margin-top: 2rem; max-width: 40rem; }
.contact-grid h3 {
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem;
}
.contact-grid p, address { font-style: normal; color: var(--ink); line-height: 1.7; }
.contact-grid a { font-weight: 600; }

footer { background: var(--card-alt); color: var(--muted-on-dark); padding: 3rem 0 2.25rem; }
footer .foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1.5rem 3rem; }
footer .wordmark {
  font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 600;
  color: var(--cream-on-dark); letter-spacing: -0.015em; line-height: 1.1;
}
footer .wordmark em { font-style: italic; color: var(--highlight); font-weight: 400; }
footer p { font-size: 0.875rem; margin-top: 0.5rem; }
footer .foot-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
footer a { color: var(--muted-on-dark); }
footer a:hover { color: var(--cream-on-dark); }
footer .ver {
  margin-top: 1.75rem; font-size: 0.75rem; color: var(--muted-on-dark);
  opacity: 0.55; letter-spacing: 0.04em;
}

/* ---------- Legal pages ---------- */
.legal main { padding: 3rem 0 4rem; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.5rem; }
.legal .effective { color: var(--muted); font-size: 0.9375rem; margin-bottom: 2.5rem; }
.legal h2 {
  font-size: 1.375rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 0.875rem; max-width: none;
}
.legal p, .legal li { color: var(--muted); max-width: 46rem; margin-bottom: 0.875rem; }
.legal ul, .legal ol { margin: 0 0 1rem 1.25rem; max-width: 46rem; }
.legal table { border-collapse: collapse; margin: 1.25rem 0; max-width: 46rem; width: 100%; }
.legal th, .legal td { border: 1px solid var(--line); padding: 0.625rem 0.875rem; text-align: left; font-size: 0.9375rem; color: var(--muted); }
.legal th { color: var(--ink); font-weight: 600; }
.legal strong { color: var(--ink); }
.legal .back-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 1.5rem; font-size: 0.9375rem; font-weight: 500; color: var(--muted); }
.legal .back-link:hover { color: var(--accent); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { 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) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .feature-list li, .examples li, .btn { transition: none; }
}
