/* ============================================================
 * pergam — landing & viewer stylesheet
 * ------------------------------------------------------------
 *  Shared by:
 *    - index.html  (body.landing)      — marketing landing
 *    - view.html   (body.viewer-page)  — embedded pergam viewer
 *
 *  Conventions:
 *    - Design tokens live in :root as CSS custom properties.
 *    - Page-specific rules are scoped via the body class
 *      (`.landing` or `.viewer-page`) to avoid cross-pollination.
 *    - Block / element naming is light BEM: `.mock-card`,
 *      `.mock-card__bar`. Modifiers use double-dash: `.btn--primary`.
 *    - One responsive section near the bottom — no media queries
 *      sprinkled per component.
 *
 *  Table of contents
 *  ─────────────────
 *  01. Tokens
 *  02. Reset & base
 *  03. Typography
 *  04. Layout primitives          .container, .section
 *  05. Shared components          buttons, chips, code, modal
 *  06. Landing · topbar
 *  07. Landing · hero
 *  08. Landing · hero mockup
 *  09. Landing · trust strip
 *  10. Landing · how it works
 *  11. Landing · why pergam (features)
 *  12. Landing · gallery
 *  13. Landing · quickstart
 *  14. Landing · drop strip
 *  15. Landing · github CTA
 *  16. Landing · FAQ
 *  17. Landing · footer
 *  18. Viewer page
 *  19. Utilities
 *  20. Responsive
 *  21. Reduced motion & a11y
 * ============================================================ */


/* ─── 01 · Tokens ─────────────────────────────────────────── */
:root {
  /* Surface */
  --bg:           #07080d;
  --bg-elev:      #0d1019;
  --bg-card:      #11141f;
  --line:         #1e2333;
  --line-soft:    #161a26;

  /* Ink */
  --ink:          #eef1f8;
  --ink-soft:     #9aa3b8;
  --ink-faint:    #5c6379;

  /* Accents */
  --accent:       #7aa2ff;   /* AI blue */
  --accent-2:     #5ee7ff;   /* electric cyan */
  --warm:         #f0d28a;   /* parchment */
  --ok:           #56d364;
  --crit:         #f85149;
  --warn:         #d29922;

  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif:   'Instrument Serif', Georgia, serif;

  /* Geometry */
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --container:    1180px;

  /* Effects */
  --shadow-glow:  0 0 0 1px rgba(122, 162, 255, .18),
                  0 20px 60px -20px rgba(94, 231, 255, .25),
                  0 8px 30px -10px rgba(122, 162, 255, .18);
}


/* ─── 02 · Reset & base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Page-wide background painted once on the landing only.
   `overflow-x: clip` (vs. `hidden`) prevents iOS Safari from creating
   a horizontal scroll context that swallows touch gestures and locks
   vertical scrolling on swipe. Falls back to default on Safari <16. */
body.landing { overflow-x: clip; }
body.landing::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% 8%,  rgba(122,162,255,.20), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba( 94,231,255,.13), transparent 50%),
    radial-gradient(circle at 50% 95%, rgba(240,210,138,.07), transparent 55%),
    var(--bg);
}
body.landing::after {
  content: "";
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  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.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .8;
  mix-blend-mode: overlay;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

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

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


/* ─── 03 · Typography ─────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
code, pre, kbd { font-family: var(--font-mono); }

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}


/* ─── 04 · Layout primitives ──────────────────────────────── */
.container {
  width: min(var(--container), 92vw);
  margin: 0 auto;
}

.section { padding: 96px 0; position: relative; }
.section--bordered { border-top: 1px solid var(--line-soft); }

.section__eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--ink-faint);
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section__eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.section__title {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  margin: 0 0 18px;
}
.section__title .serif { color: var(--warm); }
.section__title code {
  color: var(--warm);
  background: transparent;
  padding: 0;
  font-size: .85em;
}
.section__lead {
  color: var(--ink-soft);
  font-size: clamp(16px, 1.4vw, 18px);
  max-width: 62ch;
  margin: 0 0 40px;
}


