/* ==========================================================================
   scratchpad.sh
   The app's "ink and graph paper", turned into a page: warm paper, one
   saturated ink (the app's sky blue), a highlighter for emphasis and a pen
   for margin notes. Panes stay flat with borders; only buttons and floating
   screenshots get a shadow.
   ========================================================================== */

:root {
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --card: #fffdf9;
  --ink: #15171a;
  --ink-soft: #464a50;
  --ink-muted: #7a7c80;
  --rule: #e3dfd5;
  --rule-strong: #cfcabd;
  --grid: rgba(21, 23, 26, 0.05);

  --accent: #0277bd;
  --accent-hover: #026094;
  --accent-solid: #0277bd;
  --accent-solid-hover: #026aa7;
  --accent-wash: #e0f2fe;
  --pen: #0b6aa8;
  --marker: #fcd95e;
  --pencil: #f2b736;
  --sticky: #fde68a;
  --sticky-ink: #5b4708;

  --shot-shadow: 0 1px 2px rgba(21, 23, 26, 0.06), 0 24px 60px -24px rgba(21, 23, 26, 0.28);
  --btn-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 1px 2px rgba(2, 60, 95, 0.3), 0 6px 16px -6px rgba(2, 119, 189, 0.55);

  --font-ui: "soleil", "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-display: "miller-display", "Iowan Old Style", Georgia, serif;
  --font-hand: "mali", "Bradley Hand", cursive;

  --gutter: clamp(20px, 4vw, 40px);
  --radius: 14px;
  color-scheme: light;
}

/* Dark: the system's choice unless light was picked, or dark picked outright. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121417;
    --paper-2: #191c20;
    --card: #17191d;
    --ink: #ece9e3;
    --ink-soft: #bdbab4;
    --ink-muted: #8b8985;
    --rule: #2a2d32;
    --rule-strong: #3b3f45;
    --grid: rgba(236, 233, 227, 0.04);

    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-wash: rgba(56, 189, 248, 0.12);
    --pen: #7cc7f2;
    --marker: rgba(242, 183, 54, 0.42);
    --sticky: #e8c55a;
    --sticky-ink: #3d2f05;

    --shot-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 70px -28px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121417;
  --paper-2: #191c20;
  --card: #17191d;
  --ink: #ece9e3;
  --ink-soft: #bdbab4;
  --ink-muted: #8b8985;
  --rule: #2a2d32;
  --rule-strong: #3b3f45;
  --grid: rgba(236, 233, 227, 0.04);

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-wash: rgba(56, 189, 248, 0.12);
  --pen: #7cc7f2;
  --marker: rgba(242, 183, 54, 0.42);
  --sticky: #e8c55a;
  --sticky-ink: #3d2f05;

  --shot-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 70px -28px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
p { margin: 0; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap-wide { width: min(1320px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

em { font-style: italic; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px/1 var(--font-ui);
  padding: 15px 22px; border-radius: 12px;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.btn .ico { width: 18px; height: 18px; stroke-width: 1.8; transition: transform 200ms ease; }
.btn:hover .ico { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent-solid); color: #fff; box-shadow: var(--btn-shadow); }
.btn-primary:hover { background: var(--accent-solid-hover); }

.btn-quiet { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn-quiet:hover { background: var(--paper-2); }

.btn-sm { padding: 10px 16px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

.fine { font-size: 15px; color: var(--ink-muted); }
.center { text-align: center; }

kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 2px;
  font: 500 0.8em/1.5 var(--font-ui); text-align: center;
  border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 6px;
  background: var(--card); color: var(--ink-soft);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.nav.is-stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--rule);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 72px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
}
.brand img { border-radius: 8px; }

.nav-links { display: flex; gap: 28px; margin-left: 28px; }
.nav-links a, .nav-signin {
  text-decoration: none; font-size: 16px; color: var(--ink-soft);
  transition: color 150ms ease;
}
.nav-links a:hover, .nav-signin:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-inner { height: 64px; }
  .nav-actions { gap: 16px; }
}

/* ---------- Hero ---------- */

.hero { position: relative; padding-top: clamp(40px, 8vw, 96px); }

/* Graph paper behind the headline, fading out before the screenshot. */
.hero::before {
  content: ""; position: absolute; inset: -72px 0 30% 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 20%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 20%, #000 35%, transparent 80%);
}

