/* swe4vibe landing — design system (warm editorial minimalism)
 *
 * The :root token block below is the SINGLE SOURCE OF TRUTH for the rebrand
 * surface (color, type, space, radii, shadow, texture). Every archetype reads
 * from it via var(--…); no hex or size is re-decided per section. To rebrand,
 * edit tokens here only. Spec: saas-landing-page skill / design-system.md.
 */

/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* Color: light field (warm bone — never #fff) */
  --bg:            #f1efe9;
  --bg-2:          #e9e7df;
  --ink:           #1a1814;
  --ink-muted:     #6b665d;
  --hairline:      rgba(26, 24, 20, 0.10);

  /* Color: dark surfaces (cards, nav, CTA band) */
  --surface:       #161412;
  --surface-top:   #211e1a;
  --on-surface:    #f5f3ee;
  --on-surface-muted: #9b958a;
  --ring:          rgba(245, 243, 238, 0.14);

  /* One restrained accent — warm terracotta (the "floor / poured ground") */
  --accent:        #c8643c;

  /* Texture — faint dotted grid ("not flat" tell) */
  --dot:           rgba(26, 24, 20, 0.06);
  --dot-size:      22px;

  /* Type */
  --font-display:  "Instrument Serif", "Tiempos Headline", Georgia, serif;
  --font-sans:     "Inter", system-ui, -apple-system, sans-serif;
  --tracking-tag:  0.14em;

  /* Type scale (fluid) */
  --t-hero:   clamp(2rem, 7vw, 5.5rem);
  --t-h2:     clamp(2rem, 4vw, 3rem);
  --t-h3:     clamp(1.35rem, 2vw, 1.75rem);
  --t-lead:   clamp(1.05rem, 1.6vw, 1.25rem);
  --t-body:   1rem;
  --t-small:  0.8125rem;

  /* Space scale */
  --s-1: 0.5rem;  --s-2: 0.75rem; --s-3: 1rem;   --s-4: 1.5rem;
  --s-5: 2rem;    --s-6: 3rem;    --s-7: 4.5rem; --s-8: 7rem;

  /* Radii */
  --r-card: 22px;  --r-btn: 12px;  --r-pill: 999px;

  /* Shadow — soft, large-radius, low-opacity (cards float) */
  --shadow-card: 0 24px 48px -24px rgba(26, 24, 20, 0.45),
                 0 2px 6px rgba(26, 24, 20, 0.08);
  /* Lifted elevation on hover — deeper, wider (the "picked up" state) */
  --elev-hover:  0 40px 80px -32px rgba(26, 24, 20, 0.55),
                 0 6px 16px rgba(26, 24, 20, 0.10);

  /* Motion — one vocabulary of durations + easings, referenced everywhere.
   * [LAW:one-source-of-truth] timing values live here only; js/motion.js is the
   * single authority that decides WHEN (viewport entry, rAF), never a magic ms
   * scattered in a rule or a setTimeout. */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-fast: 160ms;
  --motion-base: 300ms;
  --motion-slow: 640ms;
  --reveal-shift: 20px;
  --stagger:     70ms;

  /* Depth — ambient warm/cool glow field behind the whole page + accent glow */
  --glow-warm:   rgba(200, 100, 60, 0.11);
  --glow-cool:   rgba(120, 142, 172, 0.10);
  --glow-accent: rgba(200, 100, 60, 0.30);

  /* Seam-field hero (canvas, drawn by js/motion.js) reads these so the
   * generative art stays inside the token system. */
  --seam-node:   rgba(26, 24, 20, 0.72);
  --seam-line:   rgba(26, 24, 20, 0.30);
  --seam-live:   rgba(200, 100, 60, 0.90);

  /* Content measure */
  --measure: 62ch;
}

/* ── FOUNDATIONS ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: var(--dot-size) var(--dot-size);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Ambient depth field — large, soft warm/cool glows fixed behind all content,
 * over the dot grid, under the page. The "this isn't a flat template" tell.
 * Drifts slowly; drift is disabled under reduced-motion (see the block below). */
body::before {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 12% 6%,  var(--glow-warm), transparent 62%),
    radial-gradient(34vmax 30vmax at 92% 18%, var(--glow-cool), transparent 62%),
    radial-gradient(40vmax 34vmax at 50% 108%, var(--glow-warm), transparent 60%);
  animation: aurora-drift 34s var(--ease-out) infinite alternate;
}
@keyframes aurora-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.08); }
}

