/* ==========================================================================
   bgbgone.franzai.com — MOBILE-FIRST, FLUID stylesheet
   --------------------------------------------------------------------------
   KISS + DRY. Base rules target the phone; desktop is the exception, layered
   on with `min-width` media queries only. Type and spacing are fluid
   (clamp), and card grids use auto-fit, so most breakpoints disappear.
   Single source of truth: every colour/alpha lives on :root — no hex/rgb
   anywhere else. System fonts only. No framework, no CDN.
   ========================================================================== */

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

:root {
  /* ---------- COLOUR — SSOT ---------- */
  --paper:        #FFFBF0;
  --paper-2:      #FFF6E2;
  --paper-3:      #FFEFD0;
  --ink:          #1A1015;
  --ink-2:        #2A1F26;
  --ink-soft:     #4A3A42;
  --gray-100:     #F1ECE2;
  --gray-200:     #E3DCCB;
  --gray-300:     #C9C1B0;
  --gray-400:     #9F9786;
  --gray-500:     #6F6A60;
  --gray-600:     #4F4A42;
  --gray-700:     #322E29;

  --pink:         #E91E63;
  --pink-deep:    #AD1457;
  --pink-deeper:  #880E4F;
  --pink-bright:  #FF3D7F;
  --pink-pale:    #FFE0EC;
  --pink-tint:    #FFF0F6;

  --yellow:       #FFC107;
  --yellow-deep:  #F39C12;
  --yellow-bright:#FFD93D;
  --yellow-pale:  #FFF4CC;
  --yellow-tint:  #FFFAE5;

  /* ---------- TYPE ---------- */
  --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-body:    ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --font-serif:   ui-serif, "New York", "Charter", Georgia, "Times New Roman", serif;

  /* ---------- RADII ---------- */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* ---------- FLUID SPACING (phone → desktop, no breakpoints needed) ------- */
  --section-y: clamp(64px, 9vw, 120px);
  --gutter:    clamp(18px, 4vw, 24px);

  /* ---------- ALPHA SURFACES (only place rgba may appear) ---------- */
  --hairline-soft:        rgba(26, 16, 21, 0.06);
  --shadow-soft:          rgba(26, 16, 21, 0.08);
  --shadow-soft-2:        rgba(26, 16, 21, 0.12);
  --pink-glow:            rgba(233, 30, 99, 0.18);
  --yellow-glow:          rgba(255, 193, 7, 0.28);
  --divider-shadow-glow:  rgba(255, 193, 7, 0.60);
  --handle-shadow-pink:   rgba(233, 30, 99, 0.40);
  --ink-on-yellow:        rgba(255, 193, 7, 0.12);
  --ink-on-yellow-edge:   rgba(255, 193, 7, 0.30);
  --paper-blur:           rgba(255, 251, 240, 0.92);
  --grain-dot:            rgba(26, 16, 21, 0.05);

  --paper-06:  rgba(255, 251, 240, 0.06);
  --paper-08:  rgba(255, 251, 240, 0.08);
  --paper-12:  rgba(255, 251, 240, 0.12);
  --paper-14:  rgba(255, 251, 240, 0.14);
  --paper-70:  rgba(255, 251, 240, 0.70);
  --paper-85:  rgba(255, 251, 240, 0.85);
  --paper-90:  rgba(255, 251, 240, 0.90);
  --ink-05:    rgba(26, 16, 21, 0.05);
  --ink-82:    rgba(26, 16, 21, 0.82);
  --yellow-10: rgba(255, 193, 7, 0.10);
  --yellow-15: rgba(255, 193, 7, 0.15);
  --black-18:  rgba(0, 0, 0, 0.18);

  --shadow-sm: 0 1px 2px var(--hairline-soft);
  --shadow-md: 0 6px 22px var(--shadow-soft);
  --shadow-lg: 0 18px 48px var(--shadow-soft-2);
  --shadow-pink: 0 14px 40px var(--pink-glow);
  --shadow-yellow: 0 14px 40px var(--yellow-glow);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   BASE
   ========================================================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  overflow-x: hidden;
  max-width: 100vw;
  color-scheme: light only;
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "ss01", "ss02", "cv02", "cv11";
  overflow-x: hidden;
  max-width: 100vw;
}
/* any grid/flex child holding a <pre> must be allowed to shrink */
.hero-grid > *, .quickstart-grid > *, .flags-grid > *,
.privacy-grid > *, .eco-grid > *, .footer-inner > *, .footer-cols > *,
.demo > *, .demo-subjects > * { min-width: 0; }

