/* ==========================================================================
   VectorizeIMG v3.0 — Design System (Awwwards pass)
   Brand: gradient #FFAA95 → #FF5D35 · warm paper neutrals · hairline grids
   Type: Archivo Expanded (display) · Archivo (headings) · Instrument Sans
         (body) · JetBrains Mono (HUD / data only)
   Depth: 5-level surfaces, graded hairlines, 3-tier shadows (light) /
          inner hairlines + ambient light + grain (dark)
   Radius roles: canvas/telemetry 0 · chip 2 · control 4 · card 10 · modal 14
   ========================================================================== */

/* ---------- Tokens ------------------------------------------------------- */
:root {
  /* Brand colors derive from the logo gradient: #FFAA95 → #FF5D35 */
  --brand-coral: #FF5D35;
  --btn-h-primary: 44px;           /* R1 — single primary-CTA height site-wide */
  --brand-coral-light: #FFAA95;
  --brand-coral-hover: #FF7149;
  --brand-coral-ink: #C93B10;      /* accent text on light bg, ≥4.5:1 */
  --on-coral: #111315;
  --brand-gradient: linear-gradient(135deg, var(--brand-coral-light) 0%, var(--brand-coral) 100%);
  --brand-gradient-hover: linear-gradient(135deg, #FFBBA8 0%, var(--brand-coral-hover) 100%);
  /* accent roles */
  --coral-tint: rgba(255, 93, 53, .10);
  --coral-glow: rgba(255, 93, 53, .42);
  /* semantic status colors (auth success check, free-quota warnings) */
  --ok: #1A7F37;
  --ok-ink: #1A7F37;             /* ≥4.5:1 on light bg */
  --danger-ink: #B62324;         /* ≥4.5:1 on light bg */

  /* semantic: raster = input (cold gray-blue), coral = vector output */
  --raster: #5F7186;
  --raster-ink: #46607A;           /* ≥4.5:1 on light bg */

  /* 5-level warm-neutral surfaces */
  --bg: #F4F3F0;
  --bg-sunken: #EBEAE5;
  --surface: #FCFBF9;
  --surface-raised: #FFFFFF;
  --canvas: #E4E3DE;

  --ink: #111315;
  --ink-subtle: #4F5558;
  /* graded hairlines */
  --line-ha: rgba(17, 19, 21, .09);
  --line: rgba(17, 19, 21, .16);
  --line-strong: rgba(17, 19, 21, .38);
  --focus: #C93B10;

  /* shadow tiers (light theme) */
  --sh-1: 0 1px 2px rgba(17, 19, 21, .07);
  --sh-2: 0 1px 2px rgba(17, 19, 21, .05), 0 10px 28px -12px rgba(17, 19, 21, .22);
  --sh-3: 0 2px 6px rgba(17, 19, 21, .07), 0 28px 56px -18px rgba(17, 19, 21, .32);
  --sh-inset-top: inset 0 1px 0 rgba(255, 255, 255, .65);

  /* radius roles */
  --r-chip: 2px;
  --r-control: 4px;
  --r-card: 10px;
  --r-modal: 14px;
  --r-pill: 999px;

  --font-display: "Archivo", system-ui, -apple-system, sans-serif;
  --font-heading: "Archivo", system-ui, -apple-system, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-hud: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* spacing scale */
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px;
  --s24: 24px; --s40: 40px; --s56: 56px; --s80: 80px;
  --s96: 96px; --s128: 128px;

  /* motion */
  --ease-reveal: cubic-bezier(.33, 1, .68, 1);

  --header-h: 60px;
  --rail: 1280px;
  --sidebar-w: 288px;
  /* dialog widths: exactly two named tiers — default and small (checkout) */
  --modal-w: min(560px, 100%);
  --modal-w-sm: min(460px, 100%);

  /* featured pricing tier: fixed pair, never flips with --ink/--bg */
  --featured-bg: #111315;
  --featured-ink: #F4F4F1;
  --featured-sub: rgba(244, 244, 241, .88);
  --featured-hud: rgba(244, 244, 241, .92);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101214;
  --bg-sunken: #0A0C0D;
  --surface: #191C1F;
  --surface-raised: #202427;
  --canvas: #1D2124;
  --ink: #F4F4F1;
  --ink-subtle: #B3B9BB;
  --line-ha: rgba(244, 244, 241, .08);
  --line: rgba(244, 244, 241, .16);
  --line-strong: rgba(244, 244, 241, .38);
  --raster: #8FA1B5;
  --raster-ink: #9FB4C9;
  --brand-coral-ink: #FFAA95;   /* gradient light stop — 10:1 on dark bg */
  --coral-tint: rgba(255, 93, 53, .14);
  --ok: #3FB950;
  --ok-ink: #56D364;
  --danger-ink: #FF7B72;
  --focus: #FFAA95;
  /* dark theme: no drop shadows — depth comes from inner hairlines */
  --sh-1: none;
  --sh-2: none;
  --sh-3: none;
  --sh-inset-top: inset 0 1px 0 rgba(244, 244, 241, .07);
  /* featured tier inverts to light card in dark theme — fixed pair */
  --featured-bg: #F4F4F1;
  --featured-ink: #111315;
  --featured-sub: rgba(17, 19, 21, .80);
  --featured-hud: rgba(17, 19, 21, .85);
  color-scheme: dark;
}

/* ambient warmth + film grain — fixed, non-interactive texture layers */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(255, 170, 149, .10), transparent 62%),
    radial-gradient(60% 40% at 85% 110%, rgba(255, 170, 149, .05), transparent 60%);
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(255, 170, 149, .06), transparent 62%),
    radial-gradient(60% 40% at 85% 110%, rgba(255, 170, 149, .03), transparent 60%);
}
/* faint technical grid in the hero, fading out downward */
.hero {
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-ha) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-ha) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(120% 90% at 60% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 60% 0%, #000 30%, transparent 78%);
}
.hero > * { position: relative; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none;
  opacity: .038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* Radius roles (no blanket zero): canvas/code/telemetry stay square via
   component rules; chips 2px, controls 4px, cards 10px, modals 14px. */

/* ---------- Typography --------------------------------------------------- */
h1, .display {
  font-family: var(--font-display);
  font-stretch: 125%;               /* Archivo Expanded */
  font-weight: 620;
  font-size: clamp(2.75rem, 6.4vw, 5.75rem);
  letter-spacing: -.035em;
  line-height: .98;
  text-wrap: balance;
  max-width: 17ch;
}
h2, h3, h4, .subheading {
  font-family: var(--font-heading);
  letter-spacing: -.022em;
  line-height: 1.12;
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 3.4vw, 3rem); font-weight: 600; letter-spacing: -.028em; max-width: 22ch; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
h4 { letter-spacing: 0; }
p { max-width: 62ch; }

.hud-label {
  font-family: var(--font-hud);
  text-transform: uppercase;
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .12em;
  color: var(--ink-subtle);
}
.mono { font-family: var(--font-hud); }
.subtle { color: var(--ink-subtle); }
/* prices & metrics: display type + tabular figures, never mono-with-tracking */
.tnum { font-variant-numeric: tabular-nums; }

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

.skip-link {
  position: absolute; left: var(--s8); top: -48px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: var(--s8) var(--s16);
  transition: top .15s ease;
}
.skip-link:focus { top: var(--s8); }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s8);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  padding: 10px 18px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  transition: background .12s ease, border-color .12s ease, color .12s ease,
              box-shadow .18s ease, transform .1s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.98); }