.hero-copy { text-align: center; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(46px, 8.4vw, 108px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-title .line { display: block; }
.hero-title em { font-weight: 400; letter-spacing: -0.015em; }

/* The highlighter sweep. */
.mark {
  background-image: linear-gradient(
    176deg,
    transparent 0 52%,
    var(--marker) 52% 90%,
    transparent 90%
  );
  background-repeat: no-repeat;
  background-size: 0% 100%;
  padding: 0 0.08em;
  margin: 0 -0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 1000ms cubic-bezier(0.65, 0, 0.25, 1);
}
.mark.is-on { background-size: 100% 100%; }

.lede {
  max-width: 640px; margin: 30px auto 0;
  font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--ink-soft);
  text-wrap: pretty;
}

.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.hero-copy .fine { margin-top: 18px; }

.hero-stage {
  position: relative;
  margin-top: clamp(56px, 8vw, 96px);
  padding-right: clamp(0px, 7vw, 110px);
}

.frame {
  margin: 0; overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--rule-strong), var(--shot-shadow);
}
.frame img { width: 100%; }

.frame-desktop { border-radius: 16px; }

.frame-phone {
  position: absolute; right: 0; bottom: -56px;
  width: clamp(130px, 21%, 262px);
  border-radius: clamp(22px, 3.2vw, 40px);
  border: clamp(5px, 0.7vw, 9px) solid #1b1d21;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), var(--shot-shadow);
}

/* Margin notes in pen. */
.hand {
  position: absolute; z-index: 2;
  font-family: var(--font-hand); font-weight: 600;
  font-size: clamp(15px, 1.5vw, 19px); line-height: 1.2;
  color: var(--pen);
  display: flex; gap: 6px;
  pointer-events: none;
}
.hand span { transform: rotate(-4deg); white-space: nowrap; }
.hand-arrow {
  width: clamp(90px, 10vw, 150px); height: auto; overflow: visible;
  fill: none; stroke: var(--pen); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.hand-arrow path { stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 900ms cubic-bezier(0.65, 0, 0.35, 1); }
.hand-arrow path + path { transition-delay: 700ms; transition-duration: 300ms; }
.hand span { opacity: 0; transition: opacity 500ms ease 200ms; }
.hand.is-on .hand-arrow path { stroke-dashoffset: 0; }
.hand.is-on span { opacity: 1; }

.hand-title { left: 7%; top: -58px; align-items: flex-start; }
.hand-title .hand-arrow { margin-top: 14px; width: clamp(110px, 16vw, 210px); }
.hand-phone { right: clamp(170px, 24%, 300px); bottom: -118px; align-items: flex-end; }
.hand-phone span { transform: rotate(3deg); text-align: right; margin-bottom: -6px; }
.hand-phone .hand-arrow { margin-bottom: 26px; }

@media (max-width: 900px) {
  .hand { display: none; }
  .hero-stage { padding-right: 0; }
  .frame-phone { right: -6px; bottom: -40px; width: 30%; }
}

.works-on {
  list-style: none; padding: 0; margin: clamp(96px, 12vw, 150px) auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px;
  font-size: 16px; color: var(--ink-muted);
}
.works-on li { position: relative; }
.works-on li + li::before {
  content: ""; position: absolute; left: -19px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--rule-strong);
}

/* ---------- Entrance ---------- */

.rise, .rise-up { opacity: 0; transform: translateY(16px); animation: rise 800ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.rise { animation-delay: calc(var(--d, 0) * 110ms + 80ms); }
.rise-up { transform: translateY(40px); animation-duration: 1100ms; animation-delay: calc(var(--d, 0) * 110ms + 520ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Stories ---------- */

.story { padding: clamp(96px, 13vw, 170px) 0 0; }
.story-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 88px); align-items: center;
}
.story-flip .story-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.story-flip .story-copy { order: 2; }

.story h2, .section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -0.015em;
  text-wrap: balance;
}
.story h2 em, .section-title em { color: var(--ink-soft); }
.story-copy p { margin-top: 22px; color: var(--ink-soft); text-wrap: pretty; }
.story-copy p + p { margin-top: 14px; }

.frame-inset { background: transparent; }
.frame-lock { max-width: 400px; justify-self: center; width: 100%; border-radius: 19px; }

