/* Overthink This — landing page.
   Styled from the app itself: every token below is copied from
   frontend/src/theme.ts, and the components (Button, Card, Chip, Label,
   EditorialTag, NumberRule, OutcomeRow, VerdictHero, ExplainerStep,
   PlanCard) follow frontend/src/components.tsx and the result / welcome /
   paywall screens. Roboto is what the app renders in on Android. */

:root {
  /* palette.light */
  --background: #F1ECE3;
  --surface: #FBF8F2;
  --surface-muted: #E8E2D5;
  --primary: #3D3654;
  --primary-muted: #E6E3F8;
  --accent: #7F77DD;
  --text-primary: #161520;
  --text-secondary: #5A586B;
  --text-tertiary: #76748A; /* app: #8E8C9C — darkened to pass 4.5:1 on cream at web body sizes */
  --border: #D9D4C7;
  --border-strong: #B0AB9C;
  --best: #5C8A1F;
  --likely: #A86918;
  --worst: #C73A38;
  --in-control: #1D9E75;
  --out-control: #6F6E68;
  --ink: #161520;
  --on-ink: #FFFFFF;
  --ink-muted: #9C99B6;
  --ink-border: #3D3654;
  --on-text-primary: #FFFFFF;
  --ribbon: #E8B341;

  /* radii + shadows */
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 18px 44px -12px rgba(22, 21, 32, 0.28);

  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  --page: min(1120px, 100% - 44px);
}
@media (min-width: 760px) { :root { --page: min(1120px, 100% - 80px); } }

@media (prefers-color-scheme: dark) {
  :root {
    /* palette.dark */
    --background: #0F1115;
    --surface: #1A1D24;
    --surface-muted: #22252E;
    --primary: #F4F3F7;
    --primary-muted: #2B2845;
    --accent: #9B93EB;
    --text-primary: #F4F3F7;
    --text-secondary: #B4B2C2;
    --text-tertiary: #8E8CA5;
    --border: #2D3039;
    --border-strong: #3D404B;
    --best: #82C341;
    --likely: #E0922F;
    --worst: #FF6464;
    --in-control: #34C2A0;
    --out-control: #9D9A91;
    --ink: #1F1B33;
    --on-text-primary: #161520;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 18px 44px -12px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--text-primary); color: var(--on-text-primary); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 8px; }

/* ── Type (H1 / H2 / Body / Label / EditorialTag) ────────────────── */
h1, h2, h3 { font-weight: 900; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 7.4vw, 5.5rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; }
h3 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800; }
/* Text_Italic in the app: italic, weight 800 */
h1 em, h2 em, .plan em { font-style: italic; font-weight: 800; }

.label {
  font-weight: 800; font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 14px;
}
.tag {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.tag .no { font-weight: 700; font-size: 0.875rem; letter-spacing: 0; margin-right: 8px; }
.fine { font-size: 0.8125rem; line-height: 1.5; color: var(--text-tertiary); }
.center { text-align: center; }

/* ── Button (pill, ink fill, weight 800) ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text-primary); color: var(--on-text-primary);
  border: 1px solid var(--text-primary);
  border-radius: 999px;
  font-weight: 800; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1rem; }
.btn-md { min-height: 44px; padding: 0 20px; font-size: 0.875rem; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { opacity: 1; background: var(--surface-muted); }
.btn-on-ink { background: #fff; color: #161520; border-color: #fff; }

/* ── Chip ────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; align-self: flex-start;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface-muted); color: var(--text-secondary);
  font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
}
.chip.info { background: var(--primary-muted); color: var(--primary); }

/* ── Icon circle (paywall feature rows) ──────────────────────────── */
.ico {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-muted); color: var(--text-primary);
}
.ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 28px; height: 28px; }
.ico.sm svg { width: 14px; height: 14px; stroke-width: 2.4; }