section, header, footer { overflow: hidden; }
a { color: var(--pink-deep); text-decoration: none; transition: color .2s var(--ease-out); }
a:hover { color: var(--pink); }
/* in-text links stay distinguishable without relying on colour (WCAG) */
p a, .demo-note a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
img { max-width: 100%; height: auto; display: block; }
code, pre, .mono { font-family: var(--font-mono); }
code {
  font-size: 0.92em;
  background: var(--pink-tint);
  color: var(--pink-deep);
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-word;
}
strong { font-weight: 600; color: var(--ink); }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.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;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- shared code tokens ---------- */
.c-prompt { color: var(--yellow); margin-right: 8px; user-select: none; }
.c-cmd { color: var(--paper); }
.c-comment { color: var(--paper-70); font-style: italic; }

/* code blocks: phone wraps (no sideways wobble); desktop gets tidy scroll */
.ex-code, .demo-cli, .qs-install pre, .qs-usage pre { overflow-x: hidden; }
.ex-code code, .demo-cli code, .qs-install pre code, .qs-usage pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- kicker / section head ---------- */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-deep);
  background: var(--pink-tint);
  border: 1px solid var(--pink-pale);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.kicker-onink   { color: var(--yellow); background: var(--ink-on-yellow); border-color: var(--ink-on-yellow-edge); }
.kicker-onyellow{ color: var(--pink-deep); background: var(--paper); border-color: var(--pink-pale); }

.section-head { max-width: 820px; margin-bottom: clamp(32px, 6vw, 60px); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 14px;
}
.section-head h2 code {
  background: var(--yellow-tint);
  color: var(--ink);
  border: 1px dashed var(--yellow-deep);
  font-size: 0.55em;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  vertical-align: middle;
}
.section-head p { font-size: clamp(16px, 2vw, 18px); color: var(--gray-700); line-height: 1.6; max-width: 680px; }
.ink-pink { color: var(--pink); }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 12px 0;
  transition: background .25s var(--ease-out), padding .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.nav.scrolled {
  background: var(--paper-blur);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--hairline-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(18px, 2.4vw, 20px); color: var(--ink); letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--ink); }
.logo-mark {
  width: 22px; height: 22px;
  background: var(--pink); border-radius: 6px;
  position: relative; flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute; inset: 6px 6px auto auto;
  width: 10px; height: 10px;
  background: var(--yellow); border-radius: 2px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
/* phone: only the GitHub chip; text links appear on wider screens */
.nav-links > a:not(.nav-github) { display: none; }
.nav-links > a {
  color: var(--ink-soft); font-size: 14px; font-weight: 500; transition: color .2s;
}
.nav-links > a:hover { color: var(--pink-deep); }
.nav-github {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper) !important;
  padding: 8px 14px; border-radius: 100px;
  font-family: var(--font-mono); font-size: 12px; transition: background .2s;
}
.nav-github:hover { background: var(--pink-deep); color: var(--paper) !important; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(96px, 20vw, 132px) 0 clamp(48px, 10vw, 88px);
  background: var(--paper);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-stripe { position: absolute; border-radius: 999px; filter: blur(64px); }
.stripe-1 { width: 560px; height: 560px; background: var(--pink-bright); top: -180px; right: -140px; opacity: 0.22; }
.stripe-2 { width: 440px; height: 440px; background: var(--yellow); top: 220px; left: -160px; opacity: 0.30; }
.hero-grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--grain-dot) 1px, transparent 1px);
  background-size: 22px 22px; opacity: 0.9;
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr;
  gap: clamp(36px, 7vw, 56px);
}
.hero-text { min-width: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(22px, 4vw, 32px); }
.meta-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 5px 11px; border-radius: 100px;
  background: var(--paper); border: 1px solid var(--gray-300);
  color: var(--gray-700); text-transform: uppercase;
}
.tag-active { background: var(--ink); color: var(--yellow); border-color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.tag-dot { width: 7px; height: 7px; background: var(--yellow); border-radius: 50%; display: inline-block; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(0.85); } }

