@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/newsreader.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/newsreader-italic.woff2) format('woff2');
}

/* Paper and ink, taken from the app's own light and dark themes. */
:root {
  --bg: #f7f4ee;
  --paper: #fffdf9;
  --sunk: #efeae0;
  --txt: #1f1c17;
  --mut: #6b6355;
  --faint: #9a9182;
  --rule: #e3dccf;
  --rule-2: #d2c9b8;
  --accent: #3346d3;
  --accent-2: #4257f0;
  --accent-soft: rgba(51, 70, 211, .1);
  --mark: #fbe7a1;
  --code-bg: #f3eee5;
  --c-note: #2f6feb; --c-tip: #1a7f37; --c-warn: #9a6700;
  --tok-k: #a3268c; --tok-s: #1f7a4d;
  --shadow: 0 30px 80px -24px rgba(40, 30, 10, .32), 0 6px 18px rgba(40, 30, 10, .08);
  --ink-blend: multiply;
  --grain: .07;

  --read: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --ui: 'Geist', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --out: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.2, 1.35, .4, 1);
  --gut: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121318; --paper: #17191f; --sunk: #1d2027; --txt: #e9e5dc; --mut: #a39d90; --faint: #6f6b62;
    --rule: #262933; --rule-2: #353946; --accent: #8f9dff; --accent-2: #a5b0ff; --accent-soft: rgba(143, 157, 255, .13);
    --mark: rgba(250, 204, 21, .28); --code-bg: #1d2027; --c-note: #6ea8ff; --c-tip: #56d364; --c-warn: #e3b341;
    --tok-k: #ff7ab8; --tok-s: #7ee2a8;
    --shadow: 0 40px 90px -20px rgba(0, 0, 0, .8), 0 6px 18px rgba(0, 0, 0, .4);
    --ink-blend: screen; --grain: .05; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121318; --paper: #17191f; --sunk: #1d2027; --txt: #e9e5dc; --mut: #a39d90; --faint: #6f6b62;
  --rule: #262933; --rule-2: #353946; --accent: #8f9dff; --accent-2: #a5b0ff; --accent-soft: rgba(143, 157, 255, .13);
  --mark: rgba(250, 204, 21, .28); --code-bg: #1d2027; --c-note: #6ea8ff; --c-tip: #56d364; --c-warn: #e3b341;
  --tok-k: #ff7ab8; --tok-s: #7ee2a8;
  --shadow: 0 40px 90px -20px rgba(0, 0, 0, .8), 0 6px 18px rgba(0, 0, 0, .4);
  --ink-blend: screen; --grain: .05; color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--txt); -webkit-font-smoothing: antialiased; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font: 400 17px/1.6 var(--ui); background: var(--bg); color: var(--txt); overflow-x: hidden; transition: background .5s, color .5s; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