/* ── Top bar ─────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-in { width: var(--page); margin: 0 auto; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 10px; }
/* Masthead in the app: weight 900, 11px, letter-spacing 4 */
.brand span { font-weight: 900; font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; }
.top nav { display: none; gap: 30px; }
.top nav a { font-size: 0.9375rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: 10px 0; transition: color 0.16s ease; }
.top nav a:hover { color: var(--text-primary); }
@media (min-width: 900px) { .top nav { display: flex; } }
@media (max-width: 400px) { .brand span { letter-spacing: 0.18em; font-size: 0.6875rem; } }

/* ── Hero ────────────────────────────────────────────────────────── */
main > section { width: var(--page); margin: 0 auto; }
.hero { display: grid; gap: 72px; align-items: center; padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero h1 { margin-top: 20px; }
.lede { margin-top: 22px; font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; color: var(--text-secondary); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero .fine { margin-top: 18px; }
@media (min-width: 980px) { .hero { grid-template-columns: 1.08fr 0.92fr; gap: 40px; } }

.hero-device { position: relative; justify-self: center; width: min(100%, 372px); }
.peek { position: absolute; z-index: 0; width: 46%; right: -17%; top: -13%; transform: rotate(9deg); }
@media (max-width: 520px) { .peek { right: -4%; width: 38%; top: -11%; } }

.device {
  position: relative; z-index: 1;
  padding: 10px;
  background: #161520;
  border-radius: 46px;
  box-shadow: var(--shadow-pop), inset 0 0 0 1.5px #3D3654;
}
.device-screen {
  background: var(--background);
  border-radius: 37px;
  padding: 22px 16px 26px;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.device-screen > * { flex: none; }
.app-top { display: flex; align-items: center; justify-content: space-between; }
.app-top .circle { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; }
.app-top svg { width: 17px; height: 17px; fill: none; stroke: var(--text-primary); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app-top .chips { display: flex; gap: 8px; }
.filed { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 14px 16px; }
.filed strong { display: block; font-weight: 900; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.03em; }
.rule-label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-family: var(--mono); font-weight: 700; font-size: 0.5625rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-tertiary); }
.rule-label i { width: 18px; height: 1px; background: var(--text-primary); }

/* ── VerdictHero ("The take") ────────────────────────────────────── */
.take { background: var(--ink); color: var(--on-ink); border-radius: var(--r-xl); padding: 26px 20px 28px; text-align: center; }
.take-tag { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-muted); }
.take p { margin-top: 12px; font-weight: 900; font-size: 1.375rem; line-height: 1.32; letter-spacing: -0.035em; }
.take p b { color: var(--ink-muted); font-size: 1.3em; line-height: 0; font-weight: 900; }
.take-lg { padding: clamp(30px, 4vw, 44px) clamp(22px, 3.4vw, 40px) clamp(34px, 4.4vw, 48px); box-shadow: var(--shadow-pop); }
.take-lg p { font-size: clamp(1.5rem, 2.5vw, 1.875rem); min-height: 5.3em; }
.take.swap p { animation: land 0.42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes land { from { opacity: 0; transform: translateY(10px) scale(1.03); } }

/* ── OutcomeRow ──────────────────────────────────────────────────── */
.orow {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 18px 18px 24px;
  box-shadow: var(--shadow-card);
}
.orow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.orow.best { --c: var(--best); }
.orow.likely { --c: var(--likely); }
.orow.worst { --c: var(--worst); }
.orow-main, .orow.mini { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.orow strong { display: block; margin-top: 8px; font-weight: 800; font-size: 1.1875rem; line-height: 1.26; letter-spacing: -0.02em; }
.orow > p { margin-top: 12px; color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.47; }
.orow > p.reality { border-left: 2px solid var(--border-strong); padding-left: 12px; font-style: italic; font-size: 0.8125rem; line-height: 1.4; color: var(--text-tertiary); }
/* NumberRule: "01 ━━ BEST CASE" */
.nrule { display: flex; align-items: center; gap: 10px; color: var(--c); font-weight: 800; font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; }
.nrule b { font-family: var(--mono); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.12em; }
.nrule i { width: 22px; height: 2px; background: var(--c); }
.pct { flex: none; text-align: right; font-family: var(--mono); font-weight: 700; font-size: 2.25rem; line-height: 1; letter-spacing: -0.04em; color: var(--c); }
.pct small { display: block; margin-top: 2px; font-weight: 400; font-size: 0.625rem; letter-spacing: 0.2em; text-transform: uppercase; }
.orow.mini { padding: 14px 14px 14px 20px; box-shadow: none; }
.orow.mini strong { font-size: 0.9375rem; margin-top: 6px; }
.orow.mini .pct { font-size: 1.75rem; }
.orow.mini .pct small { font-size: 0.5rem; }
.orow.mini .nrule { font-size: 0.5625rem; }

/* ── Section blocks ──────────────────────────────────────────────── */
.block { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--border); }
.block > h2, .spiral-head h2 { max-width: 16em; }

/* ExplainerStep */
.steps { display: grid; gap: 14px; margin-top: 32px; }
.steps li { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.steps .n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 0.875rem; }
.steps strong { font-weight: 900; font-size: 1.125rem; letter-spacing: -0.02em; }
.steps p { margin-top: 2px; font-size: 0.9375rem; line-height: 1.4; color: var(--text-secondary); }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } .steps li { align-items: flex-start; } }