/* R1 — one primary-CTA height site-wide; the header CTA must not shrink
   via .btn-sm (workbench .btn-sm controls are unaffected: not .btn-primary) */
.btn-primary { min-height: var(--btn-h-primary); }
.topnav .btn.btn-primary {
  min-height: var(--btn-h-primary);
  padding-block: 0;
  align-items: center;
}
.btn-primary {
  background: var(--brand-gradient); color: var(--on-coral);
  border-color: var(--brand-coral);
  box-shadow: var(--sh-1), var(--sh-inset-top);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-gradient-hover); border-color: var(--brand-coral-hover); }
/* downloaded state: settled tile with check affordance (beats :hover gradient) */
.btn-primary.is-done,
.btn-primary.is-done:hover:not(:disabled) { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-1); }
.btn-primary.is-done::before { content: '✓'; color: var(--brand-coral); font-weight: 600; }
:root[data-theme="dark"] .btn-primary.is-done { box-shadow: var(--sh-1); }
/* the single coral glow in the product: main CTA on dark surfaces only */
:root[data-theme="dark"] .btn-primary {
  box-shadow: 0 0 0 1px rgba(255, 93, 53, .5), 0 10px 34px -10px var(--coral-glow);
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-raised); }
/* secondary: promoted quiet action — raised white tile, visible hairline, lifts on hover */
.btn-secondary {
  background: var(--surface-raised); color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--sh-1);
  min-height: 36px; padding: 7px 14px; font-size: 13px;
}
.btn-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
  border-color: var(--ink);
}
.btn-sm { padding: 5px 10px; font-size: 12.5px; min-height: 32px; }
/* primary CTAs keep the 44px token even when tagged .btn-sm (header, account) */
.btn-sm.btn-primary { min-height: var(--btn-h-primary); }
.btn-block { width: 100%; }

.link-btn {
  color: var(--brand-coral-ink); font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}
.link-btn:hover { border-color: var(--brand-coral-ink); }

/* ---------- Header (60px sticky) ----------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-ha);
}
/* header/footer span the full viewport — the app shell aligns with the
   workspace canvas edges, not the landing content rail (v7 R2) */
.topbar-inner {
  width: 100%; height: 100%;
  max-width: none;
  padding-inline: clamp(16px, 2vw, 32px);
  display: flex; align-items: center; justify-content: space-between;
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; height: 100%; }
.wordmark img { height: 19px; width: auto; }
.wordmark .wm-icon { height: 40px; width: 40px; }
.topnav { display: flex; align-items: center; gap: var(--s24); height: 100%; }
.topnav a {
  display: inline-flex; align-items: center; height: 100%;
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-subtle);
  border-bottom: 1px solid transparent;
}
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }
.topnav a#nav-account { color: var(--ink); }
/* 1px hairline separating nav links from header tools */
.nav-sep { width: 1px; height: 20px; background: var(--line-ha); flex: none; }
.topnav .btn { margin-left: var(--s8); height: auto; min-height: 34px; padding: 6px 16px; }
/* beat ".topnav a" specificity so button labels keep their intended colors */
.topnav a.btn-primary, a.btn-primary { color: var(--on-coral); }
.topnav a.btn-ghost, a.btn-ghost { color: var(--ink); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; color: var(--ink-subtle);
  border: none;
  border-radius: var(--r-control);
}
.theme-toggle:hover { color: var(--ink); background: var(--coral-tint); }

/* hamburger — only rendered < 640px (see media queries) */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 32px; height: 32px; color: var(--ink-subtle);
  border: none; border-radius: var(--r-control);
}
.nav-toggle:hover { color: var(--ink); background: var(--coral-tint); }
/* account link is text ≥ 641px, icon-only < 640px */
.nav-acct-icon { display: none; }
#nav-account { display: inline-flex; align-items: center; gap: 6px; }

/* dual-label header CTA — short label only on very narrow phones (v7 R3) */
.cta-short { display: none; }
@media (max-width: 420px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
/* R4 — the stateful header CTA hides itself inside the workspace */
.topnav .btn[hidden] { display: none !important; }

/* mobile nav drawer — fullscreen panel below the sticky header */
.nav-drawer {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 90;
  background: var(--bg);
  border-top: 1px solid var(--line-ha);
  overflow-y: auto;
}
.nav-drawer-inner {
  display: flex; flex-direction: column;
  padding: var(--s16) var(--s24) var(--s40);
}
.nav-drawer-inner a:not(.btn) {
  display: flex; align-items: center; min-height: 52px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  border-bottom: 1px solid var(--line-ha);
}
.nav-drawer-inner a:not(.btn):hover { color: var(--brand-coral-ink); }
.nav-drawer-inner .btn { margin-top: var(--s24); justify-content: center; }
body.nav-open { overflow: hidden; }

/* ---------- Layout rail -------------------------------------------------- */
.rail { max-width: var(--rail); margin: 0 auto; padding: 0 var(--s24); }

/* ---------- Landing ------------------------------------------------------ */
.hero {
  border-bottom: 1px solid var(--line-ha);
  padding: var(--s96) 0 var(--s80);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: var(--s56); align-items: center;
}
.hero-kicker { margin-bottom: var(--s24); }
.hero h1 { margin-bottom: var(--s24); }
.hero .lede { font-size: 17.5px; line-height: 1.65; color: var(--ink-subtle); margin-bottom: var(--s40); }
.hero-cta { display: flex; gap: var(--s12); align-items: center; flex-wrap: wrap; }
.hero-proof {
  margin-top: var(--s40);
  /* equal three columns — no ragged 2+1 wrap (spec §5) */
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s12);
  font-family: var(--font-hud); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-subtle);
}
.hero-proof span { display: inline-flex; align-items: center; gap: 7px; }
.hero-proof svg { width: 13px; height: 13px; color: var(--brand-coral-ink); flex: 0 0 auto; }