pre, textarea, .tbl, code, kbd { font-variant-ligatures: none; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.label { color: var(--faint); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 18px; }
em { font-family: var(--read); font-style: italic; font-weight: 400; }
code { font: .86em var(--mono); background: var(--code-bg); border: 1px solid var(--rule); border-radius: 5px; padding: .08em .35em; }
kbd {
  display: inline-grid; place-items: center; min-width: 1.75em; height: 1.6em; padding: 0 .4em;
  font: 500 .78em/1 var(--mono); color: var(--txt); background: var(--paper);
  border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: .38em; vertical-align: .1em;
}

.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 60; opacity: var(--grain); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; } }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: 14px var(--gut); transition: background .4s, box-shadow .4s;
}
.top.scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 23px/1 var(--read); letter-spacing: -.01em; }
.brand-drop { width: 22px; height: 22px; fill: var(--accent); transition: transform .5s var(--spring); }
.brand:hover .brand-drop { transform: translateY(2px) scale(1.08); }
.top-nav { display: flex; gap: 4px; margin-left: auto; }
.top-nav a { padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--mut); text-decoration: none; transition: color .2s, background .2s; }
.top-nav a:hover { color: var(--txt); background: var(--accent-soft); }
.top-nav .top-cta { color: var(--paper); background: var(--txt); }
.top-nav .top-cta:hover { color: var(--paper); background: var(--accent); }
.top-tools { display: flex; gap: 8px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--rule); }
.seg button, .seg span[data-k] {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 0; border-radius: 7px; background: none;
  font: 500 13px/1 var(--ui); color: var(--mut); cursor: pointer; transition: color .2s, background .25s, box-shadow .25s;
}
.seg svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--txt); }
.seg [aria-pressed="true"], .seg .on { color: var(--txt); background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--rule); }
.seg-icons button { padding: 5px 7px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 120px var(--gut) 80px; overflow: hidden; }
.ink {
  position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: var(--ink-blend); cursor: crosshair;
  /* Ink soaks out towards the edges instead of stopping at a hard line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 62%, transparent 100%), linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, #000 0, #000 62%, transparent 100%), linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%); mask-composite: intersect;
}
/* The words sit on the paper: clicks fall through to the ink, only the buttons stay live. */
.hero-copy { position: relative; max-width: 980px; text-align: center; pointer-events: none; user-select: none; -webkit-user-select: none; }
.hero-copy :is(a, button) { pointer-events: auto; }
.kicker { color: var(--mut); margin: 0 0 26px; }
/* Entrance in CSS, not GSAP: it holds from the first paint, so the text never flashes before the scripts load. */
.hero-copy > * { animation: hero-in 1.1s var(--out) both; animation-delay: calc(.45s + var(--i, 0) * .09s); }
.hero-copy > :nth-child(2) { --i: 1; }
.hero-copy > :nth-child(3) { --i: 2; }
.hero-copy > :nth-child(4) { --i: 3; }
.hero-copy > :nth-child(5) { --i: 4; }
@keyframes hero-in { from { opacity: 0; transform: translateY(28px); } }
/* A halo of bare paper around the letters: the ink bleeds around the print instead of over it. */
.hero-copy { --halo: 0 0 1px var(--bg), 0 0 5px var(--bg), 0 0 12px var(--bg), 0 0 22px var(--bg); }
.hero h1 { text-shadow: 0 0 2px var(--bg), 0 0 14px var(--bg), 0 0 30px color-mix(in srgb, var(--bg) 70%, transparent); }
.kicker, .lede, .hint { text-shadow: var(--halo); }
.hero h1 {
  margin: 0; font: 400 clamp(52px, 9.5vw, 148px)/.92 var(--read); letter-spacing: -.035em; font-variation-settings: 'opsz' 72;
}
.hero h1 .h-l { display: block; }
.hero h1 em { color: var(--accent); font-weight: 350; letter-spacing: -.04em; }
.lede { max-width: 640px; margin: 34px auto 0; font: 400 clamp(19px, 2vw, 23px)/1.5 var(--read); color: color-mix(in srgb, var(--txt) 72%, var(--mut)); }
.lede strong { color: var(--txt); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 12px; border: 0; cursor: pointer;
  font: 500 15px/1 var(--ui); text-decoration: none; transition: transform .35s var(--spring), box-shadow .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-ink { color: #fff; background: linear-gradient(180deg, #4257f0, #2a37b8); box-shadow: 0 14px 34px -10px rgba(51, 70, 211, .6), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ink svg { width: 16px; height: 16px; fill: currentColor; }
.btn-ghost { color: var(--txt); background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-2); }
.peek-hash { font: 600 15px var(--mono); color: var(--accent); }
.hint { margin: 34px 0 0; color: var(--mut); }
.hint kbd { font-size: 11px; }

/* ---------- pinned window tour ---------- */
.track { position: relative; height: 420vh; }
.stage {
  position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 4vw, 64px); padding: 90px var(--gut) 70px;
}
.stage-copy .step { color: var(--accent); margin: 0 0 12px; }
.stage-copy h2 { margin: 0; font: 400 clamp(44px, 5vw, 72px)/1 var(--read); letter-spacing: -.03em; }
.stage-copy p:last-child { margin: 18px 0 0; font: 400 19px/1.55 var(--read); color: var(--mut); }
.steps { position: absolute; left: var(--gut); bottom: 30px; display: flex; gap: 6px; }
.steps button { border: 0; background: none; padding: 6px 0; cursor: pointer; font: 500 12px var(--mono); color: var(--faint); display: flex; flex-direction: column; gap: 6px; width: 64px; text-align: left; }
.steps button::before { content: ''; height: 2px; border-radius: 2px; background: var(--rule-2); transition: background .3s; }
.steps button.on { color: var(--txt); }
.steps button.on::before { background: var(--accent); }

.win {
  position: relative; display: flex; flex-direction: column; width: 100%; height: min(72svh, 640px);
  background: var(--paper); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--rule);
  transition: background .5s;
}
.win-bar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-bottom: 1px solid var(--rule); background: var(--bg); flex: none; transition: opacity .4s, margin .4s; }
.lights { display: inline-flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.win-ctrl { display: none; gap: 18px; margin-left: 8px; }
.win-ctrl i { width: 10px; height: 10px; border-bottom: 1.4px solid var(--mut); }
.win-ctrl i:nth-child(2) { border: 1.4px solid var(--mut); }
.win-ctrl i:nth-child(3) { background: linear-gradient(45deg, transparent 45%, var(--mut) 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--mut) 45% 55%, transparent 55%); border: 0; }
.win[data-os="win"] .lights { display: none; }
.win[data-os="win"] .win-ctrl { display: inline-flex; }
.win-icon { width: 20px; height: 20px; padding: 3px; border-radius: 6px; fill: #fff; background: linear-gradient(135deg, #4257f0, #1c2585); }
.win-title { font: 500 13px var(--ui); }
.seg-mini { margin: 0 auto; }
.seg-mini span[data-k], .seg-mini button { padding: 4px 10px; font-size: 12px; }
.win[data-os="win"] .seg-mini { margin-right: 0; }

.win-body { position: relative; flex: 1; display: flex; min-height: 0; }
.win-side { flex: none; width: 190px; padding: 16px 10px; border-right: 1px solid var(--rule); background: var(--bg); overflow: hidden; transition: none; }
.side-h { margin: 0 8px 8px; font: 600 10.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.win-side ol { list-style: none; margin: 0 0 20px; padding: 0; }
.win-side li { padding: 5px 9px; border-radius: 6px; font: 400 12.5px/1.3 var(--ui); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rise .35s var(--out) both; }
.win-side li.l1 { color: var(--txt); font-weight: 600; }
.win-side li.l2 { padding-left: 18px; }
.win-side li.on { background: var(--accent-soft); color: var(--accent); }
.side-file { margin: 0 8px; font-size: 12.5px; color: var(--mut); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.win-edit, .win-prev { position: relative; min-width: 0; overflow: hidden; }
.win-edit { flex: 1 1 50%; border-right: 1px solid var(--rule); }
.win-prev { flex: 1 1 50%; background: var(--bg); }
.win-edit pre {
  margin: 0; padding: 26px 30px 60px; font: 400 13.5px/1.85 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--txt);
}
.win-edit pre .mk { color: var(--accent); }
.win-edit pre .mu { color: var(--faint); }
.win-edit pre .caret { display: inline-block; width: 2px; height: 1.2em; margin: 0 -1px -.25em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.win-status { display: flex; gap: 18px; align-items: center; height: 28px; padding: 0 14px; border-top: 1px solid var(--rule); background: var(--bg); color: var(--faint); font-size: 11px; flex: none; transition: opacity .4s; }
.win-status .path { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved { display: inline-flex; align-items: center; gap: 6px; }
.saved i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-tip); }

/* Rendered Markdown, mirroring the app's reading view. */
.prose { max-width: 620px; margin: 0 auto; padding: 30px 40px 80px; font: 400 17.5px/1.7 var(--read); color: var(--txt); }
.prose > :first-child { margin-top: 0; }
.prose h1 { font: 400 2.25em/1.08 var(--read); letter-spacing: -.025em; margin: 0 0 .5em; }
.prose h2 { font: 400 1.55em/1.15 var(--read); letter-spacing: -.015em; margin: 1.5em 0 .5em; padding-bottom: .3em; border-bottom: 1px solid var(--rule); }
.prose h3 { font: 600 1.15em/1.25 var(--read); margin: 1.4em 0 .4em; }
.prose p { margin: 0 0 .9em; }
.prose strong { font-weight: 650; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose mark { background: var(--mark); color: inherit; padding: 0 .12em; border-radius: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .2em 0; }
.prose li::marker { color: var(--faint); }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.3em; }
.prose input[type="checkbox"] { accent-color: var(--accent); margin: 0 .5em 0 0; transform: translateY(1px); }
.prose li:has(> input:checked) { color: var(--faint); text-decoration: line-through; }
.prose blockquote { margin: 1.2em 0; padding: .3em 0 .3em 1.2em; border-left: 3px solid var(--accent); color: var(--mut); font-style: italic; background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.prose blockquote p { margin: .3em 0; }
.prose blockquote.callout { font-style: normal; color: var(--txt); border-left-color: var(--c-tip); background: color-mix(in srgb, var(--c-tip) 8%, transparent); border-radius: 0 8px 8px 0; padding: .6em 1em; }
.prose blockquote.callout .ct { display: block; font: 600 13px var(--ui); color: var(--c-tip); text-transform: uppercase; letter-spacing: .08em; }
.prose blockquote.callout.note { border-left-color: var(--c-note); background: color-mix(in srgb, var(--c-note) 8%, transparent); }
.prose blockquote.callout.note .ct { color: var(--c-note); }
.prose blockquote.callout.warning { border-left-color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 9%, transparent); }
.prose blockquote.callout.warning .ct { color: var(--c-warn); }
.prose code { font-size: .8em; }
.prose pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; overflow: auto; font: 13px/1.6 var(--mono); }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose hr { border: 0; height: 1px; background: var(--rule); margin: 2em 0; }
.prose table { border-collapse: collapse; font: 14px var(--ui); margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 12px; text-align: left; }
.prose th { background: var(--sunk); }
.prose img { max-width: 100%; border-radius: 8px; }
.win-prev .prose { transition: max-width .4s var(--out); }

/* ---------- typeset features ---------- */
.set, .try, .quiet, .keys { padding: clamp(90px, 14vw, 170px) var(--gut) 0; }
.set-head, .try-head, .keys-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.set-head p:last-child, .try-head p:last-child, .keys-head p:last-child, .quiet-copy p:last-child { font: 400 20px/1.55 var(--read); color: var(--mut); margin: 22px 0 0; }
.big { margin: 0; font: 400 clamp(40px, 6vw, 84px)/1 var(--read); letter-spacing: -.03em; }
.big em { color: var(--accent); }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; max-width: 1200px; margin: 0 auto; }
.card {
  position: relative; display: flex; flex-direction: column; grid-column: span 2; min-height: 360px; padding: 18px 22px 22px;
  border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); overflow: hidden;
  transition: transform .5s var(--out), box-shadow .4s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--rule-2), 0 24px 50px -28px rgba(40, 30, 10, .35); }