.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(44px, 12vw, 92px);
  line-height: 0.94; letter-spacing: -0.04em;
  color: var(--ink); margin: 0 0 clamp(20px, 4vw, 28px);
}
.title-line { display: block; }
.title-strike { position: relative; display: inline-block; color: var(--pink-deep); font-style: italic; padding: 0 6px; }
.title-strike::after {
  content: ""; position: absolute; left: -8px; right: -8px; top: 56%; bottom: 18%;
  background: var(--yellow); z-index: -1; transform: skewY(-2deg);
}
.hero-lede {
  max-width: 560px;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.6; color: var(--gray-700);
  margin-bottom: clamp(24px, 4vw, 32px);
}
.hero-lede strong { color: var(--ink); background: linear-gradient(180deg, transparent 64%, var(--yellow-pale) 64%); padding: 0 3px; }

.hero-install {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); border-radius: var(--r-md);
  padding: 14px 16px; max-width: 560px; margin: 0 0 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.hero-install code { flex: 1; background: none; color: var(--paper); padding: 0; font-size: clamp(13px, 2vw, 15px); white-space: nowrap; overflow-x: auto; min-width: 0; }
.hero-install .prompt { color: var(--yellow); margin-right: 10px; user-select: none; }
.hero-install .cmd { color: var(--paper); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pink-deep); color: var(--paper);
  border-radius: var(--r-sm); padding: 8px 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  transition: background .2s, transform .15s; flex-shrink: 0;
}
.copy-btn:hover { background: var(--pink); transform: scale(1.03); }
.copy-btn.copied { background: var(--yellow); color: var(--ink); }
.copy-btn svg { width: 14px; height: 14px; }

.hero-foot { font-size: 14px; color: var(--gray-600); max-width: 520px; }

/* hero before/after slider — sizing logic preserved (do not letterbox) */
.hero-slider {
  position: relative; margin: 0 auto; max-width: 520px;
  border-radius: var(--r-lg); overflow: hidden;
  background:
    linear-gradient(45deg, var(--gray-200) 25%, transparent 25%) 0 0/24px 24px,
    linear-gradient(-45deg, var(--gray-200) 25%, transparent 25%) 0 12px/24px 24px,
    linear-gradient(45deg, transparent 75%, var(--gray-200) 75%) 12px -12px/24px 24px,
    linear-gradient(-45deg, transparent 75%, var(--gray-200) 75%) -12px 0/24px 24px,
    var(--paper);
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200);
}
.hero-comp {
  --divider-color: var(--yellow);
  --divider-width: 3px;
  --divider-shadow: 0 0 18px var(--divider-shadow-glow);
  --default-handle-width: 56px;
  --default-handle-color: var(--pink);
  --default-handle-shadow: 0 4px 12px var(--handle-shadow-pink);
  display: block; width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--r-lg); overflow: hidden; line-height: 0;
}
.hero-comp img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; user-select: none; -webkit-user-drag: none; }
.hero-slider-cap {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 14px;
  background: var(--ink-82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--paper); pointer-events: none;
}
.cap-row { display: inline-flex; align-items: center; gap: 7px; }
.cap-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cap-dot-pink { background: var(--pink-bright); }
.cap-dot-yellow { background: var(--yellow); }
.cap-hint { margin-left: auto; color: var(--yellow); font-weight: 600; }

/* ==========================================================================
   LIVE GALLERY
   ========================================================================== */
