/* readkave.com design system: tokens, navbar, motion, screenshots, content. One file for every page.
   Themes: light by default, dark from the system or from the toggle (html[data-theme]).
   Motion: transform and opacity only; everything decorative stops under prefers-reduced-motion. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f8f6f1;            /* paper */
  --bg-2: #f2efe8;          /* alternate section */
  --surface: #fffdf9;
  --surface-2: #efebe3;
  --ink: #1a1814;
  --ink-2: #3d3832;
  --muted: #68625a;         /* 5.4:1 on --bg */
  --line: rgba(26, 24, 20, 0.09);
  --line-2: rgba(26, 24, 20, 0.16);
  --accent: #2563eb;        /* the logo's blue; white text 5.2:1 */
  --accent-hover: #1d4fd0;
  --accent-ink: #fff;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --amber: #e9a515;         /* the logo's bookmark, used sparingly */
  --amber-soft: rgba(233, 165, 21, 0.28);
  --thumb: rgba(26, 24, 20, 0.22);
  --thumb-hover: rgba(37, 99, 235, 0.55);
  --glass: rgba(255, 253, 249, 0.86);
  --shadow-sm: 0 1px 2px rgba(26, 24, 20, 0.06), 0 1px 1px rgba(26, 24, 20, 0.04);
  --shadow-md: 0 2px 4px rgba(26, 24, 20, 0.05), 0 8px 24px rgba(26, 24, 20, 0.08);
  --shadow-lg: 0 4px 8px rgba(26, 24, 20, 0.05), 0 24px 64px rgba(26, 24, 20, 0.14);
  --shadow-accent: 0 6px 20px rgba(37, 99, 235, 0.32);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --nav-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --serif: Literata, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121110; --bg-2: #171614; --surface: #1c1a18; --surface-2: #262320;
    --ink: #ede9e2; --ink-2: #d2ccc2; --muted: #a39d93;
    --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
    --accent: #7aa2ff; --accent-hover: #9bb9ff; --accent-ink: #0d1530; --accent-soft: rgba(122, 162, 255, 0.14);
    --amber: #f0b94a; --amber-soft: rgba(240, 185, 74, 0.3);
    --thumb: rgba(255, 255, 255, 0.18); --thumb-hover: rgba(122, 162, 255, 0.6);
    --glass: rgba(28, 26, 24, 0.84);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.35), 0 28px 72px rgba(0, 0, 0, 0.55);
    --shadow-accent: 0 6px 22px rgba(122, 162, 255, 0.28);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110; --bg-2: #171614; --surface: #1c1a18; --surface-2: #262320;
  --ink: #ede9e2; --ink-2: #d2ccc2; --muted: #a39d93;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
  --accent: #7aa2ff; --accent-hover: #9bb9ff; --accent-ink: #0d1530; --accent-soft: rgba(122, 162, 255, 0.14);
  --amber: #f0b94a; --amber-soft: rgba(240, 185, 74, 0.3);
  --thumb: rgba(255, 255, 255, 0.18); --thumb-hover: rgba(122, 162, 255, 0.6);
  --glass: rgba(28, 26, 24, 0.84);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.35), 0 28px 72px rgba(0, 0, 0, 0.55);
  --shadow-accent: 0 6px 22px rgba(122, 162, 255, 0.28);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 32px); }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Paper grain: a barely visible texture so large flat areas don't look like plain CSS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--amber-soft); color: var(--ink); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 16px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; transition: transform 0.2s var(--ease-out); }
.skip:focus { transform: translateY(64px); }

/* Lenis (smooth scrolling) needs these; without JS the native smooth scroll above applies. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- custom scrollbar ---------- */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 999px; border: 3px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--thumb-hover); border: 3px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: var(--bg); }
@supports (-moz-appearance: none) { html { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; } }

