/* ==========================================================================
   Loach website
   --------------------------------------------------------------------------
   The palette, glass recipes and radii are lifted from the app itself
   (src/styles/globals.css, Aurora background style), so the site and the
   app read as one product. Tokens are space-separated HSL / RGB triplets,
   used as hsl(var(--foreground) / .5), exactly like the app.
   ========================================================================== */

:root {
  --background: 30 25% 97%;
  --foreground: 230 30% 7%;
  --primary: 22 95% 60%;
  --primary-text: 22 95% 34%;
  /* The app's 60%-lightness accent is a fill colour; white text on it is
     2.6:1. Badges and buttons that carry text use this deeper step (4.6:1). */
  --primary-strong: 20 90% 42%;
  --primary-glow: 255 110 50;
  --ring: 22 95% 38%;
  --border: 230 25% 12% / 0.12;
  --azure: 210 100% 50%;
  --ok: 152 62% 30%;
  --bad: 0 84% 44%;

  --glass-tint: 255 255 255;
  --glass-surface-a: 0.62;
  --glass-surface-b: 0.42;
  --glass-highlight: 0.90;
  --glass-shadow: 0 20px 60px -22px rgba(24, 18, 44, 0.22);
  --prompt-glow: 0 10px 40px -8px rgba(255, 110, 50, 0.18);
  /* Hero download button: the page's peach → lavender → orange, as fill and rim stops. */
  --cta-fill: rgb(255 196 150 / 0.40), rgb(236 140 190 / 0.32) 48%, rgb(255 110 50 / 0.45);
  --cta-rim: rgb(255 180 130 / 0.60), rgb(220 130 200 / 0.50) 48%, rgb(255 110 50 / 0.85);

  --text-2: hsl(var(--foreground) / 0.80);
  --text-3: hsl(var(--foreground) / 0.66);

  --radius: 1.25rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --wrap: 1200px;
  --gutter: 24px;

  color-scheme: light;
}

[data-theme="dark"] {
  --background: 230 30% 6%;
  --foreground: 0 0% 100%;
  --primary-text: 22 95% 62%;
  --ring: 22 95% 60%;
  --border: 0 0% 100% / 0.10;
  --azure: 210 100% 58%;
  --ok: 152 60% 58%;
  --bad: 0 84% 66%;

  --glass-surface-a: 0.09;
  --glass-surface-b: 0.04;
  --glass-highlight: 0.14;
  --glass-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.70);
  --prompt-glow: 0 10px 40px -8px rgba(255, 110, 50, 0.28);
  --cta-fill: rgb(255 140 90 / 0.16), rgb(190 100 210 / 0.30) 48%, rgb(255 110 50 / 0.42);
  --cta-rim: rgb(255 160 110 / 0.35), rgb(200 120 220 / 0.45) 48%, rgb(255 110 50 / 0.85);

  --text-2: hsl(var(--foreground) / 0.82);
  --text-3: hsl(var(--foreground) / 0.64);

  color-scheme: dark;
}

/* ----- base ------------------------------------------------------------- */

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

* { border-color: hsl(var(--border)); }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "rlig" 1, "calt" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

/* lucide-style stroke icons, like the app's lucide-react set */
svg.i {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.f { fill: currentColor; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

.prose a,
.link {
  color: hsl(var(--primary-text));
  font-weight: 500;
  border-bottom: 1px solid hsl(var(--primary) / 0.45);
  transition: border-color 0.2s ease;
}
.prose a:hover,
.link:hover { border-bottom-color: hsl(var(--primary)); }

code, kbd, pre { font-family: var(--font-mono); }

code {
  font-size: 0.86em;
  font-weight: 500;
  padding: 0.12em 0.4em;
  border-radius: 0.35rem;
  background: hsl(var(--foreground) / 0.07);
  border: 1px solid hsl(var(--foreground) / 0.10);
  white-space: nowrap;
}

kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  color: hsl(var(--foreground) / 0.7);
  background: hsl(var(--foreground) / 0.06);
  border: 1px solid hsl(var(--foreground) / 0.14);
}

::selection { background: hsl(var(--foreground) / 0.24); }

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 3px;
  border-radius: 8px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ----- Aurora backdrop (the app's .app-mesh) ---------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: #f4efe8;
  background-image:
    radial-gradient(at 6% 16%, hsla(28, 95%, 88%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(202, 85%, 90%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(268, 70%, 93%, 0.65) 0px, transparent 55%),
    radial-gradient(at 82% 58%, hsla(18, 92%, 84%, 0.85) 0px, transparent 55%),
    radial-gradient(at 96% 88%, hsla(342, 85%, 90%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #f4f2e7 0%, #eee0f2 35%, #f8d7cf 70%, #f8c9a8 100%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(20, 10, 30, 0.08) 100%);
}

.aurora i {
  position: absolute;
  width: 48vmax;
  height: 48vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
  will-change: transform;
}
.aurora i:nth-child(1) {
  left: 10%; top: 15%;
  background: radial-gradient(circle, hsla(220, 100%, 78%, 0.30), transparent 62%);
  animation: drift-a 38s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  right: -6%; top: 35%;
  background: radial-gradient(circle, hsla(18, 100%, 70%, 0.34), transparent 62%);
  animation: drift-b 46s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  left: 40%; top: -18%;
  background: radial-gradient(circle, hsla(330, 100%, 78%, 0.24), transparent 62%);
  animation: drift-c 52s ease-in-out infinite alternate;
}

[data-theme="dark"] .aurora {
  background-color: #06070f;
  background-image:
    radial-gradient(at 6% 16%, hsla(225, 75%, 15%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(255, 60%, 14%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(305, 60%, 18%, 0.55) 0px, transparent 55%),
    radial-gradient(at 80% 58%, hsla(14, 80%, 32%, 0.85) 0px, transparent 55%),
    radial-gradient(at 96% 88%, hsla(8, 85%, 28%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #080a1a 0%, #140e22 35%, #361618 70%, #4a1a10 100%);
}
[data-theme="dark"] .aurora::after {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.45) 100%);
}
[data-theme="dark"] .aurora i:nth-child(1) { background: radial-gradient(circle, hsla(220, 80%, 55%, 0.20), transparent 62%); }
[data-theme="dark"] .aurora i:nth-child(2) { background: radial-gradient(circle, hsla(18, 95%, 55%, 0.24), transparent 62%); }
[data-theme="dark"] .aurora i:nth-child(3) { background: radial-gradient(circle, hsla(330, 85%, 55%, 0.14), transparent 62%); }

@keyframes drift-a { to { transform: translate3d(18vw, 22vh, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-24vw, -14vh, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(-12vw, 30vh, 0) scale(1.1); } }

/* ----- glass recipes (the app's .glass-panel / .glass-prompt / .chip-glass) */

.glass {
  background: linear-gradient(
    180deg,
    rgb(var(--glass-tint) / calc(var(--glass-surface-a) + 0.08)) 0%,
    rgb(var(--glass-tint) / calc(var(--glass-surface-b) + 0.06)) 100%
  );
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
  border: 1px solid hsl(var(--foreground) / 0.12);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset,
    var(--glass-shadow);
}

.glass-prompt {
  background: linear-gradient(
    135deg,
    rgb(var(--glass-tint) / calc(var(--glass-surface-a) + 0.06)) 0%,
    rgb(var(--glass-tint) / var(--glass-surface-b)) 50%,
    rgb(var(--glass-tint) / calc(var(--glass-surface-b) + 0.04)) 100%
  );
  backdrop-filter: blur(40px) saturate(170%);
  -webkit-backdrop-filter: blur(40px) saturate(170%);
  border: 1px solid hsl(var(--foreground) / 0.14);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset,
    var(--glass-shadow),
    var(--prompt-glow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--foreground) / 0.9);
  background: rgb(var(--glass-tint) / calc(var(--glass-surface-a) - 0.04));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid hsl(var(--foreground) / 0.12);
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
a.chip:hover,
button.chip:hover {
  background: rgb(var(--glass-tint) / var(--glass-surface-a));
  border-color: hsl(var(--foreground) / 0.22);
}
button.chip[aria-pressed="true"] {
  color: hsl(var(--background));
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

.grad-text {
  background: linear-gradient(135deg, hsl(var(--foreground)) 0%, hsl(var(--foreground) / 0.9) 45%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.08em;
}

/* ----- buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.btn:active { transform: scale(0.98); }

/* Primary: the app's prompt bar with its orange send button. */
.btn-send {
  padding: 0 7px 0 24px;
  color: hsl(var(--foreground));
}
.btn-send .send-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--primary));
  box-shadow: 0 6px 18px -4px rgb(var(--primary-glow) / 0.7);
  transition: transform 0.35s var(--ease-spring);
}
.btn-send:hover {
  border-color: hsl(var(--foreground) / 0.24);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / calc(var(--glass-highlight) + 0.08)) inset,
    var(--glass-shadow),
    0 12px 48px -8px rgb(var(--primary-glow) / 0.45);
}
.btn-send:hover .send-dot { transform: translateY(2px) scale(1.06); }

/* Gradient variant (hero CTA): an Aurora wash over the glass and a gradient rim. */
.btn-grad { position: relative; isolation: isolate; }
.btn-grad,
.btn-grad:hover { border-color: transparent; }
.btn-grad::before,
.btn-grad::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}
.btn-grad::after {
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, var(--cta-fill));
}
.btn-grad::before {
  inset: -1px;
  padding: 1px;
  background: linear-gradient(100deg, var(--cta-rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.btn-ghost {
  color: hsl(var(--foreground) / 0.9);
  background: rgb(var(--glass-tint) / calc(var(--glass-surface-a) - 0.04));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid hsl(var(--foreground) / 0.12);
}
.btn-ghost:hover {
  background: rgb(var(--glass-tint) / var(--glass-surface-a));
  border-color: hsl(var(--foreground) / 0.22);
}

.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; }

/* ----- header pill ------------------------------------------------------ */

.site-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

/* Flat: keeps the glass edge highlight but drops the floating shadow. */
.header-pill {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 4px 0 16px;
  border-radius: 999px;
  box-shadow: 0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset;
  transition: transform 0.4s var(--ease-out);
}
.site-header.scrolled .header-pill { transform: translateY(-4px); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: 10px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.brand img { border-radius: 7px; transition: transform 0.6s var(--ease-spring); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand .ver {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-3);
}

.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.75);
  transition: color 0.2s ease, background 0.2s ease;
}
.primary-nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.07); }
.primary-nav a[aria-current="page"] { color: hsl(var(--foreground)); background: none; }
.primary-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 0 6px hsl(var(--primary) / 0.7);
}

.header-tools { display: flex; align-items: center; gap: 4px; margin-left: 6px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: hsl(var(--foreground) / 0.75);
  transition: background 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { background: hsl(var(--foreground) / 0.08); color: hsl(var(--foreground)); }

.theme-toggle svg { transition: transform 0.6s var(--ease-spring), opacity 0.3s ease; }
.theme-toggle .ico-moon { position: absolute; }
.theme-toggle { position: relative; }
[data-theme="light"] .theme-toggle .ico-moon,
:root:not([data-theme]) .theme-toggle .ico-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .ico-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }

.nav-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 3.5px; }
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.3px) rotate(-45deg); }