.gallery {
  padding: var(--section-y) 0;
  background: var(--paper-3);
  border-top: 1px solid var(--gray-200);
  position: relative; overflow: hidden;
}
.gallery::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--grain-dot) 1px, transparent 1px);
  background-size: 24px 24px; opacity: 0.6; pointer-events: none;
}
.gallery .container { position: relative; z-index: 1; }
/* phone: subjects as a wrapping chip row above the stage */
.demo { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.demo-subjects { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.subj {
  flex: 1 1 140px;
  display: flex; align-items: center; gap: 12px;
  text-align: left; padding: 8px;
  border-radius: var(--r-md); border: 1px solid var(--gray-200);
  background: var(--paper);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .15s var(--ease-out);
}
.subj:hover { border-color: var(--pink); transform: translateY(-1px); }
.subj.is-active { border-color: var(--ink); box-shadow: var(--shadow-md); background: var(--paper-2); }
.subj-thumb { width: 52px; height: 52px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; background: var(--gray-200); border: 1px solid var(--gray-200); }
.subj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.subj-meta { display: flex; flex-direction: column; min-width: 0; }
.subj-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.subj-year { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-600); }
.subj.is-active .subj-year { color: var(--pink-deep); }

.demo-stage { margin: 0; }
.demo-frame {
  position: relative;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--gray-300); box-shadow: var(--shadow-lg);
  /* centre the slider so a height-capped portrait subject pillarboxes neatly */
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(45deg, var(--gray-200) 25%, transparent 25%) 0 0/22px 22px,
    linear-gradient(-45deg, var(--gray-200) 25%, transparent 25%) 0 11px/22px 22px,
    linear-gradient(45deg, transparent 75%, var(--gray-200) 75%) 11px -11px/22px 22px,
    linear-gradient(-45deg, transparent 75%, var(--gray-200) 75%) -11px 0/22px 22px,
    var(--paper);
}
.demo-comp {
  --divider-color: var(--pink);
  --divider-width: 3px;
  --divider-shadow: 0 0 16px var(--handle-shadow-pink);
  --default-handle-width: 52px;
  --default-handle-color: var(--yellow);
  --default-handle-shadow: 0 4px 12px var(--divider-shadow-glow);
  display: block; width: 100%;
  /* aspect-ratio + width/height set per-subject by app.js to the image's real
     ratio so before/after render at IDENTICAL boxes — cover never letterboxes */
  aspect-ratio: 1200 / 795;
  line-height: 0;
}
.demo-comp img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }

.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.demo-algos { display: inline-flex; gap: 4px; padding: 5px; background: var(--paper-2); border: 1px solid var(--gray-200); border-radius: 100px; }
.algo { font-family: var(--font-mono); font-size: 13px; padding: 7px 16px; border-radius: 100px; color: var(--gray-700); transition: background .15s var(--ease-out), color .15s var(--ease-out); }
.algo:hover { color: var(--ink); }
.algo.is-active { background: var(--ink); color: var(--yellow); }
.algo[hidden] { display: none; }
.demo-cli { flex: 1 1 100%; min-width: 0; background: var(--ink); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.demo-cli code { display: block; font-family: var(--font-mono); font-size: 13px; line-height: 1.4; background: none; color: var(--paper); padding: 0; }
.demo-note { margin-top: 22px; font-size: 14px; color: var(--gray-700); max-width: 760px; }
.demo-note code { background: var(--paper); border: 1px solid var(--gray-200); color: var(--ink); }

/* ==========================================================================
   STATS
   ========================================================================== */
.stats { padding: var(--section-y) 0; background: var(--paper-2); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.stats-head { max-width: 760px; margin-bottom: clamp(32px, 6vw, 56px); }
.stats-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 5.5vw, 44px); letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
.stats-table { width: 100%; border-collapse: collapse; border: 1px solid var(--ink); background: var(--paper); table-layout: fixed; }
.stats-table tr + tr td { border-top: 1px solid var(--ink); }
.stats-table tr:nth-child(2) { background: var(--yellow-tint); }
.stats-table tr:nth-child(3) { background: var(--pink-tint); }
.stats-table td { padding: clamp(16px, 3vw, 24px) clamp(16px, 3vw, 22px); vertical-align: middle; text-align: left; }
.st-num { width: 32%; font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 11vw, 80px); line-height: 1; letter-spacing: -0.04em; color: var(--ink); white-space: nowrap; }
.st-unit { font-size: 0.4em; color: var(--pink-deep); font-weight: 600; margin-left: 3px; letter-spacing: -0.01em; }
.st-info { width: 68%; }
.st-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pink-deep); }