/* ---------- typography ---------- */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 24px; text-wrap: balance; }
h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; text-wrap: balance; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.lead { font-size: 20px; line-height: 1.6; color: var(--ink-2); max-width: 680px; margin: 0 0 32px; text-wrap: pretty; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.note { font-size: 14px; color: var(--muted); margin: 16px 0 0; max-width: 620px; }
code { font: 14px var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
kbd { font: 13px var(--mono); background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
/* The highlighter: one phrase in a hero headline, swept in like the extension's own highlight. */
mark.hl { color: inherit; background: linear-gradient(transparent 58%, var(--amber-soft) 58%, var(--amber-soft) 92%, transparent 92%); background-repeat: no-repeat; background-size: 100% 100%; padding: 0 2px; border-radius: 2px; }
html.js mark.hl { background-size: 0% 100%; animation: hl-sweep 0.9s 0.45s var(--ease-out) forwards; }
@keyframes hl-sweep { to { background-size: 100% 100%; } }

/* ---------- buttons ---------- */
.btn {
  --lift: 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--radius);
  font: 600 16px/1 var(--sans); text-decoration: none; white-space: nowrap;
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-sm);
  transform: translateY(var(--lift)) scale(1);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.btn:hover { color: var(--accent-ink); background: var(--accent-hover); transform: translateY(-2px) scale(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-accent); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.08s; }
.btn svg { width: 20px; height: 20px; flex: none; transition: transform 0.25s var(--ease-out); }
.btn:hover svg.arrow { transform: translateX(3px); }
.btn.secondary { color: var(--ink); background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { color: var(--ink); background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-md); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- navbar ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding-top: 12px; pointer-events: none; transition: transform 0.45s var(--ease-out); }
.nav.is-hidden { transform: translateY(calc(-100% - 8px)); }
.nav-bar {
  position: relative; pointer-events: auto;
  display: flex; align-items: center; gap: 16px;
  height: var(--nav-h); padding: 0 12px 0 16px;
  border-radius: 18px;
  max-width: 1144px;
  isolation: isolate;
}
/* The glass surface sits on its own layer so it can fade in without animating layout. */
.nav-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.nav.is-scrolled .nav-bar::before, .nav.is-open .nav-bar::before { opacity: 1; transform: scale(1); }
html.js .nav-bar { animation: nav-in 0.7s var(--ease-out) both; }
@keyframes nav-in { from { opacity: 0; transform: translateY(-16px); } }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 650 19px/1 var(--serif); letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: var(--shadow-sm); transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
.brand:hover img { transform: scale(1.14) rotate(-6deg); box-shadow: var(--shadow-accent); }
.brand span { transition: transform 0.4s var(--ease-out); }
.brand:hover span { transform: translateX(2px); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  border-radius: 10px; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out), transform 0.25s var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); transform: scale(1.06); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
html.js .nav-links a { animation: fade-down 0.6s var(--ease-out) both; animation-delay: calc(0.15s + var(--i, 0) * 0.05s); }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; } /* right-aligned even when a page has no nav links */
.nav-links + .nav-actions { margin-left: 8px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.icon-btn:hover { transform: scale(1.08); border-color: var(--accent); box-shadow: var(--shadow-md); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 20px; height: 20px; }
/* Theme toggle: sun and moon stacked, one rotates out as the other rotates in. */
.theme-toggle svg { position: absolute; transition: transform 0.5s var(--ease-out), opacity 0.3s var(--ease-out); }
.theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .sun { opacity: 1; transform: rotate(0) scale(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
  :root:not([data-theme="light"]) .theme-toggle .sun { opacity: 1; transform: rotate(0) scale(1); }
}
.nav-burger { display: none; }
.nav-burger span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.35s var(--ease-out), opacity 0.2s; }
.nav-burger span:nth-child(1) { transform: translateY(-4px); }
.nav-burger span:nth-child(2) { transform: translateY(4px); }
.nav.is-open .nav-burger span:nth-child(1) { transform: rotate(45deg); }
.nav.is-open .nav-burger span:nth-child(2) { transform: rotate(-45deg); }

/* Language button and menu: every language in its own name, the current one ticked. */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 10px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 13px/1 var(--sans); letter-spacing: 0.03em; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.lang-btn svg { width: 18px; height: 18px; transition: transform 0.6s var(--ease-out); }
.lang-btn:hover { transform: scale(1.06); border-color: var(--accent); box-shadow: var(--shadow-md); }
.lang-btn:hover svg, .lang.is-open .lang-btn svg { transform: rotate(-30deg); }
.lang-btn:active { transform: scale(0.96); }
.lang.is-open .lang-btn { border-color: var(--accent); }
.lang-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 2;
  width: 360px; max-width: calc(100vw - 32px); padding: 12px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.97); transform-origin: top right;
  transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s;
}
.lang.is-open .lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s; }
.lang-menu p { margin: 4px 8px 8px; font: 600 12px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.lang-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.lang-menu li { margin: 0; padding: 0; }
.lang-menu li::before { display: none; }
.lang-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-size: 15px; text-decoration: none;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.25s var(--ease-out);
}
.lang-menu a:hover { background: var(--accent-soft); color: var(--ink); transform: translateX(2px); }
.lang-menu a[aria-current] { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.lang-menu a[aria-current]::after { content: "✓"; color: var(--accent); font-weight: 700; }
.lang.is-open .lang-menu li { animation: fade-down 0.35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 0.02s); }
@media (max-width: 900px) { .lang-btn span { display: none; } .lang-btn { padding: 0; width: 40px; justify-content: center; } }
@media (max-width: 420px) { .lang { position: static; } .lang-menu { right: 0; left: 0; margin: 0 auto; width: auto; max-width: none; } }

