/* ============================================================================
   margin — margin.shivgodhia.com / muse.shivgodhia.com
   An editorial identity for a writer + AI collaborator working the same page.
   Ink on paper; a yellow comment, a blue suggestion, a red/green diff.
   ========================================================================== */

/* ----- Fonts (self-hosted, variable) ------------------------------------- */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900; font-stretch: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
  font-weight: 100 900; font-stretch: normal; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ----- Tokens ------------------------------------------------------------ */
:root {
  /* Clean-manuscript palette: bright warm-white paper, ink text, editor's red pen */
  --ink: #1c1b19;         /* warm near-black manuscript ink */
  --paper: #fbfaf6;       /* bright warm-white page (whiter than cream) */
  --paper-soft: #fdfcf9;
  --paper-white: #ffffff; /* the page sheet floats brightest */

  /* the editor's-pen accent — an ink-blue proofreading pen */
  --pen: #2f5bd0;         /* editor's ink-blue pen */
  --pen-ink: #234aad;

  /* signature marks — the three things Margin puts on your prose */
  --comment: #f2b636;     /* comment highlight (amber) */
  --comment-soft: rgba(242, 182, 54, 0.30);
  --suggest: #2f5bd0;     /* Muse suggestion (ink-blue, same family as the pen) */
  --suggest-soft: rgba(47, 91, 208, 0.13);
  --add: #2b7a4b;         /* accepted / inserted (green) */
  --add-soft: rgba(43, 122, 75, 0.12);
  --del: #c8452f;         /* pending deletion strikes red (a real proofing mark) */
  --del-soft: rgba(200, 69, 47, 0.09);

  /* the faint ruled paper lines that back the whole page */
  --ruled: rgba(28, 27, 25, 0.05);
  --ruled-margin: rgba(47, 91, 208, 0.14); /* the left-margin rule of ruled paper */

  /* Semantic — LIGHT theme (default) */
  --bg: var(--paper);
  --bg-veil: #f6f4ec;
  --surface: var(--paper-white);
  --surface-2: #f4f1e8;
  --surface-sunken: #efece2;
  --text: var(--ink);
  --text-soft: #57544d;
  --text-faint: #8f8b80;
  --rule: #e6e1d3;
  --rule-soft: #eeeae0;
  --accent: var(--pen);      /* the editor's red pen is the interactive accent */
  --accent-ink: var(--pen-ink);
  --accent-bright: var(--pen);
  --glow: rgba(194, 59, 46, 0.08);

  --shadow-sm: 0 1px 2px rgba(26, 26, 30, 0.05), 0 2px 8px rgba(26, 26, 30, 0.04);
  --shadow-md: 0 4px 14px rgba(26, 26, 30, 0.07), 0 10px 40px rgba(26, 26, 30, 0.06);
  --shadow-lg: 0 10px 30px rgba(26, 26, 30, 0.12), 0 30px 80px rgba(26, 26, 30, 0.10);

  --maxw: 1120px;
  --readw: 62ch;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.36rem + 0.7vw, 2rem);
  --step-3: clamp(2rem, 1.7rem + 1.5vw, 3.1rem);
  --step-4: clamp(2.8rem, 2.1rem + 3.6vw, 5.4rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* dark mode reads as ink-stained paper / a writing desk at night */
    --bg: #16150f;
    --bg-veil: #191811;
    --surface: #201e16;      /* the page sheet, a step above the desk */
    --surface-2: #272419;
    --surface-sunken: #17160f;
    --text: #f0ede1;
    --text-soft: #c0bba9;
    --text-faint: #8b8674;
    --rule: rgba(240, 237, 225, 0.10);
    --rule-soft: rgba(240, 237, 225, 0.06);
    --pen: #7f9def; --pen-ink: #9db3f5;
    --accent: #7f9def;
    --accent-ink: #9db3f5;
    --accent-bright: #7f9def;
    --glow: rgba(127, 157, 239, 0.14);
    --comment-soft: rgba(242, 182, 54, 0.20);
    --suggest: #7f9def; --suggest-soft: rgba(127, 157, 239, 0.20);
    --add: #57c184; --add-soft: rgba(87, 193, 132, 0.14);
    --del: #ef8a76; --del-soft: rgba(239, 138, 118, 0.14);
    --ruled: rgba(240, 237, 225, 0.05);
    --ruled-margin: rgba(127, 157, 239, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  }
}