/* ─── 05 · Shared components ──────────────────────────────── */

/* 5a · buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101e;
  box-shadow: 0 10px 40px -10px rgba(94, 231, 255, .55),
              0 0 0 1px rgba(255, 255, 255, .08) inset;
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 50px -10px rgba(94, 231, 255, .7),
              0 0 0 1px rgba(255, 255, 255, .12) inset;
  color: #08101e;
}

.btn--ghost {
  background: rgba(255, 255, 255, .04);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(122, 162, 255, .4);
  color: var(--ink);
}

/* Star-count pill: lives inside Star-on-GitHub buttons, hidden until JS
   confirms the repo has crossed the threshold (see app.js). */
.gh-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(8, 16, 30, .22);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.gh-stars[hidden] { display: none; }
.gh-stars::before {
  content: "★";
  color: #f1e05a;
  font-size: 11px;
  line-height: 1;
}

/* 5b · chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(122, 162, 255, .06);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(86, 211, 96, .18);
  animation: chip-pulse 2s ease-in-out infinite;
}
@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(86, 211, 96, .18); }
  50%      { box-shadow: 0 0 0 8px rgba(86, 211, 96, .04); }
}

/* 5c · code blocks (inside .quick) */
.code {
  margin: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}
.code .tok-com { color: var(--ink-faint); font-style: italic; }
.code .tok-cmd { color: var(--accent-2); }
.code .tok-arg { color: var(--warm); }
.code .tok-str { color: #b8e890; }

/* Code block + copy button.
   The wrapper is the positioning context for the absolutely-placed
   button in the top-right. Subtle by default; brighter on hover;
   flashes green for ~1.4s after a successful copy. */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s ease, color .15s ease,
              background .2s ease, border-color .2s ease,
              transform .2s ease;
}
.code-wrap:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
  outline: none;
}
.copy-btn:hover {
  background: rgba(122, 162, 255, .12);
  border-color: rgba(122, 162, 255, .4);
  color: var(--ink);
}
.copy-btn.copied {
  opacity: 1;
  background: rgba(86, 211, 100, .14);
  border-color: rgba(86, 211, 100, .5);
  color: #56d364;
  transform: scale(1.08);
}
.copy-btn svg[hidden] { display: none; }

/* inline code */
code {
  font-size: .9em;
  background: rgba(255, 255, 255, .05);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}