/* ── SCROLL REVEAL ───────────────────────────────────────────────────────────
 * js/motion.js (the single timing authority) adds .in when an element enters the
 * viewport; CSS owns the transition. Elements hide first ONLY when JS is present
 * (html.js) AND motion is allowed — so no-JS and reduced-motion always render the
 * content fully visible. [LAW:no-silent-failure] the show-off never eats content. */
html.js [data-reveal] {
  opacity: 0; transform: translateY(var(--reveal-shift));
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
  will-change: opacity, transform;
}
html.js [data-reveal].in { opacity: 1; transform: none; }

/* Grid children cascade by column (one attribute on the grid, three phases). */
html.js .grid[data-reveal] > .defect {
  opacity: 0; transform: translateY(var(--reveal-shift));
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
  will-change: opacity, transform;
}
html.js .grid[data-reveal].in > .defect { opacity: 1; transform: none; }
html.js .grid[data-reveal].in > .defect:nth-child(3n+1) { transition-delay: 0ms; }
html.js .grid[data-reveal].in > .defect:nth-child(3n+2) { transition-delay: 90ms; }
html.js .grid[data-reveal].in > .defect:nth-child(3n)   { transition-delay: 180ms; }

/* Honest degrade: motion off → everything visible, nothing animates, no drift. */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  html.js [data-reveal],
  html.js .grid[data-reveal] > .defect {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.wrap { max-width: 1140px; margin-inline: auto; padding-inline: var(--s-4); }
.serif { font-family: var(--font-display); font-weight: 400; line-height: 1.05; }

/* Screen-reader-only: kept in the a11y tree, removed from the visual layout. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Honeypot wrapper (swe4vibe-funnel-28i.8): off-screen, not display:none, so
   naive bots still fill it while no human ever sees or tabs to it. aria-hidden
   on the markup keeps it out of the accessibility tree. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--ink-muted); }
.accent { color: var(--accent); }
section { padding-block: var(--s-8); }

/* Uppercase letter-spaced eyebrow above section headings */
.eyebrow {
  display: inline-block;
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: var(--tracking-tag);
  color: var(--ink-muted);
  margin-bottom: var(--s-3);
}

/* ── NAV (floating pill) ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: var(--s-4); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  color: var(--on-surface);
  border: 1px solid var(--ring);
  border-radius: var(--r-pill); box-shadow: var(--shadow-card);
  transition: box-shadow var(--motion-base) var(--ease-out);
}
.nav a.btn { transition: transform var(--motion-fast) var(--ease-out), filter var(--motion-fast) var(--ease-out); }
.nav .links { display: flex; gap: var(--s-4); align-items: center; }
.nav a { color: var(--on-surface-muted); text-decoration: none; font-size: var(--t-small); }
.nav a:hover { color: var(--on-surface); }
.brand { font-family: var(--font-display); font-size: 1.4rem; color: var(--on-surface); }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; text-align: center;
  padding-block: var(--s-8) var(--s-7);
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  font-size: var(--t-hero); margin-bottom: var(--s-4);
  letter-spacing: -0.015em; text-wrap: balance;
}
.hero .lead {
  font-size: var(--t-lead); color: var(--ink-muted);
  max-width: 46ch; margin-inline: auto; margin-bottom: var(--s-5);
  text-wrap: pretty;
}

/* Generative "seam field" — the hero art, drawn in code by js/motion.js: drifting
 * nodes joined by lines (the product's own metaphor — parts joined at seams),
 * brightening toward the cursor. Sits behind the hero text, masked to an ellipse
 * so it reads as ambient depth, never a boxed image. aria-hidden; pointer-events
 * none so it never intercepts the capture form. Colors come from the seam tokens. */
.seam-field {
  position: absolute; z-index: 0; inset: -12% -6% -6% -6%;
  width: 112%; height: 118%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 74% at 50% 46%, #000 55%, transparent 92%);
          mask-image: radial-gradient(ellipse 80% 74% at 50% 46%, #000 55%, transparent 92%);
}

/* ── EMAIL CAPTURE (the single action; appears at each CTA) ───────────────── */
/* Markup is real but unwired — capture + delivery is swe4vibe-landing-p0x.4.
 * One .capture class single-sources the look across every instance. */
.capture {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  max-width: 30rem; margin-inline: auto;
}
.capture input[type="email"] {
  flex: 1 1 14rem; min-width: 0;
  padding: 0.75em 1em; font: inherit; font-size: var(--t-body);
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--hairline); border-radius: var(--r-btn);
}
.capture input[type="email"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.capture .note {
  flex-basis: 100%; margin-top: var(--s-2);
  font-size: var(--t-small); color: var(--ink-muted); text-align: center;
}
/* Consent disclosure under every form (swe4vibe-funnel-28i.9): signing up now
   enrolls people in email, so every capture point discloses it. Quieter than
   .note, and sits below it where both are present. */
.capture .consent {
  flex-basis: 100%; margin-top: var(--s-1);
  font-size: var(--t-fine, var(--t-small)); color: var(--ink-muted);
  opacity: 0.85; text-align: center; line-height: 1.5;
}
/* Capture forms that sit on a dark surface invert their input chrome. */
.on-dark .capture input[type="email"] {
  color: var(--on-surface); background: var(--surface-top);
  border-color: var(--ring);
}
.on-dark .capture .note { color: var(--on-surface-muted); }
.on-dark .capture .consent { color: var(--on-surface-muted); }

/* Capture states (wired by js/capture.js — swe4vibe-landing-p0x.4).
 * .msg.ok replaces the form on confirmed signup; .msg.err sits above the note
 * while the form stays usable. Links use the accent on light and dark alike. */
.capture .msg {
  flex-basis: 100%; margin-top: var(--s-2);
  font-size: var(--t-small); text-align: center;
}
.capture .msg.ok { font-size: var(--t-body); }
.capture .msg a { color: var(--accent); }
.capture .msg.err strong { color: var(--accent); }
.capture button[disabled] { opacity: 0.6; cursor: wait; }

/* Key-redemption form on the /course/ gate's 403 page — same shape as .capture,
   text field instead of email. */
.key-form {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  max-width: 34rem; margin-block: var(--s-5);
}
.key-form input {
  flex: 1 1 16rem; min-width: 0;
  padding: 0.75em 1em; font: inherit; font-size: var(--t-body);
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--hairline); border-radius: var(--r-btn);
}
.key-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── MANIFESTO (block 2 — the reframe: "stop prompting harder, prompt better") ─ */
.manifesto { max-width: var(--measure); margin-inline: auto; text-align: center; }
.manifesto h2 { font-family: var(--font-display); font-size: var(--t-h2); margin-bottom: var(--s-5); }
.manifesto p { margin-bottom: var(--s-4); }
.pullquote {
  font-family: var(--font-display); font-size: var(--t-h2); line-height: 1.15;
  margin-block: var(--s-6); color: var(--ink);
}

/* ── PROOF (block 3 — free lesson, pride of place: featured dark card) ─────── */
.proof {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-top), var(--surface));
  color: var(--on-surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--s-7); max-width: 780px; margin-inline: auto;
  text-align: center;
}
/* Warm glow bleeding from the top — the free lesson is the hot centerpiece. */
.proof::before, .cta::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: -40%; left: 50%; width: 120%; height: 90%; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, var(--glow-accent), transparent 70%);
  opacity: 0.6;
}
.proof > *, .cta > * { position: relative; z-index: 1; }
.proof h2 { font-family: var(--font-display); font-size: var(--t-h2); margin-bottom: var(--s-4); }
.proof .lesson-title {
  font-family: var(--font-display); font-size: var(--t-h3);
  color: var(--on-surface); margin-bottom: var(--s-3);
}
.proof p { color: var(--on-surface-muted); max-width: 54ch; margin-inline: auto; margin-bottom: var(--s-5); }