/* One-time suggestion: "this site is also in your language", from the browser's language list. */
.lang-hint {
  position: fixed; left: 50%; bottom: 24px; z-index: 55;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  font-size: 15px; color: var(--ink);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.4s var(--ease-out);
}
.lang-hint.is-shown { transform: translate(-50%, 0); opacity: 1; }
.lang-hint svg { flex: none; width: 20px; height: 20px; color: var(--accent); }
.lang-hint .btn { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.lang-hint .close { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.lang-hint .close:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 520px) { .lang-hint { left: 16px; right: 16px; transform: translateY(calc(100% + 40px)); flex-wrap: wrap; } .lang-hint.is-shown { transform: none; } .lang-hint { padding: 12px; row-gap: 8px; } .lang-hint span { flex: 1 1 calc(100% - 40px); } .lang-hint .btn { margin-left: 32px; } }

/* Reading progress: a hairline at the very top that fills as the page scrolls. */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; background: linear-gradient(90deg, var(--accent), var(--amber)); transform: scaleX(var(--p, 0)); transform-origin: left; }

@media (max-width: 900px) {
  .nav-burger { display: inline-grid; }
  .nav-cta { display: none; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 8px;
    border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: top center;
    transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s;
  }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s; }
  .nav-links a { height: 48px; padding: 0 16px; font-size: 16px; }
  .nav-links a::after { display: none; }
  .nav-links a:hover { transform: none; background: var(--accent-soft); }
  html.js .nav-links a { animation: none; }
  .nav.is-open .nav-links a { animation: fade-down 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 0.04s); }
  .nav-links + .nav-actions { margin-left: auto; }
}

/* ---------- layout ---------- */
main { display: block; padding-top: calc(var(--nav-h) + 12px); }
.section { padding: 96px 0; overflow-x: clip; } /* reveals slide in from the side: keep them off the scroll width */
.section.tight { padding: 64px 0; }
.section-head { max-width: 680px; margin: 0 0 48px; }
h2.caps { font-size: clamp(18px, 2vw, 22px); letter-spacing: 0.06em; line-height: 1.3; }
.section-head p { color: var(--ink-2); font-size: 18px; margin: 0; }
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .section { padding: 64px 0; }
  .section.tight { padding: 48px 0; }
  .lead { font-size: 18px; }
  .hero .actions { flex-direction: column; align-items: stretch; }
  .hero .actions .btn { width: 100%; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 64px 0 32px; overflow-x: clip; }
.hero.center { text-align: center; }
.hero.center .lead, .hero.center .note { margin-left: auto; margin-right: auto; }
.hero.center .actions { justify-content: center; }
.hero h1 { max-width: 900px; }
.hero.center h1 { margin-left: auto; margin-right: auto; }
/* Atmosphere: two soft blooms in the brand colours behind the hero. */
.hero::before {
  content: ""; position: absolute; inset: -160px -20% auto; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 40%, var(--accent-soft), transparent 70%),
    radial-gradient(30% 40% at 72% 30%, var(--amber-soft), transparent 70%);
  opacity: 0.8; filter: blur(8px);
}
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* ---------- screenshots in a browser frame ---------- */
.shot { position: relative; margin: 0; }
.frame {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
}
.frame-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.frame-bar i { width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); }
.frame-bar i:nth-child(1) { background: #ef6a5e; } .frame-bar i:nth-child(2) { background: #f4bf4f; } .frame-bar i:nth-child(3) { background: #61c454; }
.frame-bar span { margin-left: 16px; flex: 1; max-width: 360px; height: 24px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font: 12px/22px var(--sans); color: var(--muted); padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
/* Light screenshot in the light theme, dark screenshot in the dark one, where both exist. */
.frame img.on-dark { display: none; }
:root[data-theme="dark"] .frame img.on-light.has-dark { display: none; }
:root[data-theme="dark"] .frame img.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .frame img.on-light.has-dark { display: none; }
  :root:not([data-theme="light"]) .frame img.on-dark { display: block; }
}
.shot figcaption { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }

/* The hero screenshot leans back in 3D and straightens as it scrolls into view (--tilt: 1 → 0, set by rk.js). */
.hero-shot { margin: 64px auto 0; max-width: 1100px; perspective: 1600px; }
.hero-shot .frame { transform-origin: 50% 0; transform: rotateX(calc(var(--tilt, 0) * 18deg)) scale(calc(1 - var(--tilt, 0) * 0.06)); will-change: transform; }
.hero-shot::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -32px; height: 64px; z-index: -1; background: var(--accent-soft); filter: blur(32px); border-radius: 50%; }

