/* LayerQuote landing page — tokens, base, hero card, sections.
   Design notes: one bold element (the self-printing quote card); everything else quiet.
   Spool magenta appears exactly twice: the scan line and the "filament × 2" figure. */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #F6F7F9;            /* cool workshop white */
  --surface: #FFFFFF;
  --ink: #14181F;
  --ink-2: #4E5766;
  --ink-3: #5D6676;
  --line: #DCE1E9;
  --line-soft: #EBEEF3;
  --accent: #2E5CFF;        /* filament blue */
  --accent-ink: #1E45D9;
  --accent-soft: #E9EEFF;
  --accent-2: #E8407A;      /* spool magenta — two touches max */
  --accent-2-rgb: 232, 64, 122;
  --ok: #0A7F57;            /* profit green (AA on white and on --ok-soft) */
  --ok-soft: #E2F5EC;
  --danger: #C4302B;
  --danger-soft: #FCEBEA;
  --dark: #14181F;
  --dark-2: #1D232D;
  --on-dark: #F6F7F9;
  --on-dark-2: #A8B0BE;

  --font-display: "Space Grotesk", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 12px 32px -12px rgba(20, 24, 31, .18);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);

  --section-y: clamp(3.5rem, 9vw, 7rem);
  --layer-lines: repeating-linear-gradient(to bottom, rgba(46, 92, 255, .16) 0 1px, transparent 1px 4px);
}

/* ── Reset / base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, dl, dd, figure, blockquote, ul, ol { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: .15em; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100%; z-index: 10;
  padding: .6rem .9rem; background: var(--ink); color: var(--on-dark); border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 1rem; }

.section-title { font-size: clamp(1.625rem, 1.1rem + 2.4vw, 2.375rem); max-width: 22ch; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section-lead { color: var(--ink-2); max-width: 52ch; margin-top: -1rem; margin-bottom: 2rem; }
.footnote { color: var(--ink-3); font-size: .875rem; margin-top: 1.5rem; max-width: 60ch; }

/* ── Header ─────────────────────────────────────────────────────── */
.site-header { padding-block: 1.1rem; }
.site-header__row { display: flex; align-items: center; justify-content: space-between; }
.wordmark {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em;
}
.wordmark__mark { fill: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero { padding-block: clamp(1.5rem, 5vw, 4.5rem) var(--section-y); }
.hero__grid { display: grid; gap: clamp(2.25rem, 6vw, 4rem); align-items: center; }
.hero__copy h1 { font-size: clamp(2.125rem, 1.15rem + 5.2vw, 3.75rem); max-width: 14ch; }
.hero__sub { color: var(--ink-2); font-size: clamp(1.0625rem, 1rem + .35vw, 1.2rem); max-width: 50ch; margin-top: 1.25rem; }
.hero .waitlist, .hero .thanks { margin-top: 1.75rem; }

.hero__caption { margin-top: .8rem; font-size: .85rem; color: var(--ink-3); text-align: center; }

@media (min-width: 48em) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .hero__visual { justify-self: end; width: 100%; max-width: 26.5rem; }
}

/* ── Waitlist form ──────────────────────────────────────────────── */
.waitlist { max-width: 32rem; }
.waitlist__row { display: flex; flex-direction: column; gap: .6rem; }
.waitlist__input {
  width: 100%; min-height: 3.25rem; padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.waitlist__input::placeholder { color: var(--ink-3); }
.waitlist__input:hover { border-color: #B9C2D2; }
.waitlist__input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.waitlist__input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--radius-sm); }

.button {
  min-height: 3.25rem; padding: .75rem 1.25rem; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.button:hover { background: var(--accent-ink); }
.button:active { transform: translateY(1px); }
.button[disabled] { cursor: progress; opacity: .8; }

.waitlist__error { color: var(--danger); font-size: .9rem; font-weight: 500; margin-top: .55rem; min-height: 0; }
.waitlist__error:empty { display: none; }
.waitlist__micro { color: var(--ink-3); font-size: .875rem; margin-top: .6rem; }

/* Honeypot: off-screen, still focusable-by-bots, never displayed (KTD9). */
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.thanks { padding: 1.25rem 1.35rem; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius-sm); background: var(--surface); max-width: 32rem; }
.thanks__title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.thanks__title:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 4px; }
.thanks p + p { margin-top: .5rem; color: var(--ink-2); }

@media (min-width: 30em) {
  .waitlist__row { flex-direction: row; }
  .waitlist__input { flex: 1 1 auto; }
}

/* No-JS thank-you block, only shown when the URL fragment is #joined (KTD4). */
.joined { display: none; }
.joined:target { display: block; padding-bottom: var(--section-y); }
.joined[hidden] { display: none; } /* JS hides it when it has already swapped the forms for the thanks box */