.c-tasks, .c-table { grid-column: span 3; }
.card header { display: flex; justify-content: space-between; align-items: center; color: var(--faint); margin-bottom: 10px; }
.flip { border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; padding: 3px 7px; font: 600 10.5px var(--mono); color: var(--mut); cursor: pointer; }
.card.src .flip { color: var(--paper); background: var(--accent); border-color: var(--accent); }
.card h3 { margin: 0 0 18px; font: 400 26px/1.15 var(--read); letter-spacing: -.01em; }
.card-say { margin: auto 0 0; padding-top: 16px; font-size: 14px; color: var(--mut); }
.face { transition: opacity .35s, transform .45s var(--out), filter .35s; }
.face-src {
  position: absolute; inset: 52px 22px 64px; margin: 0; padding: 16px; overflow: auto; border-radius: 10px;
  background: var(--code-bg); font: 12.5px/1.75 var(--mono); white-space: pre-wrap; color: var(--txt);
  opacity: 0; transform: translateY(10px); pointer-events: none;
}
.face-src .mk { color: var(--accent); }
.card.src .face-out, html[data-mode="write"] .card .face-out { opacity: 0; transform: translateY(-8px); filter: blur(4px); pointer-events: none; }
.card.src .face-src, html[data-mode="write"] .card .face-src { opacity: 1; transform: none; pointer-events: auto; }