/* ---------- showcase rows: text beside a screenshot, alternating sides ---------- */
.showcase { display: grid; gap: 96px; }
.row { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.row:nth-child(even) { grid-template-columns: 7fr 5fr; }
.row:nth-child(even) .row-text { order: 2; }
.row-text h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 16px; }
.row-text p { color: var(--ink-2); font-size: 17px; }
.row .frame { transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out); }
.row .frame:hover { transform: translateY(-4px) scale(1.015); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.gallery .frame { transition: transform 0.5s var(--ease-out); }
.gallery .shot:hover .frame { transform: translateY(-4px) scale(1.02); }
@media (max-width: 900px) {
  .showcase { gap: 64px; }
  .row, .row:nth-child(even) { grid-template-columns: 1fr; gap: 24px; }
  .row:nth-child(even) .row-text { order: 0; }
  .gallery { grid-template-columns: 1fr; }
}

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid.four, .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.four, .grid.three { grid-template-columns: 1fr; } }
.card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 19px; margin: 0 0 8px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; } /* whole card clickable */
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.card :focus-visible { outline: none; }
.card:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Feature cards are not links: no lift, just a quiet numbered label. */
.card-num { display: block; margin: 0 0 16px; font: 600 15px/1 var(--serif); color: var(--accent); letter-spacing: 0.02em; }
.card-num::after { content: ""; display: inline-block; width: 24px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--line-2); }

/* Link cards: a file icon, an arrow button in the top corner beside it, a spotlight that follows the pointer. */
.card.link {
  min-height: 100%;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out), border-color 0.3s var(--ease-out);
}
.card.link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.4s var(--ease-out);
}
.card.link:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.link:hover::before { opacity: 1; }
.card.link:not(:has(.file)) h3 { padding-right: 48px; }
.card.link:active { transform: translateY(-2px) scale(0.99); transition-duration: 0.12s; }

.file {
  position: relative; display: grid; place-items: end center;
  width: 44px; height: 54px; margin: 0 0 24px; padding-bottom: 8px;
  border-radius: 8px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--accent) 6%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  color: var(--accent); font: 800 10px/1 var(--sans); letter-spacing: 0.04em;
  transform-origin: 30% 100%;
  transition: transform 0.5s var(--ease-out);
}
.file::before { /* the folded corner */
  content: ""; position: absolute; top: -1px; right: -1px; width: 15px; height: 15px;
  background: color-mix(in srgb, var(--accent) 30%, var(--surface));
  border-bottom-left-radius: 5px;
}
.file::after { /* three text lines on the page */
  content: ""; position: absolute; left: 8px; right: 12px; top: 14px; height: 12px;
  background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--accent) 35%, transparent) 0 2px, transparent 2px 5px);
  border-radius: 1px;
}
.card.link:hover .file { transform: translateY(-3px) rotate(-6deg); }

.card-go {
  position: absolute; right: 24px; top: 24px; z-index: 0;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.45s var(--ease-out);
}
.card-go svg { width: 16px; height: 16px; transition: transform 0.45s var(--ease-out); }
.card.link:hover .card-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: scale(1.08); }
.card.link:hover .card-go svg { transform: rotate(-45deg); }

/* ---------- lists ---------- */
main ul, main ol { padding-left: 0; list-style: none; max-width: 760px; }
main ul > li, main ol > li { position: relative; padding-left: 32px; margin: 0 0 12px; color: var(--ink-2); }
main ul > li::before { content: ""; position: absolute; left: 6px; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
main ol { counter-reset: step; }
main ol > li { counter-increment: step; padding-left: 48px; min-height: 32px; }
main ol > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 14px/1 var(--sans); }