/* ── Quote card (signature element) ─────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 1.5rem 2.1rem;
}
/* Layer-line texture on the card's left edge: the side of a print, 1px per layer. */
.card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: .6rem;
  background: var(--layer-lines);
  border-right: 1px solid var(--line-soft);
}
/* Print box: the clipped content and the scan line share this box, so clip % and translate % stay in sync. */
.card__print { position: relative; }
.card__head { display: flex; flex-direction: column; gap: .3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.card__meta { color: var(--ink-2); font-size: .8rem; }
.card__lines { padding-block: .85rem; display: grid; gap: .55rem; }
.card__line { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.card__line dt { color: var(--ink-2); }
.card__line dd { color: var(--ink); }
.card__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-top: .9rem; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
}
.card__price { color: var(--ok); font-size: 1.75rem; font-weight: 400; letter-spacing: -0.03em; }
.card__pill {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  margin-top: 1.1rem; min-height: 2.75rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 500; font-size: .95rem;
}
/* Scan line: a 100%-tall layer whose top 2px is the print head. Translating it 100% walks it down the print box. */
.card__scan {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, var(--accent-2) 0 2px, transparent 2px);
  filter: drop-shadow(0 0 6px rgba(var(--accent-2-rgb), .55));
}

@media (prefers-reduced-motion: no-preference) {
  .card__inner {
    clip-path: inset(0 0 100% 0);
    -webkit-clip-path: inset(0 0 100% 0);
    animation: card-print 1.6s cubic-bezier(.45, 0, .3, 1) .25s forwards;
    will-change: clip-path;
  }
  .card__scan {
    opacity: 1;
    animation: card-scan 1.6s cubic-bezier(.45, 0, .3, 1) .25s forwards;
    will-change: transform, opacity;
  }
  @keyframes card-print {
    from { clip-path: inset(0 0 100% 0); -webkit-clip-path: inset(0 0 100% 0); }
    to   { clip-path: inset(0 0 0 0);   -webkit-clip-path: inset(0 0 0 0); }
  }
  @keyframes card-scan {
    0%   { transform: translateY(0); opacity: 1; }
    92%  { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
  }
}

/* ── Pain mirror ────────────────────────────────────────────────── */
.pain {
  padding-block: var(--section-y);
  background-color: var(--surface);
  background-image: repeating-linear-gradient(to bottom, rgba(20, 24, 31, .035) 0 1px, transparent 1px 6px);
  border-block: 1px solid var(--line-soft);
}
.chat { list-style: none; padding: 0; display: grid; gap: .9rem; max-width: 36rem; }
.chat__item { display: flex; }
.chat__item--alt { justify-content: flex-end; }
.bubble {
  max-width: 85%; padding: .8rem 1.05rem; border-radius: 1.15rem;
  background: var(--line-soft); color: var(--ink); font-size: 1.0625rem; line-height: 1.5;
  border-bottom-left-radius: .35rem;
}
.chat__item--alt .bubble {
  background: var(--accent); color: #fff;
  border-bottom-left-radius: 1.15rem; border-bottom-right-radius: .35rem;
}
.chat__caption { color: var(--ink-3); font-size: .875rem; margin-top: 1.5rem; max-width: 60ch; }

/* ── Steps ─────────────────────────────────────────────────────── */
.steps { padding-block: var(--section-y); }
.steps__list { list-style: none; padding: 0; display: grid; gap: 2.5rem; counter-reset: none; }
.step { display: grid; gap: 1rem; }
.step__figure {
  aspect-ratio: 3 / 2; width: 100%; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
}
.step__figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.step__zoom {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; border-radius: inherit; overflow: hidden;
}
.step__zoom img { transition: transform .2s ease; }
.step__zoom:hover img { transform: scale(1.02); }
.step__figure:has(.step__zoom:hover) { box-shadow: var(--shadow); }
.step__zoom:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); border-radius: inherit; }
.steps__hint { color: var(--ink-3); font-size: .85rem; margin-top: 1.25rem; }

/* Lightbox: the dialog itself is transparent; the image and close button float on the backdrop. */
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; }
.lightbox::backdrop { background: rgba(20, 24, 31, .82); }
.lightbox__img { display: block; max-width: 100vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg); }
.lightbox__close {
  position: fixed; top: .75rem; right: .75rem; z-index: 1;
  width: 2.75rem; height: 2.75rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 1.6rem; line-height: 1; box-shadow: var(--shadow);
}
.lightbox__close:hover { background: var(--line-soft); }
.lightbox__close:focus-visible { box-shadow: 0 0 0 3px var(--dark), 0 0 0 6px var(--accent); }
/* Scroll lock while the lightbox is open is applied inline by app.js (overflow on <html>, padding-right on <body>
   equal to the scrollbar width) and removed on every close path, so the page never stays shifted. */