/* Explicit theme overrides win over the media query in both directions */
:root[data-theme="light"] {
  --bg: var(--paper); --bg-veil: #f6f4ec; --surface: var(--paper-white);
  --surface-2: #f4f1e8; --surface-sunken: #efece2;
  --text: var(--ink); --text-soft: #57544d; --text-faint: #8f8b80;
  --rule: #e6e1d3; --rule-soft: #eeeae0;
  --pen: #2f5bd0; --pen-ink: #234aad;
  --accent: var(--pen); --accent-ink: var(--pen-ink); --accent-bright: var(--pen);
  --glow: rgba(47,91,208,.09);
  --comment-soft: rgba(242,182,54,.30); --suggest: #2f5bd0; --suggest-soft: rgba(47,91,208,.13);
  --add: #2b7a4b; --add-soft: rgba(43,122,75,.12);
  --del: #c8452f; --del-soft: rgba(200,69,47,.09);
  --ruled: rgba(28,27,25,.05); --ruled-margin: rgba(47,91,208,.14);
  --shadow-sm: 0 1px 2px rgba(28,27,25,.05), 0 2px 8px rgba(28,27,25,.04);
  --shadow-md: 0 4px 14px rgba(28,27,25,.07), 0 10px 40px rgba(28,27,25,.06);
  --shadow-lg: 0 10px 30px rgba(28,27,25,.12), 0 30px 80px rgba(28,27,25,.10);
}
:root[data-theme="dark"] {
  --bg: #16150f; --bg-veil: #191811; --surface: #201e16;
  --surface-2: #272419; --surface-sunken: #17160f;
  --text: #f0ede1; --text-soft: #c0bba9; --text-faint: #8b8674;
  --rule: rgba(240,237,225,.10); --rule-soft: rgba(240,237,225,.06);
  --pen: #7f9def; --pen-ink: #9db3f5;
  --accent: #7f9def; --accent-ink: #9db3f5; --accent-bright: #7f9def;
  --glow: rgba(127,157,239,.14);
  --comment-soft: rgba(242,182,54,.20); --suggest: #7f9def; --suggest-soft: rgba(127,157,239,.20);
  --add: #57c184; --add-soft: rgba(87,193,132,.14);
  --del: #ef8a76; --del-soft: rgba(239,138,118,.14);
  --ruled: rgba(240,237,225,.05); --ruled-margin: rgba(127,157,239,.16);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
}

/* ----- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}
/* Ruled-paper backdrop: faint horizontal rules across the whole page, the way a
   manuscript pad is lined. Fixed so the page reads as one continuous sheet. It
   sits behind everything (z -1) and never intercepts clicks. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom, transparent, transparent 33px, var(--ruled) 33px, var(--ruled) 34px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
}
h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 540;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -0.014em;
}
p { margin: 0; }
a { color: var(--accent); text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code, kbd, pre, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
:focus-visible { outline: 2.5px solid var(--accent-bright); outline-offset: 3px; border-radius: 3px; }
img, canvas { max-width: 100%; display: block; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
/* Editorial kicker — a serif italic label with a hand-drawn red pen underline,
   replacing the mono-uppercase eyebrow. Reads like a margin note, not a UI tag. */
.eyebrow {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: var(--step-1);
  letter-spacing: 0;
  color: var(--accent);
  font-weight: 460;
  margin: 0;
  display: inline-block;
  position: relative;
  padding-bottom: 0.25em;
}
.eyebrow::after {
  content: ""; position: absolute; left: 0.05em; right: 0.05em; bottom: 0.02em;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  /* a slightly uneven, drawn-with-a-pen underline */
  opacity: 0.55;
  transform: rotate(-0.4deg);
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
          mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.section-head.center .eyebrow::after { left: 8%; right: 8%; }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--text-soft); max-width: 54ch; font-weight: 380; }