/* ==========================================================================
   QUICK START
   ========================================================================== */
.quickstart { padding: var(--section-y) 0; background: var(--paper); border-top: 1px solid var(--gray-200); }
.quickstart-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: stretch; }
.qs-install, .qs-usage { background: var(--ink); border-radius: var(--r-lg); padding: clamp(18px, 4vw, 24px); box-shadow: var(--shadow-md); overflow: hidden; }
.qs-install { background: var(--pink-deep); color: var(--paper); }
.qs-install .card-label { color: var(--yellow-bright); }
.qs-install pre code { color: var(--paper); }
.qs-install .card-foot { color: var(--paper-90); }
.qs-install .card-foot code { background: var(--black-18); color: var(--yellow-bright); }
.card-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 18px; }
.qs-install pre, .qs-usage pre { background: none; padding: 0; margin: 0 0 18px; }
.qs-install pre code, .qs-usage pre code { display: block; font-family: var(--font-mono); font-size: clamp(12px, 1.6vw, 13px); line-height: 1.7; background: none; color: var(--paper); padding: 0; }
.qs-install pre:last-of-type, .qs-usage pre:last-of-type { margin-bottom: 0; }
.card-foot { font-size: 14px; color: var(--paper-70); line-height: 1.55; margin-top: 18px; }
.card-foot code { color: var(--yellow); background: none; }

/* ==========================================================================
   EXAMPLES
   ========================================================================== */
.examples { padding: var(--section-y) 0; background: var(--paper-2); }
.ex-block + .ex-block { margin-top: clamp(48px, 8vw, 96px); padding-top: clamp(48px, 8vw, 96px); border-top: 1px dashed var(--gray-300); }
.ex-head { margin-bottom: 22px; }
.ex-head h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 4vw, 34px); letter-spacing: -0.02em; color: var(--ink);
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.ex-num { font-family: var(--font-mono); font-size: clamp(12px, 1.6vw, 14px); letter-spacing: 0.1em; background: var(--ink); color: var(--yellow); padding: 4px 10px; border-radius: var(--r-sm); font-weight: 600; }

.ex-code { background: var(--ink); border-radius: var(--r-md); padding: clamp(16px, 3vw, 22px) clamp(14px, 3vw, 24px); margin: 0 0 24px; box-shadow: var(--shadow-md); }
.ex-code code { display: block; font-family: var(--font-mono); font-size: clamp(12px, 1.6vw, 13px); line-height: 1.7; background: none; color: var(--paper); padding: 0; }

.ex-figure { margin: 0; background: var(--paper); border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: clamp(10px, 2vw, 18px); box-shadow: var(--shadow-sm); }
.ex-figure img { border-radius: var(--r-md); margin: 0 auto; }
.ex-figure-tall img { max-height: 460px; width: auto; }
.ex-figure figcaption, .ex-cap { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; color: var(--gray-600); text-align: center; margin-top: 14px; }
.ex-figure figcaption code { font-size: 11px; background: var(--paper-2); color: var(--ink); }