/* 5d · modal (used by app.js for share results) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal__card {
  width: min(520px, 92vw);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.modal__card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal__card header h3 { font-size: 16px; }
.modal__close-icon {
  background: none;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 16px;
}
.modal__body { padding: 18px 20px; }
.modal__body p { color: var(--ink-soft); font-size: 14px; margin: 0 0 8px; }
.modal__card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.modal__card footer .btn { padding: 9px 14px; font-size: 13.5px; }

.url-row { display: flex; gap: 8px; margin: 10px 0; }
.url-row input {
  flex: 1;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.url-row button {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101e;
  font-weight: 600;
  cursor: pointer;
}

/* 5e · skip link (a11y) */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  background: var(--accent);
  color: #08101e;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 200;
  transition: top .15s;
}
.skip-link:focus { top: 8px; color: #08101e; }


/* ─── 06 · Landing · topbar ───────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(to bottom, rgba(7,8,13,.85), rgba(7,8,13,.55));
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
  box-shadow: 0 0 24px -4px rgba(122, 162, 255, .55);
}
.brand__mark::before,
.brand__mark::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: rgba(7, 8, 13, .85);
  border-radius: 2px;
}
.brand__mark::before { left: 8px; }
.brand__mark::after  { right: 8px; }
.brand__name { font-size: 17px; }

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topnav a {
  color: var(--ink-soft);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.topnav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
}
.topnav__star {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}
.topnav__star:hover {
  border-color: rgba(122, 162, 255, .45);
  background: linear-gradient(180deg, rgba(122,162,255,.12), rgba(122,162,255,.04));
  color: var(--ink);
}
.topnav__star svg { width: 14px; height: 14px; }


/* ─── 07 · Landing · hero ─────────────────────────────────── */
.hero { padding: 90px 0 70px; position: relative; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 60px;
  align-items: center;
}
.hero__title {
  font-size: clamp(34px, 5.8vw, 76px);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 18px 0 22px;
  text-wrap: balance;
}
/* On narrow viewports drop the forced break so the title flows naturally
   instead of stranding "parchment" alone on its own line. */
@media (max-width: 640px) {
  .hero__title br { display: none; }
}
.hero__title .serif {
  background: linear-gradient(120deg, var(--warm), #fff 60%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 32px;
}
.hero__sub strong { color: var(--ink); font-weight: 600; }
.hero__sub code   { color: var(--warm); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero__meta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 13px; height: 13px; opacity: .8; }


/* ─── 08 · Landing · hero mockup ──────────────────────────── */
.mock { position: relative; perspective: 1400px; }
.mock::before {
  content: "";
  position: absolute;
  inset: -60px -40px;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(122,162,255,.35), transparent 65%),
    radial-gradient(ellipse at 80% 70%, rgba( 94,231,255,.25), transparent 65%);
  filter: blur(40px);
  z-index: 0;
  opacity: .9;
}
.mock-card {
  position: relative;
  background: linear-gradient(180deg, rgba(20,24,38,.95), rgba(13,16,25,.95));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  transform: rotateX(2deg) rotateY(-4deg);
}
.mock-card__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}
.mock-card__lights {
  display: flex;
  gap: 6px;
  margin-right: 8px;
}
.mock-card__lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.mock-card__lights span:nth-child(1) { background: #ff5f57; }
.mock-card__lights span:nth-child(2) { background: #ffbd2e; }
.mock-card__lights span:nth-child(3) { background: #28c940; }
.mock-card__url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  background: rgba(0, 0, 0, .25);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  text-align: center;
}
.mock-card__url .ok { color: var(--ok); }
.mock-card__body {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}
.mock-card__body .ln       { display: block; color: var(--ink-soft); }
.mock-card__body .tok-cmd  { color: var(--accent-2); }
.mock-card__body .tok-flag { color: var(--warm); }
.mock-card__body .tok-str  { color: #b8e890; }
.mock-card__body .tok-com  { color: var(--ink-faint); font-style: italic; }
.mock-card__body .arrow {
  color: var(--ink-faint);
  margin: 14px 0;
  display: block;
  text-align: center;
  font-size: 16px;
}

.mock-response {
  margin-top: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(122, 162, 255, .35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(122,162,255,.08), rgba(94,231,255,.04));
  position: relative;
}
.mock-response::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 0 30px -5px rgba(122, 162, 255, .5) inset;
  pointer-events: none;
}
.mock-response__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mock-response__title {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-sans);
  letter-spacing: -.01em;
}
.mock-response__pills {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.mock-response__pill {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-mono);
}
.mock-response__pill--v {
  color: var(--accent-2);
  border-color: rgba(94, 231, 255, .3);
  background: rgba(94, 231, 255, .05);
}
.mock-response__pill--t {
  color: var(--warm);
  border-color: rgba(240, 210, 138, .3);
  background: rgba(240, 210, 138, .05);
}
.mock-response__urlbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink);
}
.mock-response__urlbar svg {
  width: 12px;
  height: 12px;
  color: var(--ok);
  flex-shrink: 0;
}
.mock-response__urlbar code {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  padding: 0;
}
.mock-response__urlbar .copy {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
}

.typing {
  border-right: 2px solid var(--accent-2);
  animation: cursor-blink 1.1s steps(1) infinite;
  padding-right: 2px;
}
@keyframes cursor-blink {
  50% { border-color: transparent; }
}


