/* ─────────────────────────────────────────────────────────────
   Signal — marketing page
   Editorial paper aesthetic. System fonts only, by design.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #FAF7F2;                        /* warm paper */
  --bg-soft: #F2EDE3;                   /* slightly darker paper */
  --ink: #14110D;                       /* near-black, warm */
  --ink-muted: #5C5550;                 /* body subdued */
  --ink-soft: #8A8278;                  /* metadata */
  --hair: #D9D2C5;                      /* hairline dividers */
  --accent: #7F1D1D;                    /* deep oxblood */
  --accent-deep: #5C0E0E;
  --accent-soft: rgba(127, 29, 29, 0.08);

  --serif: ui-serif, "New York", "Iowan Old Style", "Charter", "Source Serif Pro", "Apple Garamond", Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", monospace;

  --maxw: 720px;
  --pad: clamp(1.25rem, 4vw, 2rem);

  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;             /* 17px */
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
}

/* paper grain overlay — subtle, multiplies into the warm bg */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' 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.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

main, header, footer { position: relative; z-index: 1; }

a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

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

/* ───── Skip link ───────────────────────────────────────────── */
.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 0.95rem;
  border-radius: 4px;
  font-size: 0.875rem;
  z-index: 10;
}
.skip:focus { left: 1rem; }

/* ───── Header ──────────────────────────────────────────────── */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem var(--pad) 0.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.brand-mark {
  color: var(--accent);
  font-size: 1.45rem;
  line-height: 1;
  transform: translateY(0.08em);
}
.brand-name { font-weight: 500; }
.brand-sub {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-weight: 600;
  margin-left: 0.25rem;
}

.header-cta {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: gap 0.25s var(--ease), opacity 0.2s ease;
}
.header-cta:hover { gap: 0.55rem; opacity: 0.85; }

/* ───── Hero ────────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vh, 5.5rem) var(--pad) clamp(4rem, 12vh, 7rem);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
}
.eyebrow-rule {
  display: block;
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-feature-settings: "kern", "liga", "calt", "onum";
  color: var(--ink);
  text-wrap: balance;
}

h1.display {
  font-size: clamp(2.3rem, 6.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

h2.display {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2.25rem;
}
h2.display em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.lede {
  font-family: var(--sans);
  font-size: clamp(1.075rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 34rem;
  margin-bottom: 2.5rem;
  text-wrap: pretty;
}

/* ───── CTAs ────────────────────────────────────────────────── */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.btn {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              transform 0.2s var(--ease), gap 0.2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  color: var(--ink);
  padding: 0.5rem 0;
  position: relative;
  align-self: center;
}
.btn-ghost .arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.btn-ghost:hover .arrow { transform: translateX(4px); }
.btn-ghost::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.btn-ghost:hover::after { transform: scaleX(1); }

/* ───── Section frame ───────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 5.5rem) var(--pad);
}

.section-rule {
  max-width: var(--maxw);
  margin: 0 auto;
  border: 0;
  height: 1px;
  background: var(--hair);
}

/* chapter mark: "§ I — Problem" with a trailing hairline */
.chapter {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.25rem;
}
.chapter-num {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  flex-shrink: 0;
}
.chapter > span:last-child { letter-spacing: 0.22em; }
.chapter::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  max-width: 4rem;
}

/* ───── Problem points ──────────────────────────────────────── */
.points {
  display: grid;
  gap: 2.25rem;
}
.point h3 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.point p {
  color: var(--ink-muted);
  max-width: 36rem;
}

/* ───── Steps ───────────────────────────────────────────────── */
.steps {
  list-style: none;
  display: grid;
  gap: 2.5rem;
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 1.75rem;
  align-items: baseline;
}
.step-num {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 4.5vw, 3.75rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 0.75rem;
  border-right: 1px solid var(--hair);
  align-self: stretch;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
}
.step-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.45rem;
  color: var(--ink);
}
.step-body p {
  color: var(--ink-muted);
  max-width: 36rem;
}

/* ───── Argument prose (drop cap) ───────────────────────────── */
.prose p {
  font-family: var(--sans);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--ink);
  text-wrap: pretty;
}
.prose p:last-child { margin-bottom: 0; }

.prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-size: 4rem;
  font-weight: 400;
  line-height: 0.85;
  float: left;
  padding: 0.4rem 0.55rem 0 0;
  color: var(--accent);
}

/* ───── Closing CTA ─────────────────────────────────────────── */
.closing {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 11vh, 7rem) var(--pad) clamp(5rem, 13vh, 8rem);
}
.closing h2 { margin-bottom: 1.5rem; }
.closing .lede { margin-bottom: 2rem; }

/* ───── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hair);
  padding: 1.75rem var(--pad) 2.25rem;
  background: transparent;
}
.footer-row {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.825rem;
  color: var(--ink-soft);
}
.footer-row a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.footer-row a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ───── Reveal animations (JS-gated) ────────────────────────── */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  will-change: opacity, transform;
}
.js [data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* Hero stagger on load (CSS-only, doesn't need JS) */
.hero .eyebrow   { animation: fadeUp 0.7s 0.05s var(--ease) both; }
.hero h1         { animation: fadeUp 0.85s 0.17s var(--ease) both; }
.hero .lede      { animation: fadeUp 0.85s 0.32s var(--ease) both; }
.hero .cta-row   { animation: fadeUp 0.85s 0.46s var(--ease) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header {
    padding: 1.25rem var(--pad) 0.5rem;
  }
  .header-cta { display: none; }

  .step {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .step-num {
    text-align: left;
    justify-content: flex-start;
    border-right: 0;
    padding-right: 0;
    padding-left: 0;
    font-size: 2.4rem;
    margin-bottom: 0.1rem;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .cta-row { gap: 0.9rem; }
}

@media (min-width: 900px) {
  /* small editorial luxury on wider screens: pull chapter numerals
     slightly into the margin so they read like manuscript folio marks */
  .section { position: relative; }
  .chapter { margin-left: -2.5rem; padding-left: 2.5rem; }
  .chapter::after { max-width: 5rem; }
}

/* ───── Motion preference ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Print: make it read like a memo */
@media print {
  body::before { display: none; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .cta-row, .btn { display: none !important; }
  .display em, .chapter, .step-num, .prose ::first-letter { color: #000; }
  a { color: #000; text-decoration: underline; }
}