/* The spiral */
.spiral-grid { display: grid; gap: 28px; margin-top: 36px; align-items: start; }
.spiral-left, .spiral-right { display: grid; gap: 14px; }
.as-written { border-block: 1px solid var(--border-strong); padding: 18px 0 20px; }
.as-written .label { margin-bottom: 10px; }
.written { font-style: italic; font-size: 1.1875rem; line-height: 1.5; }
.hashtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.hashtags span { padding: 4px 10px; border-radius: 999px; background: var(--surface-muted); font-family: var(--mono); font-size: 0.6875rem; color: var(--text-secondary); }
.tone-pick { margin-top: 14px; }
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tone-grid button {
  text-align: left; min-height: 68px; padding: 14px;
  background: var(--surface); color: var(--text-primary);
  border: 1.5px solid var(--border); border-radius: var(--r-lg);
  font: inherit; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.tone-grid button:hover { border-color: var(--border-strong); }
.tone-grid strong { display: block; font-weight: 800; font-size: 0.9375rem; letter-spacing: -0.015em; }
.tone-grid span { display: block; margin-top: 2px; font-size: 0.75rem; line-height: 1.3; color: var(--text-secondary); }
.tone-grid button[aria-checked="true"] { background: var(--text-primary); border-color: var(--text-primary); color: var(--on-text-primary); }
.tone-grid button[aria-checked="true"] span { color: inherit; opacity: 0.72; }
.control { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.control > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.control .label { margin-bottom: 8px; font-size: 0.625rem; }
.control .label.in { color: var(--in-control); }
.control .label.out { color: var(--out-control); }
.control li { font-size: 0.9375rem; line-height: 1.4; padding: 4px 0; }
@media (min-width: 940px) {
  .spiral-grid { grid-template-columns: 0.94fr 1.06fr; gap: 40px; }
  .spiral-left { position: sticky; top: 96px; }
}
@media (max-width: 480px) { .control { grid-template-columns: 1fr; } }

/* Feature tiles (Card) */
.tiles { display: grid; gap: 14px; margin-top: 32px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-card);
}
.tile h3 { margin-top: 18px; }
.tile p { margin: 6px 0 18px; font-size: 0.9375rem; line-height: 1.47; color: var(--text-secondary); }
.tile .chip { margin-top: auto; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* Plans (PlanCard; Pro is the inverted "flagship" card with a ribbon) */
.plans { display: grid; gap: 22px; margin-top: 36px; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(24px, 3vw, 34px); box-shadow: var(--shadow-card); }
.plan header h3 { font-weight: 900; font-size: 1.75rem; letter-spacing: -0.035em; }
.plan header p { margin-top: 2px; font-style: italic; color: var(--text-secondary); }
.plan ul { margin-top: 22px; border-top: 1px solid var(--border); }
.plan li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 1rem; line-height: 1.35; }
.plan-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-pop); }
.plan-ink header p { color: var(--ink-muted); }
.plan-ink header em { color: var(--on-ink); }
.plan-ink ul, .plan-ink li { border-color: var(--ink-border); }
.plan-ink .ico { background: var(--ink-border); color: var(--on-ink); }
.plan-ink .fine { margin-top: 20px; color: var(--ink-muted); }
.ribbon { position: absolute; top: -11px; right: 22px; background: var(--ribbon); color: #1A1209; padding: 6px 12px; border-radius: 999px; font-weight: 900; font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; }
@media (min-width: 820px) { .plans { grid-template-columns: 1fr 1.12fr; align-items: start; } }

/* Not therapy */
.care { display: grid; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(24px, 4vw, 48px); }
.care img { width: 132px; }
.care h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
.care p:not(.label) { margin-top: 14px; color: var(--text-secondary); max-width: 40em; }
.care strong { color: var(--text-primary); }
.care a { color: var(--text-primary); font-weight: 700; }
@media (min-width: 760px) { .care { grid-template-columns: 190px 1fr; gap: 48px; } .care img { width: 190px; } }

/* FAQ */
.qa { margin-top: 28px; display: grid; gap: 10px; max-width: 820px; }
.qa details { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.qa summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 14px 20px; cursor: pointer; list-style: none; font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.015em; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--text-tertiary); border-bottom: 2px solid var(--text-tertiary); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.2s ease; }
.qa details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.qa details p { padding: 0 20px 20px; color: var(--text-secondary); max-width: 44em; }