/* ─── 09 · Landing · trust strip ──────────────────────────── */
.trust {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 28px 0;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.015), transparent);
}
.trust__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.trust__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 14px;
  border-left: 1px solid var(--line-soft);
}
.trust__item:first-child {
  border-left: 0;
  padding-left: 0;
}
.trust__k {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
}
.trust__k .unit {
  color: var(--ink-faint);
  font-size: 13px;
  margin-left: 3px;
  font-weight: 400;
}
.trust__l {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .12em;
}


/* ─── 10 · Landing · how it works ─────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 30px;
}
.how-card {
  position: relative;
  padding: 26px 24px 22px;
  background: linear-gradient(180deg, var(--bg-card), rgba(13,16,25,.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.how-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122,162,255,.5), transparent);
}
.how-card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: .18em;
}
.how-card h3 {
  margin: 8px 0 10px;
  font-size: 19px;
  font-weight: 600;
}
.how-card p {
  color: var(--ink-soft);
  margin: 0 0 16px;
  font-size: 14.5px;
}
.how-card p code { color: var(--accent-2); }
.how-card__illu {
  height: 130px;
  background: rgba(0, 0, 0, .25);
  border: 1px dashed var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.how-card__illu svg { width: 100%; height: 100%; }


/* ─── 11 · Landing · why pergam (features) ────────────────── */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}
.feat {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .015);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feat__ic {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(122, 162, 255, .1);
  color: var(--accent-2);
  margin-bottom: 4px;
}
.feat__ic svg { width: 18px; height: 18px; }
.feat h4 { font-size: 15.5px; font-weight: 600; }
.feat p  { color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }


/* ─── 12 · Landing · gallery ──────────────────────────────── */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 30px;
}
.show-card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-card), rgba(11,14,22,.7));
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  color: inherit;
}
.show-card:hover {
  transform: translateY(-3px);
  border-color: rgba(122, 162, 255, .4);
  box-shadow: 0 20px 60px -25px rgba(94, 231, 255, .35);
  color: inherit;
}
.show-card__preview {
  /* Maintain the SVG's intrinsic 500x220 aspect (220/500 = 44%) so it
     never gets cropped by preserveAspectRatio="slice".
     Uses the padding-bottom % technique instead of `aspect-ratio`
     because Safari iOS mis-computes aspect-ratio on flex items with
     no explicit width — Chrome handles it, Safari doesn't. The
     padding-bottom trick is bulletproof across all browsers. */
  position: relative;
  height: 0;
  padding-bottom: 44%;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: #0d1117;
}
/* Wide variant: spans both columns. Used for the meta server-view card
   that contextualizes the other 4. The preview stays at its natural
   44% aspect ratio so the SVG (viewBox 500x220) renders without
   cropping, just at double scale — giving the card a hero feel. */
.show-card--wide {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .show-card--wide { grid-column: auto; }
}
.show-card__preview svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.show-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
}
.show-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.show-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.show-card__type {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--warm);
  background: rgba(240, 210, 138, .06);
}
.show-card p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.show-card__open {
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ─── 13 · Landing · quickstart ───────────────────────────── */
.quick-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 30px;
}
.quick {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-card), rgba(11,14,22,.65));
  overflow: hidden;
}
.quick__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.quick__head h3 {
  font-size: 16px;
  font-weight: 600;
}
.quick__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: .14em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(94, 231, 255, .08);
  border: 1px solid rgba(94, 231, 255, .2);
}