/* ----- Header ------------------------------------------------------------ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
  backdrop-filter: blur(10px) saturate(1.1);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.masthead.scrolled { border-bottom-color: var(--rule); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; width: min(100% - 2.5rem, var(--maxw)); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: "Fraunces", serif; font-weight: 600; font-size: 1.32rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.masthead nav { display: flex; align-items: center; gap: 1.4rem; }
.masthead nav a { font-size: 0.95rem; color: var(--text-soft); text-decoration: none; font-weight: 480; }
.masthead nav a:hover { color: var(--accent); }
.nav-link-mono { font-family: "JetBrains Mono", monospace; font-size: 0.86rem !important; }
.theme-toggle {
  appearance: none; border: 1px solid var(--rule); background: var(--surface);
  color: var(--text-soft); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(15deg); }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .nav-hide { display: none; } }

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: "Inter", sans-serif; font-weight: 560; font-size: 0.98rem;
  padding: 0.72rem 1.3rem; border-radius: 100px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .btn-primary { color: #131316; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #131316; } }
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .btn-primary:hover { background: #aebdfb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { background: #aebdfb; } }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ----- Hero -------------------------------------------------------------- */
.hero { position: relative; padding: clamp(3rem, 8vh, 7rem) 0 clamp(3.5rem, 7vh, 6rem); overflow: hidden; }
#paper-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.8; pointer-events: none; }
.hero-veil { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 80% 6%, var(--glow), transparent 55%); }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; gap: 2.75rem; } }

.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.hero h1 { font-size: var(--step-4); font-weight: 580; letter-spacing: -0.03em; }
/* the marked-up word: red-pen italic with a drawn underline, like an editor
   circling the operative word. */
.ink-word { position: relative; font-style: italic; font-weight: 460; color: var(--accent); white-space: nowrap; }
.ink-word::after {
  content: ""; position: absolute; left: -0.02em; right: -0.02em; bottom: 0.04em;
  height: 0.09em; background: var(--accent); border-radius: 2px; opacity: 0.6;
  transform: rotate(-0.5deg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.hero .tagline { font-size: var(--step-1); color: var(--text-soft); max-width: 40ch; line-height: 1.5; font-weight: 380; }
.hero .tagline b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.4rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-faint); }
.hero-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta .dot { width: 14px; height: 14px; border-radius: 0; background: none; color: var(--accent); flex: none; }
.hero-meta .dot::before { content: "✓"; font-size: 0.82rem; font-weight: 700; }

/* ----- Editor mockup (the star of the show) ------------------------------
   A writing app, not a terminal: no traffic lights. A clean title bar carries
   the doc name + a live word-count slug; the sheet floats on a soft page shadow. */
