/* Wit — public site. Shared by every page. Plain CSS, no build step. */

/* ------------------------------------------------------------------ tokens */
:root {
  /* brand (fixed, from the app) */
  --ink: #2B1B2E;
  --crimson: #C8283F;
  --indigo: #4B2A7B;
  --parchment: #FBF3E2;
  --parchment-edge: #E8D6B4;
  --face: #F7E8D4;
  --gold-hi: #FFD66B;
  --gold-lo: #D99A1E;

  /* theme (light) */
  --bg: #F6ECD6;
  --bg-deep: #EFE1C4;
  --surface: #FFF9EE;
  --text: #2B1B2E;
  --muted: #5B465C;
  --accent: #B3203A;          /* crimson tuned for text on parchment */
  --accent-2: #4B2A7B;
  --line: rgba(43, 27, 46, .16);
  --line-strong: rgba(43, 27, 46, .55);
  --shadow: 0 10px 30px rgba(43, 20, 40, .12);
  --spot: rgba(255, 214, 107, .38);
  --focus: #4B2A7B;

  --display: "IM Fell English", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --radius: 16px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1320;
    --bg-deep: #150E19;
    --surface: #251A2C;
    --text: #F3E8D3;
    --muted: #CDBCC7;
    --accent: #F2788A;
    --accent-2: #B99BEA;
    --line: rgba(243, 232, 211, .14);
    --line-strong: rgba(243, 232, 211, .5);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --spot: rgba(255, 214, 107, .16);
    --focus: #FFD66B;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--parchment); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* motley band: crimson / indigo diamonds, used sparingly as a divider */
.motley {
  height: 20px; border: 0; margin: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M10 0L20 10L10 20L0 10Z' fill='%23C8283F'/%3E%3Cpath d='M30 0L40 10L30 20L20 10Z' fill='%234B2A7B'/%3E%3Ccircle cx='20' cy='10' r='2.4' fill='%23E9B23C'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: center;
  opacity: .9;
}
.motley.thin { height: 12px; background-size: 24px 12px; opacity: .75; }

.eyebrow {
  font-variant: small-caps; letter-spacing: .12em; font-size: .95rem;
  color: var(--accent); margin-bottom: .6em; display: block;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 42em; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 1rem/1.2 var(--serif); letter-spacing: .01em;
  padding: 13px 22px; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--ink); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  min-height: 48px;
}
.btn-primary { background: var(--crimson); color: #FFF8EC; box-shadow: 0 3px 0 var(--ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); text-decoration: none; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }
.btn-small { padding: 8px 16px; min-height: 40px; font-size: .95rem; }
@media (prefers-color-scheme: dark) {
  .btn-primary { border-color: #0d0710; box-shadow: 0 3px 0 #0d0710; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 1.7rem; color: var(--text); text-decoration: none; line-height: 1;
}
.brand svg { width: 40px; height: 30px; flex: none; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: 1rem; }
.nav a:hover { color: var(--accent); }
.site-header .btn { margin-left: 4px; }
@media (max-width: 820px) {
  .nav { display: none; }
  .site-header .btn { margin-left: auto; }
}

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 6vw, 64px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 32px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-bottom: 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fine { font-size: .92rem; color: var(--muted); margin-top: 14px; }

.stage {
  position: relative; height: 500px;
  display: flex; justify-content: center; align-items: flex-end;
}
.stage::before { /* a warm spotlight behind the fool */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 420px; height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--spot), transparent 100%);
  pointer-events: none;
}
.stage-floor {
  position: absolute; left: 50%; bottom: 10px; width: min(340px, 90%); height: 2px;
  transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.wit-btn {
  position: relative; z-index: 2; padding: 0; margin: 0 0 6px; border: 0; background: none;
  cursor: pointer; border-radius: 50%; line-height: 0;
}
.wit-btn svg { width: 260px; height: auto; display: block; }

.stage .bubble {
  position: absolute; z-index: 3;
  bottom: 326px; left: 50%; transform: translateX(-50%);
  width: min(360px, 100%);
  --tail: 50%;
}
.stage .bubble.poked { animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pop { 0% { transform: translateX(-50%) scale(.94) } 100% { transform: translateX(-50%) scale(1) } }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .stage { height: 385px; }
  .wit-btn svg { width: 190px; }
  .stage .bubble { bottom: 246px; }
}

/* ------------------------------------------------------------------ bubble (identical to the app) */
.bubble {
  position: relative; box-sizing: border-box;
  padding: 13px 17px 14px;
  background: var(--parchment);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 1px 0 var(--parchment-edge) inset, 0 8px 22px rgba(25, 10, 35, .28);
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 16.5px; line-height: 1.38; letter-spacing: .005em;
  --tail: 74px;
}
.bubble::after, .bubble::before {
  content: ""; position: absolute; left: var(--tail); bottom: -13px;
  margin-left: -12px;
  border: 12px solid transparent; border-bottom: 0; border-top-color: var(--ink);
}
.bubble::after { bottom: -9.5px; margin-left: -10px; border-width: 10px; border-bottom: 0; border-top-color: var(--parchment); }
.bubble p { margin: 0; }
.bubble p::first-letter { font-size: 1.5em; line-height: 1; color: var(--crimson); font-weight: 700; }
.stage .bubble p { min-height: 1.38em; }
.caret { display: inline-block; width: 1px; }

/* ------------------------------------------------------------------ the jester (scoped copy of the app's styles) */
.wit { overflow: visible; filter: drop-shadow(0 3px 5px rgba(20, 10, 30, .28)); }
.wit .body { animation: bob 3.4s ease-in-out infinite; transform-origin: 100px 200px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-6px) rotate(-1.2deg) } }
.wit .shadow { fill: rgba(30, 15, 40, .18); animation: shadow 3.4s ease-in-out infinite; transform-origin: 100px 222px; }
@keyframes shadow { 0%, 100% { transform: scaleX(1) } 50% { transform: scaleX(.85); opacity: .7 } }
.wit .crimson { fill: var(--crimson); }
.wit .indigo { fill: var(--indigo); }
.wit .cheek { fill: #F29A9A; opacity: .45; }
.wit .pupil circle { fill: var(--ink); }
.wit .pupil .glint { fill: #fff; }
.wit .pupil { transition: transform .12s ease-out; }
.wit .lid { fill: var(--face); stroke: var(--ink); stroke-width: 2; transform-box: fill-box; transform-origin: top; transform: scaleY(var(--lid, 0)); transition: transform .18s; }
.wit.blink .lid { transform: scaleY(1); transition-duration: .06s; }
.wit .brow { fill: none; stroke: var(--ink); stroke-width: 3.6; stroke-linecap: round; transform-box: fill-box; transform-origin: center; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.wit .mouth { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wit .mouth.open { fill: #7A1F33; }
.wit .bell { transform-box: view-box; animation: sway 4s ease-in-out infinite; }
.wit .bell:nth-of-type(2) { animation-delay: -1.3s; }
.wit .bell:nth-of-type(3) { animation-delay: -2.6s; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) } }
.wit.talking .bell { animation: jingle .32s ease-in-out infinite; }
@keyframes jingle { 0%, 100% { transform: rotate(-14deg) } 50% { transform: rotate(14deg) } }
.wit.mood-amused { --lid: 0; } .wit.mood-amused .brow { transform: translateY(-3px); }
.wit.mood-smug { --lid: .38; } .wit.mood-smug .browL { transform: translateY(2px) rotate(4deg); } .wit.mood-smug .browR { transform: translateY(-6px) rotate(-8deg); }
.wit.mood-sleepy { --lid: .62; } .wit.mood-sleepy .brow { transform: translateY(3px); }
.wit .zzz text { font: italic 700 16px Georgia, serif; fill: var(--indigo); opacity: 0; }
.wit.away .zzz text { animation: zzz 3s ease-in infinite; }
.wit.away .zzz text:nth-child(2) { animation-delay: 1s; }
.wit.away .zzz text:nth-child(3) { animation-delay: 2s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 8px) } 30% { opacity: .9 } 100% { opacity: 0; transform: translate(10px, -14px) } }
@media (prefers-color-scheme: dark) { .wit .zzz text { fill: #B99BEA; } }
@media (prefers-reduced-motion: reduce) {
  .wit .body, .wit .shadow, .wit .bell, .wit.talking .bell, .wit.away .zzz text, .stage .bubble.poked { animation: none !important; }
  .wit.away .zzz text { opacity: .8; }
}

/* ------------------------------------------------------------------ fool's creed */
.creed { background: var(--bg-deep); text-align: center; }
.creed blockquote { margin: 0 auto; max-width: 30em; }
.creed blockquote p { font-family: var(--display); font-size: clamp(1.5rem, 3.2vw, 2.2rem); line-height: 1.3; margin: 0 0 .6em; }
.creed blockquote p::first-letter { color: var(--accent); }
.creed cite { font-style: normal; color: var(--muted); font-size: 1rem; }

/* ------------------------------------------------------------------ how it works */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; counter-reset: step; }
.steps li {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 22px 80px; counter-increment: step;
}
.steps li::before, .steps li::after {
  position: absolute; left: 24px; top: 26px; width: 38px; height: 38px;
}
.steps li::before { /* the diamond */
  content: ""; background: var(--indigo); border: 2px solid var(--ink);
  transform: rotate(45deg); border-radius: 6px;
}
.steps li::after { /* the numeral, upright */
  content: counter(step, upper-roman);
  display: grid; place-items: center; line-height: 1;
  font-family: var(--display); font-size: 1.05rem; color: #FFF8EC;
}
.steps li:nth-child(even)::before { background: var(--crimson); }
.steps h3 { margin-bottom: .35em; }
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { padding: 22px 20px 20px 74px; }
  .steps li::before, .steps li::after { left: 20px; top: 24px; }
}

.manners { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.manners li {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-size: .95rem; color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

/* ------------------------------------------------------------------ roasts */
.roasts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 24px; align-items: start; }
.roast { margin: 0; }
.roast .bubble { --tail: 38px; margin: 0; }
.roast figcaption { margin: 20px 0 0 12px; font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.roast figcaption::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--crimson); transform: rotate(45deg); border: 1.5px solid var(--ink); border-radius: 2px; }
.roast:nth-child(even) figcaption::before { background: var(--indigo); }
.roast.featured { grid-column: 1 / -1; }
.roast.featured .bubble { font-size: 1.2rem; padding: 20px 24px; max-width: 760px; }
@media (max-width: 900px) { .roasts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .roasts { grid-template-columns: 1fr; } .roast.featured .bubble { font-size: 1.05rem; padding: 16px 18px; } }

/* ------------------------------------------------------------------ privacy summary */
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.card h3 { margin-bottom: .5em; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: .6em; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px;
  background: var(--accent-2); transform: rotate(45deg);
}
.ticks.no li::before { background: var(--accent); }
@media (max-width: 760px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ pricing */
.pricing { background: var(--bg-deep); position: relative; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px 26px;
}
.plan.featured { border: 2px solid var(--ink); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .plan.featured { border-color: var(--gold-hi); } }
.plan .ribbon {
  position: absolute; top: -14px; left: 26px;
  background: var(--crimson); color: #FFF8EC; font-size: .85rem; letter-spacing: .08em; font-variant: small-caps;
  padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink);
}
.plan h3 { font-size: 1.6rem; margin-bottom: .2em; }
.plan .tagline { color: var(--muted); font-size: 1rem; min-height: 3em; }
.price { font-family: var(--display); font-size: 3rem; line-height: 1; margin: 10px 0 4px; }
.price small { font-family: var(--serif); font-size: 1rem; color: var(--muted); }
.price-alt { color: var(--muted); font-size: .98rem; margin-bottom: 18px; min-height: 1.6em; }
.price-alt strong { color: var(--accent); font-weight: 600; }
.plan .ticks { margin-bottom: 24px; flex: 1; font-size: 1rem; }
.plan-cta { display: grid; gap: 10px; }
.plan-cta .btn { width: 100%; }
.pricing-notes { margin-top: 28px; color: var(--muted); font-size: .95rem; max-width: 52em; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } .plan .tagline { min-height: 0; } }