/* ─── 14 · Landing · drop strip ───────────────────────────── */
.dropzone {
  margin-top: 40px;
  padding: 64px 28px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag {
  border-color: rgba(122, 162, 255, .65);
  background: rgba(122, 162, 255, .06);
  outline: none;
}
.dropzone.drag { transform: scale(1.005); }
.dropzone.uploading { opacity: .6; pointer-events: none; }
.dz-icon {
  color: var(--ink-faint);
  transition: color .15s ease, transform .15s ease;
}
.dropzone:hover .dz-icon,
.dropzone.drag .dz-icon {
  color: rgba(122, 162, 255, .9);
  transform: translateY(-2px);
}
.dz-prompt {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.dz-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.dz-progress {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--accent);
}


/* ─── 15 · Landing · github CTA ───────────────────────────── */
.gh-cta {
  margin-top: 40px;
  position: relative;
  padding: 48px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 20%, rgba(122,162,255,.16), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba( 94,231,255,.12), transparent 65%),
    linear-gradient(180deg, var(--bg-card), rgba(11,14,22,.7));
  overflow: hidden;
  text-align: center;
}
.gh-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 .5H40M.5 0V40' stroke='%23ffffff10' stroke-width='1'/></svg>");
  opacity: .4;
  mask: radial-gradient(circle at center, black, transparent 75%);
  -webkit-mask: radial-gradient(circle at center, black, transparent 75%);
}
.gh-cta > * { position: relative; }
.gh-cta h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 38px);
}
.gh-cta p {
  margin: 0 auto 28px;
  color: var(--ink-soft);
  max-width: 50ch;
}
.gh-cta .cta-row { justify-content: center; }


/* ─── 16 · Landing · FAQ ──────────────────────────────────── */
.faq-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .015);
  transition: border-color .15s;
}
.faq-list details[open] { border-color: rgba(122, 162, 255, .35); }
.faq-list summary {
  list-style: none;
  padding: 18px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--accent-2);
  font-size: 22px;
  font-family: var(--font-mono);
  line-height: 1;
  transition: transform .2s;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p {
  padding: 0 22px 20px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}


/* ─── 17 · Landing · footer ───────────────────────────────── */
.footbar {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.footbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footbar a { color: var(--ink-soft); }
.footbar a:hover { color: var(--ink); }


/* ─── 18 · Viewer page ────────────────────────────────────── */
body.viewer-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.vb-left, .vb-right { display: flex; align-items: center; gap: 12px; }
.vb-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.vb-logo .logo {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: -.15em;
}
.vb-logo .name { font-weight: 600; }
.vb-divider { color: var(--ink-faint); }
.vb-right .btn { font-size: 13px; padding: 7px 12px; }

#viewer-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}
.viewer-empty {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.viewer-empty[hidden] { display: none; }
.viewer-empty h2 { font-size: 26px; margin: 0 0 8px; }
.viewer-empty p  { color: var(--ink-soft); margin: 0 0 18px; }


/* ─── 19 · Utilities ──────────────────────────────────────── */
.muted   { color: var(--ink-soft); }
.small   { font-size: 13px; }
.center  { text-align: center; }


/* ─── 20 · Responsive ─────────────────────────────────────── */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 860px) {
  .how-grid,
  .quick-wrap { grid-template-columns: 1fr; }
  .feat-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* Trust strip: 3 narrow cols stay readable down to ~420px; below that,
   stack each item vertically and center to avoid the orphan 2+1 layout. */
@media (max-width: 480px) {
  .trust__row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .trust__item {
    align-items: center;
    text-align: center;
    border-left: 0;
    padding: 6px 0;
  }
}

@media (max-width: 760px) {
  .showcase-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topnav a:not(.topnav__star) { display: none; }
}

@media (max-width: 640px) {
  /* The 3D rotateY on the hero terminal mockup creates visible
     horizontal drift when the card is near full-width on mobile —
     remove it (and the rotateX) below this breakpoint. */
  .mock-card { transform: none; }

  /* Hero CTAs ("Star on GitHub" + "Read the quickstart →") don't
     fit horizontally below ~640px and wrap to two lines. Centre
     the wrapped items so they look intentional rather than
     left-orphaned. Applies to .cta-row generally so the bottom
     gh-cta button group also stays centred (it already had its
     own override; now it matches). */
  .cta-row { justify-content: center; }
}

@media (max-width: 540px) {
  .section { padding: 72px 0; }
  .feat-grid { grid-template-columns: 1fr; }
  .gh-cta    { padding: 36px 24px; }
  .viewer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
  }
}


/* ─── 21 · Reduced motion & a11y ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .mock-card { transform: none; }
}