.editor {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--rule);
  overflow: hidden; color: var(--text);
}
.editor.hero-editor { transform: perspective(1600px) rotateY(-4deg) rotateX(1.2deg); transition: transform 0.55s var(--ease); }
.editor.hero-editor:hover { transform: perspective(1600px) rotateY(0deg) rotateX(0deg); }
@media (max-width: 960px) { .editor.hero-editor { transform: none; } .editor.hero-editor:hover { transform: none; } }
.ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.95rem; background: var(--surface-2); border-bottom: 1px solid var(--rule); }
.ed-bar .file { display: inline-flex; align-items: center; gap: 0.45rem; font-family: "Fraunces", serif; font-weight: 600; font-size: 0.92rem; color: var(--text); letter-spacing: -0.01em; }
.ed-bar .file svg { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.ed-bar .file .dirty { color: var(--accent); font-family: "Inter", sans-serif; }
.ed-bar .slug { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.02em; white-space: nowrap; }
.ed-bar .slug .saved { color: var(--add); }

/* two-pane: prose + muse rail */
.ed-body { display: grid; grid-template-columns: 1fr 0.82fr; }
/* Reserve the hero mockup's full height up front so the box never grows as the
   suggestion card + comment thread pop in during the intro animation. Sized to
   the fully-populated rail; the rail is pinned to the top so cards fill down. */
.hero-editor .ed-body { min-height: 500px; }
.hero-editor .ed-rail { align-self: start; }
@media (max-width: 520px) { .ed-body { grid-template-columns: 1fr; } .ed-rail { display: none !important; } .hero-editor .ed-body { min-height: 0; } }
.ed-prose {
  padding: 1.5rem 1.5rem 1.7rem; font-family: "Fraunces", Georgia, serif;
  font-size: 1.02rem; line-height: 1.72; color: var(--text);
  border-right: 1px solid var(--rule-soft); min-width: 0;
}
.ed-prose h4 { font-family: "Fraunces", serif; font-size: 1.3rem; font-weight: 600; margin-bottom: 0.8rem; letter-spacing: -0.02em; }
.ed-prose p { margin-bottom: 0.85rem; }
.ed-prose p:last-child { margin-bottom: 0; }

/* the three marks */
mark.comment { background: var(--comment-soft); color: inherit; border-radius: 2px; padding: 0.02em 0.06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; cursor: default; }
mark.suggest { background: var(--suggest-soft); color: inherit; border-radius: 2px; padding: 0.02em 0.06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.del { color: var(--del); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.add { color: var(--add); background: var(--add-soft); border-radius: 2px; padding: 0.02em 0.08em; }

/* muse rail */
.ed-rail { padding: 1.1rem 1.05rem; display: flex; flex-direction: column; gap: 0.85rem; background: color-mix(in oklab, var(--surface-2) 55%, var(--surface)); font-family: "Inter", sans-serif; min-width: 0; }
.rail-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 640; color: var(--text-soft); letter-spacing: 0.02em; }
.rail-head .avatar { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: "Fraunces", serif; font-weight: 700; font-size: 0.82rem; flex: none; }
:root[data-theme="dark"] .rail-head .avatar { color: #131316; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rail-head .avatar { color: #131316; } }

/* suggestion card */
.card { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.card.suggestion { border-color: color-mix(in oklab, var(--suggest) 42%, var(--rule)); }
.card-label { font-size: 0.68rem; font-family: "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); padding: 0.55rem 0.75rem 0.35rem; }
.card-diff { padding: 0 0.75rem 0.55rem; font-family: "Fraunces", serif; font-size: 0.86rem; line-height: 1.5; }
.card-diff .line { display: block; padding: 0.12em 0.4em; border-radius: 4px; margin-bottom: 0.15rem; }
.card-diff .line.minus { background: var(--del-soft); color: var(--del); }
.card-diff .line.plus { background: var(--add-soft); color: var(--add); }
.card-diff .line .sign { font-family: "JetBrains Mono", monospace; opacity: 0.6; margin-right: 0.35em; }
.card-reason { padding: 0 0.75rem 0.6rem; font-size: 0.78rem; color: var(--text-soft); line-height: 1.45; }
.card-actions { display: flex; gap: 0.4rem; padding: 0.55rem 0.75rem; border-top: 1px solid var(--rule-soft); background: var(--surface-2); }
.mini-btn { font-family: "Inter", sans-serif; font-size: 0.74rem; font-weight: 580; padding: 0.32rem 0.7rem; border-radius: 7px; border: 1px solid var(--rule); background: var(--surface); color: var(--text-soft); cursor: default; }
.mini-btn.accept { background: var(--add); border-color: var(--add); color: #fff; }
.mini-btn.reject { background: transparent; }

/* comment thread bubble */
.thread { border-left: 2px solid var(--comment); padding: 0.15rem 0 0.15rem 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; }
.msg { font-size: 0.8rem; line-height: 1.5; }
.msg .who { font-weight: 640; font-size: 0.72rem; color: var(--text-soft); display: block; margin-bottom: 0.1rem; }
.msg.you .who { color: var(--text); }
.msg.muse .who { color: var(--accent); }
.msg p { color: var(--text-soft); }

/* ----- Section scaffolding ----------------------------------------------- */
section { position: relative; }
.section-pad { padding: clamp(3.5rem, 9vh, 7rem) 0; }
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3.2rem); display: flex; flex-direction: column; gap: 0.9rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head.center { margin-inline: auto; text-align: center; align-items: center; }

.rule-divider { display: flex; align-items: center; justify-content: center; gap: 0.9rem; color: var(--accent); opacity: 0.7; }
.rule-divider::before, .rule-divider::after { content: ""; height: 1px; width: min(28vw, 200px); background: linear-gradient(90deg, transparent, var(--rule), transparent); }
.rule-divider svg { width: 22px; height: 22px; }

/* ----- How it works (numbered, alternating rows) ------------------------- */
.how { background: var(--bg-veil); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.how-rows { display: flex; flex-direction: column; gap: clamp(2.5rem, 6vw, 4.5rem); max-width: 1000px; margin-inline: auto; }
.how-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.how-row:nth-child(even) .how-visual { order: -1; }
@media (max-width: 820px) { .how-row { grid-template-columns: 1fr; gap: 1.5rem; } .how-row:nth-child(even) .how-visual { order: 0; } }
.how-num { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; letter-spacing: 0.16em; color: var(--accent); font-weight: 700; margin-bottom: 0.7rem; }
.how-copy h3 { font-size: var(--step-2); margin-bottom: 0.7rem; font-weight: 560; }
.how-copy p { color: var(--text-soft); font-size: 1.02rem; line-height: 1.6; max-width: 44ch; }
.how-copy p code, .how-copy p .kbd { font-family: "JetBrains Mono", monospace; font-size: 0.85em; color: var(--accent-ink); background: color-mix(in oklab, var(--accent) 10%, transparent); padding: 0.06em 0.4em; border-radius: 5px; }
.how-visual { min-width: 0; }

/* small inline editor snapshot used inside how-rows */
.snap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
/* labeled sheet header — a small tab/label instead of a window bar */
.snap .ed-bar { padding: 0.5rem 0.9rem; }
.snap .snap-label { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; letter-spacing: 0.04em; color: var(--text-faint); text-transform: lowercase; display: inline-flex; align-items: center; gap: 0.4rem; }
.snap .snap-label::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--accent); opacity: 0.7; }
.snap-body { padding: 1.15rem 1.25rem; font-family: "Fraunces", Georgia, serif; font-size: 0.96rem; line-height: 1.68; color: var(--text); }
.snap-body p { margin-bottom: 0.7rem; }
.snap-body p:last-child { margin-bottom: 0; }
.snap-code { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; line-height: 1.8; padding: 1.1rem 1.2rem; color: var(--text-soft); background: var(--surface-sunken); overflow-x: auto; }
.snap-code .k { color: var(--accent); } .snap-code .g { color: var(--add); } .snap-code .r { color: var(--del); } .snap-code .m { color: var(--text-faint); }

/* provenance / blame strip */
.blame { font-family: "JetBrains Mono", monospace; font-size: 0.78rem; line-height: 2; padding: 1.1rem 1.2rem; }
.blame .row { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blame .who-w { color: var(--text-faint); } .blame .who-a { color: var(--accent); }
.blame .txt { color: var(--text-soft); font-family: "Fraunces", serif; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- Audience (fiction / non-fiction / blog) --------------------------- */
.aud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; max-width: 980px; margin-inline: auto; }
@media (max-width: 780px) { .aud-grid { grid-template-columns: 1fr; } }
.aud {
  position: relative; padding: 1.9rem 1.7rem 2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--rule); overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.aud:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--accent) 38%, var(--rule)); }
.aud .aicon { width: 40px; height: 40px; color: var(--accent); margin-bottom: 1.1rem; }
.aud h3 { font-size: 1.42rem; margin-bottom: 0.55rem; font-weight: 560; }
.aud p { color: var(--text-soft); font-size: 0.97rem; line-height: 1.6; }
.aud .aud-tag { display: inline-block; margin-top: 1rem; font-family: "JetBrains Mono", monospace; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text-faint); }

/* ----- Features grid ----------------------------------------------------- */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; max-width: 900px; margin-inline: auto; }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }
.feature {
  position: relative; padding: 1.7rem 1.6rem 1.8rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--rule);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; overflow: hidden;
}
.feature::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--accent-bright), transparent); opacity: 0; transition: opacity 0.25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--accent) 40%, var(--rule)); }
.feature:hover::before { opacity: 1; }
.feature .ficon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 0.95rem; }
.feature h3 { font-size: 1.28rem; margin-bottom: 0.5rem; font-weight: 560; }
.feature p { color: var(--text-soft); font-size: 0.96rem; line-height: 1.6; }
.feature code { font-family: "JetBrains Mono", monospace; font-size: 0.85em; color: var(--accent-ink); background: color-mix(in oklab, var(--accent) 10%, transparent); padding: 0.08em 0.36em; border-radius: 4px; }