.tasks { list-style: none; margin: 0; padding: 0; font: 400 20px/1.5 var(--read); }
.tasks li { margin: 4px 0; }
.tasks label { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; transition: color .3s; }
.tasks input { appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1.5px solid var(--rule-2); display: grid; place-items: center; cursor: pointer; transition: background .25s, border-color .25s; }
.tasks input:checked { background: var(--accent); border-color: var(--accent); }
.tasks input:checked::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.tasks label:has(input:checked) { color: var(--faint); text-decoration: line-through; }
.mini-src { margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); font: 12.5px/1.7 var(--mono); white-space: pre-wrap; }
.mini-src .flash { background: var(--accent-soft); color: var(--accent); border-radius: 3px; animation: flash 1.2s var(--out); }
@keyframes flash { from { background: var(--accent); color: #fff; } }

.tbl { font-size: 13px; line-height: 2; white-space: pre; overflow-x: auto; padding: 8px 0; }
.tbl .row { display: block; }
.tbl .cell { display: inline-block; overflow: hidden; vertical-align: top; transition: width .7s var(--spring); }
.tbl .pipe { color: var(--accent); }
.tbl .row.sep .cell { color: var(--faint); }
.tab-key { margin-top: 14px; align-self: flex-start; border: 1px solid var(--rule); background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--mut); cursor: pointer; }
.c-table .face-out { display: flex; flex-direction: column; }

.formula { display: flex; align-items: center; justify-content: center; gap: .18em; min-height: 160px; font: 400 44px/1 var(--read); }
.formula .mi { font-style: italic; }
.formula sup { font-size: .55em; margin-left: .05em; transform: translateY(-.3em); }
.int { display: inline-grid; grid-template-rows: auto auto auto; justify-items: center; margin-right: .1em; }
.int .sig { font-size: 1.7em; line-height: .9; font-style: italic; }
.lim-up, .lim-lo { font-size: .38em; }
.dx { margin-left: .25em; }
.eq { margin: 0 .3em; color: var(--accent); }
.sqrt { display: inline-flex; align-items: flex-start; }
.sqrt .rad { font-size: 1.1em; line-height: .9; }
.sqrt .under { border-top: 2px solid currentColor; padding: .05em .12em 0; font-style: italic; margin-top: .14em; }

.mermaid { width: 100%; height: auto; color: var(--mut); }
.mermaid .nodes rect { fill: var(--bg); stroke: var(--rule-2); stroke-width: 1.4; }
.mermaid .nodes rect.end { fill: var(--accent-soft); stroke: var(--accent); }
.mermaid text { font: 500 14px var(--ui); fill: var(--txt); text-anchor: middle; }
.mermaid text.lbl { font: 400 12px var(--mono); fill: var(--faint); }
.mermaid .edges path { stroke-dasharray: 300; stroke-dashoffset: 300; transition: stroke-dashoffset 1.2s var(--out); }
.mermaid.drawn .edges path { stroke-dashoffset: 0; }
.mermaid.drawn .edges path:nth-child(2) { transition-delay: .25s; }
.mermaid.drawn .edges path:nth-child(3) { transition-delay: .5s; }
.mermaid.drawn .edges path:nth-child(4) { transition-delay: .8s; }

.callout { margin: 0 0 10px; padding: 9px 14px; border-left: 3px solid var(--c-note); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--c-note) 8%, transparent); font-size: 14px; }
.callout b { display: block; font: 600 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--c-note); }
.callout p { margin: 3px 0 0; font: 400 16px/1.45 var(--read); }
.callout.tip { border-color: var(--c-tip); background: color-mix(in srgb, var(--c-tip) 8%, transparent); }
.callout.tip b { color: var(--c-tip); }
.callout.warn { border-color: var(--c-warn); background: color-mix(in srgb, var(--c-warn) 9%, transparent); }
.callout.warn b { color: var(--c-warn); display: inline; }
.callout summary { cursor: pointer; list-style: none; }
.callout summary::after { content: ' ›'; color: var(--c-warn); display: inline-block; transition: transform .25s; }
.callout[open] summary::after { transform: rotate(90deg); }
.callout code { font-size: .78em; }