/* signature moment: interactive raster/vector split */
.hero-demo {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--sh-2), var(--sh-inset-top);
}
.hero-demo-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s12);
  padding: 10px var(--s16);
  border-bottom: 1px solid var(--line-ha);
}
.hero-demo-head .hud-label { font-size: 10.5px; }
.hero-demo-head .hd-raster { color: var(--raster-ink); }
.hero-demo-head .hd-vector { color: var(--brand-coral-ink); }
.hero-demo-head .hd-telemetry {
  font-family: var(--font-hud); font-size: 10.5px; letter-spacing: .08em;
  color: var(--ink-subtle); font-variant-numeric: tabular-nums;
  text-align: center;
}
.hero-demo-body {
  --split: 52%;
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--surface-raised);
  cursor: ew-resize;
  touch-action: pan-y;
}
.hero-demo-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hero-demo-raster {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
.hero-demo-divider {
  position: absolute; top: 0; bottom: 0; left: var(--split);
  width: 1px; background: var(--brand-coral);
}
.hero-demo-grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--brand-gradient); color: var(--on-coral);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: 1px; font-weight: 700;
  box-shadow: var(--sh-1);
  cursor: ew-resize;
}
.hero-demo-slider {
  position: absolute; top: 0; bottom: 0; left: var(--split);
  width: 44px; margin-left: -22px;
  cursor: ew-resize; border-radius: 0;
}
.hero-demo-hint {
  position: absolute; left: 50%; bottom: var(--s12); transform: translateX(-50%);
  font-family: var(--font-hud); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-subtle);
  background: var(--surface-raised); border: 1px solid var(--line-ha);
  border-radius: var(--r-pill); padding: 4px 12px;
  box-shadow: var(--sh-1);
  transition: opacity .4s ease;
  pointer-events: none;
}
.hero-demo-body[data-touched="true"] .hero-demo-hint { opacity: 0; }

/* ---------- Section rhythm ---------------------------------------------- */
.section { padding: clamp(80px, 9vw, 128px) 0; border-bottom: 1px solid var(--line-ha); }
.section--band { background: var(--bg-sunken); }
.section--flush { padding: 0; border-bottom: none; }
.section-head { margin-bottom: var(--s56); max-width: 640px; }
.section-head .hud-label { margin-bottom: var(--s16); }
.section-head p { margin-top: var(--s16); color: var(--ink-subtle); font-size: 15.5px; line-height: 1.65; }

/* exports-to strip (proof, honest text — no fabricated logos) */
.exports-strip {
  display: flex; align-items: center; gap: var(--s24); flex-wrap: wrap;
  padding: var(--s24) 0;
  border-bottom: 1px solid var(--line-ha);
}
.exports-strip .hud-label { flex: 0 0 auto; }
.exports-names {
  display: flex; gap: var(--s24); flex-wrap: wrap;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  letter-spacing: -.01em; color: var(--ink-subtle);
}
.exports-names span { transition: color .15s ease; }
.exports-names span:hover { color: var(--ink); }