.mobile-nav {
  pointer-events: auto;
  position: absolute;
  top: 56px;
  left: 12px;
  right: 12px;
  display: grid;
  gap: 2px;
  padding: 10px;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav.open { opacity: 1; transform: none; }
.mobile-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.85);
}
.mobile-nav a:hover { background: hsl(var(--foreground) / 0.07); color: hsl(var(--foreground)); }
.mobile-nav a[aria-current="page"] { background: none; color: hsl(var(--foreground)); font-weight: 600; }
.mobile-nav a[aria-current="page"]::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 0 6px hsl(var(--primary) / 0.7);
}

@media (max-width: 960px) {
  .primary-nav,
  .k-trigger,
  .nav-gh { display: none; }
  .nav-toggle { display: flex; }
  /* A touch taller than the desktop pill, with 44px tap targets. */
  .header-pill { width: 100%; max-width: 560px; height: 52px; padding-left: 18px; justify-content: space-between; }
  .header-pill .icon-btn { width: 44px; height: 44px; }
  .header-pill .brand img { width: 28px; height: 28px; }
  .brand { margin-right: auto; }
  .mobile-nav { top: 62px; }
}

/* ----- floating CTA ---------------------------------------------------- */

.floating-cta {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  height: 50px;
  font-size: 14px;
  transition: opacity 0.35s ease, transform 0.5s var(--ease-out), box-shadow 0.25s ease;
}
.floating-cta .send-dot { width: 36px; height: 36px; }
.floating-cta.is-collapsed {
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  pointer-events: none;
}
@media (max-width: 640px) {
  .floating-cta { left: 16px; right: 16px; bottom: 14px; justify-content: space-between; }
}
/* Desktop-only app: no floating pill on phones and tablets (main.js also drops it by user agent). */
@media (hover: none) and (pointer: coarse) {
  .floating-cta { display: none; }
}

/* ----- section scaffolding --------------------------------------------- */

main { display: block; }

.section { padding: 120px 0; position: relative; }
.section-tight { padding: 72px 0; }

.section-head {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head.left { margin-left: 0; text-align: left; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--primary-text));
}
.kicker::before {
  content: "";
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}

.h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.sub {
  margin-top: 18px;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .section { padding: 96px 0; }
}
@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .section-tight { padding: 56px 0; }
  .section-head { margin-bottom: 40px; }
}

/* reveal-on-scroll; only hidden when JS is running */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ----- hero ------------------------------------------------------------ */

.hero { padding: 150px 0 40px; text-align: center; position: relative; }
@media (max-width: 640px) { .hero { padding-top: 112px; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  margin-bottom: 28px;
  font-size: 13px;
}
.hero-badge .tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: hsl(var(--primary-strong));
  box-shadow: 0 0 14px -2px rgb(var(--primary-glow) / 0.7);
}
.hero-badge svg { transition: transform 0.3s var(--ease-out); }
@media (max-width: 520px) {
  .hero-badge { max-width: 100%; white-space: normal; text-align: left; border-radius: 18px; }
}
.hero-badge:hover svg { transform: translateX(3px); }

