/* Thrum landing — Resonant Journal. Light warm paper, art-directed to the lead theme
   (the landing does not switch with the OS; the dark counterpart is reserved for the
   product — see docs/DESIGN.md §14). Visual system: docs/DESIGN.md. Token source: design/tokens.json. */

/* ---- Fonts (self-hosted, subset latin) ---- */
@font-face { font-family: 'Fraunces'; src: url('/public/fonts/fraunces-var-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; font-style: normal; }
@font-face { font-family: 'Literata'; src: url('/public/fonts/literata-400-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; font-style: normal; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/public/fonts/ibm-plex-mono-400-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; font-style: normal; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/public/fonts/ibm-plex-mono-500-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; font-style: normal; }

/* ---- Tokens (light — lead) ---- */
:root {
  --color-bg: #E8E1D3; --color-surface: #F4EFE6; --color-surface-raised: #FCFAF5; --color-surface-sunken: #DED6C6;
  --color-text: #1C1A17; --color-text-muted: #5E574B; --color-text-faint: #8A8273;
  --color-hairline: #DAD3C5; --color-hairline-strong: #C4BBA9;
  --color-accent: #7E2B1E; --color-accent-hover: #6A2317; --color-on-accent: #F6F1E8;
  --color-brass: #8A6E27; --color-ink-green: #2E3A34;

  /* dark plates (showcase, footer) — constant, do not flip with theme */
  --plate-bg: #15110C; --plate-text: #EDE7DC; --plate-muted: #B0A795; --plate-faint: #847C6D;
  --plate-hairline: #322A20; --plate-accent: #D2604A; --plate-brass: #C7A04B;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-prose: 'Literata', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-display-1: clamp(2.5rem, 1.35rem + 4.8vw, 4.75rem);
  --text-display-2: clamp(1.875rem, 1.25rem + 2.6vw, 3.3125rem);
  --text-title:     clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
  --text-subtitle:  clamp(1.0625rem, 0.99rem + 0.4vw, 1.3125rem);
  --text-body:      clamp(1.03rem, 1rem + 0.18vw, 1.125rem);
  --text-small:     clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --text-label:     clamp(0.75rem, 0.72rem + 0.1vw, 0.8125rem);

  --radius-sm: 3px; --radius-md: 6px; --radius-lg: 10px;
  --gutter: 20px;
  --container: 1248px;
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

/* The landing is art-directed to the light lead theme — no prefers-color-scheme: dark
   override here (DESIGN.md §14). The dark counterpart lives in design/tokens.json +
   DESIGN.md §2.2 for the product. The showcase + footer stay constant dark plates via
   the --plate-* tokens above, regardless of OS theme. */

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-prose); font-size: var(--text-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--color-accent); color: var(--color-on-accent); }

.shell { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--color-accent); color: var(--color-on-accent); padding: 10px 16px; border-radius: var(--radius-md); z-index: 50; font-family: var(--font-mono); font-size: var(--text-small); }
.skip-link:focus { left: 16px; top: 16px; }

:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- Seal ---- */
.seal { width: 34px; height: 34px; color: var(--color-accent); flex: none; }

/* ---- Masthead ---- */
.masthead { border-bottom: 1.5px solid var(--color-hairline-strong); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.lockup-word { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; letter-spacing: -0.01em; color: var(--color-text); }
.masthead-kicker { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.12em; color: var(--color-text-faint); }
@media (max-width: 520px) { .masthead-kicker { display: none; } }

/* ---- Hero ---- */
.hero { padding-block: clamp(48px, 9vw, 104px) clamp(36px, 6vw, 64px); }
.hero-inner { display: flex; flex-direction: column; align-items: flex-start; }
.eyebrow { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 24px; }
.hero-headline { font-family: var(--font-display); font-weight: 900; font-size: var(--text-display-1); line-height: 1.04; letter-spacing: -0.02em; color: var(--color-text); margin-bottom: 24px; }
.standfirst { font-family: var(--font-prose); font-size: var(--text-subtitle); line-height: 1.52; color: var(--color-text-muted); max-width: 42ch; }

/* ---- Form ---- */
.form { margin-top: 28px; width: 100%; max-width: 540px; }
.form-row { display: flex; gap: 12px; align-items: stretch; }
.input-wrapper { flex: 1 1 auto; display: flex; }
.input { width: 100%; background: var(--color-surface); border: 1.5px solid var(--color-hairline-strong); border-radius: var(--radius-md); padding: 14px 18px; min-height: 50px; font-family: var(--font-mono); font-size: 0.95rem; color: var(--color-text); transition: border-color .15s ease; }
.input::placeholder { color: var(--color-text-faint); }
.input:focus { outline: none; border-color: var(--color-accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--color-accent); color: var(--color-on-accent); font-family: var(--font-mono); font-weight: 500; font-size: 0.875rem; letter-spacing: 0.02em; padding: 14px 26px; min-height: 50px; border: none; border-radius: var(--radius-md); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease; }
.button:hover { background: var(--color-accent-hover); }
.form-note { margin-top: 14px; font-family: var(--font-mono); font-size: var(--text-label); color: var(--color-text-faint); letter-spacing: 0.01em; }
.form-feedback { margin-top: 8px; font-family: var(--font-mono); font-size: var(--text-label); min-height: 1em; }
.form-feedback.is-error { color: var(--color-accent); }
.form-feedback.is-success { color: var(--color-ink-green); }
.is-done .form-row, .is-done .form-note, .is-done .form-feedback { display: none; }

.form-done { margin-top: 4px; }
.form-done-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); color: var(--color-text); }
.form-done-tick { color: var(--color-accent); }
.form-done-body { margin-top: 8px; color: var(--color-text-muted); max-width: 46ch; }
.form-done-body a { color: var(--color-accent); }

.enrich { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--color-hairline); max-width: 540px; }
.enrich-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.enrich-intro { font-family: var(--font-prose); font-size: var(--text-small); color: var(--color-text-muted); }
.enrich-progress { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.08em; color: var(--color-text-faint); }
.enrich-label { display: block; font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.04em; color: var(--color-text); margin-bottom: 10px; }
.enrich-row { display: flex; gap: 12px; align-items: stretch; }
.enrich-row.align-end { align-items: flex-end; }
.enrich-textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.enrich-skip { margin-top: 12px; background: none; border: none; padding: 0; font-family: var(--font-mono); font-size: var(--text-label); color: var(--color-text-faint); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.enrich-skip:hover { color: var(--color-text-muted); }
.enrich-thanks { font-family: var(--font-display); font-weight: 600; font-size: var(--text-subtitle); color: var(--color-text); }

/* ---- Resonance signature ---- */
.resonance { width: 100%; max-width: 540px; height: 44px; margin-top: 36px; }
.resonance-base { stroke: var(--color-hairline); stroke-width: 1.5; }
.resonance-wave { stroke: var(--color-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Showcase plate ---- */
.showcase { position: relative; overflow: hidden; background: var(--plate-bg); }
.showcase-media { position: relative; height: clamp(340px, 46vw, 560px); overflow: hidden; }
/* LQIP blur-up: a ~24px placeholder painted under the <img> so the plate is
   never an empty box while the full WebP streams in on mobile data. */
.showcase-media::before { content: ""; position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; filter: blur(18px); transform: scale(1.12); }
.showcase-media--road::before { background-image: url("data:image/webp;base64,UklGRooAAABXRUJQVlA4IH4AAABQBACdASoYABEAPwFsrE6rJiQiMAgBYCAJZQDCgCHYIlnv3TSbbirsVm0sAPjPDfBxdGwk4K+e0wqapWv/faUBz6PB59oFmw1ZrQW8qlPMFIID/hq3/mFCMJF3g1wMCsvm//UhTb46aSkpIrbgj2w68HPwBoD/+Lb5XgaAAAA="); background-position: 50% 62%; }
.showcase-media--dhaba::before { background-image: url("data:image/webp;base64,UklGRn4AAABXRUJQVlA4IHIAAABwBACdASoYABEAPwFoqk6rJaOiMAgBYCAJYwCCSQiueGfv0QWLACT+KeHmgAD+8MhvQkwPwhvFrYHrJhrUyBvgYAk0jBJ+3fXdXnu1TYXtqvgJR/k+XqEKOsd3AQXmrCFR5iBPYGNEQLdiWZMMszDwAAA="); background-position: 50% 50%; }
.showcase-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.showcase-img--road { object-position: 50% 62%; }
.showcase-cap { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 28px 32px; background: rgba(14, 11, 7, 0.55); }
.showcase-cap-row { display: flex; align-items: flex-end; }
.showcase-plate { display: block; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.1em; color: var(--plate-muted); margin-bottom: 8px; }
.showcase-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 1rem + 2.4vw, 2.625rem); letter-spacing: -0.015em; color: var(--plate-text); }

/* ---- Sections ---- */
.section { padding-block: clamp(72px, 10vw, 100px); }
.kicker { display: block; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 32px; }

/* Pillars */
.pillars { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 768px) { .pillars { grid-template-columns: repeat(3, 1fr); gap: 44px; } }
.pillar { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.pillar-rule { width: 30px; height: 2.5px; background: var(--color-accent); border-radius: 2px; transition: width .25s ease; }
.pillar.is-active .pillar-rule { width: 52px; }
.pillar-folio { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.08em; color: var(--color-brass); }
.pillar-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); line-height: 1.14; letter-spacing: -0.01em; color: var(--color-text); }
.pillar-body { font-family: var(--font-prose); font-size: var(--text-body); line-height: 1.5; color: var(--color-text-muted); }