.img-zoom { display: block; cursor: zoom-in; position: relative; border-radius: var(--r-md); overflow: hidden; transition: transform .25s var(--ease-out); }
.img-zoom:hover { transform: scale(1.005); }
.img-zoom::after {
  content: "↗ open full size";
  position: absolute; top: 10px; right: 10px;
  padding: 5px 10px; background: var(--ink); color: var(--yellow);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 100px; opacity: 0; transform: translate3d(0, -4px, 0);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.img-zoom:hover::after { opacity: 1; transform: translate3d(0, 0, 0); }
@media (hover: none) { .img-zoom::after { opacity: 1; transform: none; } }

/* example before/after sliders — dimension-matched pairs, aspect set inline */
.ex-comp {
  --divider-color: var(--pink);
  --divider-width: 3px;
  --divider-shadow: 0 0 16px var(--handle-shadow-pink);
  --default-handle-width: 48px;
  --default-handle-color: var(--yellow);
  --default-handle-shadow: 0 4px 12px var(--divider-shadow-glow);
  display: block; width: 100%; aspect-ratio: 3 / 2; line-height: 0;
  border-radius: var(--r-md); overflow: hidden;
}
.ex-comp img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.ex-comp-checker {
  background:
    linear-gradient(45deg, var(--gray-200) 25%, transparent 25%) 0 0/22px 22px,
    linear-gradient(-45deg, var(--gray-200) 25%, transparent 25%) 0 11px/22px 22px,
    linear-gradient(45deg, transparent 75%, var(--gray-200) 75%) 11px -11px/22px 22px,
    linear-gradient(-45deg, transparent 75%, var(--gray-200) 75%) -11px 0/22px 22px,
    var(--paper);
}

/* ==========================================================================
   FLAGS
   ========================================================================== */
.flags { padding: var(--section-y) 0; background: var(--paper); }
.flags-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.flag-group { background: var(--paper-2); border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 24px); }
.flag-group:nth-child(even) { background: var(--yellow-tint); }
.flag-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--pink); display: inline-block; }
.flag-group ul { list-style: none; }
/* phone: flag over description; desktop: two columns */
.flag-group li { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px dotted var(--gray-300); align-items: baseline; }
.flag-group li:last-child { border-bottom: 0; }
.flag-group li code { background: var(--paper); border: 1px solid var(--gray-200); color: var(--ink); font-size: 12.5px; padding: 2px 7px; white-space: normal; word-break: break-word; }
.flag-group li span { font-size: 13px; color: var(--gray-700); }
.exit-codes { margin-top: 16px; width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
.exit-codes th, .exit-codes td { text-align: left; padding: 6px 10px; border-bottom: 1px dotted var(--gray-300); }
.exit-codes th { background: var(--pink-deep); color: var(--paper); width: 44px; text-align: center; border-radius: 4px; }
.exit-codes td { color: var(--gray-700); }

/* ==========================================================================
   PRIVACY  (auto-fit grid — fluid, no breakpoints)
   ========================================================================== */
.privacy { padding: var(--section-y) 0; background: var(--yellow); color: var(--ink); }
.privacy .kicker-onyellow { background: var(--paper); }
.privacy .section-head h2 { color: var(--ink); }
.privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.privacy-card { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 28px) clamp(20px, 3vw, 24px); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.privacy-card:nth-child(2) { background: var(--paper); color: var(--ink); }
.privacy-card:nth-child(2) .privacy-num { color: var(--pink-deep); }
.privacy-card:nth-child(2) h3 { color: var(--ink); }
.privacy-num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--yellow); margin-bottom: 18px; }
.privacy-card h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2.4vw, 22px); letter-spacing: -0.02em; color: var(--paper); }
.privacy-card:nth-child(2) h3 { color: var(--ink); }

/* ==========================================================================
   ECOSYSTEM  (auto-fit grid — fluid, no breakpoints)
   ========================================================================== */