.display {
  font-size: clamp(2.7rem, 7.4vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.0;
  max-width: 14ch;
  margin: 0 auto;
}

.hero .lede {
  max-width: 640px;
  margin: 26px auto 0;
  font-size: clamp(16.5px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
/* phones: one column of equal-width buttons */
@media (max-width: 520px) {
  .hero .cta-row { flex-direction: column; width: min(100%, 300px); margin-inline: auto; }
  .hero .cta-row .btn-send { justify-content: space-between; }
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-3);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { color: hsl(var(--ok)); }

/* load-in choreography for the hero copy */
.js .hero [data-rise] {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 1s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ----- the app window replica ------------------------------------------ */

.stage {
  position: relative;
  margin: 72px auto 0;
  max-width: 1120px;
  perspective: 2000px;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 8% 6% -6%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 30% 50%, hsla(230, 90%, 60%, 0.35), transparent),
    radial-gradient(closest-side at 72% 55%, rgb(var(--primary-glow) / 0.45), transparent);
  filter: blur(60px);
  opacity: 0.8;
}

.app {
  --app-fg: 0 0% 100%;
  position: relative;
  display: grid;
  grid-template-rows: 36px 1fr;
  height: clamp(460px, 56vw, 640px);
  overflow: hidden;
  text-align: left;
  color: hsl(var(--foreground));
  border-radius: 16px;
  border: 1px solid hsl(var(--foreground) / 0.14);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset,
    0 50px 120px -30px rgba(20, 12, 40, 0.45),
    0 0 0 1px hsl(var(--foreground) / 0.04);
  background-color: #f4efe8;
  background-image:
    radial-gradient(at 6% 16%, hsla(28, 95%, 88%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(202, 85%, 90%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(268, 70%, 93%, 0.65) 0px, transparent 55%),
    radial-gradient(at 82% 58%, hsla(18, 92%, 84%, 0.85) 0px, transparent 55%),
    radial-gradient(at 96% 88%, hsla(342, 85%, 90%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #f4f2e7 0%, #eee0f2 35%, #f8d7cf 70%, #f8c9a8 100%);
  /* paint the mesh under the translucent border too; with the default
     padding-box origin the tile repeats there and each edge shows the
     opposite side's colour (an ember line down the left in dark mode) */
  background-origin: border-box;
  transform-origin: 50% 0%;
}
[data-theme="dark"] .app {
  border-color: hsl(0 0% 100% / 0.12);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / 0.10) inset,
    0 60px 140px -30px rgba(0, 0, 0, 0.85);
  background-color: #06070f;
  background-image:
    radial-gradient(at 6% 16%, hsla(225, 75%, 15%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(255, 60%, 14%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(305, 60%, 18%, 0.55) 0px, transparent 55%),
    radial-gradient(at 80% 58%, hsla(14, 80%, 32%, 0.85) 0px, transparent 55%),
    radial-gradient(at 96% 88%, hsla(8, 85%, 28%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #080a1a 0%, #140e22 35%, #361618 70%, #4a1a10 100%);
}

.js .stage .app {
  opacity: 0;
  transform: rotateX(22deg) translateY(40px) scale(0.94);
  animation: window-in 1.6s var(--ease-out) 0.45s forwards;
}
@keyframes window-in { to { opacity: 1; transform: none; } }

/* title bar */
.app-tb {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 0 0 6px;
  font-size: 12px;
  background: hsl(var(--foreground) / 0.03);
  border-bottom: 1px solid hsl(var(--foreground) / 0.08);
}
.app-tb-left { display: flex; align-items: center; gap: 8px; color: hsl(var(--foreground) / 0.7); }
.app-tb-left .ic { display: grid; place-items: center; width: 28px; height: 28px; }
.app-tb-left strong { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; letter-spacing: 0.02em; color: hsl(var(--foreground) / 0.85); }
.app-tb-left .ver { font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0; color: hsl(var(--foreground) / 0.6); }
.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 6px 0 10px;
  width: clamp(180px, 28vw, 320px);
  border-radius: 6px;
  color: hsl(var(--foreground) / 0.65);
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.08);
}
.app-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-search kbd { font-size: 9.5px; padding: 2px 4px; border-radius: 4px; letter-spacing: 0.05em; }
.app-tb-right { display: flex; justify-content: flex-end; align-items: center; height: 100%; color: hsl(var(--foreground) / 0.7); }
.app-tb-right .ic { display: grid; place-items: center; width: 36px; height: 100%; }
.app-tb-right .win { width: 44px; }
/* macOS draws its own traffic lights over the bar (v1.6.0); main.js sets .os-mac */
.app-tb .lights { display: none; align-items: center; gap: 9px; padding-left: 8px; }
.app-tb .lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.2); }
.app-tb .lights i:nth-child(2) { background: #febc2e; }
.app-tb .lights i:nth-child(3) { background: #28c840; }
.os-mac .app-tb .lights { display: inline-flex; }
.os-mac .app-tb .win { display: none; }

.app-main { display: grid; grid-template-columns: 56px minmax(0, 1fr); min-height: 0; }

.app-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  background: hsl(var(--foreground) / 0.04);
  border-right: 1px solid hsl(var(--foreground) / 0.08);
  color: hsl(var(--foreground) / 0.72);
}
.app-rail .ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.app-rail .ic.on { background: hsl(var(--foreground) / 0.10); color: hsl(var(--foreground)); }
.app-rail .spacer { flex: 1; }
.app-rail .foot { padding-top: 8px; border-top: 1px solid hsl(var(--foreground) / 0.08); }

.app-chat { display: grid; grid-template-rows: 48px 1fr; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; position: relative; }

.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  font-size: 14px;
  border-bottom: 1px solid hsl(var(--foreground) / 0.05);
}
.app-head .title { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.app-head .title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-head .spacer { flex: 1; }
.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid hsl(var(--foreground) / 0.15);
  background: hsl(var(--foreground) / 0.03);
  white-space: nowrap;
}
.app-head .ic { display: grid; place-items: center; width: 32px; height: 32px; color: hsl(var(--foreground) / 0.75); }

.app-body { position: relative; min-height: 0; overflow: hidden; }

/* empty state, mirrors HeroComposer in App.tsx */
.app-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 28px 40px;
  transition: opacity 0.5s ease, transform 0.6s var(--ease-out);
}
.app-empty.gone { opacity: 0; transform: translateY(-24px) scale(0.98); pointer-events: none; }

.greet {
  min-height: 1.2em;
  font-size: clamp(26px, 3.8vw, 46px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: center;
}
.greet .caret {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  vertical-align: -0.08em;
  background: hsl(var(--primary));
  animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.greet-sub { margin-top: 12px; font-size: 13.5px; color: hsl(var(--foreground) / 0.7); text-align: center; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin-top: 28px;
  padding: 10px 10px 10px 18px;
  border-radius: 28px;
  font-size: 15px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.composer.focus {
  border-color: hsl(var(--foreground) / 0.24);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / calc(var(--glass-highlight) + 0.08)) inset,
    var(--glass-shadow),
    0 12px 48px -8px rgb(var(--primary-glow) / 0.40);
}
.composer .plus,
.composer .mic { display: grid; place-items: center; width: 32px; height: 40px; color: hsl(var(--foreground) / 0.68); }
.composer .field {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 0;
  line-height: 1.6;
  color: hsl(var(--foreground));
  max-height: calc(1.6em * 3 + 16px);
  overflow: hidden;
}
.composer .field:empty::before { content: attr(data-placeholder); color: hsl(var(--foreground) / 0.5); }
.composer .field .tc {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: hsl(var(--primary));
  animation: blink 1s step-start infinite;
}

.send {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--primary));
  box-shadow: 0 6px 20px -6px rgb(var(--primary-glow) / 0.8);
  flex-shrink: 0;
}
.send svg { position: absolute; transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
.send .stop { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.send.streaming .arrow { opacity: 0; transform: scale(0.5) rotate(90deg); }
.send.streaming .stop { opacity: 1; transform: none; }
.send.streaming::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: hsl(var(--primary));
  animation: pulse-soft 2.4s ease-in-out infinite;
  z-index: -1;
}
@keyframes pulse-soft { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.12; } }
.send.press { animation: press 0.35s var(--ease-out); }
@keyframes press { 40% { transform: scale(0.88); } }

.composer-wrap { position: relative; width: 100%; max-width: 640px; margin-top: 28px; }
.composer-wrap .composer { margin-top: 0; max-width: none; }

/* the chat's Library sources above the composer (ChatSourceChips) */
.src-row {
  display: flex;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out), margin 0.45s var(--ease-out), opacity 0.3s ease;
}
.src-row.on { max-height: 40px; margin-bottom: 12px; opacity: 1; }
.src-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid hsl(var(--foreground) / 0.15);
  background: hsl(var(--foreground) / 0.05);
}
.src-chip .dim { font-size: inherit; }
.src-chip > svg:last-child { color: hsl(var(--foreground) / 0.5); }
.src-chip.cfg { border-color: hsl(var(--primary) / 0.4); background: hsl(var(--primary) / 0.1); }
.src-chip.cfg > svg:first-child { color: hsl(var(--primary)); }

/* the `#` list (MentionPalette) */
.mention {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid hsl(var(--foreground) / 0.10);
  background: hsl(var(--background) / 0.94);
  box-shadow: 0 20px 40px -12px rgba(20, 12, 40, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}
.mention.on { opacity: 1; transform: none; }
.mention-head { display: flex; justify-content: space-between; gap: 12px; padding: 4px 10px 6px; font-size: 10.5px; color: hsl(var(--foreground) / 0.55); }
.mention-head span:first-child { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.mention-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; transition: background 0.2s ease, transform 0.2s ease; }
.mention-row.on { background: hsl(var(--foreground) / 0.08); }
.mention-row.press { transform: scale(0.98); }
.mention-row .grow { flex: 1; min-width: 0; }
.mention-row b { display: block; font-size: 13.5px; font-weight: 400; color: hsl(var(--foreground) / 0.9); }
.mention-row small { display: block; font-size: 11.5px; color: hsl(var(--foreground) / 0.6); }

/* Library item tiles, tinted per kind like libraryUi.tsx */
.lib-ic { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; }
.lib-ic.ds { color: #7c3aed; background: hsl(258 90% 66% / 0.12); }
.lib-ic.tx { color: #b45309; background: hsl(38 92% 50% / 0.12); }
[data-theme="dark"] .lib-ic.ds { color: #c4b5fd; }
[data-theme="dark"] .lib-ic.tx { color: #fcd34d; }

/* "Used 6 excerpts from 3 sources." above a reply (SourcesUsedChip) */
.used { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: hsl(var(--foreground) / 0.65); }
.app-thread .used { align-self: flex-start; margin: 0 0 -10px; animation: msg-in 0.4s var(--ease-out) both; }

.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.suggest .chip { font-size: 12px; padding: 8px 16px; }
.suggest .chip.press { transform: scale(0.95); border-color: hsl(var(--primary) / 0.6); }

/* conversation state */
.app-thread {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 26px clamp(18px, 6vw, 90px) 110px;
  gap: 18px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.app-thread.on { opacity: 1; }
.app-dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: min(640px, calc(100% - 36px));
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.6s var(--ease-out);
}
.app-dock.on { opacity: 1; transform: translateX(-50%); }
.app-dock .composer { margin: 0; max-width: none; }
.ctx-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 18px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: hsl(var(--foreground) / 0.6);
}
.ctx-bar .track { flex: 1; height: 3px; border-radius: 3px; background: hsl(var(--foreground) / 0.10); overflow: hidden; }
.ctx-bar .fill { display: block; height: 100%; width: var(--p, 4%); border-radius: inherit; background: hsl(var(--primary)); transition: width 0.6s var(--ease-out); }

.msg-user {
  align-self: flex-end;
  max-width: 78%;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 24px 8px 24px 24px;
  border: 1px solid hsl(var(--foreground) / 0.10);
  background: hsl(var(--foreground) / 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: msg-in 0.5s var(--ease-out) both;
}
.msg-user .att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 10px;
  font-size: 12px;
  background: hsl(var(--foreground) / 0.06);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.msg-user .att b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 8.5px; color: #fff; background: hsl(0 72% 52%); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }

.msg-ai { max-width: 86%; font-size: 14px; line-height: 1.65; animation: msg-in 0.5s var(--ease-out) both; }
.msg-ai p + p,
.msg-ai p + ul,
.msg-ai ul + p { margin-top: 8px; }
.msg-ai ul { margin: 6px 0 0; padding-left: 1.3em; }
.msg-ai li { margin: 3px 0; }
.msg-ai li::marker { color: hsl(var(--foreground) / 0.35); }
.msg-ai code { font-size: 0.86em; }
.msg-ai pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  overflow: hidden;
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.10);
  white-space: pre;
}
.msg-ai .cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  border-radius: 2px;
  background: hsl(var(--foreground) / 0.6);
  animation: blink 1s step-start infinite;
}
.metrics {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--foreground) / 0.62);
  animation: msg-in 0.4s var(--ease-out) both;
}

.called {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: hsl(var(--foreground) / 0.72);
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.called svg { color: hsl(var(--primary-text)); }
.app-thread .called { align-self: flex-start; margin: 0 0 -10px; animation: msg-in 0.4s var(--ease-out) both; }

/* syntax colours (github-dark in dark, github-light in light, like the app) */
.tk-k { color: #a0111f; }
.tk-f { color: #6f42c1; }
.tk-s { color: #032f62; }
.tk-n { color: #005cc5; }
.tk-c { color: #57606a; }
[data-theme="dark"] .tk-k { color: #ff7b72; }
[data-theme="dark"] .tk-f { color: #d2a8ff; }
[data-theme="dark"] .tk-s { color: #a5d6ff; }
[data-theme="dark"] .tk-n { color: #79c0ff; }
[data-theme="dark"] .tk-c { color: #8b949e; }

/* Narrow screens: lay the window out at a fixed desktop size (840 × 480, the
   desktop's 1.75 : 1) and scale it down to the stage, so phones see the same
   window as desktops, only smaller. tan(atan2(a, b)) is a / b as a plain number,
   which `scale` needs; `scale` stacks with the entry animation's `transform`. */
@supports (container-type: inline-size) and (scale: tan(atan2(1px, 2px))) {
  @media (max-width: 880px) {
    .stage { container-type: inline-size; aspect-ratio: 840 / 480; }
    .app {
      position: absolute;
      top: 0;
      left: 50%;
      width: 840px;
      height: 480px;
      margin-left: -420px;
      scale: tan(atan2(100cqw, 840px));
    }
    /* the vw-based sizes, fixed at what a desktop shows for an 840px window */
    .app .greet { font-size: 34px; }
    .app-search { width: 320px; }
    /* the bottom padding gives home.js room to scroll a long reply clear of the dock */
    .app-thread { padding: 26px 56px 160px; scroll-behavior: smooth; }
  }
}

/* Fallback without container queries: a narrow, phone-shaped window. */
@supports not ((container-type: inline-size) and (scale: tan(atan2(1px, 2px)))) {
@media (max-width: 760px) {
  .app { grid-template-rows: 36px 1fr; height: 470px; border-radius: 14px; }
  .app-main { grid-template-columns: minmax(0, 1fr); }
  .app-rail,
  .app-tb-right .ic:not(.win),
  .app-tb-left .ver,
  .app-search span,
  .app-head .ic.hide-sm { display: none; }
  .app-tb { grid-template-columns: auto 1fr auto; }
  .app-search { width: auto; padding: 0 8px; margin-left: 10px; justify-self: start; }
  .app-tb-right .win { width: 34px; }
  .model-pill { padding: 0 10px 0 12px; font-size: 12px; }
  .app-head .title span { display: none; }
  .app-thread { padding: 18px 16px 104px; }
  .app-dock { width: calc(100% - 32px); }
  .mention-head span:last-child,
  .src-chip .mode { display: none; }
  .src-row { gap: 6px; }
  .src-chip { gap: 5px; padding: 0 8px; font-size: 11.5px; }
  .msg-user { max-width: 90%; }
  .msg-ai { max-width: 100%; }
  .suggest .chip:nth-child(n+3) { display: none; }
}
}

/* ----- pillars --------------------------------------------------------- */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar { padding: 30px 28px 32px; position: relative; overflow: hidden; }
.pillar h3 { margin-top: 22px; font-size: 21px; letter-spacing: -0.02em; }
.pillar p { margin-top: 10px; font-size: 15px; color: var(--text-2); }
.pillar-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: hsl(var(--primary-text));
  background: hsl(var(--primary) / 0.12);
  border: 1px solid hsl(var(--primary) / 0.25);
}
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ----- spotlight (pointer-following highlight on glass) ----------------- */

.spot { position: relative; isolation: isolate; }
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--primary-glow) / 0.13), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.spot:hover::before { opacity: 1; }

/* ----- feature chapters ------------------------------------------------ */

.chapters { display: grid; gap: 140px; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 72px;
  align-items: center;
}
.feature.reverse .feature-copy { order: 2; }
.feature.reverse .feature-visual { order: 1; }

.feature-num {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--primary-text));
}
.feature-num b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  background: hsl(var(--primary-strong));
  box-shadow: 0 0 18px -4px rgb(var(--primary-glow) / 0.8);
}
.feature h3 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.feature .feature-lede { margin-top: 16px; font-size: 17px; color: var(--text-2); }

.ticks { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ticks li {
  position: relative;
  padding-left: 32px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat,
    hsl(var(--primary));
  box-shadow: 0 0 12px -3px rgb(var(--primary-glow) / 0.8);
}
.ticks strong { color: hsl(var(--foreground)); font-weight: 600; }

.feature-visual { position: relative; }
.feature-visual::before {
  content: "";
  position: absolute;
  inset: 10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--primary-glow) / 0.28), transparent);
  filter: blur(40px);
}

@media (max-width: 900px) {
  .chapters { gap: 96px; }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .feature.reverse .feature-copy,
  .feature.reverse .feature-visual { order: 0; }
}

/* ----- mocks (shared atoms) -------------------------------------------- */

.mock { padding: 22px; font-size: 13.5px; }
.mock-label {
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.55);
}
.mock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background 0.3s ease;
}
.mock-row.sel { background: hsl(var(--foreground) / 0.08); }
.mock-row .grow { flex: 1; min-width: 0; }
.mock-row .dim,
.dim { color: hsl(var(--foreground) / 0.6); font-size: 12px; }
.mock-row .mono { font-family: var(--font-mono); font-size: 12.5px; }
.mock-sep { height: 1px; margin: 10px 4px; background: hsl(var(--foreground) / 0.08); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--ok)); box-shadow: 0 0 6px hsl(var(--ok) / 0.6); flex-shrink: 0; }
.dot.off { background: hsl(var(--foreground) / 0.25); box-shadow: none; }
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  background: hsl(var(--foreground) / 0.07);
  color: hsl(var(--foreground) / 0.75);
}
.pill-tag.ok { background: hsl(var(--ok) / 0.14); color: hsl(var(--ok)); }
.pill-tag.warn { background: hsl(38 92% 50% / 0.16); color: hsl(32 90% 34%); }
[data-theme="dark"] .pill-tag.warn { color: hsl(40 95% 66%); }
.pill-tag.bad { background: hsl(var(--bad) / 0.12); color: hsl(var(--bad)); }
.pill-tag.pri { background: hsl(var(--primary) / 0.15); color: hsl(var(--primary-text)); }

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid hsl(var(--foreground) / 0.14);
  background: hsl(var(--foreground) / 0.04);
}
.ui-btn.pri { color: #fff; border-color: transparent; background: hsl(var(--primary)); box-shadow: 0 6px 18px -8px rgb(var(--primary-glow)); }
.ui-btn.ghost { border-color: transparent; background: transparent; color: hsl(var(--foreground) / 0.7); }

/* stagger children of a revealed mock */
.js .stagger > * { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out); }
.js .is-in .stagger > * { opacity: 1; transform: none; }
.js .is-in .stagger > *:nth-child(2) { transition-delay: 0.08s; }
.js .is-in .stagger > *:nth-child(3) { transition-delay: 0.16s; }
.js .is-in .stagger > *:nth-child(4) { transition-delay: 0.24s; }
.js .is-in .stagger > *:nth-child(5) { transition-delay: 0.32s; }
.js .is-in .stagger > *:nth-child(6) { transition-delay: 0.40s; }
.js .is-in .stagger > *:nth-child(7) { transition-delay: 0.48s; }
.js .is-in .stagger > *:nth-child(8) { transition-delay: 0.56s; }
.js .is-in .stagger > *:nth-child(9) { transition-delay: 0.64s; }
.js .is-in .stagger > *:nth-child(n+10) { transition-delay: 0.72s; }