/* metrics strip — real, measured numbers */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-ha); border-right: none;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--sh-1);
}
.metric { padding: var(--s24); border-right: 1px solid var(--line-ha); }
.metric-n {
  font-family: var(--font-display); font-stretch: 125%;
  font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 620; letter-spacing: -.03em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.metric-n em { font-style: normal; color: var(--brand-coral-ink); }
.metric .hud-label { margin-top: var(--s12); font-size: 10.5px; }

/* output gallery — two tiers only: one large ~1:1 cell spanning two rows,
   six small 3:2 cards (spec §4.2). Column ratio 1.38:1:1 makes the large
   frame exactly 1:1 at the 1280px rail; every SVG source is exported at its
   card ratio, so object-fit: cover never crops a subject. */
.gallery {
  display: grid; grid-template-columns: 1.52fr 1fr 1fr;
  gap: var(--s16);
}
/* explicit placement fills every grid cell: Deer takes r3c1, Monstera
   (horizontal composition) spans r3 c2–3 — no empty cell (v7 R5) */
.ex-pos-r3c2 { grid-column: 1; grid-row: 3; }
.ex-pos-r3c3 { grid-column: 2 / span 2; grid-row: 3; }
/* Monstera spans ~3.07:1 and Deer sits in the 1.52fr column — both frames
   differ from the 3:2 source; contain against the card bg (baked --ex-bg or
   the theme paper color) so neither subject is cropped (desktop span only —
   at ≤1080 both are regular 3:2 cards and cover is exact) */
@media (min-width: 1081px) {
  .gallery .ex-pos-r3c2 .ex-fig img,
  .gallery .ex-pos-r3c3 .ex-fig img { object-fit: contain; }
}
.ex-card {
  position: relative;
  border: 1px solid var(--line-ha);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column;
  text-align: left; padding: 0;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.ex-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: var(--line);
}
.ex-card--large { grid-row: span 2; }
/* warm paper backdrop keeps transparent SVGs (line art) visible in both
   themes; cards whose SVG has a baked background set --ex-bg to match it */
.ex-card .ex-fig { flex: 1; min-height: 0; overflow: hidden; background: var(--ex-bg, #FCFBF9); position: relative; }
:root[data-theme="dark"] .ex-card .ex-fig { background: var(--ex-bg, #F4F3F0); }
.ex-card--large .ex-fig { aspect-ratio: auto; }
.ex-card:not(.ex-card--large) .ex-fig { aspect-ratio: 3/2; }
.ex-card .ex-fig img { width: 100%; height: 100%; object-fit: cover; }
.ex-card .ex-open {
  position: absolute; right: var(--s12); top: var(--s12);
  font-family: var(--font-hud); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-pill); padding: 5px 12px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.ex-card:hover .ex-open, .ex-card:focus-visible .ex-open { opacity: 1; transform: translateY(0); }
.ex-card .ex-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s12);
  padding: var(--s12) var(--s16);
  border-top: 1px solid var(--line-ha);
}
.ex-card .ex-name {
  font-family: var(--font-heading); font-weight: 600; font-size: 14px; letter-spacing: -.01em;
  /* one line only — a wrapping name stretches the grid row and breaks
     the shared 3:2 figure ratio of every card in that row */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ex-card .ex-tag {
  font-family: var(--font-hud); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* how it works — big display numerals */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s16); }
.step {
  border: 1px solid var(--line-ha); border-radius: var(--r-card);
  padding: var(--s24); background: var(--surface-raised);
  box-shadow: var(--sh-1);
}
.step .step-n {
  font-family: var(--font-display); font-stretch: 125%;
  font-size: 44px; font-weight: 620; letter-spacing: -.03em; line-height: 1;
  color: var(--brand-coral-ink); margin-bottom: var(--s16);
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: var(--s8); }
.step p { color: var(--ink-subtle); font-size: 14px; line-height: 1.65; }

/* testimonials — one lead quote + two supporting (spec §5) */
.quotes {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s16);
}
.quote {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s24);
  border: 1px solid var(--line-ha); border-radius: var(--r-card);
  padding: var(--s24); background: var(--surface-raised);
  box-shadow: var(--sh-1);
}
.quote--main { grid-row: span 2; padding: var(--s40); }
.quote blockquote {
  font-size: 14.5px; line-height: 1.7; color: var(--ink);
  letter-spacing: -.005em;
}
.quote--main blockquote {
  font-family: var(--font-display); font-stretch: 125%;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem); font-weight: 520;
  line-height: 1.45; letter-spacing: -.015em;
}
.quote figcaption { display: flex; align-items: center; gap: var(--s12); flex-wrap: wrap; }
.quote-avatar {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--coral-tint); color: var(--brand-coral-ink);
  font-family: var(--font-hud); font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.quote--main .quote-avatar { width: 48px; height: 48px; font-size: 14px; }
.quote-who { display: flex; flex-direction: column; gap: 2px; }
.quote-who strong { font-size: 13.5px; font-weight: 600; }
.quote-who span { font-size: 12.5px; color: var(--ink-subtle); }
.quote-tag {
  margin-left: auto;
  font-family: var(--font-hud); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-subtle);
  border: 1px solid var(--line-ha); border-radius: var(--r-pill);
  padding: 4px 10px;
}
.quote-disclaimer { font-size: 12px; color: var(--ink-subtle); margin-top: var(--s16); }

/* full-bleed statement — the one visual breakpoint */
.statement {
  background: var(--ink); color: var(--bg);
  padding: clamp(96px, 12vw, 160px) 0;
  position: relative; overflow: hidden;
}
.statement .display {
  max-width: 20ch;
  color: var(--bg);
}
.statement .display em {
  font-style: normal;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.statement .hud-label { color: rgba(244, 244, 241, .55); margin-bottom: var(--s24); }

/* pricing — visual ladder + hover lift */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s16); align-items: stretch; }
.tier {
  border: 1px solid var(--line-ha); border-radius: var(--r-card);
  padding: var(--s24);
  background: var(--surface-raised);
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: var(--s16);
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tier:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line); }
.tier-featured {
  background: var(--featured-bg); color: var(--featured-ink);
  border-color: var(--featured-bg);
  box-shadow: var(--sh-2);
}
.tier-featured .hud-label { color: var(--featured-hud); }
.tier-featured .tier-note { color: var(--featured-sub); }
/* must out-specify .tier li (same-origin cascade order put it behind) */
.tier.tier-featured li { color: var(--featured-sub); }
.tier.tier-featured li::before { color: var(--brand-coral); }
.tier-featured .tier-price { color: var(--featured-ink); }
.tier-featured .tier-price small { color: var(--featured-sub); }
.tier-flag {
  position: absolute; top: calc(var(--s12) * -1); left: var(--s24);
  background: var(--brand-gradient); color: var(--on-coral);
  font-family: var(--font-hud); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}
.tier-name { font-family: var(--font-heading); font-size: 20px; font-weight: 600; }
.tier-price {
  font-family: var(--font-display); font-stretch: 125%;
  font-size: 44px; font-weight: 640; letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tier-price small { font-family: var(--font-body); font-stretch: 100%; font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--ink-subtle); }
.tier-note { font-size: 13px; color: var(--ink-subtle); }
.tier ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s8); font-size: 14px; }
.tier li { padding-left: var(--s16); position: relative; color: var(--ink-subtle); }
.tier li::before { content: "—"; position: absolute; left: 0; color: var(--brand-coral-ink); }
.tier .btn { margin-top: auto; }

/* FAQ — card accordion */
.faq { display: flex; flex-direction: column; gap: var(--s8); }
.faq-item {
  border: 1px solid var(--line-ha); border-radius: var(--r-card);
  background: var(--surface-raised);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.faq-item[open] { border-color: var(--line); box-shadow: var(--sh-1); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: var(--s16) var(--s24);
  font-family: var(--font-heading); font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s16);
  border-radius: var(--r-card);
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--font-hud); color: var(--ink-subtle);
  transition: transform .2s var(--ease-reveal);
}
.faq-item[open] summary::after { content: "+"; transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 var(--s24) var(--s16); color: var(--ink-subtle); font-size: 14px; line-height: 1.65; max-width: 64ch; }

/* ---------- Footer ------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-subtle);
}
.footer-inner {
  width: 100%;
  max-width: none;
  padding: var(--s24) clamp(16px, 2vw, 32px);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s16);
  flex-wrap: wrap;
}
.footer nav { display: flex; gap: var(--s24); }
.footer a:hover { color: var(--ink); }

/* ---------- Workspace ---------------------------------------------------- */
.workspace { min-height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; }