/* ----- Versus (why not just a chat window) ------------------------------- */
.versus-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1rem, 3vw, 2rem); align-items: stretch; max-width: 980px; margin-inline: auto; }
@media (max-width: 800px) { .versus-grid { grid-template-columns: 1fr; } }
.versus-col { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.6rem; display: flex; flex-direction: column; }
.versus-col.left { background: var(--surface-sunken); }
.versus-col.right { border-color: color-mix(in oklab, var(--accent) 45%, var(--rule)); box-shadow: var(--shadow-md); }
.versus-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--rule-soft); flex-wrap: wrap; }
.versus-tag { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); }
.versus-tag.on { color: var(--accent); }
.versus-note { font-size: 0.8rem; color: var(--text-faint); font-style: italic; }
.versus-steps { margin: 0; padding-left: 0.2rem; display: flex; flex-direction: column; gap: 0.6rem; color: var(--text-soft); font-size: 0.93rem; line-height: 1.5; list-style: none; }
.versus-steps li { position: relative; padding-left: 1.5rem; }
.versus-steps.bad li::before { content: "✕"; position: absolute; left: 0; color: color-mix(in oklab, var(--del) 85%, var(--text-faint)); font-weight: 700; }
.versus-steps.good li::before { content: "✓"; position: absolute; left: 0; color: var(--add); font-weight: 700; }
.versus-steps code { font-family: "JetBrains Mono", monospace; font-size: 0.85em; color: var(--accent-ink); }
.versus-arrow { display: grid; place-items: center; color: var(--accent); }
.versus-arrow svg { width: 30px; height: 30px; }
@media (max-width: 800px) { .versus-arrow { transform: rotate(90deg); padding: 0.3rem 0; } }

/* ----- CTA / footer ------------------------------------------------------ */
.closing { text-align: center; }
.closing .wrap { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.closing h2 { font-size: var(--step-3); max-width: 20ch; }
.closing .lede { text-align: center; max-width: 48ch; }
.closing .hero-actions { justify-content: center; }
.closing .soon { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

.site-foot { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; color: var(--text-faint); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.site-foot .foot-brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: "Fraunces", serif; font-size: 1.1rem; color: var(--text-soft); }
.site-foot .foot-brand .mark { width: 22px; height: 22px; border-radius: 6px; }
.site-foot a { color: var(--text-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.92rem; }
.site-foot .foot-fine { width: 100%; font-size: 0.82rem; color: var(--text-faint); border-top: 1px solid var(--rule-soft); padding-top: 1.3rem; margin-top: 0.4rem; line-height: 1.6; }
.site-foot .foot-fine a { color: var(--accent); }

/* ----- Reveal on scroll -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* typing caret used by the hero animation */
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--accent); vertical-align: text-bottom; margin-left: 1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pop-in { animation: popin 0.45s var(--ease) both; }
@keyframes popin { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