/* 01 · model picker */
.picker-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.picker-head .model-pill { background: rgb(var(--glass-tint) / var(--glass-surface-a)); }
.picker-head .model-pill .swap { display: inline-grid; }
.picker-head .model-pill .swap > * { grid-area: 1 / 1; transition: opacity 0.4s ease, transform 0.5s var(--ease-out); }
.picker-head .model-pill .swap > :last-child { opacity: 0; transform: translateY(8px); }
.is-in .picker-head .model-pill .swap > :first-child { animation: swap-out 0.5s var(--ease-out) 2.2s forwards; }
.is-in .picker-head .model-pill .swap > :last-child { animation: swap-in 0.5s var(--ease-out) 2.3s forwards; }
@keyframes swap-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes swap-in { to { opacity: 1; transform: none; } }
.picker .mock-row .check { opacity: 0; color: hsl(var(--primary-text)); }
.picker .mock-row.cur .check { opacity: 1; }
.is-in .picker .mock-row.cur { animation: unsel 0.4s ease 1.9s forwards; }
.is-in .picker .mock-row.cur .check { animation: fade-out 0.3s ease 1.9s forwards; }
.is-in .picker .mock-row.next { animation: sel 0.4s ease 1.2s forwards; }
.is-in .picker .mock-row.next .check { animation: fade-in 0.3s ease 1.9s forwards; }
@keyframes sel { to { background: hsl(var(--foreground) / 0.08); } }
@keyframes unsel { to { background: transparent; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }
.provider-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.provider-chips .chip { font-size: 11.5px; padding: 5px 11px; }
.provider-chips .chip.on { border-color: hsl(var(--primary) / 0.55); color: hsl(var(--primary-text)); }

/* 02 · library */
.lib-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lib-title { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.lib-title svg { color: hsl(var(--foreground) / 0.6); }
.lib-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 14px;
  padding: 3px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.62);
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.lib-tabs span { padding: 5px 11px; border-radius: 11px; }
.lib-tabs span.on { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.10); }
.lib-tabs b { margin-left: 3px; font-size: 11px; font-weight: 400; color: hsl(var(--foreground) / 0.5); }
.lib-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.lib-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; background: hsl(var(--foreground) / 0.035); border: 1px solid hsl(var(--foreground) / 0.10); }
.lib-card .lib-ic { width: 34px; height: 34px; border-radius: 10px; }
.lib-card-title { font-size: 13.5px; font-weight: 600; }
.lib-card p { margin-top: 2px; font-size: 11.5px; color: hsl(var(--foreground) / 0.6); }
.mock .used { margin-top: 16px; }
.used-list { display: grid; gap: 6px; margin: 8px 0 0 20px; }
.used-src { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 12px; background: hsl(var(--foreground) / 0.03); border: 1px solid hsl(var(--foreground) / 0.10); }
.used-src b { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.used-src span { font-size: 11px; color: hsl(var(--foreground) / 0.55); }
@media (max-width: 520px) {
  .lib-cards { grid-template-columns: 1fr; }
  .lib-tabs { display: flex; flex-wrap: nowrap; font-size: 12px; }
  .lib-tabs span { flex: 1 1 auto; padding: 5px 6px; text-align: center; white-space: nowrap; }
}

/* 03 · workspace approval */
.ws-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: hsl(var(--foreground) / 0.8);
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.ws-notice svg { color: hsl(var(--primary-text)); }
.ws-notice .lf { font-size: 10px; letter-spacing: 0.02em; opacity: 0.8; padding-left: 8px; border-left: 1px solid hsl(var(--foreground) / 0.15); }
.approval { padding: 18px; border-radius: 16px; background: hsl(38 92% 50% / 0.07); border: 1px solid hsl(38 92% 50% / 0.35); }
.approval-q { font-size: 13.5px; font-weight: 500; }
.approval-q code { font-size: 12px; }
.approval-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.55);
}
.approval-sub .del { color: hsl(var(--bad)); }
.approval-sub .add { color: hsl(var(--ok)); }
.diff {
  margin: 0;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.7;
  overflow: hidden;
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.diff span { display: block; padding: 0 12px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.diff .d { color: hsl(var(--bad)); background: hsl(var(--bad) / 0.08); }
.diff .a { color: hsl(var(--ok)); background: hsl(var(--ok) / 0.10); }
.diff .c { color: hsl(var(--foreground) / 0.7); }
.js .diff .a { clip-path: inset(0 100% 0 0); }
.js .is-in .diff .a { animation: type-in 1.1s steps(28) 0.9s forwards; }
@keyframes type-in { to { clip-path: inset(0 0 0 0); } }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.is-in .approval-actions .pri { animation: nudge 2.8s ease-in-out 2.2s infinite; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 6px 18px -8px rgb(var(--primary-glow)); }
  50% { box-shadow: 0 0 0 4px hsl(var(--primary) / 0.22), 0 6px 22px -6px rgb(var(--primary-glow)); }
}

/* 04 · models */
.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.model-tile {
  padding: 14px;
  border-radius: 14px;
  background: hsl(var(--foreground) / 0.035);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.model-name { font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.15; letter-spacing: 0; }
.model-tile p { margin-top: 4px; font-size: 12px; color: hsl(var(--foreground) / 0.6); }
.model-tile .pill-tag { margin-top: 10px; }
.pull {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: hsl(var(--foreground) / 0.035);
  border: 1px dashed hsl(var(--foreground) / 0.18);
}
.pull-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.pull-top .mono { font-family: var(--font-mono); }
.pull-bar { margin-top: 10px; height: 6px; border-radius: 6px; background: hsl(var(--foreground) / 0.08); overflow: hidden; }
.pull-bar i {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(14 92% 58%));
  box-shadow: 0 0 12px rgb(var(--primary-glow) / 0.7);
}
.is-in .pull-bar i { animation: pull 5.5s var(--ease-out) 0.6s infinite; }
@keyframes pull { 0% { width: 8%; } 80%, 100% { width: 100%; } }
.pull-pct::after { content: "62%"; }
.is-in .pull-pct::after { animation: pct 5.5s steps(1) 0.6s infinite; }
@keyframes pct {
  0% { content: "8%"; } 15% { content: "31%"; } 30% { content: "52%"; } 45% { content: "70%"; }
  60% { content: "86%"; } 75% { content: "97%"; } 80% { content: "100%"; }
}

/* 05 · spaces & memory */
.space-head { display: flex; align-items: center; gap: 12px; }
.space-ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, hsl(250 70% 60%), hsl(var(--primary)));
}
.space-name { font-size: 15px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.space-instr {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: hsl(var(--foreground) / 0.75);
  background: hsl(var(--foreground) / 0.035);
  border: 1px solid hsl(var(--foreground) / 0.08);
}
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 9px;
  font-size: 11.5px;
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.file-chip b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-size: 7.5px; color: #fff; }
.file-chip .pdf { background: hsl(0 72% 52%); }
.file-chip .doc { background: hsl(214 80% 50%); }
.file-chip .md { background: hsl(230 15% 40%); }
.mem-list { margin-top: 14px; display: grid; gap: 6px; }
.mem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  background: hsl(var(--foreground) / 0.035);
}
.file-chip .ds { background: hsl(258 70% 58%); }
.file-chip .ds svg { stroke: #fff; }
.mem .grow { flex: 1; }
.mem s { color: hsl(var(--foreground) / 0.45); }
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  box-shadow: 0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset, var(--glass-shadow);
  background: rgb(var(--glass-tint) / calc(var(--glass-surface-a) + 0.1));
  border: 1px solid hsl(var(--foreground) / 0.12);
}
.toast .grow { flex: 1; }
.toast svg { color: hsl(var(--primary-text)); }
.js .toast { opacity: 0; transform: translateY(12px) scale(0.97); }
.js .is-in .toast { animation: toast-in 0.7s var(--ease-spring) 1.4s forwards; }
@keyframes toast-in { to { opacity: 1; transform: none; } }