.paste { position: relative; min-height: 170px; }
.clip { padding: 14px 16px; border-radius: 10px; background: #fff; color: #222; font: 14px/1.5 Arial, sans-serif; box-shadow: 0 0 0 1px var(--rule), 0 10px 24px -14px rgba(0, 0, 0, .3); transition: opacity .5s, transform .6s var(--out); }
.clip p { margin: 0; }
.clip .clip-h { font: 700 18px Georgia, serif; margin-bottom: 4px; }
.clip a { color: #1a0dab; text-decoration: underline; }
.paste-key { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .3s, transform .3s var(--spring); }
.paste-key kbd { font-size: 15px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }
.clip-md { position: absolute; inset: 0 0 auto; margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--code-bg); font: 12.5px/1.75 var(--mono); white-space: pre-wrap; opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .6s var(--out); }
.clip-md b { color: var(--accent); font-weight: 500; }
.clip-md i { font-style: normal; color: var(--tok-s); }
.paste.p1 .clip { transform: scale(.96); opacity: .5; }
.paste.p1 .paste-key { opacity: 1; transform: scale(1.1); }
.paste.p2 .clip { opacity: 0; transform: translateY(-12px) scale(.96); }
.paste.p2 .clip-md { opacity: 1; transform: none; }

.more { max-width: 1000px; margin: 56px auto 0; text-align: center; font: 400 clamp(19px, 2.2vw, 26px)/1.7 var(--read); color: var(--mut); }
.more span { white-space: nowrap; }
.more span + span::before { content: '·'; margin: 0 .55em; color: var(--rule-2); }
.more code { font-size: .7em; }

/* ---------- playground ---------- */
.win-try { max-width: 1200px; margin: 0 auto; height: min(78svh, 700px); }
.tool-row { display: flex; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--rule); background: var(--paper); flex: none; }
.tool-row button { width: 32px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--mut); cursor: pointer; font: 500 13px var(--ui); }
.tool-row button:hover { background: var(--accent-soft); color: var(--accent); }
.tool-row .mk { background: var(--mark); padding: 0 3px; border-radius: 2px; color: var(--txt); }
.win-try textarea {
  display: block; width: 100%; height: 100%; padding: 26px 30px; border: 0; outline: 0; resize: none; background: var(--paper);
  font: 400 14px/1.85 var(--mono); color: var(--txt); caret-color: var(--accent); tab-size: 2;
}
.win-try .win-prev { overflow: auto; overscroll-behavior: contain; }
.win-try[data-view="write"] .win-prev, .win-try[data-view="read"] .win-edit { display: none; }
.win-try[data-view="write"] .win-edit { border-right: 0; }
.win-try[data-view="write"] textarea { max-width: 760px; margin: 0 auto; }
.win-try .win-edit { background: var(--paper); }
.win-try.dropped { animation: land .9s var(--out); }
@keyframes land { 0% { box-shadow: var(--shadow), 0 0 0 1px var(--accent), 0 0 0 12px var(--accent-soft); } }