/* Manifesto */
.manifesto { background: var(--color-surface-sunken); padding-block: clamp(80px, 11vw, 120px); }
.manifesto-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; max-width: 720px; margin-inline: auto; }
.manifesto-orn { width: 140px; height: 26px; }
.manifesto-orn path { stroke: var(--color-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.manifesto-quote { font-family: var(--font-display); font-weight: 600; font-size: var(--text-display-2); line-height: 1.1; letter-spacing: -0.02em; color: var(--color-text); }
.manifesto-support { font-family: var(--font-prose); font-size: var(--text-subtitle); line-height: 1.52; color: var(--color-text-muted); max-width: 46ch; }

/* About / prose */
.about-body { max-width: 760px; }
.prose p { font-family: var(--font-prose); font-size: var(--text-body); line-height: 1.62; color: var(--color-text-muted); max-width: 68ch; }
.prose p + p { margin-top: 1.1em; }

/* FAQ */
.faq { list-style: none; padding: 0; max-width: 760px; }
.faq-item { padding-block: 26px; border-bottom: 1px solid var(--color-hairline); }
.faq-item:first-child { border-top: 1px solid var(--color-hairline); }
.faq-q { font-family: var(--font-display); font-weight: 600; font-size: var(--text-subtitle); color: var(--color-text); margin-bottom: 10px; }
.faq-a { font-family: var(--font-prose); font-size: var(--text-body); line-height: 1.55; color: var(--color-text-muted); max-width: 64ch; }

/* Closing */
.closing { padding-block: clamp(80px, 11vw, 120px); }
.closing-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; max-width: 640px; margin-inline: auto; }
.closing-seal { width: 56px; height: 56px; color: var(--color-accent); }
.closing-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-display-2); line-height: 1.1; letter-spacing: -0.015em; color: var(--color-text); }
.closing-body { font-family: var(--font-prose); font-size: var(--text-subtitle); line-height: 1.52; color: var(--color-text-muted); }
.closing .button { margin-top: 8px; }

