/* ==========================================================================
   Whodunly — marketing landing page
   Cozy-noir gaslight. Tokens mirror the app (whodunly-screens.html).
   ========================================================================== */

:root {
  --gaslight: #0E1412;            /* deep banker's-lamp green-black */
  --gaslight-2: #141C19;          /* raised surfaces on dark */
  --gaslight-3: #1C2622;          /* face-down evidence cards */
  --parchment: #F6F0E3;           /* case-file paper */
  --parchment-bright: #FDFAF2;
  --parchment-edge: #E3D8C2;      /* aged paper edge */
  --ink: #2A2320;                 /* text on paper */
  --ink-soft: #5C5248;
  --brass: #C79A4B;               /* accents, numerals, CTAs */
  --brass-soft: #8C7443;
  --wax: #93222C;                 /* the seal */
  --wax-deep: #6E1820;
  --sage: #8FA08D;                /* secondary text on dark */
  --moon: #E9E4D6;                /* primary text on dark */
  --hairline: rgba(199, 154, 75, 0.2);
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Spectral', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 60px;
}

/* ---------- reset & base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--gaslight);
  color: var(--moon);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: var(--brass); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--wax); color: var(--parchment-bright); }

.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;
}

/* ---------- atmosphere: lamplight, vignette, grain ---------- */

body::before {
  /* gaslamp glow top-left + vignette */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 18% -8%, rgba(199, 154, 75, 0.10), transparent 62%),
    radial-gradient(900px 600px at 88% 112%, rgba(147, 34, 44, 0.07), transparent 60%),
    radial-gradient(140% 110% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}

body::after {
  /* film grain */
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
}

.q { color: var(--brass); }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--moon);
  margin: 12px 0 14px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn-brass {
  background: var(--brass);
  color: #241C0E;
  box-shadow: 0 10px 22px rgba(199, 154, 75, 0.25);
}

.btn-brass:hover { background: #D3A85C; box-shadow: 0 14px 28px rgba(199, 154, 75, 0.33); }

.btn-ghost {
  background: transparent;
  color: var(--moon);
  border: 1px solid rgba(233, 228, 214, 0.25);
}

.btn-ghost:hover { border-color: rgba(233, 228, 214, 0.5); }

.btn:active { transform: translateY(1px); }

.btn[disabled] { opacity: 0.55; cursor: wait; }

.btn-small { font-size: 14px; padding: 8px 16px; border-radius: 10px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(14, 20, 18, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.topbar.scrolled {
  border-bottom-color: var(--hairline);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--moon);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wordmark-glass { font-size: 17px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 110px) clamp(20px, 4vw, 40px) clamp(56px, 8vh, 96px);
}

.hero-copy .eyebrow { display: block; margin-bottom: 6px; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 7.4vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--moon);
  margin: 10px 0 18px;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--sage);
  max-width: 34em;
  margin-bottom: 30px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.microline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  margin-top: 22px;
}

/* ---------- the framed app preview ---------- */

.hero-media { display: flex; justify-content: center; }

.frame {
  position: relative;
  width: min(310px, 84vw);
  border-radius: 34px;
  background: linear-gradient(180deg, var(--gaslight-3), var(--gaslight-2));
  border: 1px solid var(--hairline);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(233, 228, 214, 0.06);
  padding: 11px 11px 15px;
}

.hero .frame { transform: rotate(-1.6deg); }

.frame video {
  aspect-ratio: 9 / 18;
  width: 100%;
  border-radius: 24px;
  position: relative;
  z-index: 1;
  object-fit: cover;
  background: transparent;
}

.frame-placeholder {
  /* parchment sits behind the video until footage exists / loads */
  position: absolute;
  top: 11px; left: 11px; right: 11px;
  aspect-ratio: 9 / 18;
  border-radius: 24px;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--parchment-bright) 0%, var(--parchment) 55%, var(--parchment-edge) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.frame-placeholder-glass { font-size: 44px; filter: sepia(0.4); }

.frame-placeholder-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.9;
}

.frame-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
  padding: 12px 8px 0;
}

/* ---------- sections shared shell ---------- */

.how, .features, .demo, .waitlist {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 104px) clamp(20px, 4vw, 40px);
  text-align: center;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

/* ---------- how it works ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 28px);
  margin-top: clamp(30px, 5vh, 48px);
  text-align: left;
}

.step-card {
  position: relative;
  background: linear-gradient(180deg, var(--parchment-bright) 0%, var(--parchment) 62%, var(--parchment-edge) 100%);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 34px 24px 26px;
  box-shadow: var(--shadow);
}

.step-card::before {
  /* wax file-tab, like the app's dossier */
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 46px;
  height: 9px;
  background: var(--wax);
  border-radius: 0 0 3px 3px;
  opacity: 0.85;
}

.step-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: var(--brass);
  margin-bottom: 10px;
}

.step-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

/* ---------- features ---------- */

.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 22px);
  margin-top: clamp(30px, 5vh, 48px);
  text-align: left;
}

.feature-card {
  background: var(--gaslight-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(199, 154, 75, 0.4);
}

.feature-icon {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: var(--brass);
  margin-bottom: 14px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--moon);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--sage);
}

