/* decodelabs.app — Ember on the web. Tokens from DESIGN.md; words obey BRAND_GUIDELINES.md. */

:root {
  --paper: #FDFBF7;
  --paper-tint: #F5F0E8;
  --card: #FFFFFF;
  --ink: #1C1917;
  --ink-soft: #57534E;
  --ink-faint: #A8A29E;
  --ember: #B45309;
  --ember-soft: #FEF3C7;
  --line: #E7E5E4;
  --pass: #15803D;
  --skip: #B91C1C;
  --amber-glow: #FBBF24;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-card: 18px;
  --radius-slab: 20px;
  --radius-row: 12px;
  --shadow: 0 6px 22px rgba(20, 20, 15, 0.07);

  --gutter: 20px;
  --measure: 1080px;
}

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

/* Width/height attributes reserve layout space; CSS widths then scale. Without
   height:auto the attribute height sticks and every image distorts. */
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

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

.display {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-optical-sizing: auto;
}
h1.display { font-size: clamp(36px, 6.2vw, 58px); }
h2.display { font-size: clamp(27px, 3.6vw, 36px); }

.dim { opacity: 0.42; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.eyebrow::before { content: "■ "; color: var(--ember); font-size: 8px; vertical-align: 2px; }

.sub { color: var(--ink-soft); font-size: 17px; max-width: 44ch; }
.micro { color: var(--ink-faint); font-size: 13px; }

/* ---------- nav ---------- */

.nav-shell { position: sticky; top: 12px; z-index: 50; padding: 0 var(--gutter); }
.nav {
  max-width: var(--measure); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px 10px 20px;
  box-shadow: 0 2px 12px rgba(20, 20, 15, 0.05);
}
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.wordmark em { font-style: normal; color: var(--ember); }
.wordmark .logo { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: block; }

.pill {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  color: #fff; background: var(--ember);
  border: 0; border-radius: 999px;
  padding: 11px 22px;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pill:hover { background: #96450a; }
.pill:active { transform: scale(0.98); }
.pill.small { font-size: 14px; padding: 9px 18px; }

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

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 88px; }
.hero .sub { margin-top: 20px; }

.phone-well {
  background: linear-gradient(160deg, #F5F0E8, #EFE7D8);
  border-radius: var(--radius-slab);
  padding: 28px;
  display: flex; justify-content: center;
}
.phone-shot {
  width: min(340px, 100%);
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(20, 20, 15, 0.12);
  display: block;
}

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

.waitlist { margin-top: 28px; max-width: 460px; }
.waitlist-row { display: flex; gap: 10px; }
.waitlist input[type="email"] {
  flex: 1; min-width: 0;
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.waitlist input[type="email"]::placeholder { color: var(--ink-faint); }
.waitlist input[type="email"]:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.waitlist .micro { margin-top: 10px; }
.waitlist .form-note { margin-top: 10px; font-size: 14px; }
.waitlist .form-note.ok { color: var(--pass); }
.waitlist .form-note.err { color: var(--skip); }

/* ---------- product cards (the Superpower-style numbered grid) ---------- */

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 36px; }
.card { margin: 0; }
.card-well {
  position: relative;
  background: linear-gradient(160deg, #F5F0E8, #EFE7D8);
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.card-well img {
  width: 82%; height: auto;
  display: block;
  margin: 12% auto 0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 20, 15, 0.14);
}
.card-num {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 9px;
}
.card h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 16px; }
.card figcaption p { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }

/* ---------- the old way: the evening's tally vs the verdict card ---------- */

.oldway {
  margin-top: 32px;
  background: var(--paper-tint);
  border-radius: var(--radius-slab);
  padding: 44px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: center;
}
.tally { list-style: none; }
.tally li {
  display: flex; gap: 20px; align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.tally time { flex: 0 0 66px; font-size: 11.5px; color: var(--ink-faint); }
.tally li.last { border-bottom: 0; }
.tally li.last span { color: var(--ink); font-weight: 500; }

.verdict-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.v-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.v-brand { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.v-pill { background: var(--pass); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 4px 15px; }
.v-line { font-family: var(--serif); font-weight: 600; font-size: 25px; letter-spacing: -0.015em; margin-top: 10px; }
.v-rows { margin-top: 16px; }
.v-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-soft);
}
.v-row b {
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.06em;
  color: var(--pass); white-space: nowrap;
}
.v-row b::after { content: " ●"; font-size: 8px; }
.v-receipt {
  margin-top: 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--ember);
  display: flex; gap: 20px; flex-wrap: wrap;
}
.v-caption { margin-top: 14px; font-size: 15px; font-weight: 500; color: var(--ink); }

/* ---------- moment band ---------- */

.moment {
  background: radial-gradient(130% 110% at 18% 0%, #9A3412, #7C2D12 38%, #431407 72%, #1C1917 100%);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-slab);
  margin: 24px var(--gutter) 0;
  padding: 64px 40px;
}
@media (min-width: 1120px) { .moment { margin: 24px auto 0; max-width: var(--measure); } }
.moment::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(55% 42% at 78% 26%, rgba(251, 146, 60, 0.42), transparent 68%);
  pointer-events: none;
}
.moment > * { position: relative; z-index: 1; }
/* The halftone plate (Shaders.metal, ported): painted once by JS over the same
   gradient, then the CSS bloom is dropped so it isn't doubled. Static — a verdict
   about someone's bloodwork should not shimmer. */
.moment .moment-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.moment.screened::after { display: none; }
.moment .eyebrow { color: rgba(255, 255, 255, 0.55); }
.moment h2 { color: #fff; margin-top: 14px; max-width: 27ch; }
.moment .quote-sub { color: rgba(255, 255, 255, 0.78); font-size: 17px; margin-top: 14px; max-width: 52ch; }
.receipt-row {
  margin-top: 26px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--amber-glow);
  display: flex; flex-wrap: wrap; gap: 8px 22px;
}

/* ---------- steps as ledger rows (the criterion-row grammar, page scale) ---------- */

.ledger-steps { list-style: none; margin-top: 36px; border-bottom: 1px solid var(--line); }
.ledger-steps li {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 32px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.ledger-steps .n {
  font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1;
  letter-spacing: -0.02em; color: var(--ink);
}
.ledger-steps .n em { font-style: normal; font-size: 15px; font-weight: 600; opacity: 0.35; margin-left: 1px; }
.ledger-steps h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.ledger-steps li > div > p { color: var(--ink-soft); font-size: 15.5px; margin-top: 6px; max-width: 54ch; }
.ledger-steps .stamp {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-faint); white-space: nowrap;
  padding-top: 10px;
}

/* ---------- honest chips + closing ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip {
  font-size: 14px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px;
  background: var(--card);
}
.chip::before { content: "✓ "; color: var(--pass); }

.closing { padding-top: 96px; padding-bottom: 96px; }
.closing .sub { margin-top: 16px; }

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

footer { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 24px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: baseline; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--ink); }
.disclosure { margin-top: 18px; font-size: 13px; color: var(--ink-faint); max-width: 62ch; }

/* ---------- sections ---------- */

section.block { padding-top: 88px; }
.section-head { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.section-head h2 { margin-top: 14px; }

/* ---------- reveal motion (killed under reduced motion) ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- legal / prose pages ---------- */

.prose-page { max-width: 720px; margin: 0 auto; padding: 48px var(--gutter) 96px; }
.prose-page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.02em; line-height: 1.15; }
.prose-page .updated { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-faint); margin-top: 12px; text-transform: uppercase; }
.prose-page h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: -0.01em; margin-top: 44px; }
.prose-page h3 { font-size: 15px; font-weight: 700; margin-top: 26px; }
.prose-page p, .prose-page li { color: var(--ink-soft); font-size: 15.5px; margin-top: 12px; }
.prose-page ul { padding-left: 22px; margin-top: 4px; }
.prose-page li { margin-top: 8px; }
.prose-page a { color: var(--ember); }
.prose-page strong { color: var(--ink); }
.prose-page table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14.5px; }
.prose-page th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.prose-page td { color: var(--ink-soft); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose-page .callout {
  background: var(--paper-tint); border-radius: var(--radius-card);
  padding: 20px 24px; margin-top: 20px;
}
.prose-page .callout p { margin-top: 0; }
.prose-page .callout p + p { margin-top: 10px; }

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

@media (max-width: 1060px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 64px; }
  .phone-well { padding: 20px; }
  .phone-well img { width: min(300px, 80%); }
  .oldway { grid-template-columns: 1fr; gap: 32px; padding: 28px 22px; }
  .ledger-steps li { grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; }
  .ledger-steps .n { font-size: 32px; }
  .ledger-steps .stamp { grid-column: 2; padding-top: 2px; white-space: normal; }
  .moment { padding: 48px 26px; }
  .moment h2 { font-size: clamp(24px, 5.5vw, 33px); }
  section.block { padding-top: 64px; }
  .closing { padding-top: 72px; padding-bottom: 72px; }
  h1.display { font-size: clamp(31px, 8vw, 58px); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; gap: 32px; }
  .card-well { aspect-ratio: 5 / 5; }
  .card-well img { width: 64%; }
  .waitlist-row { flex-direction: column; }
  .waitlist .pill { width: 100%; }
  .nav { padding: 8px 8px 8px 14px; }
  .wordmark { font-size: 17px; gap: 8px; }
  .wordmark .logo { width: 26px; height: 26px; }
  .pill.small { font-size: 13px; padding: 8px 14px; }
  .receipt-row { font-size: 11px; gap: 6px 16px; }
}