/* ---------- FAQ accordion (rk.js animates the height; without JS it opens instantly) ---------- */
.faq { display: grid; gap: 12px; max-width: 840px; }
.faq details {
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.faq details:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-md); transform: none; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; cursor: pointer; list-style: none;
  font: 600 17px/1.4 var(--serif); color: var(--ink);
  border-radius: inherit;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-icon {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.5s var(--ease-out);
}
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px;
  border-radius: 2px; background: currentColor; transition: transform 0.45s var(--ease-out);
}
.faq-icon::after { transform: rotate(90deg); }
.faq summary:hover .faq-icon { background: var(--accent-soft); color: var(--accent); }
.faq details[open] .faq-icon { background: var(--accent); color: var(--accent-ink); transform: rotate(180deg); }
.faq details[open] .faq-icon::after { transform: rotate(0deg); } /* plus → minus */
/* While closing, the icon and border go back at once instead of waiting for the animation to end. */
.faq details.closing { border-color: var(--line); box-shadow: var(--shadow-sm); }
.faq details.closing .faq-icon { background: var(--surface-2); color: var(--ink-2); transform: none; }
.faq details.closing .faq-icon::after { transform: rotate(90deg); }
.faq-a { overflow: hidden; }
.faq-a p { margin: 0; padding: 0 72px 24px 24px; color: var(--ink-2); }
@media (max-width: 640px) { .faq summary { padding: 16px 16px 16px 20px; } .faq-a p { padding: 0 20px 20px; } }

/* ---------- call to action band ---------- */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 32px 0 0; padding: 64px 48px; border-radius: 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
}
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 20% 0%, var(--accent-soft), transparent 70%), radial-gradient(40% 70% at 85% 100%, var(--amber-soft), transparent 70%); }
.cta-band img { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 16px; box-shadow: var(--shadow-md); transition: transform 0.5s var(--ease-out); }
.cta-band:hover img { transform: scale(1.08) rotate(-4deg); }
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { color: var(--ink-2); max-width: 520px; margin: 0 auto 32px; }
.cta-band .actions { justify-content: center; }
@media (max-width: 640px) { .cta-band { padding: 48px 24px; border-radius: 20px; } }

/* ---------- footer ---------- */
.site-footer { margin-top: 96px; padding: 64px 0 48px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 48px; }
.foot-brand p { color: var(--muted); max-width: 320px; margin: 16px 0 0; }
.foot-col h4 { margin: 0 0 16px; font: 600 13px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-col.langs ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foot-col a { color: var(--ink-2); text-decoration: none; display: inline-block; transition: color 0.2s var(--ease-out), transform 0.25s var(--ease-out); }
.foot-col a:hover { color: var(--accent); transform: translateX(3px); }
.foot-col a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-bottom a { color: var(--muted); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- long-form pages (guides, help, privacy, terms) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); margin: 56px 0 12px; }
.prose h3 { margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { max-width: 720px; }
.updated, .date { font-size: 14px; color: var(--muted); margin: -8px 0 32px; }
.prose.page { padding-top: 48px; }
h2.label { font: 600 13px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 64px 0 16px; }
.prose figure { margin: 32px 0; }
.prose figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); }
.prose figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }
.table-scroll { overflow-x: auto; margin: 24px 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
.cta { margin: 48px 0; padding: 32px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); }
.cta p { margin: 0 0 16px; color: var(--ink); font: 600 20px/1.4 var(--serif); }
.cta .note { font: 14px/1.6 var(--sans); color: var(--muted); margin: 16px 0 0; }
main ul.plain > li::before { display: none; }
main ul.plain > li { padding-left: 0; }
main li > ol, main li > ul { margin-top: 12px; }
a.card { display: block; color: inherit; text-decoration: none; }

/* ---------- scroll reveal (rk.js adds .in; without JS everything is simply visible) ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
html.js [data-reveal="left"] { transform: translateX(-32px); }
html.js [data-reveal="right"] { transform: translateX(32px); }
html.js [data-reveal="scale"] { transform: scale(0.96); }
html.js [data-reveal].in { opacity: 1; transform: none; }
html.js .hero [data-hero] { animation: fade-up 0.9s var(--ease-out) both; animation-delay: calc(0.1s + var(--i, 0) * 0.09s); }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

/* ---------- theme switch: a circle grows from the toggle (View Transitions, where supported) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal 0.6s var(--ease-in-out); }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0%)); } to { clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 0%)); } }
/* Page to page: a soft cross-fade in browsers that support cross-document view transitions. */
@view-transition { navigation: auto; }

/* ---------- reduced motion: keep everything, move nothing ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; }
  html:not(.lenis) { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .hero-shot .frame { transform: none; }
  ::view-transition-new(root) { animation: none; }
}