/* Closing (ink hero card) */
.closing { padding: 0 0 clamp(48px, 7vw, 88px); }
.closing-card { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); border-radius: var(--r-xl); padding: clamp(40px, 7vw, 88px) clamp(24px, 5vw, 72px); box-shadow: var(--shadow-pop); }
.closing-card h2 { font-size: clamp(2.2rem, 6vw, 4.25rem); max-width: 9em; margin-bottom: 32px; position: relative; }
.closing-card .btn { position: relative; }
.closing-card img { position: absolute; right: clamp(16px, 5vw, 72px); bottom: -6%; width: clamp(170px, 24vw, 290px); background: radial-gradient(circle at 50% 56%, #EDE5D8 0 57%, transparent 58%); }
@media (max-width: 700px) { .closing-card { padding-bottom: 230px; } .closing-card img { right: 50%; transform: translateX(50%); bottom: -20px; width: 190px; } }

/* Footer */
.foot { width: var(--page); margin: 0 auto; padding: 0 0 56px; }
.signed { text-align: center; padding: 16px 0 44px; border-top: 1px solid var(--border); }
.sig { margin-top: 4px; font-style: italic; font-weight: 800; font-size: 1.375rem; }
.foot-grid { display: grid; gap: 28px; padding: 32px 0; border-block: 1px solid var(--border); font-size: 0.9375rem; color: var(--text-secondary); }
.foot nav { display: grid; gap: 4px; align-content: start; }
.foot nav a { padding: 5px 0; text-decoration: none; }
.foot nav a:hover, .foot-grid p a:hover { color: var(--text-primary); text-decoration: underline; }
.foot > .fine { margin-top: 18px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }

/* Otto is drawn in black: give him a paper disc in the dark theme */
@media (prefers-color-scheme: dark) {
  .peek, .care img { background: radial-gradient(circle at 50% 56%, #E9E0D2 0 58%, transparent 59%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