/* ---- Footer ---- */
.site-footer { background: var(--plate-bg); color: var(--plate-text); padding-block: 56px 36px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-lockup .seal { color: var(--plate-accent); width: 30px; height: 30px; }
.footer-lockup .lockup-word { color: var(--plate-text); font-size: 1.35rem; }
.footer-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
@media (min-width: 768px) { .footer-links { align-items: flex-end; } }
.footer-link { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--plate-text); text-decoration: none; }
.footer-link:hover { color: var(--plate-accent); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--plate-hairline); }
.footer-meta { font-family: var(--font-mono); font-size: var(--text-label); color: var(--plate-faint); }

/* ---- Mobile form stacking ---- */
@media (max-width: 560px) {
  .form-row { flex-direction: column; }
  .button { width: 100%; }
  .enrich-row { flex-direction: column; }
  .enrich-row .button { width: 100%; }
}

/* ---- About detail (instrument inset) ---- */
.about-detail { margin: 0 0 22px; }
.about-detail img { display: block; width: 100%; height: auto; border: 1px solid var(--color-hairline-strong); border-radius: var(--radius-md); }
.about-detail figcaption { margin-top: 8px; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-label); letter-spacing: 0.1em; color: var(--color-text-faint); }
@media (min-width: 768px) { .about-detail { float: right; width: 300px; margin: 4px 0 16px 40px; } }

/* ---- Motion: scroll reveal (the page turns) ----
   Fine-grained (per item, not per block), triggered just-before entry in JS, with a
   gentle ease-out so sections glide up rather than pop in. */
.reveal-on .pillar,
.reveal-on .manifesto-inner,
.reveal-on .about-detail,
.reveal-on .prose p,
.reveal-on .faq-item,
.reveal-on .closing-inner {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .85s cubic-bezier(.16, 1, .3, 1);
}
.reveal-on .is-in { opacity: 1 !important; transform: none !important; }
.reveal-on .pillar:nth-child(2) { transition-delay: .09s; }
.reveal-on .pillar:nth-child(3) { transition-delay: .18s; }
.reveal-on .prose p:nth-child(2) { transition-delay: .07s; }
.reveal-on .resonance-wave, .reveal-on .manifesto-orn path { stroke-dasharray: 2000; stroke-dashoffset: 2000; }

/* Showcase plate reveal — a settle, not a parallax */
.reveal-on .showcase .showcase-img { transform: scale(1.05); opacity: 0; transition: transform 1.2s var(--easing-decelerate), opacity .9s ease; }
.reveal-on .showcase.is-in .showcase-img { transform: scale(1); opacity: 1; }
.reveal-on .showcase .showcase-cap { opacity: 0; transition: opacity .8s ease .2s; }
.reveal-on .showcase.is-in .showcase-cap { opacity: 1; }

/* The mark's needle finds rest, once, on load */
.seal-anim .ig-needle { transform-box: view-box; transform-origin: 50% 50%; }
.reveal-on .seal-anim .ig-needle { animation: needle-settle 900ms cubic-bezier(.2,.7,.2,1) 250ms both; }
@keyframes needle-settle { from { transform: rotate(-26deg); } to { transform: rotate(0); } }

/* ---- Reduced motion: show everything, animate nothing ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal-on .pillar, .reveal-on .manifesto-inner, .reveal-on .about-detail, .reveal-on .prose p, .reveal-on .faq-item, .reveal-on .closing-inner,
  .reveal-on .showcase .showcase-img, .reveal-on .showcase .showcase-cap { opacity: 1 !important; transform: none !important; }
  .seal-anim .ig-needle { animation: none !important; transform: none !important; }
  .reveal-on .resonance-wave, .reveal-on .manifesto-orn path { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
}