/* empty state / upload */
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s80) var(--s24);
  text-align: center;
  gap: var(--s24);
}
.empty-state h1 { max-width: 18ch; font-size: clamp(2rem, 4.5vw, 3.5rem); }
.empty-state .subtitle { color: var(--ink-subtle); font-size: 16px; line-height: 1.65; }
.dropzone {
  width: min(560px, 100%);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-modal);
  background: var(--surface-raised);
  box-shadow: var(--sh-1);
  padding: var(--s56) var(--s24);
  display: flex; flex-direction: column; align-items: center; gap: var(--s12);
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand-coral);
  background: var(--coral-tint);
  box-shadow: var(--sh-2);
}
.dz-icon {
  width: 52px; height: 52px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-coral-ink);
  background: var(--coral-tint);
  border: 1px solid var(--line-ha);
}
.dropzone:hover .dz-icon, .dropzone.dragover .dz-icon { background: var(--brand-gradient); color: var(--on-coral); }
.dz-text { font-size: 14px; color: var(--ink-subtle); }
.dz-browse { color: var(--brand-coral-ink); border-bottom: 1px solid var(--line-strong); }
.dz-hint { font-family: var(--font-hud); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-subtle); }
.trustline { font-size: 13px; color: var(--ink-subtle); display: flex; gap: var(--s8); align-items: center; flex-wrap: wrap; justify-content: center; }
.trustline .dot { color: var(--line-strong); }
.quota-chip {
  font-family: var(--font-hud); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: 3px 10px; color: var(--ink-subtle);
  border-radius: var(--r-chip);
}
.quota-chip.warn { border-color: var(--brand-coral); color: var(--brand-coral-ink); }
.examples { display: flex; gap: var(--s12); align-items: center; font-size: 13.5px; color: var(--ink-subtle); flex-wrap: wrap; justify-content: center; }
.examples-note { font-size: 12px; color: var(--ink-subtle); }

/* ---------- Workbench ---------------------------------------------------- */
.workbench { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.wb-top {
  display: flex; justify-content: space-between; align-items: center;
  height: 44px; padding: 0 var(--s16);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: var(--s12);
}
.wb-file { display: flex; align-items: center; gap: var(--s12); min-width: 0; }
.wb-thumb {
  width: 24px; height: 24px; object-fit: cover; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-chip);
  background: var(--bg-sunken);
}
.wb-filename {
  font-family: var(--font-hud); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch;
}
.wb-quota { display: flex; align-items: center; gap: var(--s12); }

.wb-body { flex: 1; display: flex; min-height: 0; }

/* settings rail (288px) */
.wb-settings {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: var(--s16);
  display: flex; flex-direction: column; gap: var(--s24);
  overflow-y: auto;
}
.set-group { display: flex; flex-direction: column; gap: var(--s12); }
.set-title {
  font-family: var(--font-hud); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-subtle);
}
.file-summary { font-size: 12.5px; color: var(--ink-subtle); font-family: var(--font-hud); line-height: 1.6; }

.select {
  width: 100%; padding: 9px 10px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  font-size: 13.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-subtle) 50%), linear-gradient(135deg, var(--ink-subtle) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.select:hover { border-color: var(--ink); }

.slider-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s4) var(--s12); align-items: center; font-size: 13px; }
.slider-row label { color: var(--ink); }
.slider-row output {
  font-family: var(--font-hud); font-size: 11.5px; color: var(--ink-subtle);
  min-width: 40px; text-align: right;
}
.slider-row input[type="range"] { grid-column: 1 / -1; }

input[type="range"] {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 20px; background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -7.5px;
  background: var(--brand-gradient); border: 1px solid var(--on-coral);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--line-strong); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; background: var(--brand-coral);
  border: 1px solid var(--on-coral); border-radius: var(--r-pill);
}

.check-row { display: flex; align-items: center; gap: var(--s8); font-size: 13.5px; cursor: pointer; }
.check-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; border: 1px solid var(--line-strong);
  background: var(--bg); border-radius: var(--r-control); flex: 0 0 auto;
  display: inline-grid; place-content: center;
}
.check-row input[type="checkbox"]:checked { background: var(--brand-coral); border-color: var(--brand-coral); }
.check-row input[type="checkbox"]:checked::after {
  content: ""; width: 8px; height: 8px;
  background: var(--on-coral);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.disclosure {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: var(--s8) 0;
  font-family: var(--font-hud); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-subtle);
  border-top: 1px solid var(--line);
}
.disclosure:hover { color: var(--ink); }
.disclosure .caret { transition: transform .15s ease; }
.disclosure[aria-expanded="true"] .caret { transform: rotate(180deg); }
.adv-panel { display: flex; flex-direction: column; gap: var(--s12); }

/* viewer */
.wb-viewer { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

.viewer-toolbar {
  display: flex; align-items: center; gap: var(--s12);
  padding: var(--s8) var(--s16);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; }
.seg-btn {
  padding: 5px 12px; font-size: 12.5px; color: var(--ink-subtle);
  border-right: 1px solid var(--line);
  background: transparent;
  min-height: 30px;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--ink); color: var(--bg); }
.seg-sm .seg-btn { padding: 3px 8px; font-size: 11.5px; }
.zoom-controls { display: inline-flex; gap: var(--s4); align-items: center; }
.zoom-fit { min-width: 52px; }

/* Canvas — the product's centerpiece: sunken ground, inset hairline frame,
   top highlight. box-shadow (not border) so layer geometry stays exact. */
.canvas-area {
  flex: 1; position: relative; overflow: hidden; min-height: 320px;
  background: var(--bg-sunken);
  box-shadow: inset 0 0 0 1px var(--line-ha), inset 0 1px 0 rgba(255,255,255,.5);
}
:root[data-theme="dark"] .canvas-area {
  box-shadow: inset 0 0 0 1px var(--line-ha), inset 0 1px 0 rgba(244,244,241,.05);
}
.canvas-area[data-bg="dark"] { background: #14171a; }
.canvas-area[data-bg="checker"] {
  background-image:
    linear-gradient(45deg, rgba(127,127,127,.18) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.18) 75%),
    linear-gradient(45deg, rgba(127,127,127,.18) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.18) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  background-color: var(--canvas);
}

