/* Postlingo landing. Tokens and rules in DESIGN.md. */
:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.975 0.004 245);
  --line: oklch(0.92 0.006 245);
  --ink: oklch(0.21 0.012 250);
  --muted: oklch(0.47 0.02 250);
  --blue: oklch(0.665 0.157 243);
  --blue-ink: oklch(0.5 0.15 250);
  --blue-deep: oklch(0.47 0.14 252);
  --blue-button: oklch(0.55 0.16 248); /* white text 4.8:1 */
  --blue-band: oklch(0.52 0.15 250); /* white text 5.4:1 */
  --flame: oklch(0.72 0.19 45);
  --flame-deep: oklch(0.55 0.17 40);
  --done: oklch(0.68 0.16 158);
  --white: oklch(1 0 0);
  --x-card: oklch(1 0 0);
  --font-display: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */
  --gutter: clamp(16px, 4vw, 48px);
  --z-sticky: 10;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0 0 0);
    --surface: oklch(0.2 0.008 250);
    --line: oklch(0.31 0.008 250);
    --ink: oklch(0.93 0.004 250);
    --muted: oklch(0.7 0.015 250);
    --blue-ink: oklch(0.75 0.13 243);
    --x-card: oklch(0.13 0.006 250);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { body { font-size: 18px; } }
img, svg { display: block; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 999px; z-index: 20; }
.skip:focus { top: 8px; }

/* ---------- pills, like X ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 16px/1 var(--font-ui); text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.pill:active { transform: scale(0.98); }
.pill-blue { background: var(--blue-button); color: var(--white); }
.pill-blue:hover { background: var(--blue-deep); }
.pill-ink { background: var(--ink); color: var(--bg); }
.pill-ink:hover { background: color-mix(in oklch, var(--ink) 85%, var(--bg)); }
.pill-white { background: var(--white); color: var(--blue-deep); }
.pill-white:hover { background: oklch(0.95 0.02 243); }
.pill-line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.wide { width: 100%; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 24px; padding: 12px var(--gutter);
  background: color-mix(in oklch, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 700 1.25rem/1 var(--font-display); }
.brand .spark { width: 26px; height: 26px; fill: var(--blue); }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.top .pill { min-height: 38px; padding: 0 18px; font-size: 15px; }
@media (max-width: 720px) { .top nav { display: none; } .top .pill { margin-left: auto; } }

main > section { padding: clamp(64px, 10vw, 128px) var(--gutter); max-width: 1240px; margin: 0 auto; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); align-items: center; padding-top: clamp(40px, 7vw, 96px) !important; }
@media (min-width: 980px) { .hero { grid-template-columns: 1.05fr 1fr; } }
.kicker { font-weight: 700; color: var(--blue-ink); margin-bottom: 18px; font-size: 16px; }
.lede { margin-top: 22px; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 34em; }
.cta { margin-top: 30px; max-width: 520px; }
.micro { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- stages and X mocks ---------- */
.stage { position: relative; border-radius: 28px; padding: clamp(20px, 3.5vw, 44px); }
.stage-blue { background: var(--blue); }
.stage-flame { background: var(--flame); }
.stage-soft { background: var(--surface); border: 1px solid var(--line); }
.stage-note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.stage-note.dark { color: oklch(0.32 0.06 40); }

.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: linear-gradient(135deg, oklch(0.8 0.08 243), oklch(0.62 0.13 260)); }
.x-composer, .x-variants > div, .x-post, .x-panel, .habit-card {
  background: var(--x-card); color: var(--ink); border-radius: 18px; font-family: var(--font-ui);
}
.x-composer { padding: 16px 16px 10px; box-shadow: 0 18px 40px oklch(0.3 0.12 250 / 0.28); }
.xc-row { display: flex; gap: 12px; }
.xc-body { flex: 1; min-width: 0; }
.lang-chip { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: oklch(0.665 0.157 243 / 0.12); color: var(--blue-ink); font-size: 13px; font-weight: 700; }
.xc-text { min-height: 9.8em; font-size: 19px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.xc-text.english { color: var(--ink); }
.xc-text .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -0.15em; background: var(--blue); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.xc-toolbar { display: flex; align-items: center; gap: 2px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.xi { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--blue); }
.xi svg { width: 19px; height: 19px; fill: currentColor; }
.xi.gif { font: 700 11px var(--font-ui); border: 1.6px solid currentColor; width: 22px; height: 17px; border-radius: 4px; margin: 0 6px; }
.sparkle { background: oklch(0.665 0.157 243 / 0.1); }
.sparkle svg { width: 21px; height: 21px; overflow: visible; }
.sparkle .s1, .sparkle .s2 { transform-box: fill-box; transform-origin: center; }
.sparkle.busy .s1 { animation: twinkle 1s ease-in-out infinite; }
.sparkle.busy .s2 { animation: twinkle 1s ease-in-out 0.5s infinite; }
@keyframes twinkle { 50% { transform: scale(0.6) rotate(45deg); opacity: 0.45; } }
.sparkle.hit { animation: hit 420ms var(--ease); }
@keyframes hit { 40% { transform: scale(1.25); background: oklch(0.665 0.157 243 / 0.25); } }
.ring-mini { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; font: 700 13px var(--font-ui); color: var(--muted); }
.ring-mini svg { width: 17px; height: 17px; transform: rotate(-90deg); }
.ring-mini circle { fill: none; stroke-width: 2.5; stroke: var(--line); }
.ring-mini .fg { stroke: var(--blue); stroke-dasharray: 44; stroke-dashoffset: 17.6; stroke-linecap: round; }
.xc-post { margin-left: auto; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; }

.x-variants { display: grid; gap: 10px; margin-top: 14px; min-height: 19rem; align-content: start; }
.x-variants > div {
  padding: 12px 14px; font-size: 15px; line-height: 1.4; white-space: pre-line;
  box-shadow: 0 10px 28px oklch(0.3 0.12 250 / 0.2);
  opacity: 0; transform: translateY(10px); transition: opacity 380ms var(--ease), transform 380ms var(--ease);
}
.x-variants > div.in { opacity: 1; transform: none; }
.x-variants .v-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.x-variants .v-head .use { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); }
.x-variants > div.picked { box-shadow: 0 0 0 3px var(--blue-deep), 0 10px 28px oklch(0.3 0.12 250 / 0.2); }
.x-variants > div.picked .use { background: var(--blue); color: var(--white); }