/* ---------- demo ---------- */

.demo .frame {
  margin: clamp(30px, 5vh, 48px) auto 0;
  width: min(360px, 88vw);
}

.frame-demo .frame-caption { line-height: 2; }

.grid-chip {
  display: inline-block;
  margin-left: 10px;
  letter-spacing: 0.08em;
  background: var(--gaslight);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 2px 8px;
}

/* ---------- waitlist ---------- */

.waitlist { padding-bottom: clamp(72px, 12vh, 130px); }

.wax-seal {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #A93540 0%, var(--wax) 45%, var(--wax-deep) 100%);
  border: 2px solid #C99;
  box-shadow: 0 12px 30px rgba(147, 34, 44, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wax-seal span { font-size: 30px; filter: grayscale(1) brightness(2.4) sepia(0.25); }

.waitlist-sub {
  color: var(--sage);
  font-size: 17px;
  max-width: 30em;
  margin: 0 auto 30px;
}

#waitlist-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

#waitlist-email {
  flex: 1 1 280px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--parchment-bright), var(--parchment));
  border: 1px solid var(--brass-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
}

#waitlist-email::placeholder { color: var(--ink-soft); opacity: 0.7; }

#waitlist-email:focus-visible { outline-offset: 1px; }

#waitlist-msg {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--sage);
  margin-top: 18px;
  min-height: 1.4em;
}

#waitlist-msg.ok { color: var(--brass); }

#waitlist-msg.err { color: #D98A93; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 44px 20px 56px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--sage);
}

.footer p { margin: 6px 0; }

.footer-brand,
.footer a.footer-brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  color: var(--moon);
  text-decoration: none;
  cursor: pointer;
  margin: 6px 0 12px;
  transition: color 160ms ease;
}

.footer a.footer-brand:hover {
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer a { color: var(--sage); text-underline-offset: 3px; }

.footer a:hover { color: var(--brass); }

.footer-links a { text-decoration: none; }

.footer-links a:hover { text-decoration: underline; }

/* ---------- legal pages (/terms, /privacy) ---------- */

.legal-main {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(36px, 7vh, 72px) clamp(16px, 4vw, 40px) clamp(56px, 9vh, 96px);
}

.legal-sheet {
  /* a case-file sheet: ink on parchment for long-form readability (AA+) */
  position: relative;
  background: linear-gradient(180deg, var(--parchment-bright) 0%, var(--parchment) 70%, var(--parchment-edge) 100%);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 60px) clamp(36px, 6vw, 64px);
}

.legal-sheet::before {
  /* wax file-tab, same motif as the step cards */
  content: "";
  position: absolute;
  top: 0;
  left: clamp(24px, 6vw, 56px);
  width: 46px;
  height: 9px;
  background: var(--wax);
  border-radius: 0 0 3px 3px;
  opacity: 0.85;
}

.legal-sheet > * { max-width: 65ch; }

.legal-eyebrow { color: var(--wax); }

.legal-sheet h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 10px 0 6px;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.legal-sheet h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
}

.legal-sheet h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17.5px;
  margin: 24px 0 8px;
}

.legal-sheet p,
.legal-sheet li {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
}

.legal-sheet p { margin: 0 0 14px; }

.legal-sheet ul,
.legal-sheet ol {
  margin: 0 0 14px;
  padding-left: 1.3em;
}

.legal-sheet li { margin-bottom: 8px; }

.legal-sheet li::marker { color: var(--brass-soft); }

.legal-sheet a {
  color: var(--wax);
  text-decoration-color: rgba(147, 34, 44, 0.45);
  text-underline-offset: 3px;
}

.legal-sheet a:hover { color: var(--wax-deep); }

.legal-sheet hr {
  border: 0;
  border-top: 1px solid var(--parchment-edge);
  margin: 30px 0;
}

.legal-note {
  /* clearly-marked pre-launch note */
  background: rgba(199, 154, 75, 0.13);
  border: 1px solid rgba(140, 116, 67, 0.45);
  border-left: 4px solid var(--brass-soft);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 28px;
}

.legal-note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6E5A33; /* darkened brass — AA on the tinted note background */
  margin-bottom: 6px;
}

.legal-note p { margin: 0; font-size: 14.5px; }

/* ---------- reveal-on-scroll (motion-safe, JS present only) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  html.js .reveal.in {
    opacity: 1;
    transform: none;
  }

  html.js .step-card.reveal:nth-child(2),
  html.js .feature-card.reveal:nth-child(3n + 2) { transition-delay: 90ms; }

  html.js .step-card.reveal:nth-child(3),
  html.js .feature-card.reveal:nth-child(3n) { transition-delay: 180ms; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .feature-card { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 48px;
  }

  .hero-copy .lede { margin-left: auto; margin-right: auto; }

  .cta-row { justify-content: center; }

  .hero .frame { transform: rotate(0deg); }

  .steps, .feature-grid { grid-template-columns: 1fr; }

  .steps { max-width: 460px; margin-left: auto; margin-right: auto; }

  .feature-grid { max-width: 460px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 861px) and (max-width: 1060px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