/* ------------------------------------------------------------------ faq */
.faq { max-width: 800px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-family: var(--display); font-size: 1.35rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: var(--accent); transform: rotate(45deg) scale(.7); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg) scale(1); background: var(--accent-2); }
.faq details > div { padding: 0 0 20px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ closing CTA */
.closing { text-align: center; }
.closing .bubble { display: inline-block; max-width: 520px; text-align: left; margin-bottom: 30px; --tail: 50%; }
.closing .cta-row { justify-content: center; }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--ink); color: #E9DCC6; padding: 0 0 36px; font-size: .95rem; }
.site-footer a { color: #F3E8D3; }
.site-footer .motley { margin-bottom: 36px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid h2 { font-size: 1.2rem; margin-bottom: .6em; color: #F3E8D3; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .4em; }
.site-footer .brand { color: #F3E8D3; margin-bottom: 10px; }
.site-footer .legal { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(243, 232, 211, .16); color: #BFAFBF; font-size: .88rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ legal pages */
.doc { padding: clamp(40px, 7vw, 80px) 0 80px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.doc h2 { font-size: 1.7rem; margin-top: 1.8em; }
.doc h3 { font-size: 1.25rem; margin-top: 1.4em; }
.doc .updated { color: var(--muted); font-size: .95rem; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .45em; }
.doc .summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--crimson); border-radius: 10px; padding: 18px 22px; margin: 24px 0 8px; }
.doc .summary p:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .98rem; margin: 1em 0 1.4em; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.doc code { font-size: .92em; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.doc a { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.lost .bubble { display: inline-block; max-width: 420px; text-align: left; --tail: 50%; margin-bottom: 18px; }
.lost svg.wit { width: 170px; height: auto; display: block; margin: 0 auto 24px; }

kbd {
  font: 600 .82em/1 var(--serif); padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text);
  white-space: nowrap;
}
section[id], [id].doc h2 { scroll-margin-top: 80px; }