/* 06 · snippets */
.snip-card { padding: 16px; border-radius: 14px; background: hsl(var(--foreground) / 0.035); border: 1px solid hsl(var(--foreground) / 0.10); }
.snip-top { display: flex; align-items: center; gap: 10px; }
.snip-name { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.snip-body { margin-top: 10px; font-size: 13px; line-height: 1.7; color: hsl(var(--foreground) / 0.85); }
.var {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  line-height: 1.6;
  color: hsl(var(--primary-text));
  background: hsl(var(--primary) / 0.12);
  border: 1px solid hsl(var(--primary) / 0.3);
  white-space: nowrap;
}
.var.builtin { color: hsl(var(--azure)); background: hsl(var(--azure) / 0.1); border-color: hsl(var(--azure) / 0.3); }
[data-theme="light"] .var.builtin { color: hsl(210 100% 38%); }
.fill { margin-top: 12px; padding: 16px; border-radius: 14px; }
.fill-title { font-size: 13.5px; font-weight: 600; }
.fill-field { margin-top: 12px; }
.fill-field label { display: block; margin-bottom: 5px; font-family: var(--font-mono); font-size: 11px; color: hsl(var(--foreground) / 0.65); }
.fill-input {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.14);
}
.fill-input .t { display: inline-block; overflow: hidden; white-space: nowrap; border-right: 2px solid transparent; }
.js .fill-input .t { width: 0; }
.js .is-in .fill-input .t { animation: typing var(--dur, 1s) steps(var(--n, 12)) var(--at, 0.6s) forwards, caret 0.9s step-end var(--at, 0.6s) 3; }
@keyframes typing { to { width: calc(var(--n, 12) * 1ch); } }
@keyframes caret { 50% { border-right-color: hsl(var(--primary)); } }
.fill-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 07 · developer UI */
.canvas { padding: 0; overflow: hidden; }
.canvas-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid hsl(var(--foreground) / 0.08);
}
.canvas-top .name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.canvas-top .lang {
  margin-right: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.6);
  background: hsl(var(--foreground) / 0.06);
}
.canvas-top .ui-btn { height: 28px; padding: 0 10px; font-size: 11.5px; }
/* Code / Preview switch: code streams in, then the preview takes over */
.canvas-tabs { display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 11.5px; border-bottom: 1px solid hsl(var(--foreground) / 0.08); }
.canvas-tabs .tabs { display: inline-flex; margin-right: auto; padding: 2px; border-radius: 9px; background: hsl(var(--foreground) / 0.06); }
.canvas-tabs .tabs span { padding: 3px 10px; border-radius: 7px; color: hsl(var(--foreground) / 0.6); }
.canvas-tabs .t-code { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.10); }
.canvas-tabs .sandbox { white-space: nowrap; color: hsl(var(--foreground) / 0.6); }
.canvas-tabs .ui-btn { height: 26px; padding: 0 10px; font-size: 11px; }
.canvas-tabs .sandbox,
.canvas-tabs .ui-btn { opacity: 0; }
.canvas-view { position: relative; }
/* an unstyled page in the sandbox: white, with the browser's default serif */
.canvas-view .preview {
  position: absolute;
  inset: 0;
  padding: 26px;
  text-align: center;
  font: 13px/1.5 Georgia, "Times New Roman", serif;
  color: #111;
  background: #fff;
  opacity: 0;
}
.canvas-view .preview .pv-h { margin: 6px 0 10px; font-size: 26px; font-weight: 700; }
.canvas-view .preview .pv-btn { display: inline-block; margin-top: 12px; padding: 3px 9px; border: 1px solid #c2410c; border-radius: 3px; font: 12px system-ui, sans-serif; color: #fff; background: #f97316; }
.is-in .canvas-tabs .t-code { animation: tab-off 0.3s ease 2.6s forwards; }
.is-in .canvas-tabs .t-prev { animation: tab-on 0.3s ease 2.6s forwards; }
.is-in .canvas-view .preview { animation: fade-in 0.45s var(--ease-out) 2.6s forwards; }
.is-in .canvas-tabs .sandbox,
.is-in .canvas-tabs .ui-btn { animation: fade-in 0.4s ease 2.8s forwards; }
@keyframes tab-on { to { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.10); } }
@keyframes tab-off { to { color: hsl(var(--foreground) / 0.6); background: transparent; } }
@media (max-width: 520px) {
  .canvas-tabs .sandbox { display: none; }
  .canvas-top { gap: 8px; padding: 10px 12px; }
  .canvas-top .ui-btn { padding: 0 9px; }
}
@media (max-width: 359px) {
  .canvas-top .lang { display: none; }
  .canvas-top .name { margin-right: auto; }
}
.code {
  margin: 0;
  padding: 14px 0;
  font-size: 12.5px;
  line-height: 1.75;
  counter-reset: ln;
  overflow: hidden;
}
.code span.l { display: block; padding: 0 16px 0 0; white-space: pre; }
.code span.l::before {
  counter-increment: ln;
  content: counter(ln);
  display: inline-block;
  width: 40px;
  padding-right: 14px;
  text-align: right;
  color: hsl(var(--foreground) / 0.35);
}
.js .code span.l { opacity: 0; transform: translateX(-6px); }
.js .is-in .code span.l { animation: line-in 0.35s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 0.16s + 0.4s); }
@keyframes line-in { to { opacity: 1; transform: none; } }
.canvas-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--foreground) / 0.62);
  border-top: 1px solid hsl(var(--foreground) / 0.08);
}
.canvas-foot .track { flex: 1; height: 4px; border-radius: 4px; background: hsl(var(--foreground) / 0.1); overflow: hidden; }
.canvas-foot .track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, hsl(var(--ok)), hsl(var(--primary))); border-radius: inherit; }
.is-in .canvas-foot .track i { animation: ctx 3s var(--ease-out) 0.6s forwards; }
@keyframes ctx { to { width: 71%; } }