.ecosystem { padding: var(--section-y) 0; background: var(--paper); }
.ecosystem .section-head h2 a { color: var(--pink-deep); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.ecosystem .section-head h2 a:hover { color: var(--pink); }
.eco-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.eco-card { background: var(--paper-2); border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 24px 22px 22px; display: flex; flex-direction: column; transition: transform .2s var(--ease-out), border-color .2s, box-shadow .2s; color: var(--ink); }
.eco-card:hover { transform: translateY(-4px); border-color: var(--pink); box-shadow: var(--shadow-pink); color: var(--ink); }
.eco-card-this { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.eco-card-this:hover { color: var(--paper); border-color: var(--yellow); box-shadow: var(--shadow-yellow); }
.eco-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: inherit; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.eco-this-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; background: var(--yellow); color: var(--ink); padding: 2px 7px; border-radius: 999px; }
.eco-cap { font-size: 13px; color: var(--gray-700); margin-bottom: 14px; line-height: 1.45; }
.eco-card-this .eco-cap { color: var(--paper-85); }
.eco-fw { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; color: var(--pink-deep); background: var(--pink-tint); border-radius: 4px; padding: 4px 8px; align-self: flex-start; margin-top: auto; }
.eco-card-this .eco-fw { background: var(--yellow-15); color: var(--yellow-bright); }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta { padding: var(--section-y) 0; background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.cta::before, .cta::after { content: ""; position: absolute; border-radius: 999px; filter: blur(80px); pointer-events: none; }
.cta::before { width: 460px; height: 460px; background: var(--pink); top: -120px; right: -80px; opacity: 0.4; }
.cta::after { width: 360px; height: 360px; background: var(--yellow); bottom: -120px; left: -80px; opacity: 0.25; }
.cta-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; text-align: center; }
.cta-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(44px, 12vw, 96px); line-height: 1; letter-spacing: -0.04em; color: var(--paper); margin: 24px 0 32px; }
.cta-strike { position: relative; display: inline-block; color: var(--yellow); font-style: italic; }
.cta-strike::after { content: ""; position: absolute; left: -8px; right: -8px; top: 56%; bottom: 18%; background: var(--pink); z-index: -1; transform: skewY(-2deg); }
.cta-install { display: flex; align-items: center; gap: 12px; background: var(--paper-06); border: 1px solid var(--paper-14); border-radius: var(--r-md); padding: 14px 16px; margin: 0 auto 32px; max-width: 620px; }
.cta-install code { flex: 1; background: none; color: var(--paper); font-size: clamp(13px, 2vw, 15px); white-space: nowrap; overflow-x: auto; padding: 0; min-width: 0; }
.cta-install .prompt { color: var(--yellow); margin-right: 10px; }
.copy-btn-onink { background: var(--yellow); color: var(--ink); }
.copy-btn-onink:hover { background: var(--yellow-bright); color: var(--ink); }
.copy-btn-onink.copied { background: var(--pink); color: var(--paper); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: var(--r-md); font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; transition: transform .15s, background .2s; }
.cta-btn-pink { background: var(--pink); color: var(--paper); }
.cta-btn-pink:hover { background: var(--pink-bright); color: var(--paper); transform: translateY(-2px); }
.cta-btn-yellow { background: var(--yellow); color: var(--ink); }
.cta-btn-yellow:hover { background: var(--yellow-bright); color: var(--ink); transform: translateY(-2px); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { background: var(--ink); color: var(--gray-300); padding: clamp(40px, 8vw, 64px) 0 28px; border-top: 1px solid var(--ink-on-yellow); }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--paper-08); }
.footer-logo { font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -0.02em; color: var(--paper); margin-bottom: 8px; }
.footer-tag { color: var(--yellow); font-family: var(--font-mono); font-size: 13px; font-style: italic; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 24px; }
.footer-col-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pink-bright); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--gray-300); font-size: 14px; padding: 4px 0; transition: color .2s; }
.footer-col a:hover { color: var(--yellow); }
.footer-bot { padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--gray-300); font-family: var(--font-mono); }
.footer-bot a { color: var(--yellow); text-decoration: underline; }

/* ==========================================================================
   DESKTOP — the exception. Layered on with min-width only.
   ========================================================================== */