/* Layers are pure JS-transform targets: origin at the image's top-left pixel,
   media at explicit pixel size. No flex centering, no max-* shrinking, no
   padding — fitView()/zoomAt() own all positioning so zoom-at-cursor, split
   clipping and 100% stay geometrically exact. */
.layer {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.layer img, .layer svg, .layer canvas { max-width: none; max-height: none; }
.layer-vector { visibility: hidden; }
.canvas-area[data-mode="vector"] .layer-vector { visibility: visible; }
.canvas-area[data-mode="vector"] .layer-original { visibility: hidden; }
.canvas-area[data-mode="split"] .layer-vector { visibility: visible; }
.canvas-area[data-mode="original"] .split-handle { display: none; }
.canvas-area[data-mode="vector"] .split-handle { display: none; }

.split-handle {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
  width: 28px; margin-left: -14px;
  cursor: ew-resize; z-index: 5;
  display: flex; align-items: stretch; justify-content: center;
}
.split-line { width: 1px; background: var(--brand-coral); }
.split-handle::after {
  content: "◂ ▸";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 10px; letter-spacing: 2px;
  background: var(--brand-gradient); color: var(--on-coral);
  padding: 6px 10px; white-space: nowrap;
  font-family: var(--font-hud);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}

.stage-status {
  position: absolute; left: 50%; bottom: var(--s24); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s12);
  background: var(--ink); color: var(--bg);
  padding: var(--s8) var(--s16);
  font-family: var(--font-hud); font-size: 12px; letter-spacing: .06em;
  z-index: 6;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
}
.stage-status .btn-ghost { color: var(--bg); border-color: rgba(244,244,241,.4); }
.spinner {
  width: 12px; height: 12px; border: 1px solid rgba(244,244,241,.35);
  border-top-color: var(--brand-coral);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-error {
  position: absolute; left: 50%; top: var(--s24); transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  border-left: 3px solid var(--brand-coral);
  border-radius: var(--r-chip);
  box-shadow: var(--sh-2);
  padding: var(--s12) var(--s16); font-size: 13.5px; z-index: 6;
  max-width: min(520px, 90%);
}

/* canvas affordances: persistent replace button + drop-to-replace hint */
.canvas-replace {
  position: absolute; top: var(--s8); right: var(--s8); z-index: 6;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-raised); color: var(--ink-subtle);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
  box-shadow: var(--sh-1);
  transition: color .12s ease, box-shadow .18s ease, transform .1s ease;
}
.canvas-replace:hover { color: var(--ink); box-shadow: var(--sh-2); transform: translateY(-1px); }
.canvas-drop-hint {
  position: absolute; inset: var(--s8); z-index: 8; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--brand-coral); border-radius: var(--r-card);
  background: var(--coral-tint);
  font-family: var(--font-hud); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink);
}
.canvas-drop-hint[hidden] { display: none; }

/* inspector */
/* marquee: on-canvas frame marking the fixed sample window the inspector reads.
   Geometry is driven by JS (positionMarquee) from view tx/ty/scale. */
.insp-marquee {
  position: absolute; z-index: 4; pointer-events: none;
  border: 1.5px solid var(--brand-coral);
  border-radius: var(--r-chip);
  background: var(--coral-tint);
  box-shadow: 0 0 0 1px rgba(17,19,21,.25);
}
.insp-marquee-badge {
  position: absolute; top: 100%; left: -1.5px;
  background: var(--brand-coral); color: var(--on-coral);
  font-family: var(--font-hud); font-size: 10px; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 0 0 var(--r-chip) var(--r-chip);
  white-space: nowrap;
}
.inspector {
  position: absolute; right: var(--s16); bottom: var(--s16); z-index: 7;
  width: 492px; max-width: calc(100% - 32px);
  background: var(--surface-raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--sh-2);
}
.insp-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s8);
  padding: var(--s8) var(--s12); border-bottom: 1px solid var(--line);
  font-family: var(--font-hud); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-subtle);
}
.insp-pair { display: grid; grid-template-columns: 1fr 1fr; }
.insp-pair figure { padding: var(--s8); }
.insp-pair figure + figure { border-left: 1px solid var(--line); }
.insp-pair canvas { width: 100%; height: auto; background: var(--canvas); image-rendering: pixelated; }
.insp-pair figcaption { font-family: var(--font-hud); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-subtle); padding-top: var(--s4); }
.insp-hint { padding: var(--s8) var(--s12); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-subtle); }

/* export bar */
.wb-export {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s16);
  padding: var(--s12) var(--s16);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.exp-status { display: flex; align-items: baseline; gap: var(--s12); font-family: var(--font-hud); font-size: 12px; letter-spacing: .06em; color: var(--ink-subtle); }
.exp-warn { color: var(--brand-coral-ink); }
.exp-actions { display: flex; gap: var(--s8); }

/* ---------- Static pages -------------------------------------------------- */
.page { padding: var(--s56) 0 var(--s80); }
.page-inner { max-width: 720px; margin: 0 auto; padding: 0 var(--s24); }
/* Account page leaves the legal-doc template (720px narrow rail) for a
   wider app-style layout — cards/orders need more room than prose. */
.acct-page { max-width: 960px; margin-inline: auto; padding: 0 var(--s24); }
.acct-page h1 { font-size: clamp(2rem, 3vw, 2.75rem); }
.page h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: var(--s24); }
.page h2 { font-size: 20px; margin: var(--s40) 0 var(--s12); }
.page p, .page li { color: var(--ink-subtle); font-size: 14.5px; }
.page p + p { margin-top: var(--s12); }
.page ul, .page ol { padding-left: var(--s24); margin-top: var(--s12); }
.page li + li { margin-top: var(--s4); }
.page a { color: var(--brand-coral-ink); border-bottom: 1px solid var(--line-strong); }
.page table { width: 100%; border-collapse: collapse; margin-top: var(--s16); font-size: 13.5px; }
.page th, .page td { border: 1px solid var(--line); padding: var(--s8) var(--s12); text-align: left; }
.page th { font-family: var(--font-hud); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-subtle); }