/* ---------- privacy ---------- */
.quiet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 90px); max-width: 1200px; margin: 0 auto; align-items: center; }
.quiet .big { font-size: clamp(56px, 7.4vw, 108px); white-space: nowrap; }
.zero { color: var(--accent); font-style: italic; }
.log { list-style: none; margin: 0; padding: 22px; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.log li { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--rule); font-size: 12.5px; }
.log li:last-child { border-bottom: 0; }
.log li span { color: var(--faint); }
.log li em { font: 12px var(--mono); color: var(--faint); font-style: normal; }
.log li.off { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--rule-2); }
.log li.on { color: var(--txt); }
.log li.on span { color: var(--c-tip); font-weight: 600; }
.log li.on em { color: var(--c-tip); }
.native { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.os-card { padding: 26px 28px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.os-card h3 { margin: 0 0 14px; font: 400 30px/1.1 var(--read); letter-spacing: -.01em; }
.os-card ul { margin: 0; padding-left: 1.1em; color: var(--mut); }
.os-card li { margin: 4px 0; }
.os-card li::marker { color: var(--accent); }
.os-card.mine { box-shadow: 0 0 0 1.5px var(--accent); }

/* ---------- shortcuts ---------- */
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-width: 1100px; margin: 0 auto; }
.k-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); font-size: 14.5px; transition: box-shadow .3s, transform .3s var(--spring), background .3s; }
.k-row span:last-child { display: inline-flex; gap: 4px; flex: none; }
.k-row kbd { font-size: 11.5px; min-width: 2em; height: 2em; transition: background .2s, color .2s, transform .2s; }
.k-row.hit { box-shadow: 0 0 0 1.5px var(--accent), 0 14px 30px -18px var(--accent); transform: translateY(-2px); background: var(--accent-soft); }
.k-row.hit kbd { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(1px); }