@media (max-width: 860px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .story-flip .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-flip .story-copy { order: 0; }
}

/* ---------- Typing demo ---------- */

.demo {
  border-radius: var(--radius); overflow: hidden;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--rule-strong), var(--shot-shadow);
  font-size: 15px;
}
.demo-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); }
.demo-body { display: grid; grid-template-columns: 38% 62%; min-height: 330px; }
.demo-list { border-right: 1px solid var(--rule); padding: 10px 8px; background: var(--paper); }
.demo-row { padding: 10px 12px; border-radius: 10px; display: grid; gap: 2px; }
.demo-row b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-row span { font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-row.is-live { background: var(--card); box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px var(--rule); }
.demo-row.is-live b { transition: color 200ms ease; }
.demo-row.is-live b.is-placeholder { color: var(--ink-muted); }

.demo-editor { padding: 18px 26px 26px; position: relative; }
.demo-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); letter-spacing: 0.02em; }
.demo-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.demo-h1 { margin-top: 18px; min-height: 40px; font-weight: 700; font-size: 26px; letter-spacing: -0.015em; line-height: 1.3; }
.demo-checks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.demo-checks li { display: flex; align-items: center; gap: 10px; min-height: 26px; animation: fadein 250ms ease; }
.demo-checks li .box {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  display: grid; place-items: center;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.demo-checks li .box svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.4); transition: all 200ms ease; }
.demo-checks li.is-done .box { background: var(--accent-solid); box-shadow: none; }
.demo-checks li.is-done .box svg { opacity: 1; transform: none; }
.demo-checks li.is-done .txt { color: var(--ink-muted); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }

.caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -0.12em;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
.caret[hidden] { display: none; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 520px) {
  .demo-body { grid-template-columns: 1fr; }
  .demo-list { display: none; }
}

/* ---------- Files illustration ---------- */

.files { position: relative; display: grid; gap: 18px; padding: 10px 0 10px 6%; }
.file-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--rule-strong), var(--shot-shadow);
}
.file-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.file-head .ico { width: 17px; height: 17px; }
.pdf-page {
  position: relative; margin: 18px; padding: 28px 30px 36px;
  background: #fffefb; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: grid; gap: 11px;
}
.pdf-page i { display: block; height: 7px; width: var(--w); border-radius: 4px; background: #e6e2da; position: relative; }
.pdf-page i.hl::after {
  content: ""; position: absolute; left: -4px; top: -5px; bottom: -5px;
  width: 0; background: rgba(252, 217, 94, 0.75); border-radius: 3px; mix-blend-mode: multiply;
  transition: width 900ms cubic-bezier(0.65, 0, 0.35, 1) 500ms;
}
.files.is-in .pdf-page i.hl::after { width: calc(100% + 8px); }
.scribble { position: absolute; right: 30px; bottom: 10px; width: 130px; fill: none; stroke: #0b6aa8; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1200ms ease 900ms; }
.files.is-in .scribble { stroke-dashoffset: 0; }
.pdf-sticky {
  position: absolute; right: -22px; top: -16px;
  padding: 12px 14px; width: 132px;
  background: var(--sticky); color: var(--sticky-ink);
  font: 600 15px/1.2 var(--font-hand);
  border-radius: 2px 2px 14px 2px;
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.45);
  transform: rotate(4deg) scale(0.9); opacity: 0;
  transition: transform 500ms cubic-bezier(0.3, 1.6, 0.5, 1) 1500ms, opacity 300ms ease 1500ms;
}
.files.is-in .pdf-sticky { transform: rotate(4deg); opacity: 1; }

.file-audio { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; margin-left: 12%; margin-top: -40px; position: relative; }
.play { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent-solid); display: grid; place-items: center; box-shadow: var(--btn-shadow); }
.play svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }
.wave { display: flex; align-items: center; gap: 3px; height: 34px; }
.wave i { flex: 1; max-width: 5px; border-radius: 3px; background: var(--accent); opacity: 0.55; height: 30%; animation: wave 1.4s ease-in-out infinite; }
.wave i:nth-child(3n) { animation-delay: -0.3s; }
.wave i:nth-child(3n+1) { animation-delay: -0.7s; }
.wave i:nth-child(4n) { animation-delay: -1.1s; }
.wave i:nth-child(5n+2) { animation-duration: 1.1s; }
@keyframes wave { 0%, 100% { height: 22%; } 50% { height: 95%; } }
.dur { font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.transcript { grid-column: 1 / -1; font-size: 15px; line-height: 1.5; color: var(--ink-soft); border-top: 1px solid var(--rule); padding-top: 12px; }

/* ---------- Sharing ---------- */

.story-grid-share { align-items: center; }
.share-stack { position: relative; padding: 0 0 60px 0; }
.browser {
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: 0 0 0 1px var(--rule-strong), var(--shot-shadow);
  width: 78%;
}
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); flex: none; }
.browser-bar span {
  margin-left: 10px; flex: 1; min-width: 0;
  font-size: 12.5px; color: var(--ink-soft); background: var(--card);
  border-radius: 8px; padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 0 0 1px var(--rule);
}
.browser img { width: 100%; max-height: 520px; object-fit: cover; object-position: top; }
.frame-float { position: absolute; right: 0; bottom: 0; width: 44%; border-radius: 11px; }