/* ----- bento ----------------------------------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.tile { padding: 24px 22px; min-height: 196px; display: flex; flex-direction: column; }
.tile.w2 { grid-column: span 2; }
.tile-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 11px;
  color: hsl(var(--foreground) / 0.85);
  background: hsl(var(--foreground) / 0.06);
  border: 1px solid hsl(var(--foreground) / 0.10);
  transition: color 0.3s ease, background 0.3s ease, transform 0.5s var(--ease-spring);
}
.tile:hover .tile-ic { color: #fff; background: hsl(var(--primary)); border-color: transparent; transform: rotate(-6deg) scale(1.06); }
.tile h3 { font-size: 16.5px; letter-spacing: -0.015em; }
.tile p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.tile .link { font-size: 14px; }
@media (max-width: 1060px) { .bento { grid-template-columns: repeat(3, 1fr); } .tile.w2 { grid-column: span 1; } }
@media (max-width: 760px) { .bento { grid-template-columns: repeat(2, 1fr); } }
/* phones: icon beside the title, which keeps the single column short */
@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; min-height: 0; padding: 20px; }
  .tile-ic { width: 36px; height: 36px; margin-bottom: 0; }
  .tile p { grid-column: 1 / -1; margin-top: 12px; }
}

/* ----- appearance demo -------------------------------------------------- */

.looks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: center;
}
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.06);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.seg button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.7);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.seg button[aria-pressed="true"] {
  color: hsl(var(--foreground));
  background: rgb(var(--glass-tint) / calc(var(--glass-surface-a) + 0.25));
  box-shadow: 0 1px 0 0 rgb(255 255 255 / var(--glass-highlight)) inset, 0 4px 12px -4px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .seg button[aria-pressed="true"] { background: hsl(0 0% 100% / 0.14); }
.looks-controls { display: grid; gap: 14px; margin-top: 28px; }
.looks-controls .row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.looks-controls .lbl { min-width: 92px; font-size: 13px; color: var(--text-3); }

/* the mini window owns its own theme, independent of the page */
.mini {
  --mfg: 230 30% 7%;
  --mpri: 22 95% 60%;
  --mglow: 255 110 50;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 360px;
  color: hsl(var(--mfg));
  border: 1px solid hsl(var(--mfg) / 0.14);
  box-shadow: 0 40px 100px -30px rgba(20, 12, 40, 0.5);
  transition: color 0.5s ease, border-color 0.5s ease;
}
.mini-bg { position: absolute; inset: 0; transition: opacity 0.6s ease; }
.mini-bg.aurora-l {
  background-color: #f4efe8;
  background-image:
    radial-gradient(at 6% 16%, hsla(28, 95%, 88%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(202, 85%, 90%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(268, 70%, 93%, 0.65) 0px, transparent 55%),
    radial-gradient(at 82% 58%, hsla(18, 92%, 84%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #f4f2e7 0%, #eee0f2 35%, #f8d7cf 70%, #f8c9a8 100%);
}
.mini-bg.aurora-d {
  background-color: #06070f;
  background-image:
    radial-gradient(at 6% 16%, hsla(225, 75%, 15%, 0.95) 0px, transparent 55%),
    radial-gradient(at 16% 82%, hsla(255, 60%, 14%, 0.85) 0px, transparent 55%),
    radial-gradient(at 58% 28%, hsla(305, 60%, 18%, 0.55) 0px, transparent 55%),
    radial-gradient(at 80% 58%, hsla(14, 80%, 32%, 0.85) 0px, transparent 55%),
    linear-gradient(125deg, #080a1a 0%, #140e22 35%, #361618 70%, #4a1a10 100%);
}
.mini-bg.solid-l { background: hsl(230 25% 97%); }
.mini-bg.solid-d { background: hsl(230 30% 6%); }
.mini-bg { opacity: 0; }
.mini[data-bg="aurora"][data-mode="light"] .aurora-l,
.mini[data-bg="aurora"][data-mode="dark"] .aurora-d,
.mini[data-bg="solid"][data-mode="light"] .solid-l,
.mini[data-bg="solid"][data-mode="dark"] .solid-d { opacity: 1; }
.mini[data-mode="dark"] { --mfg: 0 0% 100%; }
.mini[data-bg="solid"] { --mpri: 210 100% 50%; --mglow: 0 127 255; }
.mini[data-bg="solid"][data-mode="dark"] { --mpri: 210 100% 58%; --mglow: 36 150 255; }
.mini-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}
.mini-tb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: hsl(var(--mfg) / 0.04);
  border-bottom: 1px solid hsl(var(--mfg) / 0.08);
}
.mini-tb img { border-radius: 3px; }
.mini-greet {
  font-size: var(--mfs, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: center;
  transition: font-size 0.4s var(--ease-out);
}
.mini[data-bg="aurora"] .mini-greet {
  background: linear-gradient(135deg, hsl(var(--mfg)) 0%, hsl(var(--mfg) / 0.9) 45%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mini-comp {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  margin-top: 22px;
  padding: 8px 8px 8px 16px;
  border-radius: 24px;
  font-size: calc(var(--mfs, 30px) * 0.45);
  color: hsl(var(--mfg) / 0.5);
  border: 1px solid hsl(var(--mfg) / 0.14);
  background: hsl(var(--mfg) / 0.05);
  box-shadow: 0 10px 40px -8px rgb(var(--mglow) / 0.25);
  transition: box-shadow 0.5s ease, background 0.5s ease;
}
.mini[data-mode="light"] .mini-comp { background: rgb(255 255 255 / 0.6); }
.mini-comp span { flex: 1; }
.mini-comp i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--mpri));
  transition: background 0.5s ease;
}
.mini-chips { display: flex; gap: 6px; margin-top: 14px; }
.mini-chips span {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid hsl(var(--mfg) / 0.12);
  background: hsl(var(--mfg) / 0.05);
}
@media (max-width: 900px) { .looks { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
@media (max-width: 520px) { .mini-chips span:nth-child(n+3) { display: none; } }

/* ----- privacy --------------------------------------------------------- */

.offline {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  margin-bottom: 18px;
}
.offline-copy { padding: 36px; border-right: 1px solid hsl(var(--foreground) / 0.08); }
.offline-copy h3 { font-size: 24px; letter-spacing: -0.02em; }
.offline-copy p { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.net-switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.12);
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.18);
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s var(--ease-spring);
}
.net-switch.hint .switch { animation: nudge 2.4s ease-in-out 1s infinite; }
[aria-checked="true"] > .switch,
.switch.on { background: hsl(var(--primary)); }
[aria-checked="true"] > .switch::after,
.switch.on::after { transform: translateX(20px); }

.net-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 0;
  padding: 24px;
  list-style: none;
  align-content: center;
}
.net-grid li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  background: hsl(var(--foreground) / 0.03);
  transition: opacity 0.4s ease, background 0.4s ease, filter 0.4s ease;
}
.net-grid li .dot { transition: background 0.4s ease, box-shadow 0.4s ease; }
.net-grid li em {
  margin-left: auto;
  font-style: normal;
  color: hsl(var(--foreground) / 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.net-grid li.online { background: hsl(var(--azure) / 0.06); }
.net-grid li.online .dot { background: hsl(var(--azure)); box-shadow: 0 0 6px hsl(var(--azure) / 0.6); }
.is-offline .net-grid li.online { opacity: 0.5; filter: grayscale(1); }
.is-offline .net-grid li.online .dot { background: hsl(var(--foreground) / 0.3); box-shadow: none; }
.is-offline .net-grid li.online em { opacity: 1; }
.is-offline .net-grid li:not(.online) { background: hsl(var(--ok) / 0.08); }
.net-legend { display: flex; gap: 16px; margin-top: 18px; font-size: 12.5px; color: var(--text-3); }
.net-legend span { display: inline-flex; align-items: center; gap: 7px; }
.net-legend .dot.az { background: hsl(var(--azure)); box-shadow: 0 0 6px hsl(var(--azure) / 0.6); }
@media (max-width: 900px) {
  .offline { grid-template-columns: minmax(0, 1fr); }
  .offline-copy { border-right: 0; border-bottom: 1px solid hsl(var(--foreground) / 0.08); padding: 28px; }
}
@media (max-width: 520px) {
  .net-grid { gap: 5px; padding: 14px; }
  .net-grid li { gap: 8px; padding: 9px 10px; font-size: 12.5px; line-height: 1.35; }
}
@media (max-width: 359px) { .net-grid { grid-template-columns: 1fr; } }

.privacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.privacy-card { padding: 30px; }
.privacy-card .num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--primary-text));
}
.privacy-card h3 { margin-top: 14px; font-size: 20px; letter-spacing: -0.02em; }
.privacy-card p { margin-top: 10px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
@media (max-width: 640px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ----- download -------------------------------------------------------- */

.download {
  position: relative;
  overflow: hidden;
  padding: 72px 56px 56px;
  text-align: center;
}
.download::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -40%;
  width: 900px;
  height: 600px;
  margin-left: -450px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--primary-glow) / 0.22), transparent);
  filter: blur(30px);
}
.download .app-ic {
  width: 84px;
  height: 84px;
  margin: 0 auto 26px;
  border-radius: 22px;
  box-shadow: 0 20px 50px -14px rgb(var(--primary-glow) / 0.6), 0 0 0 1px hsl(var(--foreground) / 0.08);
}
.js .download.is-in .app-ic { animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 44px;
  text-align: left;
}
.dl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: hsl(var(--foreground) / 0.035);
  border: 1px solid hsl(var(--foreground) / 0.10);
  transition: transform 0.4s var(--ease-out), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.dl-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--foreground) / 0.2);
  background: hsl(var(--foreground) / 0.06);
}
.dl-card .ic { color: hsl(var(--foreground) / 0.85); }
.dl-card h3 { margin-top: 18px; font-size: 18px; }
.dl-card p { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
/* .note is also the tools/prompts callout class: drop its box here */
.dl-card .note { display: block; margin-top: 6px; padding: 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.dl-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: hsl(var(--primary-text));
}
.dl-card .go svg { transition: transform 0.3s var(--ease-out); }
.dl-card:hover .go svg { transform: translateY(2px); }
.dl-card .badge-sug {
  position: absolute;
  top: 14px;
  right: 14px;
  display: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: hsl(var(--primary-strong));
}
.dl-card.suggested {
  border-color: hsl(var(--primary) / 0.55);
  background: hsl(var(--primary) / 0.07);
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.25), 0 18px 50px -20px rgb(var(--primary-glow) / 0.6);
}
.dl-card.suggested .badge-sug { display: inline-block; }
.dl-foot { margin-top: 30px; font-size: 14px; color: var(--text-2); }
.dl-foot .sep { margin: 0 10px; color: hsl(var(--foreground) / 0.3); }
@media (max-width: 960px) { .dl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .download { padding: 48px 20px 32px; }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-foot .sep { display: none; }
  .dl-foot .link { display: table; margin: 10px auto 0; }
}