@media (prefers-reduced-motion: reduce) {
  .step__zoom img { transition: none; }
  .step__zoom:hover img { transform: none; }
}
.step__placeholder { width: 100%; height: 100%; background-color: var(--surface); background-image: var(--layer-lines); position: relative; }
.step__placeholder::after {
  content: ""; position: absolute; inset: 14% 12%;
  border: 1px dashed rgba(46, 92, 255, .45); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .7);
}
.step__title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: .75rem; }
.step__num { font-family: var(--font-mono); font-size: .9rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; min-width: 1.75rem; height: 1.75rem; display: inline-grid; place-items: center; flex: none; transform: translateY(-.15em); }
.step__body p { color: var(--ink-2); margin-top: .5rem; }

@media (min-width: 64em) {
  .steps__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
}

/* ── Math ──────────────────────────────────────────────────────── */
.math { padding-block: var(--section-y); background: var(--surface); border-block: 1px solid var(--line-soft); }
.math__grid { display: grid; gap: 2rem; align-items: start; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .975rem; }
.breakdown th, .breakdown td { padding: .7rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; text-align: left; }
.breakdown td { text-align: right; white-space: nowrap; padding-left: 1rem; }
.breakdown th { font-weight: 500; }
.breakdown__basis { display: block; color: var(--ink-3); font-size: .8rem; font-weight: 400; margin-top: .1rem; }
.breakdown__subtotal th, .breakdown__subtotal td { border-top: 1px solid var(--line); color: var(--ink-2); }
.breakdown__markup td { color: var(--ok); }
.breakdown__total th, .breakdown__total td { border-bottom: 0; border-top: 2px solid var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; padding-top: .9rem; }
.breakdown__total td { font-family: var(--font-mono); font-weight: 400; color: var(--ok); font-size: 1.35rem; letter-spacing: -0.02em; }

.compare { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.compare__cell { padding: 1.1rem 1.15rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.compare__label { font-size: .85rem; color: var(--ink-2); line-height: 1.35; }
.compare__figure { font-size: clamp(1.6rem, 1rem + 2.4vw, 2.25rem); margin-top: .5rem; letter-spacing: -0.03em; line-height: 1.1; }
.compare__cell--wrong .compare__figure { color: var(--accent-2); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(var(--accent-2-rgb), .55); }
.compare__cell--right { border-color: var(--ok); background: var(--ok-soft); }
.compare__cell--right .compare__figure { color: var(--ok); }
.compare__line { grid-column: 1 / -1; color: var(--ink-2); font-size: .95rem; padding-top: .25rem; }

@media (min-width: 48em) {
  .math__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 3rem; }
  .compare { position: sticky; top: 1.5rem; } /* decorative only; nothing load-bearing */
}

/* ── Fit ───────────────────────────────────────────────────────── */
.fit { padding-block: var(--section-y); }
.fit__grid { display: grid; gap: 2rem; }
.fit__heading { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; padding-bottom: .6rem; border-bottom: 2px solid currentColor; margin-bottom: .9rem; display: inline-block; }
.fit__heading--for { color: var(--accent-ink); }
.fit__heading--not { color: var(--ink-3); }
.fit__list { list-style: none; padding: 0; display: grid; gap: .75rem; color: var(--ink-2); }
.fit__list li { position: relative; padding-left: 1.4rem; }
.fit__list li::before { content: ""; position: absolute; left: 0; top: .6em; width: .6rem; height: .6rem; border-radius: 2px; }
.fit__list--for li::before { background: var(--accent); }
.fit__list--not li::before { border: 1.5px solid var(--ink-3); }

@media (min-width: 48em) {
  .fit__grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* ── Founding CTA ───────────────────────────────────────────────── */
.cta { padding-block: var(--section-y); background: var(--dark); color: var(--on-dark); }
.cta .section-title { color: #fff; margin-bottom: 1rem; }
.cta__text { color: var(--on-dark-2); max-width: 46ch; font-size: 1.0625rem; }
.cta .waitlist, .cta .thanks { margin-top: 1.75rem; }
.waitlist--dark .waitlist__input { background: var(--dark-2); border-color: #333B48; color: #fff; }
.waitlist--dark .waitlist__input::placeholder { color: #7C8595; }
.waitlist--dark .waitlist__input:hover { border-color: #4B5566; }
.waitlist--dark .waitlist__input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46, 92, 255, .35); }
.waitlist--dark .waitlist__micro { color: var(--on-dark-2); }
.waitlist--dark .waitlist__error { color: #FF8A8A; }
.cta :focus-visible { box-shadow: 0 0 0 3px var(--dark), 0 0 0 6px var(--accent); }
.cta .thanks { background: var(--dark-2); border-color: #333B48; color: #fff; }
.cta .thanks p + p { color: var(--on-dark-2); }
.cta a { color: #9DB4FF; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer { padding-block: 2.25rem 3rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.site-footer__grid { display: grid; gap: .6rem; }
.site-footer__name strong { color: var(--ink); font-family: var(--font-display); letter-spacing: -0.01em; }
.site-footer__privacy { color: var(--ink-3); max-width: 60ch; }

@media (min-width: 48em) {
  .site-footer__grid { grid-template-columns: auto auto; justify-content: space-between; align-items: baseline; }
  .site-footer__privacy { grid-column: 1 / -1; }
}
