/* ═══════════════════════════════════════════════════════════════════════
   Mia's AI Lab — site stylesheet
   Ivory & champagne gold: pearl ground, metallic gold accents, soft light
   ribbons and marble, warm near-black type. Single light theme.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/geist.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("/assets/fonts/geist-mono.woff2") format("woff2"); }
@font-face { font-family: "Allura"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/allura.woff2") format("woff2"); }

:root {
  /* Ground & surfaces */
  --bg: #f8f4ef;           /* pearl ivory */
  --bg-2: #f1e9df;         /* warm cream */
  --surface: #fffdfa;      /* card white */
  --surface-2: #faf6f0;
  /* Lines (warm bronze at low alpha) */
  --line: rgba(92, 70, 42, 0.12);
  --line-2: rgba(92, 70, 42, 0.22);
  /* Type */
  --text: #1d1a17;
  --muted: #62584e;
  --dim: #95897c;
  /* Gold */
  --gold: #a4804c;         /* champagne gold */
  --gold-deep: #7a5a2e;    /* text-safe gold on ivory */
  --bronze: #523f28;
  --gold-light: #e8d3a6;
  --gold-glow: #fde6a7;
  --gold-metal: linear-gradient(100deg, #6b4d26 0%, #9a763f 22%, #c7a266 42%, #e2c893 50%, #b8914f 62%, #8e6b37 82%, #6b4d26 100%);
  --gold-btn: linear-gradient(100deg, #b38b4f 0%, #d7b77c 30%, #f0dcaa 50%, #d1ad6e 70%, #aa8347 100%);
  --live: #2f8a57;
  /* System */
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --script: "Allura", "Snell Roundhand", "Apple Chancery", cursive;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --shadow-sm: 0 1px 2px rgba(60, 44, 24, 0.05), 0 2px 8px -2px rgba(60, 44, 24, 0.06);
  --shadow: 0 1px 2px rgba(60, 44, 24, 0.05), 0 18px 44px -18px rgba(60, 44, 24, 0.22);
  --shadow-lg: 0 2px 4px rgba(60, 44, 24, 0.05), 0 34px 80px -28px rgba(60, 44, 24, 0.32);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(200, 160, 95, 0.3); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; }
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ── Ambient light + grain ───────────────────────────────────────────── */
.ambient { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 80% at 50% -10%, #fffdf9 0%, rgba(255, 253, 249, 0) 60%), var(--bg); }
.ambient::after {
  content: ""; position: absolute; inset: -50%; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.glow { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.glow.g1 { width: 44vw; height: 44vw; right: -10vw; top: -12vw; background: radial-gradient(circle, rgba(253, 230, 167, 0.55), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.glow.g2 { width: 40vw; height: 40vw; left: -14vw; top: 36vh; background: radial-gradient(circle, rgba(232, 211, 166, 0.45), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.glow.g3 { width: 34vw; height: 34vw; right: 8vw; bottom: -16vw; background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 65%); animation: drift1 38s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(-6vw, 5vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(7vw, -6vh, 0) scale(1.1); } }

/* Golden light ribbons + marble (hero backdrops) */
.backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.marble { position: absolute; width: min(46vw, 640px); aspect-ratio: 640 / 380; background-size: cover; opacity: 0.55; }
.marble.tl { left: 0; top: 0; background-image: url("/assets/img/marble-tl.webp"); -webkit-mask-image: radial-gradient(120% 120% at 0% 0%, #000 25%, transparent 70%); mask-image: radial-gradient(120% 120% at 0% 0%, #000 25%, transparent 70%); }
.marble.br { right: 0; bottom: 0; background-image: url("/assets/img/marble-br.webp"); -webkit-mask-image: radial-gradient(120% 120% at 100% 100%, #000 25%, transparent 70%); mask-image: radial-gradient(120% 120% at 100% 100%, #000 25%, transparent 70%); }
.backdrop.page-top { bottom: auto; height: min(100vh, 900px); -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.ribbons { position: absolute; left: 50%; top: 0; width: max(100%, 1440px); height: 100%; transform: translateX(-50%); }
/* Soft glow faked with stacked strokes: SVG blur filters made Firefox repaint slowly every frame */
.ribbons .halo { fill: none; stroke: url(#ribbon-soft); stroke-linecap: round; }
.ribbons .ha { stroke-width: 30; opacity: 0.07; }
.ribbons .hb { stroke-width: 18; opacity: 0.13; }
.ribbons .hc { stroke-width: 9; opacity: 0.2; }
.ribbons .edge { fill: none; stroke: url(#ribbon-edge); stroke-width: 1.4; stroke-linecap: round; }
.ribbons .spark { fill: none; stroke: #fff6dc; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 90 1800; animation: travel 9s linear infinite; }
.ribbons .spark.s2 { animation-duration: 12s; animation-delay: -4s; }
.ribbons .spark.s3 { animation-duration: 15s; animation-delay: -9s; }
.ribbons .spark.sh { stroke-width: 7; opacity: 0.28; }
@keyframes travel { from { stroke-dashoffset: 1890; } to { stroke-dashoffset: 0; } }

/* ── Brand lockup: script "Mia" + spaced "AI LAB" ────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; line-height: 1; }
.brand-mia { font: 400 2.25rem/0.8 var(--script); background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0.1em 0.12em 0.14em 0.02em; margin: -0.1em 0; }
.brand-lab { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--sans); letter-spacing: 0.34em; color: var(--bronze); padding-top: 4px; }
.brand-lab::before { content: ""; width: 16px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav { position: fixed; z-index: 50; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top, 0px)); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s; }
.nav.nav-hidden { opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none; transition: opacity 0.45s var(--ease), transform 0.6s var(--ease), visibility 0s 0.45s; }
.nav-inner {
  position: relative; display: flex; align-items: center; gap: 12px;
  max-width: calc(var(--wrap) + 24px); margin-inline: auto; width: calc(100% - var(--gutter) * 2 + 24px);
  padding: 8px 8px 8px 22px; border-radius: 999px;
  background: rgba(255, 253, 250, 0.62); border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.scrolled .nav-inner { background: rgba(255, 253, 250, 0.88); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.nav-links { display: flex; gap: 4px; }
.nav-links .menu-only { display: none; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; color: var(--muted); transition: color 0.2s, background 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(164, 128, 76, 0.1); }
.nav-label { display: inline-flex; align-items: center; gap: 6px; }
.nav-heart { width: 0.8em; height: 0.8em; fill: var(--gold); transition: transform 0.3s var(--ease), fill 0.2s; }
.nav-links a:hover .nav-heart { animation: heartbeat 0.9s ease-in-out; fill: #b8864a; }
.nav-links a.active .nav-heart { fill: #b8864a; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(0.95); } 60% { transform: scale(1.15); } }
.nav-cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--text); color: #fbf7f0; font-size: 14.5px; font-weight: 600; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(122, 90, 46, 0.55); }
.nav-toggle { display: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(164, 128, 76, 0.12); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 16px; height: 1.5px; background: var(--text); border-radius: 2px; position: relative; transition: transform 0.3s var(--ease), background 0.2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; } .nav-toggle span::after { top: 5px; }
.nav.open .nav-toggle span { background: transparent; }
.nav.open .nav-toggle span::before { transform: translateY(5px) rotate(45deg); }
.nav.open .nav-toggle span::after { transform: translateY(-5px) rotate(-45deg); }

/* ── Buttons, chips, labels ──────────────────────────────────────────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 24px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; cursor: pointer; border: 0; overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s; }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--text); color: #fbf7f0; box-shadow: 0 10px 26px -12px rgba(29, 26, 23, 0.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(122, 90, 46, 0.6); }
.btn-ghost { background: rgba(255, 253, 250, 0.7); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.55), var(--shadow-sm); }
.btn-gold { background: var(--gold-btn); background-size: 200% 100%; color: #2b2012; box-shadow: 0 12px 30px -12px rgba(164, 128, 76, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-position 0.8s var(--ease); }
.btn-gold:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 40px -12px rgba(164, 128, 76, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }

.eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0; font: 500 11.5px/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-deep); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(164, 128, 76, 0.5); } 70% { box-shadow: 0 0 0 9px rgba(164, 128, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(164, 128, 76, 0); } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font: 400 12.5px/1.4 var(--mono); color: var(--muted); white-space: nowrap; }

/* ── Type ────────────────────────────────────────────────────────────── */
.display { margin: 0; font: 400 clamp(3.3rem, 7.4vw, 6.9rem)/0.94 var(--serif); letter-spacing: -0.025em; text-wrap: balance; }
.display em, .h2 em { font-style: italic; background: var(--gold-metal); background-size: 180% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.display em { animation: sheen 9s ease-in-out infinite alternate; }
@keyframes sheen { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.h2 { margin: 0; font: 400 clamp(2.5rem, 4.8vw, 4.2rem)/1 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 0; max-width: 34rem; font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.65; color: var(--muted); }
.lede strong { color: var(--text); font-weight: 500; }

/* ── Sections ────────────────────────────────────────────────────────── */
.section { position: relative; padding-block: clamp(88px, 12vw, 150px) 0; }
.section-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(40px, 5vw, 64px); max-width: 760px; }
.section-head.row { max-width: none; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section-head.row > div { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.section-note { margin: 0; font: 400 13px/1.5 var(--mono); color: var(--dim); }

/* ── Card: white pearl with a gold hairline and pointer light ────────── */
.card {
  position: relative; isolation: isolate; border-radius: var(--radius);
  background: linear-gradient(180deg, #fffefb, #fdf9f3);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  transition: box-shadow 0.4s var(--ease), transform 0.5s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(253, 230, 167, 0.45), transparent 60%);
}
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(184, 145, 79, 0.9), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.card:hover { box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line-2); }
.card:hover::before, .card:hover::after { opacity: 1; }

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

/* ═══ HERO ═══════════════════════════════════════════════════════════ */
.hero { position: relative; isolation: isolate; padding-top: calc(clamp(120px, 15vh, 170px) + env(safe-area-inset-top, 0px)); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: clamp(24px, 4vw, 56px); margin: 14px 0 0; padding-top: 28px; border-top: 1px solid var(--line-2); }
.stats div { display: flex; flex-direction: column-reverse; gap: 8px; }
.stats dt { font: 500 10.5px/1.3 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 0; font: 400 clamp(2.4rem, 3.6vw, 3.1rem)/1 var(--serif); font-variant-numeric: tabular-nums; }

.hero-art { position: relative; aspect-ratio: 1; width: 100%; max-width: 580px; justify-self: end; }
.art-stage { position: absolute; inset: 0; transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.9s var(--ease); will-change: transform; }
/* Gold-leaf portrait: ivory medallion, gold rim, embossed foil strokes */
.medallion { position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #fffefb 0%, #faf4ea 55%, #efe4d4 100%);
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.95), inset 0 -18px 40px rgba(122, 90, 46, 0.14), 0 50px 90px -45px rgba(92, 66, 30, 0.55), 0 0 0 1px rgba(164, 128, 76, 0.18); }
.medallion::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: url("/assets/img/marble-tl.webp") center / cover; opacity: 0.22; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, transparent 38%, #000 80%); mask-image: radial-gradient(circle at 50% 45%, transparent 38%, #000 80%); }
.medallion::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, #7a5a2e, #c9a567, #f3e1b3, #b8914f, #7a5a2e, #d8bb82, #fff0c8, #a4804c, #7a5a2e);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 2px 3px rgba(92, 66, 30, 0.3)); }
.foil-wrap { position: absolute; inset: 9%; border-radius: 50%; }
.foil { position: absolute; inset: 0; -webkit-mask: url("/assets/img/mia-mask-v4.webp") center / contain no-repeat; mask: url("/assets/img/mia-mask-v4.webp") center / contain no-repeat; }
.foil-shadow { background: rgba(34, 22, 8, 0.5); transform: translate(0, 1.6px); filter: blur(1.2px); }
.foil-hi { background: #fffdf6; transform: translate(-0.8px, -1.1px); opacity: 1; }
.foil-gold {
  --lx: 30%; --ly: 25%;
  /* Polished champagne gold: deep bronze darks, near-white speculars, a slow sheen sweep. */
  background:
    radial-gradient(circle at var(--lx) var(--ly), rgba(255, 250, 236, 0.95) 0%, rgba(250, 228, 180, 0.55) 7%, rgba(250, 228, 180, 0) 22%),
    radial-gradient(120% 90% at calc(100% - var(--lx)) calc(100% - var(--ly)), rgba(26, 16, 6, 0.42), transparent 55%),
    linear-gradient(118deg, #33230f 0%, #56401f 12%, #7a5a2e 25%, #a07b42 36%, #d2b173 44%, #fbecc6 47.5%, #c9a563 51%, #8e6b37 60%, #63482a 71%, #906d38 82%, #bb9555 88%, #54391c 95%, #36250f 100%);
  background-size: 100% 100%, 100% 100%, 240% 100%;
  animation: foil-sheen 9s ease-in-out infinite alternate;
}
@keyframes foil-sheen { from { background-position: 0 0, 0 0, 0% 0; } to { background-position: 0 0, 0 0, 100% 0; } }
.glints { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-art .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(164, 128, 76, 0.3); }
.hero-art .ring.r2 { inset: 2.5%; border: 1px dashed rgba(164, 128, 76, 0.32); animation: spin 120s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.marquee { position: relative; margin-top: clamp(64px, 9vw, 110px); border-block: 1px solid var(--line-2); overflow: hidden; padding-block: 22px; background: rgba(255, 253, 250, 0.45); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; }
.marquee-item { display: inline-flex; align-items: center; gap: 30px; padding-right: 30px; font: italic 400 clamp(1.35rem, 2vw, 1.8rem)/1 var(--serif); color: var(--bronze); white-space: nowrap; }
.marquee-item::after { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-btn); box-shadow: 0 0 10px rgba(253, 230, 167, 0.9); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ═══ ABOUT ══════════════════════════════════════════════════════════ */
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.about-photo { position: relative; margin: 0; padding: 14px; border-radius: 28px; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 55% 35%; border-radius: 18px; }
.about-photo::after { content: ""; position: absolute; inset: 14px; border-radius: 18px; background: linear-gradient(180deg, transparent 58%, rgba(255, 252, 246, 0.96)); pointer-events: none; }
.about-photo figcaption { position: absolute; left: 34px; right: 34px; bottom: 26px; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.about-photo figcaption strong { font: 400 3.4rem/0.8 var(--script); background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0.12em 0.1em 0.1em 0; }
.about-photo figcaption span { font: 400 12px/1.5 var(--mono); color: var(--muted); text-align: right; }
.about-copy { display: flex; flex-direction: column; gap: 26px; }
.about-copy > p:not(.eyebrow) { margin: 0; font-size: 1.12rem; line-height: 1.75; color: var(--muted); max-width: 38rem; }
.about-copy p strong { color: var(--text); font-weight: 500; }

/* Loading + missing-thumbnail placeholders (experiment page) */
.skeleton { background: linear-gradient(90deg, rgba(164,128,76,0.05), rgba(164,128,76,0.12), rgba(164,128,76,0.05)); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: radial-gradient(circle at 30% 30%, rgba(253, 230, 167, 0.5), transparent 60%), linear-gradient(135deg, #f3ece2, #e8dccd); font: 400 1.4rem/1.1 var(--serif); color: var(--bronze); }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* About: portrait only on phones (desktop/tablet already show the gold portrait in the hero) */
.about-grid { grid-template-columns: minmax(0, 1fr); }
.about-photo { display: none; }
.about-art { display: none; }
.about-copy { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px clamp(40px, 6vw, 96px); align-items: start; }
.about-head { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 120px; }
.about-text { display: flex; flex-direction: column; gap: 22px; }
.about-text > p { margin: 0; font-size: 1.12rem; line-height: 1.75; color: var(--muted); max-width: 38rem; }

/* About: link buttons to X / GitHub / Hugging Face (neutral class names: blockers hide "social") */
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.alink { display: inline-flex; align-items: center; gap: 12px; padding: 7px 20px 7px 7px; border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: 0 10px 24px -18px rgba(92, 66, 30, 0.5), inset 0 0 0 1px rgba(164, 128, 76, 0.38);
  font: 600 15px/1 var(--sans); white-space: nowrap;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease); }
.alink-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--text); color: #fbf3df; transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.alink-icon svg { width: 17px; height: 17px; }
.alink-go { margin-left: 2px; font-size: 14px; color: var(--gold-deep); transition: transform 0.35s var(--ease), color 0.35s var(--ease); }
.alink:hover { background: linear-gradient(180deg, #fffdf8, #f7eedd); transform: translateY(-2px); box-shadow: 0 16px 32px -18px rgba(122, 90, 46, 0.55), inset 0 0 0 1.5px rgba(164, 128, 76, 0.75); }
.alink:hover .alink-icon { background: linear-gradient(135deg, #b38b4f, #f0dcaa 55%, #c9a563); color: #2b2012; }
.alink:hover .alink-go { transform: translate(2px, -2px); }
.alink:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* ═══ MODELS OFFERED (free recipes, inside About) ═══ */
.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; }
.recipes { margin-top: clamp(64px, 9vw, 110px); display: flex; flex-direction: column; gap: 28px; }
.recipes-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px clamp(32px, 5vw, 72px); align-items: end; }
.recipes-intro { display: flex; flex-direction: column; gap: 16px; }
.recipes-title { margin: 0; font: 400 clamp(2rem, 3.4vw, 3rem)/1.02 var(--serif); letter-spacing: -0.015em; text-wrap: balance; }
.recipes-title em { font-style: italic; background: var(--gold-metal); background-size: 180% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.recipes-lede { margin: 0; max-width: 34rem; font-size: 1.05rem; line-height: 1.7; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.kpis div { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; background: var(--surface); }
.kpis dt { font: 500 10.5px/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-deep); }
.kpis dd { margin: 0; font: 500 clamp(1.9rem, 3vw, 2.6rem)/1 var(--sans); letter-spacing: -0.02em; color: var(--text); }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 18px; padding-top: 14px; }
.recipe { display: flex; flex-direction: column; gap: 18px; padding: 26px 24px 24px; }
.recipe-top { display: flex; flex-direction: column; gap: 6px; }
.recipe-name { margin: 0; font: 400 1.85rem/1.05 var(--serif); letter-spacing: -0.01em; }
.recipe-engine { margin: 0; font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
.recipe-speed { display: flex; flex-direction: column; gap: 6px; transition: opacity 0.15s ease, transform 0.25s var(--ease); }
.recipe-num { margin: 0; font: 400 15px/1 var(--sans); color: var(--muted); }
.recipe-num .rn { font: 500 2.6rem/1 var(--sans); letter-spacing: -0.02em; color: var(--text); margin-right: 4px; }
.recipe-cap { margin: 0; font-size: 13px; color: var(--muted); }
.meter { height: 6px; margin-top: 6px; border-radius: 4px; background: #efe4cf; overflow: hidden; }
.meter span { display: block; width: var(--v); height: 100%; border-radius: 4px; background: var(--gold); transition: width 0.6s var(--ease); }
.meter[hidden] { display: none; }
.recipe-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); align-content: start; transition: opacity 0.15s ease; }
.recipe-stats div { display: flex; flex-direction: column; gap: 6px; }
.recipe-stats dt { font: 500 9.5px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); }
.recipe-stats dd { margin: 0; font-size: 14px; line-height: 1.3; color: var(--text); }
.recipe-stats small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--dim); }
/* Setup switcher (3 vs 4 Sparks, Spark vs RTX …): swaps the card's numbers */
.setup-switch { display: inline-flex; align-self: flex-start; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(164, 128, 76, 0.08); box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.24); }
.ss { padding: 7px 13px; border: 0; border-radius: 999px; background: transparent; font: 500 12.5px/1 var(--sans); color: var(--muted); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.2s var(--ease); }
.ss:hover { color: var(--text); }
.ss:active { transform: scale(0.96); }
.ss[aria-pressed="true"] { background: linear-gradient(180deg, #2c261f 0%, #15120e 100%); color: #f6ecd6; box-shadow: 0 6px 14px -8px rgba(29, 26, 23, 0.7), inset 0 0 0 1px rgba(226, 200, 147, 0.4); }
.ss:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.recipe-speed.swapping { opacity: 0; transform: translateY(4px); }
.recipe-stats.swapping { opacity: 0; }
.recipe-gh { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.recipe-gh span { display: inline-flex; align-items: center; gap: 5px; }
.recipe-gh b { font-weight: 600; color: var(--text); }
.recipe-gh i { font-style: normal; }
.recipe-gh svg { width: 13px; height: 13px; color: var(--gold); }
.recipe-updated { display: flex; align-items: center; gap: 6px; margin: -8px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--dim); }
.recipe-updated svg { width: 13px; height: 13px; color: var(--gold); }
.recipe-updated time { color: var(--muted); }
.recipe { position: relative; }
.recipe.is-rec { padding-top: 34px; box-shadow: 0 0 0 1.5px rgba(184, 145, 79, 0.75), 0 24px 60px -30px rgba(164, 128, 76, 0.55), var(--shadow-sm); }
.recipe-rec { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  background: var(--gold-btn); color: #2b2012; font: 600 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 0 8px 20px -8px rgba(164, 128, 76, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.recipe-rec svg { width: 13px; height: 13px; color: #6b4d26; }
.recipe-sparks { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(215, 183, 124, 0.2); box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.42); font: 600 11.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); }
.recipe-sparks svg { width: 15px; height: 15px; color: var(--gold-deep); }
.recipe-hwrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.recipe-hwrow .recipe-sparks { align-self: auto; }
.recipe-or { font: 500 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.recipe-actions .btn { flex: 1 1 auto; padding: 15px 18px; font-size: 14.5px; white-space: nowrap; }
/* Olive "install" green, tuned to sit next to the champagne gold */
.recipe-install { background: linear-gradient(100deg, #43522d 0%, #5f7141 50%, #43522d 100%); background-size: 200% 100%; color: #f6edd4; font: 600 12.5px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 12px 26px -14px rgba(67, 82, 45, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(226, 200, 147, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-position 0.8s var(--ease); }
.recipe-install:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 34px -14px rgba(67, 82, 45, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(226, 200, 147, 0.55); }
.recipe-install:focus-visible, .recipe-go:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* Install-prompt window */
.ipd { width: min(760px, calc(100% - 32px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px -30px rgba(40, 28, 12, 0.55), inset 0 0 0 1px var(--line); overflow: hidden; }
.ipd::backdrop { background: rgba(33, 26, 18, 0.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ipd[open] { animation: ipd-in 0.28s var(--ease); }
@keyframes ipd-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.ipd-box { display: flex; flex-direction: column; gap: 16px; max-height: inherit; padding: clamp(22px, 4vw, 34px); }
.ipd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ipd-head .eyebrow { margin-bottom: 10px; }
.ipd-title { margin: 0; font: 400 clamp(1.7rem, 3vw, 2.2rem)/1.05 var(--serif); letter-spacing: -0.01em; }
.ipd-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(164, 128, 76, 0.12); color: var(--text); font: 400 26px/1 var(--sans); cursor: pointer; }
.ipd-close:hover { background: rgba(164, 128, 76, 0.22); }
.ipd-lede { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.ipd-text { flex: 1 1 auto; min-height: 0; margin: 0; padding: 18px 20px; overflow: auto; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font: 400 13px/1.65 var(--mono); color: var(--text); white-space: pre-wrap; word-break: break-word; }
.ipd-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ipd-status { font-size: 14px; color: var(--gold-deep); }
body.dialog-open { overflow: hidden; }
.recipes-note { max-width: 52rem; }

/* Home teaser → /models */
.recipes-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; text-align: center; }
.recipes-more .btn { padding: 16px 30px; }
/* /models page */
.models-section { padding-top: calc(clamp(130px, 17vh, 180px) + env(safe-area-inset-top, 0px)); }
.models-page { margin-top: 0; }
.models-title { font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1; }
.recipe-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 26px; padding: 18px 20px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.rf-title { flex-basis: 100%; margin: 0; font: 500 10.5px/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-deep); }
.rf-group { display: flex; flex-direction: column; gap: 8px; }
.rf-rail { display: contents; }   /* desktop: groups sit in the wrapping filter bar */
.rf-label { margin: 0; font: 500 12px/1 var(--sans); color: var(--muted); }
.rf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rf { display: inline-flex; align-items: center; gap: 9px; padding: 9px 10px 9px 15px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #fffefb 0%, #f7f0e2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(164, 128, 76, 0.34), 0 6px 14px -10px rgba(92, 66, 30, 0.45);
  font: 500 14px/1 var(--sans); letter-spacing: 0.005em; color: #3a3128; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s var(--ease), transform 0.2s var(--ease); }
.rf span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font: 600 11.5px/1 var(--mono); color: #6b4d26;
  background: linear-gradient(135deg, rgba(240, 220, 170, 0.6), rgba(215, 183, 124, 0.35)); box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.28); transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.rf:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(164, 128, 76, 0.7), 0 10px 20px -12px rgba(92, 66, 30, 0.5); }
.rf:active { transform: scale(0.96); }
.rf[aria-pressed="true"] { background: linear-gradient(180deg, #2c261f 0%, #15120e 100%); color: #f6ecd6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(226, 200, 147, 0.45), 0 12px 24px -12px rgba(29, 26, 23, 0.7); }
.rf[aria-pressed="true"] span { background: var(--gold-btn); color: #2b2012; box-shadow: none; }
.rf:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.recipe[hidden] { display: none; }
/* Compact summary row: only used on /models on phones (see the 640px block) */
.recipe-sum { display: none; }
.recipe-body { display: flex; flex-direction: column; flex: 1 1 auto; }
.recipe-inner { display: flex; flex-direction: column; gap: 18px; flex: 1 1 auto; }
.recipes-empty { margin: 0; padding: 28px; border-radius: 20px; text-align: center; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
/* KPI "what's counted" note */
.kpis-note { margin: 8px 4px 0; font: 400 12px/1.4 var(--sans); color: var(--dim); text-align: right; }
/* Lab tools (sparkDash): wide showcase card on /models */
.tools { display: flex; flex-direction: column; gap: 22px; margin-top: clamp(48px, 7vw, 88px); scroll-margin-top: 110px; }
.tool { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(22px, 3vw, 42px); align-items: center; padding: clamp(16px, 2.2vw, 24px); }
.tool-media { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #f3eee7; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); }
.tool-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.tool-media.playing img { object-position: 50% 50%; }
.tool-play { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border: 0; border-radius: 999px;
  background: rgba(21, 18, 14, 0.86); color: #f6ecd6; font: 600 13.5px/1 var(--sans); cursor: pointer; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(226, 200, 147, 0.35);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease); }
.tool-play:hover { transform: translateY(-2px); background: rgba(21, 18, 14, 0.95); }
.tool-play-icon { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--gold-btn); }
.tool-play-icon::before { content: ""; position: absolute; left: 55%; top: 50%; transform: translate(-50%, -50%); border-left: 9px solid #2b2012; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.tool-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.tool-name { margin: 0; font: 400 clamp(2.1rem, 3.2vw, 2.7rem)/1 var(--serif); letter-spacing: -0.015em; }
.tool-lede { margin: 0; font-size: 1.02rem; line-height: 1.65; color: var(--muted); }
.tool-feats { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.tool-feats li { display: flex; align-items: flex-start; gap: 10px; }
.tool-feats svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--gold-deep); }
.tool .recipe-actions { width: 100%; margin-top: 4px; }
/* ═══ EXPERIMENTS (/experiments) ═══ */
.xpage { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 88px); }
.xhero { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.xfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 8px 0 0; padding: 0; list-style: none; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.xfacts li { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); }
.xfacts strong { font: 500 clamp(1.5rem, 2.4vw, 2rem)/1 var(--sans); letter-spacing: -0.02em; color: var(--text); }
.xfacts span { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.xsec { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 110px; }
.xsec-head { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 16px clamp(28px, 5vw, 64px); align-items: end; }
.xsec-head .recipes-title { margin-top: 12px; }
.xsec-lede { margin: 0; font-size: 1.02rem; line-height: 1.7; color: var(--muted); }
.xsec-hint { margin: 0; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); background: rgba(215, 183, 124, 0.12); box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.22); }
.xgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.xcard { display: flex; flex-direction: column; padding: 10px; }
.xcard-shot { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #1a1622; }
.xcard-shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.xcard:hover .xcard-shot img { transform: scale(1.04); }
.xcard-tag { position: absolute; left: 10px; bottom: 10px; padding: 6px 10px; border-radius: 999px; background: rgba(12, 10, 16, 0.72); color: #f3ead6; font: 500 11.5px/1 var(--mono); }
.xcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 10px 8px; }
.xcard-name { margin: 0; font: 400 1.6rem/1.1 var(--serif); letter-spacing: -0.01em; }
.xcard-note { font: 400 13px/1 var(--sans); letter-spacing: 0; color: var(--dim); }
.xcard-meta { margin: 0; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.xcard-actions { display: flex; gap: 8px; margin-top: 6px; }
.xcard-actions .btn { padding: 12px 16px; font-size: 14px; }
.xcard-go { flex: 1 1 auto; }
.xcard-gh svg { width: 16px; height: 16px; }
/* ═══ SERVICES ═════════════════════════════════════════════════════ */
.install { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: center; padding: 14px; }
.install-art { margin: 0; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #f3eee7; }
.install-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.install:hover .install-art img { transform: scale(1.03); }
.install-body { display: flex; flex-direction: column; gap: 18px; padding: clamp(8px, 2vw, 24px) clamp(8px, 2vw, 26px) clamp(8px, 2vw, 24px) 0; }
.install-body h3 { margin: 0; font: 400 clamp(2.2rem, 3.4vw, 3rem)/1.05 var(--serif); letter-spacing: -0.015em; }
.install-body h3 em { white-space: nowrap; font: 400 1.3em/0.8 var(--script); background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 0.12em 0.1em 0.04em; }
.install-body > p:not(.fine) { margin: 0; color: var(--muted); line-height: 1.7; }
.tiers { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tier { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.25s, transform 0.3s var(--ease), background 0.25s; }
.tier:hover { transform: translateX(4px); background: #fff; box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.6), var(--shadow-sm); }
.tier-count { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--gold-btn); color: #3a2a14; font: 600 15px/1 var(--sans); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 12px -4px rgba(164, 128, 76, 0.6); }
.tier-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tier-text strong { font-size: 16px; font-weight: 600; }
.tier-text small { font-size: 14px; color: var(--muted); }
.tier-go { margin-left: auto; flex: none; font: 500 12.5px/1 var(--mono); color: var(--gold-deep); white-space: nowrap; }

.book { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; margin-top: 20px; padding: clamp(30px, 4vw, 52px) clamp(28px, 5vw, 72px);
  background: radial-gradient(90% 130% at 0% 50%, rgba(253, 230, 167, 0.45), transparent 60%), linear-gradient(180deg, #fffefb, #fbf5ec); }
.book-3d { display: block; perspective: 1100px; }
.book-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 188px; aspect-ratio: 2 / 3; padding: 22px 18px 18px 26px; border-radius: 3px 12px 12px 3px;
  background: radial-gradient(120% 80% at 85% 0%, rgba(215, 183, 124, 0.28), transparent 60%), linear-gradient(160deg, #2b2621, #120f0c);
  color: #fbf7f0; transform: rotateY(-24deg) rotateX(5deg); transition: transform 0.9s var(--ease);
  box-shadow: 22px 30px 44px -14px rgba(40, 28, 12, 0.5), inset 3px 0 0 rgba(255, 255, 255, 0.07), inset 12px 0 16px -10px rgba(0, 0, 0, 0.7); }
.book-cover::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, rgba(215, 183, 124, 0.7), transparent); }
.book-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.1) 50%, transparent 60%); }
.book:hover .book-cover { transform: rotateY(-8deg) rotateX(2deg) translateY(-4px); }
.book-cover svg { width: 20px; height: 20px; color: var(--gold-light); }
.book-title { font: 400 2.15rem/0.95 var(--serif); background: var(--gold-btn); -webkit-background-clip: text; background-clip: text; color: transparent; }
.book-sub { margin-top: -18px; font: 500 9.5px/1.4 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(251, 247, 240, 0.72); }
.book-author { align-self: flex-end; font: 400 1.9rem/1 var(--script); color: var(--gold-light); }
.book-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.book-body h3 { margin: 0; font: 400 clamp(2.2rem, 3.4vw, 3rem)/1 var(--serif); letter-spacing: -0.015em; }
.book-tag { margin: -4px 0 0; font: 500 11.5px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.book-text { margin: 0; max-width: 34rem; color: var(--muted); line-height: 1.7; }
.book-body .btn { margin-top: 6px; }
.book-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ═══ SUPPORT + CONTACT ══════════════════════════════════════════════ */
.connect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.panel { display: flex; flex-direction: column; gap: 22px; padding: clamp(26px, 3.4vw, 44px); }
.panel h3 { margin: 0; font: 400 clamp(2rem, 3vw, 2.7rem)/1 var(--serif); letter-spacing: -0.015em; }
.panel > p { margin: 0; color: var(--muted); line-height: 1.7; }
.support-panel { background: radial-gradient(120% 80% at 100% 0%, rgba(253, 230, 167, 0.55), transparent 55%), linear-gradient(180deg, #fffefb, #fbf5ec); }
.field-label { display: block; margin-bottom: 10px; font: 500 10.5px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 8px; }
.amount { padding: 13px 0; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: all 0.25s var(--ease); }
.amount:hover { box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.6); }
.amount[aria-pressed="true"] { background: var(--text); color: #fbf7f0; box-shadow: 0 10px 22px -10px rgba(29, 26, 23, 0.6); }
.input, .select, .textarea { width: 100%; padding: 13px 15px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font-size: 15px; transition: box-shadow 0.2s, background 0.2s; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 4px rgba(215, 183, 124, 0.25); background: #fff; }
.amounts .input { padding: 13px 12px; text-align: center; font-weight: 600; }
.select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237a5a2e' stroke-width='1.6'><path d='M1 1.5l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 16px center; }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.captcha:empty { display: none; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fine { margin: 0; font: 400 12px/1.6 var(--mono); color: var(--dim); }
.status-msg { margin: 0; font-size: 14px; line-height: 1.5; min-height: 1.5em; color: var(--muted); }
.status-msg.ok { color: var(--live); }
.status-msg.err { color: #b23c2b; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(92, 70, 42, 0.2); border-top-color: currentColor; animation: spin 0.8s linear infinite; }
.find-me { display: flex; flex-wrap: wrap; gap: 10px; }
.find-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14.5px; transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.find-link:hover { box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.6), var(--shadow-sm); transform: translateY(-1px); }
.find-link svg { width: 16px; height: 16px; }
button.find-link { border: 0; font: inherit; font-size: 14.5px; color: inherit; cursor: pointer; }
.find-link[data-copied]::after { content: "Copied"; margin-left: 2px; font: 500 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); }
.divider { display: flex; align-items: center; gap: 14px; margin: 0; font: 500 10.5px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); }
/* GitHub Sponsors — the lead support option. Class names are neutral on purpose:
   ad-blocker filter lists hide elements named like "sponsor-text".
   Deliberately static: no animations, clipping or stacking tricks inside it. iOS Safari
   failed to paint the web-font text when the button carried animated layers. */
.fund-card { display: flex; align-items: center; gap: 16px; padding: 18px 22px 18px 18px; border-radius: 18px;
  background-color: #1d1a17;
  background-image: linear-gradient(105deg, rgba(240, 220, 170, 0) 30%, rgba(240, 220, 170, 0.14) 50%, rgba(240, 220, 170, 0) 70%), radial-gradient(120% 160% at 0% 0%, rgba(215, 183, 124, 0.28), transparent 55%), linear-gradient(180deg, #26221d, #15130f);
  color: #fbf7f0; -webkit-text-fill-color: #fbf7f0;
  box-shadow: 0 18px 40px -16px rgba(29, 26, 23, 0.65), inset 0 0 0 1px rgba(215, 183, 124, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.fund-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-btn); color: #3a2a14;
  box-shadow: 0 0 0 4px rgba(215, 183, 124, 0.16), 0 6px 16px -4px rgba(215, 183, 124, 0.6); }
.fund-icon svg { width: 18px; height: 18px; }
.fund-copy { display: block; flex: 1 1 auto; }
.fund-copy strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; color: #fbf7f0; -webkit-text-fill-color: #fbf7f0; }
.fund-copy small { display: block; margin-top: 4px; font: 400 12.5px/1.4 var(--mono); color: #b9b1a5; -webkit-text-fill-color: #b9b1a5; }
.fund-go { flex: none; font-size: 18px; color: var(--gold-light); -webkit-text-fill-color: #e8d3a6; }
@media (hover: hover) {
  .fund-card { transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
  .fund-card:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -16px rgba(122, 90, 46, 0.7), inset 0 0 0 1px rgba(215, 183, 124, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* Ko-fi — the lighter companion to the GitHub Sponsors button (same static build) */
.fund-links { display: flex; flex-direction: column; gap: 12px; }
.fund-card--light { background-color: #fffcf6; background-image: linear-gradient(180deg, #fffefb, #f7efe1);
  color: #1d1a17; -webkit-text-fill-color: #1d1a17;
  box-shadow: 0 12px 28px -18px rgba(92, 66, 30, 0.45), inset 0 0 0 1px rgba(164, 128, 76, 0.45); }
.fund-card--light .fund-icon { background: #f3e6cc; color: #6b4d26; box-shadow: 0 0 0 4px rgba(215, 183, 124, 0.18); }
.fund-card--light .fund-icon svg { width: 21px; height: 21px; }
.fund-card--light .fund-copy strong { color: #1d1a17; -webkit-text-fill-color: #1d1a17; }
.fund-card--light .fund-copy small { color: #6b6157; -webkit-text-fill-color: #6b6157; }
.fund-card--light .fund-go { color: #7a5a2e; -webkit-text-fill-color: #7a5a2e; }
@media (hover: hover) {
  .fund-card--light:hover { box-shadow: 0 18px 36px -16px rgba(122, 90, 46, 0.5), inset 0 0 0 1px rgba(164, 128, 76, 0.75); }
}

/* ═══ BOOK THANK-YOU PAGE ════════════════════════════════════════════ */
.thanks { padding-block: clamp(130px, 18vh, 190px) 0; }
.thanks-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; max-width: 980px; margin-inline: auto; padding: clamp(30px, 5vw, 60px);
  background: radial-gradient(90% 130% at 0% 50%, rgba(253, 230, 167, 0.45), transparent 60%), linear-gradient(180deg, #fffefb, #fbf5ec); }
.thanks-body { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.thanks-state { display: none; flex-direction: column; align-items: flex-start; gap: 18px; }
.thanks-card[data-state="loading"] [data-show="loading"], .thanks-card[data-state="ready"] [data-show="ready"], .thanks-card[data-state="error"] [data-show="error"] { display: flex; }
.thanks-card[data-state="error"] h1, .thanks-card[data-state="error"] .eyebrow { display: none; }
.thanks-lede { margin: 0; max-width: 32rem; font-size: 1.1rem; line-height: 1.65; color: var(--muted); }
.thanks-download { font-size: 16px; padding: 17px 28px; }
.thanks-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.thanks-facts li:empty { display: none; }
/* Install intake page */
.intake-card { display: flex; flex-direction: column; gap: 26px; max-width: 880px; margin-inline: auto; padding: clamp(26px, 5vw, 56px); }
.intake-head { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(22px, 4vw, 40px); align-items: center; }
.intake-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.intake-intro .h2 { margin: 0; }
.intake-card[data-state="loading"] [data-show="loading"], .intake-card[data-state="form"] [data-show="form"],
.intake-card[data-state="done"] [data-show="done"], .intake-card[data-state="error"] [data-show="error"] { display: flex; }
.intake-card[data-state="error"] .intake-intro .h2 { display: none; }
.intake-card .thanks-lede { max-width: none; }
.intake-form { width: 100%; }
.intake-card [hidden] { display: none !important; }
.intake-short { min-height: 88px; }
.intake-optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--dim); }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 760px) {
  .thanks-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .thanks-body, .thanks-state { align-items: center; }
  .thanks-book .book-cover { width: 160px; padding: 18px 14px 14px 22px; }
  .intake-head { grid-template-columns: minmax(0, 1fr); }
  .intake-art { max-width: 320px; }
  .thanks-book .book-title { font-size: 1.7rem; }
  .thanks-book .book-sub { margin-top: -10px; font-size: 8.5px; }
}

/* ═══ FOOTER ═════════════════════════════════════════════════════════ */
.footer { position: relative; isolation: isolate; margin-top: clamp(100px, 13vw, 170px); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); overflow: hidden; background: linear-gradient(180deg, rgba(241, 233, 223, 0), var(--bg-2) 40%); border-top: 1px solid var(--line-2); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; padding-block: 48px 10px; }
.footer-top p { margin: 0; max-width: 26rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; }
.footer-links a { color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--gold-deep); }
.lockup { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 26px 0 30px; user-select: none; }
.lockup-mia { font: 400 clamp(6rem, 20vw, 15rem)/0.9 var(--script); background: var(--gold-metal); background-size: 180% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0.08em 0.2em 0.1em 0.1em; filter: drop-shadow(0 10px 18px rgba(122, 90, 46, 0.22)); animation: sheen 10s ease-in-out infinite alternate; }
.lockup-lab { display: flex; align-items: center; gap: 22px; font: 500 clamp(0.9rem, 1.6vw, 1.3rem)/1 var(--sans); letter-spacing: 0.5em; color: var(--bronze); padding-left: 0.5em; }
.lockup-lab::before, .lockup-lab::after { content: ""; width: clamp(40px, 8vw, 110px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold), var(--gold-glow), var(--gold), transparent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line-2); font: 400 12.5px/1.5 var(--mono); color: var(--dim); }
.footer-bottom a:hover { color: var(--gold-deep); }

/* ═══ EXPERIMENT PAGE ════════════════════════════════════════════════ */
.xp-top { position: relative; isolation: isolate; overflow: hidden; }
.xp-hero { padding-top: calc(clamp(130px, 17vh, 180px) + env(safe-area-inset-top, 0px)); }
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font: 400 13px/1 var(--mono); color: var(--dim); }
.crumbs a { color: var(--muted); transition: color 0.2s; }
.crumbs a:hover { color: var(--gold-deep); }
.xp-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(28px, 5vw, 80px); align-items: end; }
.xp-head .display { font-size: clamp(3rem, 7vw, 6.4rem); }
.xp-side { display: flex; flex-direction: column; gap: 20px; }
.xp-side p { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.xp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 48px 0 0; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.xp-facts div { display: flex; flex-direction: column-reverse; gap: 8px; padding: 20px 22px; background: var(--surface); }
.xp-facts dt { font: 500 10.5px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.xp-facts dd { margin: 0; font: 400 1.9rem/1 var(--serif); }
.prompt-card { margin-top: 20px; overflow: hidden; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 16px 22px; border-bottom: 1px solid var(--line); }
.prompt-head .field-label { margin: 0; }
.prompt-tools { display: flex; gap: 8px; }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font: 500 12.5px/1 var(--mono); cursor: pointer; transition: box-shadow 0.2s; }
.tool-btn:hover { box-shadow: inset 0 0 0 1px rgba(164, 128, 76, 0.6); }
.prompt-body { position: relative; max-height: 260px; overflow: hidden; transition: max-height 0.7s var(--ease); }
.prompt-card.open .prompt-body { max-height: 6000px; }
.prompt-body pre { margin: 0; padding: 22px 24px 30px; font: 400 13.5px/1.75 var(--mono); color: #4a4139; white-space: pre-wrap; word-break: break-word; }
.prompt-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(rgba(253, 249, 243, 0), #fdf9f3); pointer-events: none; transition: opacity 0.4s; }
.prompt-card.open .prompt-body::after, .prompt-card.short .prompt-body::after { opacity: 0; }
.prompt-card.short [data-expand] { display: none; }
.outputs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.out-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.out-card { display: flex; flex-direction: column; padding: 10px; }
.out-card:hover { transform: translateY(-4px); }
.out-shot { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #1b1814; cursor: zoom-in; }
.out-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1s var(--ease); }
.out-card:hover .out-shot img { transform: scale(1.04); }
.out-shot .zoom { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 253, 250, 0.9); color: var(--text); opacity: 0; transform: scale(0.85); transition: opacity 0.25s, transform 0.3s var(--ease); }
.out-card:hover .zoom { opacity: 1; transform: none; }
.out-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 8px 8px 8px; }
.out-body h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.open-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.open-link:hover { background: var(--text); color: #fbf7f0; box-shadow: none; }
.xp-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.xp-nav a { display: flex; flex-direction: column; gap: 10px; padding: 26px 28px; }
.xp-nav a:last-child { text-align: right; align-items: flex-end; }
.xp-nav small { font: 500 10.5px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.xp-nav strong { font: 400 2rem/1.05 var(--serif); }
.xp-nav a:hover { transform: translateY(-3px); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; padding: calc(18px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 48px) calc(18px + env(safe-area-inset-bottom, 0px)); background: rgba(248, 244, 239, 0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s; }
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; visibility: visible; }
.lb-top, .lb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lb-title { display: flex; flex-direction: column; gap: 6px; }
.lb-title strong { font: 400 2rem/1 var(--serif); }
.lb-title span { font: 400 12.5px/1 var(--mono); color: var(--muted); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; box-shadow: var(--shadow-lg), 0 0 0 8px #fffdfa, 0 0 0 9px var(--line-2); transition: opacity 0.25s; }
.lb-stage img.swap { opacity: 0; }
.icon-btn { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-2); cursor: pointer; transition: box-shadow 0.2s, transform 0.2s var(--ease); }
.icon-btn:hover { box-shadow: var(--shadow), inset 0 0 0 1px rgba(164, 128, 76, 0.6); }
.icon-btn svg { width: 18px; height: 18px; }
.lb-count { font: 400 13px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-arrows { display: flex; gap: 10px; }
.no-scroll { overflow: hidden; }

/* ═══ RESPONSIVE ═════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .out-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .about-grid, .xp-head { grid-template-columns: minmax(0, 1fr); }
  .hero-art { justify-self: center; max-width: 460px; order: -1; margin-bottom: -20px; }
  .connect-grid, .install { grid-template-columns: minmax(0, 1fr); }
  .about-copy { grid-template-columns: minmax(0, 1fr); }
  .recipes-head, .recipe-grid { grid-template-columns: minmax(0, 1fr); }
  .xgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xsec-head { grid-template-columns: minmax(0, 1fr); }
  .xfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .kpis-note { text-align: left; }
  .recipe-grid { max-width: 560px; }
  .about-head { position: static; }
  .install-body { padding: 4px 10px 14px; }
  .about-photo { max-width: 440px; }
  .marble { width: 70vw; opacity: 0.4; }
  /* Mobile menu: panel unfolds from the bar, links rise in one by one */
  .nav::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(248, 244, 239, 0.78); opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s; }
  .nav.open::before { opacity: 1; visibility: visible; }
  .nav-links { position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex-direction: column; gap: 0; padding: 10px 18px 14px; border-radius: 24px;
    background: radial-gradient(120% 70% at 100% 0%, rgba(253, 230, 167, 0.35), transparent 60%), rgba(255, 253, 250, 0.98);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
    transform: translateY(-10px) scale(0.98); transform-origin: 50% 0; opacity: 0; visibility: hidden;
    transition: transform 0.32s var(--ease), opacity 0.2s ease, visibility 0s 0.32s; }
  .nav.open .nav-links { transform: none; opacity: 1; visibility: visible; transition: transform 0.32s var(--ease), opacity 0.2s ease, visibility 0s; }
  .nav-links a { display: flex; align-items: center; justify-content: space-between; padding: 15px 4px; border-radius: 0; background: none;
    font: 400 1.75rem/1 var(--serif); letter-spacing: -0.01em; color: var(--text); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(8px); transition: opacity 0.22s ease, transform 0.32s var(--ease), color 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { content: ""; width: 7px; height: 7px; transform: rotate(45deg) scale(0.6); background: var(--gold-btn); opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease); }
  .nav-links a:hover, .nav-links a.active { background: none; color: var(--gold-deep); }
  .nav-links a.active::after, .nav-links a:hover::after { opacity: 1; transform: rotate(45deg) scale(1); }
  .nav.open .nav-links a { opacity: 1; transform: none; }
  .nav.open .nav-links a:nth-child(1) { transition-delay: 0.04s; }
  .nav.open .nav-links a:nth-child(2) { transition-delay: 0.07s; }
  .nav.open .nav-links a:nth-child(3) { transition-delay: 0.1s; }
  .nav.open .nav-links a:nth-child(4) { transition-delay: 0.13s; }
  .nav.open .nav-links a:nth-child(5) { transition-delay: 0.16s; }
  .nav.open .nav-links a:nth-child(6) { transition-delay: 0.19s; }
  .nav.open .nav-links a:nth-child(7) { transition-delay: 0.22s; }
  .nav-links .menu-only { display: flex; }
  /* Keep phones smooth: no continuously animated blur layers behind the page */
  .glow, .glow.g1, .glow.g2, .glow.g3 { animation: none; will-change: auto; filter: none; opacity: 0.8; }
  .display em, .lockup-mia { animation: none; }
  .lockup-mia { filter: none; }
  /* While the menu is open, pause what's still moving so the panel gets the GPU */
  .menu-open .marquee-track, .menu-open .foil-gold, .menu-open .hero-art .ring.r2 { animation-play-state: paused; }
  .ribbons .spark, .ribbons .halo { display: none; }
  .nav-inner, .nav.scrolled .nav-inner { background: rgba(255, 253, 250, 0.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-toggle { display: inline-flex; transition: background 0.25s ease, box-shadow 0.25s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { transition: transform 0.3s var(--ease), background 0.2s, opacity 0.2s; }
  .nav.open .nav-toggle { background: var(--gold-btn); box-shadow: 0 6px 16px -6px rgba(164, 128, 76, 0.8); }
  .nav.open .nav-toggle span::before { transform: translateY(5px) rotate(135deg); }
  .nav.open .nav-toggle span::after { transform: translateY(-5px) rotate(45deg); }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .nav-inner { width: calc(100% - 32px); padding: 8px 10px 8px 22px; }
  /* iOS Safari zooms into any field under 16px on focus */
  .input, .select, .textarea, .amounts .input { font-size: 16px; }
  .brand-mia { font-size: 2rem; }
  .brand-lab { letter-spacing: 0.28em; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .amounts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .amounts .input { grid-column: 1 / -1; }
  .form-row, .xp-nav, .xp-facts { grid-template-columns: minmax(0, 1fr); }
  .xp-nav a:last-child { text-align: left; align-items: flex-start; }
  .out-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-cta { display: none; }
  .lb-top .open-link span { display: none; }
  .lockup-lab { letter-spacing: 0.4em; gap: 14px; }
  .fund-copy small { display: none; }   /* phones: title only on the GitHub / Ko-fi buttons */
  .about-photo { display: block; }
  /* Filter on phones: one swipeable row — All │ DGX SPARK 1·2·3·4 │ NVIDIA GPU … — bleeding to the screen edges */
  .recipe-filter { display: block; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .rf-title { margin: 0 0 12px; }
  .rf-rail { display: flex; align-items: center; gap: 14px; overflow-x: auto; margin: -10px calc(-1 * var(--gutter)) -14px; padding: 14px var(--gutter) 26px;
    scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 40px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 40px), transparent 100%); }
  .rf-rail::-webkit-scrollbar { display: none; }
  .rf-group { flex-direction: row; align-items: center; gap: 8px; flex: none; }
  .rf-group + .rf-group { padding-left: 14px; border-left: 1px solid var(--line-2); }
  .rf-label { font: 600 9.5px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); white-space: nowrap; }
  .rf-label::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 7px 1px 0; transform: rotate(45deg); background: var(--gold-btn); }
  .rf-chips { flex-wrap: nowrap; gap: 6px; }
  .rf { padding: 8px 8px 8px 13px; font-size: 13.5px; white-space: nowrap; scroll-snap-align: start; }
  .rf[aria-pressed="true"] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(226, 200, 147, 0.45), 0 9px 18px -10px rgba(29, 26, 23, 0.65); }
  /* /models on phones: each recipe is a short row (name · hardware · speed · stars); tap to expand */
  .models-page .recipe-grid { gap: 10px; }
  .models-page .recipe { padding: 0; gap: 0; }
  .models-page .recipe.is-rec { padding-top: 0; }
  .models-page .recipe-sum { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .models-page .recipe.is-rec .recipe-sum { padding-top: 24px; }
  .rs-text { display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; min-width: 0; }
  .rs-name { font: 400 1.45rem/1.1 var(--serif); letter-spacing: -0.01em; }
  .rs-meta { display: flex; flex-wrap: wrap; gap: 4px 0; font: 500 12.5px/1.35 var(--sans); color: var(--muted); }
  .rs-meta > span + span::before { content: "·"; margin: 0 8px; color: var(--dim); }
  .rs-meta .rs-wide { flex-basis: 100%; margin-bottom: 2px; }   /* several hardware types: own line */
  .rs-meta .rs-wide + span::before { content: none; }
  .rs-stars b { font-weight: 600; color: var(--text); }
  .rs-stars svg { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; color: var(--gold); }
  .rs-chev { flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(164, 128, 76, 0.12); position: relative; transition: background 0.25s var(--ease); }
  .rs-chev::before { content: ""; position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-right: 1.6px solid var(--gold-deep); border-bottom: 1.6px solid var(--gold-deep); transform: translate(-50%, -50%) rotate(45deg); transition: transform 0.3s var(--ease); }
  .models-page .recipe.open .rs-chev { background: var(--gold-btn); }
  .models-page .recipe.open .rs-chev::before { top: 55%; transform: translate(-50%, -50%) rotate(225deg); border-color: #2b2012; }
  .models-page .recipe { transition: box-shadow 0.45s var(--ease); }
  .models-page .recipe.open { box-shadow: 0 22px 44px -26px rgba(92, 66, 30, 0.5), inset 0 0 0 1.5px rgba(184, 145, 79, 0.5); }
  .models-page .recipe.is-rec.open { box-shadow: 0 22px 44px -26px rgba(92, 66, 30, 0.5), 0 0 0 1.5px rgba(184, 145, 79, 0.85); }
  .models-page .recipe-sum { border-radius: inherit; transition: background 0.25s ease; }
  .models-page .recipe-sum:active { background: rgba(164, 128, 76, 0.07); }
  /* Height animates via grid rows 0fr → 1fr; the contents then rise in one after another */
  .models-page .recipe-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease); }
  .models-page .recipe.open .recipe-body { grid-template-rows: 1fr; }
  .models-page .recipe-inner { min-height: 0; overflow: hidden; padding: 0 18px; transition: padding 0.5s var(--ease); }
  .models-page .recipe.open .recipe-inner { padding: 2px 18px 20px; }
  .models-page .recipe-inner > * { opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.3s var(--ease); }
  .models-page .recipe.open .recipe-inner > * { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.55s var(--ease); }
  .models-page .recipe.open .recipe-inner > :nth-child(2) { transition-delay: 0.05s; }
  .models-page .recipe.open .recipe-inner > :nth-child(3) { transition-delay: 0.1s; }
  .models-page .recipe.open .recipe-inner > :nth-child(4) { transition-delay: 0.15s; }
  .models-page .recipe.open .recipe-inner > :nth-child(5) { transition-delay: 0.2s; }
  .models-page .recipe.open .recipe-inner > :nth-child(6) { transition-delay: 0.25s; }
  .models-page .recipe-body .recipe-name { display: none; }   /* already in the row */
  .kpis div { padding: 16px 14px; }
  .setup-switch { display: flex; align-self: stretch; }
  .ss { flex: 1 1 0; padding: 9px 6px; text-align: center; }
  .recipe-stats { gap: 10px; }
  /* /experiments on phones: compact rows (thumbnail · name · actions) */
  .xgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .xcard { flex-direction: row; align-items: center; gap: 14px; padding: 10px; }
  .xcard-shot { flex: 0 0 128px; border-radius: 10px; }
  .xcard-tag { display: none; }
  .xcard-body { flex: 1 1 auto; min-width: 0; gap: 3px; padding: 0; }
  .xcard-name { font-size: 1.3rem; }
  .xcard-note { display: block; margin-top: 3px; }
  .xcard-meta { font-size: 12.5px; }
  .xcard-actions { margin-top: 6px; }
  .xcard-actions .btn { padding: 8px 12px; font-size: 12.5px; }
  .xcard-gh span { display: none; }
  .xfacts li { padding: 14px 16px; }
  .tool-play { left: 10px; bottom: 10px; padding: 6px 13px 6px 6px; font-size: 12.5px; }
  .tool-play-icon { width: 24px; height: 24px; }
  .about-links { flex-direction: column; }
  .alink { width: 100%; }
  .alink-go { margin-left: auto; }
  .kpis dt { letter-spacing: 0.16em; font-size: 9.5px; }
  /* Phones: the gold portrait (moved here by home.js) replaces the photo */
  .about-grid.art-here .about-photo { display: none; }
  .about-art { display: block; width: 100%; max-width: 440px; margin: 0 auto; }
  .about-art .hero-art { display: block; max-width: none; margin: 0; order: 0; justify-self: auto; }
  /* Footer: centred to match the lockup, links in a tidy 3 × 2 grid */
  .footer-top { flex-direction: column; align-items: center; text-align: center; gap: 22px; padding-top: 40px; }
  .footer-top p { text-wrap: balance; max-width: 20rem; }
  .footer-links { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 14px 30px; }
  .footer-bottom { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .fund-card { padding-block: 14px; }
  .hero-grid > .hero-art { display: none; }   /* on phones it lives in About instead */
  .hero { padding-top: calc(120px + env(safe-area-inset-top, 0px)); }
  .book { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .book-body { align-items: center; }
  .book-actions { justify-content: center; }
  .tier-go { display: none; }
}

/* Firefox: live backdrop blur and drifting 80px-blurred glows are expensive there; keep the look, drop the cost */
@supports (-moz-appearance: none) {
  .nav-inner, .nav.scrolled .nav-inner { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 253, 250, 0.95); }
  .glow, .glow.g1, .glow.g2, .glow.g3 { animation: none; will-change: auto; }
  .hero-art .ring.r2 { animation: none; }   /* a dashed ring turning inside the 3D-tilted stage repaints every frame */
  /* Cards (big soft shadows) appear in place; sliding them in made Firefox re-blur the shadows every frame while scrolling */
  .js .card.reveal, .js .kpis.reveal, .js .about-links.reveal { transition: none; opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .ribbons .spark { display: none; }
}

/* ═══ /book — the book's landing page (bk-) ═══ */
.bk .section { padding-block: clamp(72px, 10vw, 128px) 0; }
.bk .bk-hero-sec { padding-top: calc(clamp(120px, 14vw, 170px) + env(safe-area-inset-top, 0px)); overflow-x: clip; }   /* the cover glow must not widen the page on phones */
.bk-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.bk-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.bk-title { margin: 0; font: 400 clamp(3.4rem, 7.4vw, 6.4rem)/0.92 var(--serif); letter-spacing: -0.025em; }
.bk-title em { font-style: italic; background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.bk-kicker { margin: -6px 0 0; font: 500 11.5px/1.4 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-deep); }
.bk-proof { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 4px 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--line); }
.bk-proof li { display: flex; flex-direction: column; gap: 4px; }
.bk-proof strong { font: 400 clamp(1.7rem, 2.6vw, 2.2rem)/1 var(--serif); letter-spacing: -0.01em; }
.bk-proof span { font-size: 12.5px; color: var(--muted); }
.bk-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.bk-cover-wrap { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.bk-cover-wrap::before { content: ""; position: absolute; inset: 8% -6% -4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(199, 162, 102, 0.34), transparent); filter: blur(10px); z-index: -1; }
.bk-cover { display: block; width: min(100%, 400px); height: auto; border-radius: 4px 10px 10px 4px; box-shadow: 0 2px 3px rgba(20, 14, 6, 0.25), 0 30px 60px -20px rgba(40, 28, 12, 0.55), 18px 36px 70px -34px rgba(40, 28, 12, 0.5); transform: rotateY(-9deg) rotateX(2deg); transition: transform 0.8s var(--ease); }
.bk-cover-wrap:hover .bk-cover { transform: rotateY(-3deg) rotateX(1deg) translateY(-4px); }

.bk-proof-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 20px; align-items: start; }
.bk-chart { margin: 0; padding: clamp(14px, 2vw, 22px); }
.bk-chart img { display: block; width: 100%; height: auto; border-radius: 12px; }
.bk-chart figcaption { margin-top: 14px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.bk-stats { display: grid; gap: 14px; margin: 0; }
.bk-stats > div { padding: 22px 24px; }
.bk-stats dt { font: 500 10.5px/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); }
.bk-stats dd { margin: 10px 0 0; font: 400 clamp(2rem, 3vw, 2.6rem)/1 var(--serif); }
.bk-stats dd small { font: 400 13px/1 var(--sans); color: var(--muted); margin-left: 4px; }
.bk-stats p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.bk-inside { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.bk-toc { margin: 0; padding: clamp(10px, 1.6vw, 18px) clamp(20px, 2.6vw, 34px); list-style: none; }
.bk-toc li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bk-toc li:last-child { border-bottom: 0; }
.bk-toc .n { font: 400 1.5rem/1 var(--serif); color: var(--gold); }
.bk-toc strong { display: block; font: 400 1.25rem/1.2 var(--serif); }
.bk-toc div span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.bk-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; position: sticky; top: 100px; }
.bk-page { display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; background: none; cursor: zoom-in; font: 500 10.5px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }
.bk-page img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 1px 2px rgba(60, 44, 24, 0.12), 0 18px 40px -18px rgba(60, 44, 24, 0.4); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.bk-page:hover img, .bk-page:focus-visible img { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(60, 44, 24, 0.12), 0 28px 50px -20px rgba(60, 44, 24, 0.5); }

.bk-excerpt { margin: 0; padding: clamp(30px, 5vw, 64px) clamp(26px, 6vw, 90px); display: flex; flex-direction: column; gap: 22px; }
.bk-excerpt blockquote { margin: 0; padding-left: clamp(18px, 2.4vw, 30px); border-left: 2px solid var(--gold); }
.bk-excerpt blockquote p { margin: 0 0 1em; font: 400 clamp(1.3rem, 2vw, 1.65rem)/1.45 var(--serif); color: var(--text); }
.bk-excerpt blockquote p:last-child { margin-bottom: 0; }
.bk-excerpt figcaption { font-size: 14px; color: var(--muted); }

.bk-fit { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bk-fit > div { padding: clamp(24px, 3vw, 38px); }
.bk-fit h3 { margin: 0 0 16px; font: 400 1.7rem/1.1 var(--serif); }
.bk-fit ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.bk-fit li { position: relative; padding-left: 30px; line-height: 1.6; color: var(--muted); }
.bk-fit li::before { position: absolute; left: 0; top: 0.05em; font: 600 15px/1.6 var(--sans); }
.bk-fit-yes li::before { content: "✓"; color: var(--live); }
.bk-fit-no li::before { content: "×"; color: #a4553f; font-size: 18px; line-height: 1.35; }

.bk-author { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(26px, 4vw, 48px); }
.bk-author img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2), 0 0 0 7px var(--surface), 0 0 0 8px rgba(164, 128, 76, 0.35); }
.bk-author > div { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.bk-author-name { margin: 0; font: 400 clamp(2rem, 3.4vw, 2.8rem)/1 var(--serif); }
.bk-author p:not(.eyebrow) { margin: 0; max-width: 44rem; line-height: 1.7; color: var(--muted); }
.bk-author a:not(.btn) { color: var(--gold-deep); text-decoration: underline; text-decoration-color: rgba(164, 128, 76, 0.4); text-underline-offset: 3px; }

.bk-faq-wrap { max-width: calc(880px + var(--gutter) * 2); }
.bk-faq { display: grid; gap: 12px; }
.bk-faq details { border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); }
.bk-faq summary { position: relative; padding: 20px 56px 20px 24px; list-style: none; cursor: pointer; font: 400 1.25rem/1.3 var(--serif); }
.bk-faq summary::-webkit-details-marker { display: none; }
.bk-faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font: 300 22px/1 var(--sans); color: var(--gold); transition: transform 0.3s var(--ease); }
.bk-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.bk-faq details p { margin: 0; padding: 0 24px 22px; line-height: 1.7; color: var(--muted); }

.bk-final { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(26px, 5vw, 64px); align-items: center; padding: clamp(28px, 4.5vw, 56px) clamp(26px, 5vw, 72px); }
.bk-final img { width: 170px; height: auto; border-radius: 3px 8px 8px 3px; box-shadow: 0 24px 50px -20px rgba(40, 28, 12, 0.55); transform: rotate(-3deg); }
.bk-final > div { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

.bk-viewer { width: min(92vw, 760px); max-height: 92vh; padding: 0; border: 0; border-radius: 10px; background: transparent; overflow: visible; }
.bk-viewer::backdrop { background: rgba(24, 18, 10, 0.72); }
.bk-viewer img { display: block; width: 100%; height: auto; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.bk-viewer-close { position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font: 300 24px/1 var(--sans); cursor: pointer; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .bk-hero { grid-template-columns: minmax(0, 1fr); }
  .bk-cover-wrap { order: -1; }
  .bk-cover { width: min(62vw, 300px); }
  .bk-proof-grid, .bk-inside { grid-template-columns: minmax(0, 1fr); }
  .bk-stats { grid-template-columns: 1fr 1fr; }
  .bk-pages { position: static; }
}
@media (max-width: 640px) {
  .bk .bk-hero-sec { padding-top: calc(104px + env(safe-area-inset-top, 0px)); }   /* clear the fixed nav, which also sits below the iPhone status bar */
  .bk-hero { gap: 30px; }
  .bk-cover { width: min(40vw, 150px); transform: rotateY(-7deg) rotateX(2deg); }
  .bk-hero-sec .lede { font-size: 1rem; }
  .bk-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .bk-proof strong { font-size: 1.3rem; white-space: nowrap; }
  .bk-proof span { font-size: 11.5px; }
  .bk-hero-copy { gap: 18px; }
  .bk-toc li { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 12px 0; }
  .bk-toc .n { font-size: 1.3rem; }
  .bk-cta { width: 100%; flex-direction: column; }
  .bk-cta .btn { width: 100%; }
  .bk-stats { grid-template-columns: minmax(0, 1fr); }
  .bk-stats > div { padding: 18px 20px; }
  .bk-fit { grid-template-columns: minmax(0, 1fr); }
  .bk-author, .bk-final { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .bk-author > div, .bk-final > div { align-items: center; }
  .bk-author img { width: 132px; height: 132px; }
  .bk-final img { width: 130px; }
  .bk-viewer-close { top: 8px; right: 8px; }
}