/* account page bits */
.acct-card { border: 1px solid var(--line-ha); border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--sh-1); padding: var(--s24); margin-top: var(--s24); display: flex; flex-direction: column; gap: var(--s12); align-items: flex-start; }
.acct-card > * { margin: 0; }
.acct-card--status { align-items: center; text-align: center; padding: calc(var(--s24) + var(--s8)); }
.acct-row { display: flex; justify-content: space-between; gap: var(--s16); padding: var(--s8) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.acct-row:last-child { border-bottom: none; }
.acct-row .k { color: var(--ink-subtle); }

/* ---------- Modals -------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(17, 19, 21, .48);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s24);
}
.modal {
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-modal);
  box-shadow: var(--sh-3);
  width: var(--modal-w);
  padding: var(--s24);
  display: flex; flex-direction: column; gap: var(--s16);
  /* dvh: safe against mobile address-bar collapse; long content scrolls inside */
  max-height: min(calc(100dvh - var(--s24) * 2), 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* dialog titles must not inherit the landing page's 22ch reading-width cap —
   inside a stretch flex column that cap pinned titles to the left edge */
.modal h2, .modal h3 { max-width: none; width: 100%; }
.modal h2 { font-size: 22px; }
.modal-sub { color: var(--ink-subtle); font-size: 14px; }
.modal-fine { font-size: 12px; color: var(--ink-subtle); }
.modal .btn-ghost { align-self: flex-start; }

/* centered modal variant — ALL four dialogs use this single alignment axis */
.modal-centered { text-align: center; gap: var(--s24); padding: calc(var(--s24) + var(--s8)); }
.modal-centered h2 { font-size: 26px; letter-spacing: -.02em; }
/* width-capped text blocks centre themselves, not via text-align on the parent */
.modal-centered h2,
.modal-centered .modal-sub,
.modal-centered .modal-fine { margin-inline: auto; }
.modal-centered .modal-sub { max-width: 40ch; }
.modal-centered form { display: flex; flex-direction: column; gap: var(--s16); }
/* form labels share the centred axis; typed input text stays left-aligned */
.modal-centered .field { text-align: center; }
.modal-centered .field input { text-align: start; }
.modal-centered .btn { align-self: stretch; }
.modal-centered .btn-ghost { align-self: center; }
.modal-centered #auth-demo { display: flex; flex-direction: column; gap: var(--s12); align-items: center; }
.modal-centered #auth-demo[hidden] { display: none; }

/* explicit button group: centred as a unit, consistent rhythm */
.modal-actions {
  display: flex; gap: var(--s12); justify-content: center;
  align-items: center; flex-wrap: wrap; margin-top: var(--s8);
}
.modal-actions .btn { align-self: auto; }

/* demo checkout — the one narrow dialog, via the named small-width token */
.modal-checkout { width: var(--modal-w-sm); }
#checkout-cart, #checkout-success { display: flex; flex-direction: column; gap: var(--s16); }
#checkout-cart[hidden], #checkout-success[hidden] { display: none; }
#checkout-cart .btn-primary, #checkout-success .btn-primary { align-self: stretch; }
#checkout-cart .btn-ghost, #checkout-success .btn-ghost { align-self: center; }
.co-lines { display: flex; flex-direction: column; gap: var(--s8); text-align: left;
  border: 1px solid var(--line-ha); border-radius: var(--r-card); padding: var(--s16); background: var(--bg); }
.co-line { display: flex; justify-content: space-between; gap: var(--s16); font-size: 14px; }
.co-line .k { color: var(--ink-subtle); }
.co-line.credit .k, .co-line.credit .v { color: var(--brand-coral-ink); }
.co-line.total { border-top: 1px solid var(--line); padding-top: var(--s8); font-weight: 650;
  font-variant-numeric: tabular-nums; }
.co-cardnum { font-family: var(--font-hud); font-size: 14px; letter-spacing: .04em; }
.co-check { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  background: var(--brand-gradient); color: var(--on-coral);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }

/* "Current plan" badge on tiers / packs */
.tier, .pack { position: relative; }
.tier-current { position: absolute; top: var(--s12); right: var(--s12);
  font-family: var(--font-hud); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand-coral-ink); border: 1px solid var(--brand-coral-ink);
  border-radius: var(--r-pill); padding: 3px 10px; }
.tier-current[hidden] { display: none; }
.tier .btn[disabled], .pack .btn[disabled] { opacity: .55; cursor: default; }
.tier-featured .tier-current { color: var(--brand-coral); border-color: var(--brand-coral); }

.packs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s12); }
.pack { border: 1px solid var(--line-strong); border-radius: var(--r-card); padding: var(--s16); display: flex; flex-direction: column; gap: var(--s8); background: var(--bg); }
.pack-name { font-family: var(--font-heading); font-weight: 600; }
.pack-price { font-family: var(--font-display); font-stretch: 125%; font-size: 28px; font-weight: 640; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.pack-note { font-size: 12.5px; color: var(--ink-subtle); flex: 1; }

.field { display: flex; flex-direction: column; gap: var(--s4); font-size: 13px; }
.field input {
  padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--bg); font-size: 14px;
}
.field input:focus { border-color: var(--ink); outline: none; }

/* ---------- Toasts -------------------------------------------------------- */
.toast-root {
  position: fixed; bottom: var(--s24); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: var(--s8); z-index: 180;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: var(--s8) var(--s16);
  font-size: 13px;
  border-left: 3px solid var(--brand-coral);
  border-radius: var(--r-chip);
  box-shadow: var(--sh-2);
  pointer-events: auto;
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Reveal motion (landing only — the workspace is zero-animation) */
html.js #view-landing [data-reveal] { opacity: 0; transform: translateY(12px); }
html.js #view-landing [data-reveal].revealed {
  opacity: 1; transform: none;
  transition: opacity .32s var(--ease-reveal), transform .32s var(--ease-reveal);
  transition-delay: calc(var(--i, 0) * 70ms);
}
/* statement display headline: blur settle instead of lift */
html.js #view-landing .statement [data-reveal] { transform: none; filter: blur(2px); }
html.js #view-landing .statement [data-reveal].revealed {
  filter: blur(0);
  transition: opacity .4s var(--ease-reveal), filter .4s var(--ease-reveal);
}

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: var(--s40); padding: var(--s56) 0; }
  .hero h1 { max-width: 20ch; }
  .steps, .tiers { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .ex-card--large { grid-column: 1 / -1; grid-row: auto; }
  /* square bird in a wide frame: contain against its own baked bg, no crop */
  .ex-card--large .ex-fig { aspect-ratio: 3/2; }
  .ex-card--large .ex-fig img { object-fit: contain; }
  .ex-pos-r3c2, .ex-pos-r3c3 { grid-column: auto; grid-row: auto; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line-ha); }
  .metric:nth-child(2n) { border-right: none; }
}