/* ---------- Extras ---------- */

.extras { padding: clamp(110px, 14vw, 180px) 0 0; }
.extras .section-title { max-width: 760px; }
.extras-grid {
  list-style: none; padding: 0; margin: 56px 0 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.extras-grid li { padding: 28px 26px 32px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); transition: background-color 200ms ease; }
.extras-grid li:hover { background: var(--paper-2); }
.extras-grid .ico { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.4; }
.extras-grid h3 { margin-top: 18px; font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
.extras-grid p { margin-top: 6px; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }
.extras-grid li:nth-child(4n+2) { transition-delay: 60ms; }
.extras-grid li:nth-child(4n+3) { transition-delay: 120ms; }
.extras-grid li:nth-child(4n) { transition-delay: 180ms; }

@media (max-width: 1000px) { .extras-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .extras-grid { grid-template-columns: minmax(0, 1fr); } .extras-grid li { transition-delay: 0ms !important; } }

/* ---------- Pricing ---------- */

.pricing { padding: clamp(110px, 14vw, 180px) 0 0; position: relative; }
.pricing::before {
  content: ""; position: absolute; inset: 40px 0 -120px; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 50% 60% at 50% 55%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 50% 60% at 50% 55%, #000 30%, transparent 75%);
}
.section-title.center { margin-inline: auto; text-align: center; max-width: 780px; }
.section-lede { margin-top: 18px; color: var(--ink-soft); font-size: 20px; }

.plan {
  max-width: 520px; margin: 52px auto 0;
  background: var(--card); border-radius: 22px;
  box-shadow: 0 0 0 1px var(--rule-strong);
  padding: 10px;
}
.plan-switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--paper-2); border-radius: 14px; padding: 4px;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.plan-switch button {
  position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
  font: 600 15px/1 var(--font-ui); color: var(--ink-muted);
  padding: 13px 10px; border-radius: 10px;
  transition: color 200ms ease;
}
.plan-switch button[aria-checked="true"] { color: var(--ink); }
.plan-switch-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  background: var(--card); border-radius: 10px;
  box-shadow: 0 0 0 1px var(--rule-strong), 0 2px 6px -2px rgba(0, 0, 0, 0.12);
  transition: transform 320ms cubic-bezier(0.3, 1.2, 0.5, 1);
}
.plan[data-plan="byok"] .plan-switch-pill { transform: translateX(100%); }

.plan-body { padding: 34px 30px 26px; }
.plan-price { display: flex; align-items: baseline; gap: 2px; }
.plan-price .currency { font: 400 34px/1 var(--font-display); align-self: flex-start; margin-top: 12px; }
.plan-price .amount {
  font: 400 96px/1 var(--font-display); letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums; display: inline-block;
  transition: transform 300ms ease, opacity 300ms ease;
}
.plan-price .amount.is-swapping { transform: translateY(-14px); opacity: 0; }
.plan-price .per { margin-left: 10px; color: var(--ink-muted); font-size: 17px; }
.plan-ai { margin-top: 10px; font-weight: 600; color: var(--accent); min-height: 1.6em; }