/* ----- footer ---------------------------------------------------------- */

.site-footer { position: relative; padding: 90px 0 0; overflow: hidden; }
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid hsl(var(--foreground) / 0.10);
}
.footer-brand p { margin-top: 14px; font-size: 14px; color: var(--text-2); max-width: 300px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h2 {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.footer-cols ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 14px; }
.footer-cols a { color: var(--text-2); transition: color 0.2s ease; }
.footer-cols a:hover,
.footer-cols a[aria-current="page"] { color: hsl(var(--foreground)); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0;
  font-size: 13px;
  color: var(--text-3);
}
.footer-word {
  margin: 10px 0 -0.22em;
  font-size: clamp(90px, 23vw, 330px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.9;
  text-align: center;
  user-select: none;
  background: linear-gradient(180deg, hsl(var(--foreground) / 0.12) 0%, hsl(var(--foreground) / 0) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-footer { padding-top: 56px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols ul { gap: 0; }
  .footer-cols a { display: inline-block; padding: 5px 0; }
}

/* ----- command palette (Ctrl/Cmd+K, like the app's search) -------------- */

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 16px;
  background: rgba(8, 6, 16, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cmdk[hidden] { display: none; }
.cmdk.open { opacity: 1; }
.cmdk-panel {
  width: min(620px, 100%);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.3s var(--ease-out);
}
.cmdk.open .cmdk-panel { transform: none; }
html:not([data-theme="dark"]) .cmdk-panel {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.94) 0%, rgb(255 255 255 / 0.88) 100%);
}
[data-theme="dark"] .cmdk-panel { background: hsl(230 35% 10% / 0.92); }
.cmdk-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid hsl(var(--foreground) / 0.08);
  color: hsl(var(--foreground) / 0.6);
}
.cmdk-input input {
  flex: 1;
  height: 56px;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 15.5px;
  color: hsl(var(--foreground));
  background: transparent;
}
.cmdk-input input::placeholder { color: hsl(var(--foreground) / 0.5); }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--foreground) / 0.5); }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  color: hsl(var(--foreground) / 0.85);
}
.cmdk-item svg { color: hsl(var(--foreground) / 0.6); }
.cmdk-item .hint { margin-left: auto; font-size: 12px; color: hsl(var(--foreground) / 0.5); }
.cmdk-item[aria-selected="true"] { background: hsl(var(--foreground) / 0.08); color: hsl(var(--foreground)); }
.cmdk-item[aria-selected="true"] svg { color: hsl(var(--primary-text)); }
.cmdk-empty { padding: 22px; text-align: center; font-size: 14px; color: var(--text-3); }
.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  font-size: 11.5px;
  color: hsl(var(--foreground) / 0.55);
  border-top: 1px solid hsl(var(--foreground) / 0.08);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* theme switch: circular reveal via the View Transitions API */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ==========================================================================
   Subpages
   ========================================================================== */

.page-hero { padding: 160px 0 64px; text-align: center; }
@media (max-width: 640px) { .page-hero { padding: 120px 0 48px; } }
.page-hero .display { font-size: clamp(2.5rem, 6vw, 4.6rem); max-width: 16ch; }
.page-hero .lede {
  max-width: 680px;
  margin: 24px auto 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-2);
}
.page-hero .chip { margin-bottom: 24px; }

.note {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  padding: 22px 24px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.note .note-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  color: hsl(var(--ok));
  background: hsl(var(--ok) / 0.12);
}
.note strong { color: hsl(var(--foreground)); }

/* ----- tools: Settings → Tools replica ---------------------------------- */

.settings {
  display: grid;
  grid-template-columns: 210px 1fr;
  padding: 0;
  overflow: hidden;
}
.settings-nav {
  padding: 18px 10px;
  border-right: 1px solid hsl(var(--foreground) / 0.08);
  background: hsl(var(--foreground) / 0.025);
}
.settings-title { padding: 4px 12px 14px; font-size: 15px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.settings-nav span {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.66);
}
.settings-nav span.on { color: hsl(var(--foreground)); background: hsl(var(--foreground) / 0.08); }
.settings-body { padding: 26px 28px 20px; min-width: 0; }
.settings-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-head h3 { font-size: 20px; letter-spacing: -0.02em; }
.settings-head p { margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
.tool-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.tool-count b { color: hsl(var(--primary-text)); font-weight: 500; }

.tool-list { display: grid; gap: 4px; }
.tool { border-radius: 14px; transition: background 0.25s ease; }
.tool.open { background: hsl(var(--foreground) / 0.035); }
.tool-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}
.tool-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  color: hsl(var(--foreground) / 0.8);
  background: hsl(var(--foreground) / 0.06);
  border: 1px solid hsl(var(--foreground) / 0.09);
  transition: color 0.3s ease, background 0.3s ease;
}
.tool.on .tool-ic { color: hsl(var(--primary-text)); background: hsl(var(--primary) / 0.12); border-color: hsl(var(--primary) / 0.25); }
.tool-text { flex: 1; min-width: 0; }
.tool-text h3 { font-size: 15px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-text h3 code { font-size: 11px; font-weight: 400; }
.tool-text p { margin-top: 3px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.tool-try {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.75);
  border: 1px solid hsl(var(--foreground) / 0.12);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.tool-try:hover { background: hsl(var(--foreground) / 0.06); color: hsl(var(--foreground)); }
.tool-try svg { transition: transform 0.3s var(--ease-out); }
.tool-try[aria-expanded="true"] svg { transform: rotate(180deg); }
.tool-switch { display: inline-flex; padding: 4px; border-radius: 999px; }
.tool-demo { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-out); }
.tool.open .tool-demo,
html:not(.js) .tool-demo { grid-template-rows: 1fr; }
html:not(.js) .tool-try { display: none; }
.tool-demo > div { overflow: hidden; }
.call {
  margin: 0 14px 14px 66px;
  padding: 14px;
  border-radius: 12px;
  font-size: 12.5px;
  background: hsl(var(--foreground) / 0.035);
  border: 1px solid hsl(var(--foreground) / 0.09);
}
.call-head { display: flex; align-items: center; gap: 8px; font-weight: 500; color: hsl(var(--foreground) / 0.8); }
.call-head svg { color: hsl(var(--primary-text)); }
.call-k { margin: 12px 0 4px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--foreground) / 0.5); }
.call pre {
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.08);
}
.call pre.res { color: hsl(var(--ok)); }
@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .settings-body { padding: 20px 14px 12px; }
  .call { margin-left: 14px; }
}
@media (max-width: 560px) {
  .tool-row { flex-wrap: wrap; }
  .tool-row .tool-ic { align-self: flex-start; }
  .tool-text { flex-basis: calc(100% - 52px); }
  .tool-row .tool-try,
  .tool-text + .tool-switch { margin-left: 52px; }
}

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.how { padding: 26px; }
.how b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: hsl(var(--primary-text)); }
.how h3 { margin-top: 10px; font-size: 18px; }
.how p { margin-top: 8px; font-size: 14.5px; color: var(--text-2); }
@media (max-width: 860px) { .how-grid { grid-template-columns: 1fr; } }