@media (max-width: 860px) {
  .wb-body { flex-direction: column; }
  .wb-settings {
    width: 100%; flex: none;
    border-right: none; border-bottom: 1px solid var(--line);
    max-height: 40vh;
  }
  .inspector { position: static; width: 100%; max-width: none; border-left: none; border-right: none; border-radius: 0; }
  /* 641–860px: horizontal nav is KEPT (spec §3), just compacted */
  .topbar-inner { padding-inline: clamp(12px, 3vw, 24px); }
  .topnav { gap: var(--s12); }
  .topnav a:not(.btn) { font-size: 13px; }
  .topnav .btn { margin-left: 0; padding: 6px 12px; }
  .nav-sep { display: none; }
}

@media (max-width: 640px) {
  /* theme toggle stays visible on mobile — coarse-pointer block sizes it to 44px;
     rebalance header so wordmark + toggle + CTA fit a 390px viewport */
  .topbar-inner { padding-inline: clamp(12px, 3vw, 24px); }
  .wordmark { flex: none; gap: var(--s8); }
  .wordmark .wm-icon { height: 28px; width: 28px; }
  .wordmark .wm-img { height: 14px; width: auto; }
  .topnav { gap: var(--s8); }
  /* <640px: nav links collapse into the drawer; the PRIMARY CTA stays visible
     (v7 R3 — main action must not hide in a menu); account entry stays in the
     header as an icon at every breakpoint */
  .topnav > a:not(.btn):not(#nav-account) { display: none; }
  .nav-quota { display: none; } /* ≤640px: keep the CTA, drop the quota pill */
  .topnav .btn.btn-primary {
    padding: 0 14px;
    min-height: var(--btn-h-primary);
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-toggle { display: inline-flex; }
  .nav-acct-text { display: none; }
  .nav-acct-icon { display: block; }
  #nav-account { min-width: 32px; min-height: 32px; justify-content: center; border-radius: var(--r-control); }
  #nav-account:hover { background: var(--coral-tint); }
  .hero-demo-head .hd-telemetry { display: none; }
  .hero-proof { grid-template-columns: 1fr; gap: var(--s12); }
  .steps, .tiers, .packs { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .quote--main { grid-row: auto; padding: var(--s24); }
  .gallery { grid-template-columns: 1fr; }
  .gallery .ex-card, .gallery .ex-card--large { grid-column: auto; grid-row: auto; }
  /* single column: the large card keeps its 1:1 tier, smalls stay 3:2 */
  .ex-card--large .ex-fig { aspect-ratio: 1/1; }
  .ex-card--large .ex-fig img { object-fit: cover; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--line-ha); }
  .metric:last-child { border-bottom: none; }
  .wb-top { height: auto; padding: var(--s8) var(--s12); flex-wrap: wrap; }
  .wb-export { flex-wrap: wrap; }
  .wb-export .btn { flex: 1; }
  .section { padding: var(--s56) 0; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 380px) {
  /* very small phones: icon-only brand keeps the header on one row */
  .wordmark .wm-img { display: none; }
}

/* ---------- Motion safety -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  /* true degradation: content always visible, opacity-only settle */
  html.js #view-landing [data-reveal] { transform: none; filter: none; }
}

/* ---------- Performance: skip rendering off-screen sections --------------- */
@supports (content-visibility: auto) {
  .section, .exports-strip { content-visibility: auto; contain-intrinsic-size: auto 720px; }
}

/* ---------- Coarse-pointer tap targets (≥44px) ----------------------------- */
@media (pointer: coarse) {
  :root { --header-h: 56px; }
  .topnav .btn { min-height: 44px; padding: 8px 18px; }
  .theme-toggle { width: 44px; height: 44px; }
  .nav-toggle { width: 44px; height: 44px; }
  #nav-account { min-width: 44px; min-height: 44px; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); }
  input[type="range"] { height: 28px; }
  input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -9.5px; }
}

/* ---------- Wordmark theme swap ------------------------------------------ */
.wm-dark { display: none; }
:root[data-theme="dark"] .wm-light { display: none; }
:root[data-theme="dark"] .wm-dark { display: block; }

/* code inside FAQ */
.faq-body code {
  font-family: var(--font-hud); font-size: 12.5px;
  background: var(--canvas); padding: 1px 5px;
}

/* ---------- Account page extras ------------------------------------------- */
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s16); }
.acct-card .big { font-family: var(--font-display); font-stretch: 125%; font-size: 26px; font-weight: 640; letter-spacing: -.025em; margin: var(--s8) 0; font-variant-numeric: tabular-nums; }
.acct-card.featured { border-color: var(--brand-coral); }
/* B4 — strengthened Free card: big remaining count + persistent upsell CTAs
   (inline <span>, NOT flex: innerText must read "2 of 3 exports left…") */
.acct-free-left { margin: 0; }
.acct-free-left .big { font-size: 34px; margin: 0; }
.acct-big--warn { color: var(--brand-coral-ink); }
.acct-big--danger { color: var(--danger-ink); }
.acct-cta { display: flex; flex-wrap: wrap; gap: var(--s12); align-items: center; margin-top: var(--s8); }
.acct-cta .acct-pay-note { flex-basis: 100%; margin: 0; }
/* B1 — auth modal success state: prominent green check + bold confirmation */
.auth-success { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ok-ink); }
.auth-success[hidden] { display: none; }
.auth-success .auth-check {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ok); color: #fff; font-weight: 700; font-size: 14px;
}
.auth-success strong { color: var(--ink); }
/* B4 — small quota pill left of the header CTA */
.nav-quota { font-size: 12px; color: var(--ink-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav-quota[hidden] { display: none; }
@media (max-width: 640px) { .acct-grid { grid-template-columns: 1fr; } }