.plan-list { list-style: none; padding: 0; margin: 26px 0 30px; display: grid; gap: 12px; border-top: 1px solid var(--rule); padding-top: 24px; }
.plan-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; line-height: 1.45; }
.plan-list .ico { width: 20px; height: 20px; color: var(--accent); stroke-width: 2; margin-top: 1px; }
.plan .fine { margin-top: 14px; }
.trial { background: var(--paper-2); border-radius: 14px; padding: 20px 22px 22px; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }
.trial h3 { font-size: 16px; font-weight: 600; color: var(--ink); }
.trial p { margin-top: 8px; }
.trial ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.trial li::marker { color: var(--ink-muted); }
.trial b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */

.faq { padding: clamp(110px, 14vw, 180px) 0 0; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq-list { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 22px 48px 22px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.005em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background:
    linear-gradient(currentColor, currentColor) center / 14px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.6px 14px no-repeat;
  color: var(--ink-muted);
  transition: transform 250ms ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 48px 24px 0; color: var(--ink-soft); }

@media (max-width: 860px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Closer and footer ---------- */

.closer { padding: clamp(120px, 15vw, 200px) 0 clamp(90px, 10vw, 130px); }
.closer-inner { text-align: center; display: grid; justify-items: center; gap: 26px; }
.closer-inner img { border-radius: 16px; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.5); }
.closer h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.02em;
  max-width: 860px; text-wrap: balance;
}
.closer h2 em { color: var(--ink-soft); }
.closer .fine { margin-top: -8px; }

.footer { border-top: 1px solid var(--rule); padding: 30px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.footer .brand { font-size: 16px; }
.footer .brand img { border-radius: 6px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer nav a { text-decoration: none; color: var(--ink-soft); font-size: 15px; }
.footer nav a:hover { color: var(--ink); }
.copyright { font-size: 14px; color: var(--ink-muted); }

@media (max-width: 700px) { .footer-end { margin-left: 0; width: 100%; justify-content: space-between; } }

/* ---------- Theme switch and toast ---------- */

.footer-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  transition: background-color 150ms ease, color 150ms ease;
}
.theme-toggle:hover { background: var(--paper-2); color: var(--ink); }
.theme-toggle .ico { width: 19px; height: 19px; }
.theme-toggle .ico-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  padding: 10px 15px; border-radius: 12px;
  background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease);
}
.toast.is-on { opacity: 1; transform: none; }

/* The app's sweep when the theme changes. */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: theme-sweep 460ms var(--ease); }
@keyframes theme-sweep {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* ---------- Legal pages ---------- */

.legal { padding: clamp(40px, 7vw, 80px) 0 clamp(80px, 10vw, 120px); }
.legal-inner { max-width: 720px; }
.legal h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.02em;
}
.legal .updated { margin-top: 14px; color: var(--ink-muted); font-size: 15px; }
.legal .intro { margin-top: 26px; font-size: 20px; line-height: 1.55; color: var(--ink-soft); }
.legal h2 {
  margin-top: 48px; font-family: var(--font-display); font-weight: 400;
  font-size: 30px; line-height: 1.15; letter-spacing: -0.01em;
}
.legal h3 { margin-top: 26px; font-size: 18px; font-weight: 600; }
.legal p, .legal ul { margin-top: 12px; color: var(--ink-soft); }
.legal ul { padding-left: 22px; }
.legal li { margin-top: 6px; }
.legal li::marker { color: var(--ink-muted); }
.legal a { color: var(--accent); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal address { font-style: normal; margin-top: 12px; color: var(--ink-soft); }
.legal .table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.legal th { font-weight: 600; color: var(--ink); background: var(--paper-2); }
.legal tr:last-child td { border-bottom: 0; }

/* ---------- Motion off ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .rise-up { animation: none; opacity: 1; transform: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .mark { transition: none; background-size: 100% 100%; }
  .hand span { opacity: 1; transition: none; }
  .hand-arrow path { stroke-dashoffset: 0; transition: none; }
  .wave i { animation: none; height: 60%; }
  .wave i:nth-child(odd) { height: 35%; }
  .caret { animation: none; }
  .files .pdf-page i.hl::after { width: calc(100% + 8px); transition: none; }
  .files .scribble { stroke-dashoffset: 0; transition: none; }
  .files .pdf-sticky { opacity: 1; transform: rotate(4deg); transition: none; }
  ::view-transition-new(root) { animation: none; }
}