/* ---------- problem ---------- */
.problem { display: grid; gap: 28px; }
@media (min-width: 980px) { .problem { grid-template-columns: 1fr 1fr; gap: 64px; } }
.prose { display: grid; gap: 18px; max-width: 62ch; }
.prose .strong, .strong { font-weight: 700; color: var(--ink); font-size: 1.12em; }
.problem .prose p:first-child { color: var(--muted); }

/* ---------- how ---------- */
.how h2 { max-width: 16ch; }
.steps { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 36px; counter-reset: s; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps li { display: grid; gap: 10px; align-content: start; }
.step-n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--blue); color: var(--white); font: 800 1.3rem var(--font-display); margin-bottom: 6px; }
.steps p { color: var(--muted); }
.note { margin-top: 32px; color: var(--muted); font-size: 0.95em; }

/* ---------- split sections ---------- */
.split { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
@media (min-width: 980px) { .split { grid-template-columns: 0.9fr 1.1fr; } .split.reverse .split-copy { order: 2; } .split.reverse { grid-template-columns: 1.1fr 0.9fr; } }
.split-copy { display: grid; gap: 18px; max-width: 58ch; }
.split-copy p { color: var(--muted); }
.split-copy .note { margin-top: 4px; color: var(--ink); font-weight: 600; }

.struck { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.struck li { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.struck s { text-decoration-thickness: 2px; text-decoration-color: oklch(0.6 0.2 25); }

.before-after { margin: 0; display: grid; gap: 16px; align-items: center; }
@media (min-width: 700px) { .before-after { grid-template-columns: 1fr auto 1.15fr; } }
.ba-draft { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px dashed var(--line); }
.ba-draft figcaption { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.ba-draft p { font-size: 16px; color: var(--ink); }
.ba-arrow { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; background: var(--blue); }
.ba-arrow svg { width: 24px; height: 24px; fill: var(--white); }
.x-post { padding: 18px 18px 14px; border: 1px solid var(--line); display: grid; gap: 10px; box-shadow: 0 16px 40px oklch(0.3 0.06 250 / 0.12); }
.x-post header { display: flex; align-items: center; gap: 8px; }
.x-post header .avatar { width: 34px; height: 34px; }
.x-post .handle { color: var(--muted); font-size: 15px; }
.x-post p { font-size: 16px; }
.ba-label { font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); }

/* hot panel mock */
.x-panel { border: 1px solid var(--line); overflow: hidden; box-shadow: 0 16px 40px oklch(0.3 0.06 250 / 0.12); font-size: 15px; }
.xp-top { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.xp-top span { color: var(--muted); font-size: 13px; }
.xp-row { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.xp-row:last-child { border-bottom: 0; }
.xp-head { display: flex; gap: 8px; align-items: baseline; }
.xp-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.xp-post { color: var(--muted); font-size: 14px; }
.xp-reply { padding: 10px 12px; border-radius: 12px; background: oklch(0.665 0.157 243 / 0.08); }
.xp-act { display: flex; justify-content: flex-end; gap: 6px; }
.xp-act .pill { min-height: 30px; padding: 0 14px; font-size: 13px; }
.x-bar {
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; margin: 16px auto 0;
  padding: 6px 6px 6px 8px; border-radius: 999px; background: var(--x-card); border: 1px solid var(--line);
  box-shadow: 0 8px 24px oklch(0.3 0.06 250 / 0.14); font: 700 14px var(--font-ui); flex-wrap: wrap;
}
.x-bar .hot { padding: 7px 12px; border-radius: 999px; background: oklch(0.72 0.19 45 / 0.16); }
.x-bar .pill { min-height: 32px; padding: 0 14px; font-size: 14px; }

/* habit */
.habit-card { padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; grid-template-columns: auto 1fr; align-items: center; box-shadow: 0 18px 40px oklch(0.35 0.14 40 / 0.3); }
.big-ring { position: relative; width: clamp(120px, 16vw, 150px); aspect-ratio: 1; }
.big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.big-ring circle { fill: none; stroke-width: 11; }
.big-ring .bg { stroke: var(--line); }
.big-ring .fg { stroke: var(--done); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 0; transition: stroke-dashoffset 900ms var(--ease), stroke 300ms; }
.big-ring.filling .fg { stroke: var(--blue); }
.big-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big-ring-in b { font: 800 2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.big-ring-in span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.burst { position: absolute; left: 50%; top: 50%; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); opacity: 0; }
.burst i:nth-child(even) { background: var(--flame); border-radius: 50%; }
.burst.go i { animation: burst 800ms var(--ease) forwards; }
.burst i:nth-child(1) { --a: 0deg; } .burst i:nth-child(2) { --a: 45deg; } .burst i:nth-child(3) { --a: 90deg; } .burst i:nth-child(4) { --a: 135deg; }
.burst i:nth-child(5) { --a: 180deg; } .burst i:nth-child(6) { --a: 225deg; } .burst i:nth-child(7) { --a: 270deg; } .burst i:nth-child(8) { --a: 315deg; }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateX(40px); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(110px) scale(0.4); } }
.habit-meta { display: grid; gap: 6px; }
.streak { font: 800 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--font-display); }
.streak b { font-variant-numeric: tabular-nums; }
.shield { color: var(--muted); font-size: 15px; }
.toast { justify-self: start; margin-top: 6px; padding: 6px 12px; border-radius: 999px; background: oklch(0.68 0.16 158 / 0.15); color: oklch(0.42 0.12 158); font-weight: 700; font-size: 14px; }
@media (prefers-color-scheme: dark) { .toast { color: oklch(0.8 0.14 158); } }
.week { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.week div { padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.week dt { font-size: 12px; color: var(--muted); }
.week dd { margin: 0; font: 800 1.3rem var(--font-display); font-variant-numeric: tabular-nums; }
.habit-card .stage-note { grid-column: 1 / -1; margin: 0; color: var(--muted); }
@media (max-width: 480px) { .habit-card { grid-template-columns: 1fr; justify-items: start; } }

/* ai */
.ai h2 { max-width: 18ch; }
.ai-grid { margin-top: 36px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) { .ai-grid { grid-template-columns: 1.1fr 0.9fr; } }
.ai .prose p { color: var(--muted); }
.ai .prose p + p { color: var(--ink); font-weight: 600; }
.flow { display: grid; gap: 0; justify-items: center; }
.node { width: min(100%, 320px); padding: 16px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: center; display: grid; gap: 2px; }
.node span { color: var(--muted); font-size: 14px; }
.link { position: relative; height: 70px; width: 2px; background: linear-gradient(var(--blue), var(--blue)) center / 2px 100% no-repeat; }
.link span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--blue-ink); }
.link::after { content: ""; position: absolute; left: -5px; bottom: -2px; border: 6px solid transparent; border-top-color: var(--blue); }

/* price */
.price { display: grid; justify-items: center; text-align: center; gap: 32px; }
.price-card { width: min(100%, 440px); padding: 32px; border-radius: 28px; border: 2px solid var(--blue); background: var(--bg); text-align: left; display: grid; gap: 16px; }
.plan { font-weight: 700; color: var(--muted); }
.amount b { font: 800 3.6rem/1 var(--font-display); letter-spacing: -0.02em; }
.amount span { color: var(--muted); font-weight: 600; margin-left: 6px; }
.price-card ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.price-card li { padding-left: 30px; position: relative; }
.price-card li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z' fill='white'/%3E%3C/svg%3E") center / 14px no-repeat; }
.price .micro { text-align: center; margin-top: 0; }

/* maker */
.maker { max-width: 760px !important; display: grid; gap: 18px; }
.maker p { font-size: 1.1em; color: var(--muted); }

/* faq */
.faq { max-width: 820px !important; }
.faq h2 { margin-bottom: 28px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-weight: 700; font-size: 1.08em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 600 1.6rem/1 var(--font-display); color: var(--blue-ink); transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 64ch; }

/* final */
.final { max-width: none !important; background: var(--blue-band); color: var(--white); text-align: center; display: grid; justify-items: center; gap: 18px; }
.final h2 { max-width: 18ch; }
.final p { color: var(--white); font-size: 1.1em; }
.final .cta { width: min(100%, 520px); margin-top: 12px; }

/* footer */
.foot { padding: 32px var(--gutter) 48px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; color: var(--muted); font-size: 14px; max-width: 1240px; margin: 0 auto; }
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .x-variants > div { opacity: 1; transform: none; }
}

/* demo variants: 3 lines each, the picked one goes into the box */
.x-variants .v-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