/* ----- prompts ---------------------------------------------------------- */

.filterbar {
  position: sticky;
  top: 80px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  padding: 8px;
  border-radius: 999px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 240px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: hsl(var(--foreground) / 0.6);
  background: hsl(var(--foreground) / 0.05);
  border: 1px solid hsl(var(--foreground) / 0.10);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
  color: hsl(var(--foreground));
  background: transparent;
}
.search-field input::placeholder { color: hsl(var(--foreground) / 0.55); }
.search-field:focus-within { border-color: hsl(var(--ring)); }
.cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.cats::-webkit-scrollbar { display: none; }
.cats .chip { font-size: 12.5px; }
.cats .chip .n { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.65; }
/* Compact-header layout (phones, tablets): the bar floats at the bottom of the
   screen, as wide as the header pill. It is always in view, so it rises in on
   load instead of waiting for reveal-on-scroll. The footer gets room to scroll
   clear of it, and the floating download pill (narrow desktop windows) steps aside. */
@media (max-width: 960px) {
  .filterbar,
  .js .filterbar[data-reveal] {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 90;
    max-width: 560px;
    margin: 0 auto;
    opacity: 1;
    transform: none;
  }
  .js .filterbar[data-reveal] { animation: bar-in 0.8s var(--ease-out) 0.3s both; }
  body:has(.filterbar) .site-footer { padding-bottom: 80px; }
  body:has(.filterbar) .floating-cta { display: none; }
}
@keyframes bar-in { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 760px) {
  .filterbar { flex-direction: column; align-items: stretch; border-radius: 22px; }
  .search-field { flex-basis: auto; }
  body:has(.filterbar) .site-footer { padding-bottom: 124px; }
}

.prompt-cat + .prompt-cat { margin-top: 56px; }
.prompt-cat[hidden] { display: none; }
.cat-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.cat-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.cat-head .n { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.prompt-card { display: flex; flex-direction: column; padding: 22px; }
.prompt-card[hidden] { display: none; }
.prompt-card h3 { font-size: 16px; letter-spacing: -0.01em; }
.prompt-body { margin-top: 10px; font-size: 14.5px; line-height: 1.75; color: var(--text-2); }
.prompt-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 18px; }
.p-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.8);
  border: 1px solid hsl(var(--foreground) / 0.12);
  background: hsl(var(--foreground) / 0.03);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.p-btn:hover { background: hsl(var(--foreground) / 0.07); color: hsl(var(--foreground)); }
.p-btn.run { color: #fff; border-color: transparent; background: hsl(var(--primary-strong)); }
.p-btn.run:hover { background: hsl(18 88% 38%); color: #fff; }
.p-btn .ico-check { display: none; }
.p-btn.copied { color: hsl(var(--ok)); border-color: hsl(var(--ok) / 0.4); }
.p-btn.copied .ico-copy { display: none; }
.p-btn.copied .ico-check { display: block; }
.no-results { padding: 60px 0; text-align: center; color: var(--text-3); }

/* fill-in dialog, mirrors the app's snippet variable dialog */
dialog.fill-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  color: hsl(var(--foreground));
  overflow: auto;
}
html:not([data-theme="dark"]) dialog.fill-dialog {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.95) 0%, rgb(255 255 255 / 0.9) 100%);
}
[data-theme="dark"] dialog.fill-dialog { background: hsl(230 35% 10% / 0.94); }
dialog.fill-dialog::backdrop { background: rgba(8, 6, 16, 0.45); backdrop-filter: blur(3px); }
dialog.fill-dialog[open] { animation: dlg-in 0.35s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.dlg-head h2 { flex: 1; font-size: 18px; letter-spacing: -0.015em; }
.dlg-head p { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.dlg-body { padding: 16px 24px 0; }
.dlg-field + .dlg-field { margin-top: 12px; }
.dlg-field label { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 12px; color: hsl(var(--foreground) / 0.7); }
.dlg-field input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color: hsl(var(--foreground));
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.14);
  outline: 0;
}
.dlg-field input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18); }
.dlg-preview-k { margin: 18px 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--foreground) / 0.5); }
.dlg-preview {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.7;
  background: hsl(var(--foreground) / 0.04);
  border: 1px solid hsl(var(--foreground) / 0.09);
}
.dlg-preview mark { padding: 0 3px; border-radius: 4px; color: inherit; background: hsl(var(--primary) / 0.2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px 22px; }

/* iOS Safari zooms the page into any input under 16px on focus */
@media (pointer: coarse) {
  .search-field input,
  .dlg-field input,
  .cmdk-input input { font-size: 16px; }
}

/* ----- blog ------------------------------------------------------------- */

.blog-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 100px;
  padding: 8px 0;
}
.toc h2 { margin-bottom: 12px; padding-left: 18px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.toc ol { position: relative; margin: 0; padding: 0; list-style: none; }
.toc ol::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: hsl(var(--foreground) / 0.12);
}
.toc a {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 7px 0 7px 22px;
  font-size: 13.5px;
  color: var(--text-3);
  transition: color 0.2s ease;
}
.toc a small { font-size: 11.5px; opacity: 0.8; }
.toc a::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 13px;
  width: 9.5px;
  height: 9.5px;
  border-radius: 50%;
  background: hsl(var(--background));
  border: 1.5px solid hsl(var(--foreground) / 0.3);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.toc a:hover { color: hsl(var(--foreground)); }
.toc a.active { color: hsl(var(--foreground)); font-weight: 500; }
.toc a.active::before { background: hsl(var(--primary)); border-color: hsl(var(--primary)); box-shadow: 0 0 10px hsl(var(--primary) / 0.7); }
/* below 960px the rail turns into a scrolling row of version chips above the posts */
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; padding: 0; }
  .toc h2 { padding-left: 0; }
  .toc ol { display: flex; gap: 6px; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc ol::before,
  .toc a::before,
  .toc a small { display: none; }
  .toc a {
    flex-direction: row;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    color: hsl(var(--foreground) / 0.8);
    background: rgb(var(--glass-tint) / calc(var(--glass-surface-a) - 0.04));
    border: 1px solid hsl(var(--foreground) / 0.12);
  }
  .toc a.active { color: hsl(var(--primary-text)); border-color: hsl(var(--primary) / 0.45); }
}

.post-list { display: grid; gap: 28px; }
.post { padding: 44px 48px; scroll-margin-top: 100px; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 13px;
  color: var(--text-3);
}
.post-meta .ver {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: hsl(var(--primary-text));
  background: hsl(var(--primary) / 0.12);
  border: 1px solid hsl(var(--primary) / 0.25);
}
.post-meta .latest {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: hsl(var(--primary-strong));
  box-shadow: 0 0 14px -2px rgb(var(--primary-glow) / 0.7);
}
.post-meta .sep { color: hsl(var(--foreground) / 0.3); }
.post-meta a { color: hsl(var(--primary-text)); font-weight: 500; }
.post-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post h2 {
  margin-top: 18px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.post-lede { margin-top: 16px; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.post-section { margin-top: 26px; font-size: 15.5px; line-height: 1.75; color: var(--text-2); }
.post-section h3 { margin-bottom: 10px; font-size: 18px; color: hsl(var(--foreground)); letter-spacing: -0.015em; }
.post-section p + p { margin-top: 12px; }
.post-section ul { margin: 10px 0 0; padding-left: 1.3em; }
.post-section li { margin: 8px 0; }
.post-section li::marker { color: hsl(var(--primary)); }
.post-section strong { color: hsl(var(--foreground)); font-weight: 600; }
.post-section code { white-space: normal; }
.post-get {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-2);
  background: hsl(var(--foreground) / 0.035);
  border: 1px solid hsl(var(--foreground) / 0.09);
}
.post-get .btn { height: 40px; font-size: 13.5px; }
.post-get .btn .send-dot { width: 28px; height: 28px; }
.post-get .btn-send { padding-left: 16px; padding-right: 6px; }

details.post-more { margin-top: 26px; border-top: 1px solid hsl(var(--foreground) / 0.08); padding-top: 18px; }
details.post-more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  border: 1px solid hsl(var(--foreground) / 0.12);
  background: hsl(var(--foreground) / 0.04);
  transition: background 0.2s ease;
}
details.post-more summary::-webkit-details-marker { display: none; }
details.post-more summary:hover { background: hsl(var(--foreground) / 0.08); }
details.post-more summary svg { transition: transform 0.35s var(--ease-out); }
details.post-more[open] summary svg { transform: rotate(180deg); }
details.post-more .less { display: none; }
details.post-more[open] .more { display: none; }
details.post-more[open] .less { display: inline; }
details.post-more[open] > :not(summary) { animation: msg-in 0.5s var(--ease-out) both; }
@media (max-width: 640px) {
  .post { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .post-meta .sep { display: none; }
  .post-meta a { flex-basis: 100%; }
}

/* ----- reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal],
  .js .stagger > *,
  .js .hero [data-rise],
  .js .stage .app { opacity: 1; transform: none; }
}