/* ---------- download ---------- */
.get { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(110px, 16vw, 190px) var(--gut) 100px; }
.get-icon { position: relative; width: 140px; height: 140px; margin-bottom: 40px; }
.get-icon img { position: relative; z-index: 1; width: 100%; height: 100%; filter: drop-shadow(0 24px 40px rgba(51, 70, 211, .35)); }
.ripple { position: absolute; inset: 0; border-radius: 34%; border: 1.5px solid var(--accent); opacity: 0; animation: ripple 3.2s var(--out) infinite; }
.ripple.r2 { animation-delay: 1.6s; }
@keyframes ripple { 0% { transform: scale(.9); opacity: .55; } 100% { transform: scale(2.1); opacity: 0; border-radius: 50%; } }
.get-say { max-width: 560px; margin: 24px auto 0; font: 400 20px/1.55 var(--read); color: var(--mut); }
.get-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.btn-main { color: var(--paper); background: var(--txt); padding: 14px 22px 14px 18px; text-align: left; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .45); }
.btn-main svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.btn-main:hover { background: var(--accent); }
.btn b { display: block; font-weight: 600; font-size: 15px; }
.btn small { display: block; margin-top: 4px; font-size: 12px; opacity: .65; }
.btn-main.mine { background: linear-gradient(180deg, #4257f0, #2a37b8); color: #fff; box-shadow: 0 14px 34px -10px rgba(51, 70, 211, .6); order: -1; }
.btn-coffee { background: #ffdd00; color: #1a1300; padding: 14px 22px 14px 18px; text-align: left; box-shadow: 0 12px 34px -12px rgba(255, 200, 0, .5); }
.cup { position: relative; width: 24px; height: 26px; flex: none; }
.cup::before { content: ''; position: absolute; left: 2px; bottom: 0; width: 16px; height: 15px; border-radius: 2px 2px 6px 6px; background: #1a1300; }
.cup::after { content: ''; position: absolute; right: 0; bottom: 4px; width: 5px; height: 7px; border: 2.5px solid #1a1300; border-left: 0; border-radius: 0 5px 5px 0; }
.cup i { position: absolute; bottom: 17px; width: 2.5px; height: 7px; border-radius: 2px; background: #1a1300; opacity: 0; animation: steam 2s ease-in-out infinite; }
.cup i:nth-child(1) { left: 5px; }
.cup i:nth-child(2) { left: 9px; animation-delay: .4s; }
.cup i:nth-child(3) { left: 13px; animation-delay: .8s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(3px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-5px); } }
.btn-coffee:hover .cup i { animation-duration: 1.1s; }
.get-note { max-width: 640px; margin: 30px auto 0; font-size: 14px; line-height: 1.6; color: var(--faint); }
.get-note code { font-size: .8em; }
.get-foot { color: var(--faint); margin-top: 22px; }
.get-foot a { color: var(--mut); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 30px var(--gut) 40px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 14px; }
.foot p { margin: 0; }
.foot a { color: var(--mut); text-decoration: none; }
.foot a:hover { color: var(--txt); }
.foot-links { display: flex; gap: 18px; }

/* ---------- drop veil ---------- */
.drop-veil {
  position: fixed; inset: 0; z-index: 80; display: grid; place-content: center; justify-items: center; gap: 8px; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); transition: opacity .2s;
}
.drop-veil.on { opacity: 1; }
.veil-drop { width: 90px; height: 90px; fill: var(--accent); animation: bob 1.4s ease-in-out infinite; }
.drop-veil p { margin: 10px 0 0; font: 400 40px var(--read); }
.drop-veil small { color: var(--mut); }
@keyframes bob { 50% { transform: translateY(8px) scaleY(.94); } }

/* ---------- page modes: this page is Markdown, too ---------- */
.md-mk { color: var(--accent); font: 400 .92em var(--mono); font-style: normal; font-weight: 400; letter-spacing: 0; }
html[data-mode="read"] .md-mk { display: none; }
html[data-mode="split"] .md-mk { opacity: .45; font-size: .62em; vertical-align: .15em; }
html[data-mode="split"] .md :is(h1, h2, h3) .md-mk { font-size: .32em; vertical-align: .9em; }
html[data-mode="write"] .md :is(h1, h2, h3, p, li, em, strong, a, code, kbd, span) {
  font-family: var(--mono) !important; font-style: normal; font-variation-settings: normal;
}
html[data-mode="write"] .md :is(h1, h2, h3) { font-size: clamp(18px, 2vw, 24px) !important; line-height: 1.5 !important; letter-spacing: 0 !important; font-weight: 700 !important; }
html[data-mode="write"] .md :is(p, li) { font-size: 15px !important; line-height: 1.8 !important; letter-spacing: 0 !important; }
html[data-mode="write"] .md em { color: inherit; display: inline !important; }
html[data-mode="write"] .md :is(strong, a) { font-weight: 700; text-decoration: none; }
html[data-mode="write"] .md :is(code, kbd) { background: none; border: 0; padding: 0; min-width: 0; height: auto; display: inline; font-size: 1em; }
html[data-mode="write"] .md ul { list-style: none; padding-left: 0; }
html[data-mode="write"] .hero h1 .h-l { display: inline; }
html[data-mode="write"] .zero { font-style: normal; }
html[data-mode="write"] .md, html[data-mode="write"] .hero-copy { text-align: left; }
html[data-mode="write"] .hero-copy { width: min(760px, 100%); }
html[data-mode="write"] .lede, html[data-mode="write"] .hero-actions { margin-left: 0; justify-content: flex-start; }
html[data-mode="write"] .more span + span::before { content: none; }
html[data-mode="write"] .more span { display: block; white-space: normal; }
html[data-mode="write"] .more { max-width: 760px; text-align: left; }
html[data-mode="write"] :is(.set-head, .try-head, .keys-head) { margin-left: auto; margin-right: auto; }

/* Focus mode: everything but the block in the middle of the screen recedes. */
html.focus main :is(.md > *, .card, .win, .log, .k-row, .os-card) { transition: opacity .5s, filter .5s; opacity: .14; filter: blur(1.5px); }
html.focus main .lit, html.focus main .lit * { opacity: 1 !important; filter: none !important; }
html.focus .top { opacity: .25; transition: opacity .4s; }
html.focus .top:hover { opacity: 1; }

/* The mode switch wipes across the page like a cursor running down a document. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.vt-mode::view-transition-new(root) { animation: wipe .65s cubic-bezier(.7, 0, .2, 1) both; }
.vt-theme::view-transition-new(root) { animation: bloom .8s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes bloom { from { clip-path: circle(0 at var(--vx, 90%) var(--vy, 30px)); } to { clip-path: circle(150vmax at var(--vx, 90%) var(--vy, 30px)); } }

.reveal { opacity: 0; transform: translateY(24px); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .top-nav a:not(.top-cta) { display: none; }
  .stage { grid-template-columns: 1fr; align-content: center; gap: 22px; padding-top: 80px; }
  .stage-copy { max-width: 620px; }
  .stage-copy h2 { font-size: 40px; }
  .stage-copy p:last-child { font-size: 17px; margin-top: 10px; }
  .win { height: min(58svh, 560px); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card, .c-tasks, .c-table { grid-column: span 1; }
}
@media (max-width: 760px) {
  .top { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .brand span { display: none; }
  .top-nav { margin-left: auto; }
  .seg button span { display: none; }
  .seg button { padding: 5px 7px; }
  .seg-icons button[data-theme="system"] { display: none; }
  .stage-copy p:last-child { display: none; }
  .win { height: 60svh; }
  .win-side { display: none; }
  .win-body { flex-direction: column; }
  .win-edit { border-right: 0; border-bottom: 1px solid var(--rule); }
  .win-edit pre { padding: 16px 18px 40px; font-size: 12px; }
  .prose { padding: 20px 20px 60px; font-size: 16px; }
  .seg-mini span[data-k] svg, .seg-mini button svg { display: none; }
  .win-title { display: none; }
  .win-status span:not(.path):not(.saved) { display: none; }
  .bento { grid-template-columns: 1fr; }
  .card { min-height: 330px; }
  .quiet, .native { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 38px 1fr; }
  .log li em { display: none; }
  .win-try { height: 80svh; }
  .win-try[data-view="split"] .win-body { flex-direction: column; }
  .steps { bottom: 18px; }
  .more span { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