@media (min-width: 48em) {
  .nav-links > a:not(.nav-github) { display: inline; }
  .nav { padding: 18px 0; }
  .nav.scrolled { padding: 12px 0; }

  /* flags: two columns, flag beside its description */
  .flags-grid { grid-template-columns: repeat(2, 1fr); }
  .flag-group li { grid-template-columns: minmax(0, auto) 1fr; gap: 12px; }
  .flag-group li code { white-space: nowrap; overflow-x: auto; max-width: 100%; }

  /* quickstart + footer: two columns */
  .quickstart-grid { grid-template-columns: 4fr 7fr; }
  .footer-inner { grid-template-columns: 1fr 2fr; gap: 48px; }

  /* code blocks: tidy no-wrap + horizontal scroll on bigger screens */
  .ex-code code, .demo-cli code, .qs-install pre code, .qs-usage pre code { white-space: pre; overflow-wrap: normal; word-break: normal; }
  .ex-code, .demo-cli, .qs-install pre, .qs-usage pre { overflow-x: auto; }
}

@media (min-width: 56em) {
  /* gallery: subjects become a fixed sidebar beside the stage */
  .demo { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 28px; }
  .demo-subjects { flex-direction: column; }
  .subj { flex: none; }
  .demo-cli { flex: 1; }
}

@media (min-width: 64em) {
  /* hero: text + slider side by side */
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
  .hero-slider { max-width: none; margin: 0; }
}

/* ==========================================================================
   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;
  }
}

/* ============ MAC APP (GUI · download) ============ */
.appsec {
  padding: var(--section-y) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
}
.appsec-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(28px, 4vw, 44px);
  max-width: 980px; margin: 0 auto; text-align: center;
}
.appsec-head { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.appsec-meta { justify-content: center; }
.appsec-h {
  font: 700 clamp(28px, 5vw, 46px)/1.05 var(--font-display);
  letter-spacing: -0.02em; color: var(--ink);
}
.appsec-lede {
  font: 400 clamp(16px, 2.4vw, 19px)/1.5 var(--font-body);
  color: var(--ink-soft); max-width: 56ch;
}
.appsec-lede strong { color: var(--ink); }
/* The screenshot: clicking it scrolls to the download CTA directly below. */
.appsec-shot {
  width: 100%; border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink); box-shadow: 0 24px 70px -18px var(--shadow-soft-2);
}
.appsec-shotlink { display: block; cursor: pointer; }
.appsec-shot img { display: block; width: 100%; height: auto; }
/* The conversion element — primary download, big and central, directly below the GUI. */
.appsec-cta {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 100%; scroll-margin-top: 90px;
}
.appsec-dl {
  display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
  column-gap: 16px; align-items: center; justify-content: center;
  padding: 18px 44px; background: var(--ink); color: var(--paper);
  border-radius: var(--r-md); text-decoration: none;
  box-shadow: 0 12px 34px -10px var(--shadow-soft-2);
  transition: transform .2s var(--ease-out), background .2s var(--ease-out);
}
.appsec-dl svg { grid-row: 1 / 3; color: var(--yellow); }
.appsec-dl-main { font: 700 clamp(18px, 2.6vw, 22px)/1.1 var(--font-display); justify-self: start; }
.appsec-dl-sub { font: 500 12px/1.2 var(--font-mono); color: var(--gray-300); justify-self: start; }
/* Deep pink on hover: cream title/sub stay high-contrast (~6.6:1) and readable.
   The brighter --pink left the cream "Download for macOS" muddy/illegible. */
.appsec-dl:hover { background: var(--pink-deep); transform: translateY(-2px); }
.appsec-dl:hover .appsec-dl-main { color: var(--paper); }
.appsec-dl:hover .appsec-dl-sub { color: var(--paper-85); }
.appsec-dl:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.appsec-brew {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 470px; min-width: 0;
  padding: 9px 9px 9px 16px;
  background: var(--ink); border-radius: var(--r-md);
}
.appsec-brew code {
  flex: 1; min-width: 0; background: none;  /* override global code{background:pink-tint} */
  white-space: normal; overflow-wrap: anywhere; text-align: left;
  font: 500 clamp(12px, 2vw, 13px)/1.45 var(--font-mono); color: var(--paper);
}
.appsec-brew .prompt { color: var(--yellow); margin-right: 10px; user-select: none; }
.appsec-foot { font: 500 13px/1.4 var(--font-mono); color: var(--gray-500); }