/* ── CURRICULUM GRID (block 4 — replaces the pricing grid) ─────────────────── */
/* The finite set of named defects. NOT a pricing grid: v1 has no price/checkout.
 * Each cell is one scar the course kills. The free lesson is highlighted with a
 * thin ring only (loud "popular" treatment is an anti-pattern). */
.curriculum .grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3); margin-top: var(--s-6);
}
.defect {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, var(--surface-top), var(--surface));
  color: var(--on-surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
/* Hairline sheen along the top edge — light catching a real surface. */
.defect::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  padding: 1px;
  background: linear-gradient(180deg, var(--ring), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.defect:hover { transform: translateY(-5px); box-shadow: var(--elev-hover); }
.defect .symptom { font-family: var(--font-display); font-size: var(--t-h3); }
.defect .verdict {
  align-self: flex-start; margin-top: auto;
  padding: 0.3em 0.9em; font-size: var(--t-small);
  text-transform: uppercase; letter-spacing: var(--tracking-tag);
  color: var(--on-surface-muted);
  border: 1px solid var(--ring); border-radius: var(--r-pill);
}
.defect.is-free { outline: 1px solid var(--accent); }
.defect.is-free .verdict { color: var(--accent); border-color: var(--accent); }
.defect.is-free:hover {
  box-shadow: var(--elev-hover), 0 24px 60px -24px var(--glow-accent);
}

/* ── AUDIENCE (block 5 — for / not-for, two-column) ───────────────────────── */
.audience .cols {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4); margin-top: var(--s-6);
}
.audience .col {
  background: var(--bg-2); border: 1px solid var(--hairline);
  border-radius: var(--r-card); padding: var(--s-5);
}
.audience h3 { font-family: var(--font-display); font-size: var(--t-h3); margin-bottom: var(--s-4); }
.checklist { list-style: none; display: grid; gap: var(--s-3); padding: 0; }
.checklist li { display: flex; gap: var(--s-2); }
.checklist.yes li::before { content: "✓"; color: var(--accent); }
.checklist.no  li::before { content: "✕"; color: var(--ink-muted); }

/* ── OFFER (block 6 — no-price "first access" tease) ──────────────────────── */
.offer {
  max-width: 780px; margin-inline: auto; text-align: center;
}
.offer h2 { font-family: var(--font-display); font-size: var(--t-h2); margin-bottom: var(--s-4); }
.offer p { color: var(--ink-muted); max-width: 54ch; margin-inline: auto; margin-bottom: var(--s-5); }

/* The buy CTA + its honest "opens soon" note, then the free-lesson fallback. */
.offer-actions {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.offer-actions .btn { font-size: var(--t-body); }
.offer-note { font-size: var(--t-small); color: var(--ink-muted); }
.offer-or {
  font-size: var(--t-small); color: var(--ink-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: var(--s-4);
}

/* ── FAQ (block 7 — objections, answered straight) ────────────────────────── */
.faq { max-width: var(--measure); margin-inline: auto; }
.faq h2 { font-family: var(--font-display); font-size: var(--t-h2); text-align: center; margin-bottom: var(--s-6); }
.faq-item { padding-block: var(--s-4); border-top: 1px solid var(--hairline); }
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }
.faq-item .q { font-family: var(--font-display); font-size: var(--t-h3); margin-bottom: var(--s-2); }
.faq-item .a { color: var(--ink-muted); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 0.75em 1.25em; border-radius: var(--r-btn);
  font: inherit; font-size: var(--t-body);
  text-decoration: none; cursor: pointer; border: 0; white-space: nowrap;
  transition: transform var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out),
              filter var(--motion-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(26,24,20,0.45); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-dark  { background: var(--ink); color: var(--bg); }
.btn-dark:hover  { filter: brightness(1.12); }
.btn-light { background: var(--on-surface); color: var(--surface); }
.btn-light:hover { filter: brightness(1.04); }
.btn-ghost { background: transparent; color: var(--on-surface); border: 1px solid var(--ring); }
.btn-block { width: 100%; }

/* ── CTA band (inverted, block 8) ─────────────────────────────────────────── */
.cta {
  position: relative; overflow: hidden;
  background: var(--surface); color: var(--on-surface);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  text-align: center; padding: var(--s-7);
}
.cta h2 { font-family: var(--font-display); font-size: var(--t-h2); margin-bottom: var(--s-4); }
.cta p { color: var(--on-surface-muted); margin-bottom: var(--s-5); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: var(--s-3); padding-block: var(--s-6);
  font-size: var(--t-small); color: var(--ink-muted);
}
footer a { color: var(--ink-muted); text-decoration: none; margin-left: var(--s-4); }
footer a:hover { color: var(--ink); }

/* ── CRAFT POLISH ────────────────────────────────────────────────────────── */
/* Headings break on sense, not on box width — the typographer's default. */
h1, h2, h3, .pullquote, .lesson-title { text-wrap: balance; }
.faq-item .a, .offer p, .proof p, .cta p { text-wrap: pretty; }

/* Capture inputs settle into focus instead of snapping. */
.capture input[type="email"] {
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}
.capture input[type="email"]:focus-visible {
  box-shadow: 0 0 0 4px var(--glow-accent);
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .curriculum .grid { grid-template-columns: 1fr; }
  .audience .cols { grid-template-columns: 1fr; }
  .nav .links a:not(.btn) { display: none; }
  .hero { padding-block: var(--s-7) var(--s-6); }
}

/* Phones: keep the nav pill and the long hero lines inside the viewport. */
@media (max-width: 480px) {
  .nav { padding-left: var(--s-3); gap: var(--s-2); }
  .brand { font-size: 1.2rem; }
  .nav a.btn { font-size: var(--t-small); padding: 0.55em 0.9em; }
  .hero h1 { letter-spacing: -0.02em; }
}
