/* ============================================================================
   Visual theme - matte-black canvas, frosted glass panels, cyan accent used
   as a real functional color (buttons/links/focus/glow), Space Grotesk +
   JetBrains Mono. Component selectors are unchanged from before so app.js's
   DOM hooks keep working; only the token values and a handful of additive
   rules (grain, ambient glow, landing sections) are new.
   ============================================================================ */

:root {
  /* Tells the browser this page supports a dark UI, so NATIVE form chrome
     (select's dropdown option list, checkbox/radio ring, number-input
     spinner buttons, range track, scrollbars) renders with dark-appropriate
     colors instead of the browser's light-mode default - the part of these
     controls our own CSS (color/background/accent-color) cannot reach.
     Flipped to "light" under the [data-theme="light"] override below. */
  color-scheme: dark;

  /* -- primitive tokens ----------------------------------------------------- */
  --color-void-canvas:   #08080A;  /* page background */
  --color-graphite:      #0E0E11;  /* elevated surface: header, overlays, dropdowns, cards */
  --color-graphite-2:    #151519;  /* a step above graphite, e.g. option groups */
  --color-ink-black:     #08080A;  /* text on filled accent surfaces */
  --color-snow-white:    var(--color-bone, #F3F3F0); /* legacy alias, see .btn.primary */
  --color-bone:          #F3F3F0;  /* primary text on dark surfaces */
  --color-ash:           rgba(243,243,240,.60);  /* secondary text, helper copy */
  --color-slate:         rgba(243,243,240,.38);  /* muted / tertiary metadata */
  --color-smoke:         rgba(243,243,240,.30);  /* idle/disabled control text */
  --color-hairline:      rgba(255,255,255,.10);  /* 1px borders */

  /* frosted glass panel: translucent fill + hairline, elevation via
     translucency and surface contrast, never a drop shadow */
  --frost-fill:   rgba(255,255,255,.045);
  --frost-fill-2: rgba(255,255,255,.075);
  --frost-border: rgba(255,255,255,.10);
  --frost-border-2: rgba(255,255,255,.20);
  --frost-blur:   blur(16px);

  --tint-1: rgba(255,255,255,.030);
  --tint-2: rgba(255,255,255,.045);
  --tint-3: rgba(255,255,255,.060);
  --tint-4: rgba(255,255,255,.080);
  --panel-ring: rgba(255,255,255,.10) 0px 0px 0px 1px inset;
  --primary-hover: #33EBFF;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.7);
  --grain-opacity: .05;

  /* radii - large, soft, pill controls throughout */
  --radius-ui:     12px;
  --radius-cards:  26px;
  --radius-panels: 32px;
  --radius-icons:  8px;
  --radius-pill:   9999px;

  /* type */
  --font-dm-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system,
                  BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-geist:   'Space Grotesk', ui-sans-serif, system-ui, -apple-system,
                  BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* -- semantic aliases, overridable at runtime via BRAND_ACCENT_COLOR/
        BRAND_HIGHLIGHT_COLOR (see server.js -> GET /api/config -> applyBrand()
        in app.js, which sets --accent/--accent-2/--highlight as inline
        styles on <html>). Everything chromatic in this file traces back to
        --accent, so a deployment override actually re-skins the UI. -------- */
  --accent:    #00E5FF;
  --accent-2:  #00B7CC;  /* pre-JS/no-override fallback hover shade; app.js recomputes this from a custom BRAND_ACCENT_COLOR */
  --highlight: #00E5FF;
  --accent-fg: var(--accent); /* readable-as-text variant; redefined per-theme below */
  --glow:      color-mix(in oklab, var(--accent) 22%, transparent);

  --bg:        var(--color-void-canvas);
  --panel:     var(--color-graphite);
  --panel-2:   var(--color-graphite-2);
  --line:      var(--frost-border);
  --text:      var(--color-bone);
  --muted:     var(--color-ash);
  --good:      var(--color-bone);
  --warn:      #e0b34d;
  --danger:    #e5788a;
  --radius:    var(--radius-cards);
}

/* ── Light theme override ────────────────────────────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;
  --color-void-canvas:   #F2F2EE;
  --color-graphite:      #FFFFFF;
  --color-graphite-2:    #F7F7F5;
  --color-ink-black:     #08080A;
  --color-bone:          #0D0D0F;
  --color-ash:           rgba(13,13,15,.62);
  --color-slate:         rgba(13,13,15,.42);
  --color-smoke:         rgba(13,13,15,.34);
  --color-hairline:      rgba(8,8,10,.10);

  --frost-fill:   rgba(8,8,10,.028);
  --frost-fill-2: rgba(8,8,10,.055);
  --frost-border: rgba(8,8,10,.10);
  --frost-border-2: rgba(8,8,10,.22);

  --tint-1: rgba(8,8,10,.035);
  --tint-2: rgba(8,8,10,.045);
  --tint-3: rgba(8,8,10,.070);
  --tint-4: rgba(8,8,10,.080);
  --panel-ring: rgba(8,8,10,.06) 0px 0px 0px 1px inset;
  --primary-hover: #00CFE0;

  --shadow: 0 1px 2px rgba(8,8,10,.06), 0 24px 60px -24px rgba(8,8,10,.22);
  --grain-opacity: .028;

  --accent-fg: color-mix(in oklab, var(--accent) 60%, black);
  --glow:      color-mix(in oklab, var(--accent) 30%, transparent);

  --warn:   #a15c00;
  --danger: #dc2626;
}

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

html, body { height: 100%; }

body {
  position: relative;
  font-family: var(--font-dm-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.overlay-open { overflow: hidden; }

/* Ambient cursor-follow glow + grain texture - purely decorative, so both
   are pointer-events:none and skipped for prefers-reduced-motion. --mx/--my
   are updated by app.js on pointermove; the fallback position keeps the
   glow looking intentional before JS runs or on touch devices. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(620px circle at var(--mx, 60%) var(--my, 12%), var(--glow), transparent 68%);
  transition: background .3s linear;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  body::before { transition: none; }
}

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

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: 14px 32px;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1360px; margin: 0 auto; }
.topbar h1  {
  font-family: var(--font-geist); font-size: 20px; font-weight: 600;
  letter-spacing: -.03em; color: var(--color-bone); line-height: 1.2;
}
.topbar h1::after {
  content: ''; display: inline-block; width: 5px; height: 5px; margin-left: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}
/* Wordmark link - clickable home link, with a special lowercase two-tone
   treatment ("size" / italic accent "it" / "down") when the deployment's
   BRAND_NAME is exactly "SizeItDown" (see app.js/legal.js renderBrandWordmark).
   Any other BRAND_NAME renders as plain text here, same as before. */
.brand-wordmark a {
  display: inline-flex; align-items: baseline; gap: 1px;
  color: inherit; font: inherit; letter-spacing: inherit; text-decoration: none;
}
.brand-wordmark a:hover { opacity: .85; }
.brand-wordmark .bw-it {
  font-style: italic; font-weight: 300; color: var(--accent-fg);
}
.tagline    { margin-top: 4px; color: var(--color-ash); font-size: 13.5px; font-weight: 400; }
.topbar-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }

.site-nav { display: flex; gap: 22px; font-size: 13.5px; color: var(--color-ash); }
.site-nav a { color: inherit; text-decoration: none; }
.site-nav a:hover { color: var(--color-bone); }
@media (max-width: 760px) { .site-nav { display: none; } }

.tool-switch { color: var(--color-ash); font-size: 13px; text-decoration: none; white-space: nowrap; }
.tool-switch:hover { color: var(--accent-fg); text-decoration: underline; }

.tool-badge {
  display: inline-block; margin-left: 8px; padding: 2px 9px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; vertical-align: middle;
  color: var(--color-bone); background: var(--tint-3);
  border: 1px solid var(--frost-border); border-radius: var(--radius-pill);
}

/* Ad slot - stays hidden/collapsed (no reserved space, no layout shift) until
   app.js's renderAds() unhides it after GET /api/config reports ads enabled. */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 90px; padding: 16px;
  background: linear-gradient(180deg, var(--frost-fill), transparent);
  border: 1px solid var(--line); border-radius: var(--radius-ui);
  text-align: center; color: var(--color-slate); font-size: 12px;
}
.ad-slot[hidden] { display: none; }
.ad-slot::before {
  content: 'Advertisement';
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-slate);
}
.ad-slot[data-mounted] { display: block; padding: 0; background: none; }
.ad-slot[data-mounted]::before { display: none; }

/* Ad band - both slots together at the bottom of the hero, with a small
   transparency note above them ("why is there an ad here"), not just the
   generic per-slot label. Two side-by-side 200px blocks on desktop, stacked
   and shorter on mobile so they don't dominate the screen above the fold. */
.hero-ad-band { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.hero-ad-band-note {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--color-slate); text-align: center;
}
.hero-ad-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.hero-ad-row .ad-slot { min-height: 200px; }
@media (min-width: 640px) {
  .hero-ad-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 639px) {
  .hero-ad-row .ad-slot { min-height: 110px; padding: 10px; }
}

/* Light/dark toggle - a plain icon pill, not the primary/inverted treatment,
   so it doesn't compete with the Compress CTA for visual weight. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--tint-2); border: 1px solid var(--frost-border);
  border-radius: var(--radius-pill); color: var(--color-bone);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--tint-3); border-color: var(--frost-border-2); }
.theme-toggle svg { width: 17px; height: 17px; stroke-width: 1.75; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── Landing sections (hero / stats / steps / presets / formats / faq) ─────
   Wrap the tool, built from the same design system as everything else.
   1120px column, generous vertical rhythm, JetBrains Mono for eyebrows and
   figures, Space Grotesk for headings. */
/* Same max-width + horizontal padding as .wrap/.topbar-inner/.site-footer
   below, so the hero copy's left edge lines up with the dropzone/options
   left edge instead of reading as a narrower, off-center block above it. */
.landing {
  position: relative; z-index: 2; max-width: 1360px; margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 900px) { .landing { padding: 0 16px; } }
.eyebrow-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-slate);
}
.eyebrow.accent { color: var(--accent-fg); }
.eyebrow-rule { height: 1px; width: 44px; background: var(--frost-border-2); display: block; }

.hero {
  padding: clamp(44px, 8vh, 96px) 0 clamp(28px, 4vh, 44px);
  display: grid; grid-template-columns: minmax(0,1fr); gap: 32px;
}
.hero-copy { max-width: none; }
/* Sized (and un-wrapped in the markup) to hold as one line down to ~960px
   viewports; below that it wraps naturally rather than overflowing. */
.hero h1 {
  margin: 0; font-family: var(--font-geist); font-weight: 400;
  font-size: clamp(26px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -.03em;
  white-space: normal;
}
.hero h1 em { font-style: italic; font-weight: 300; color: var(--accent-fg); }
.hero p.lede {
  margin: 18px 0 0; max-width: 60ch; font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6; color: var(--color-ash);
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em;
  padding: 6px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--frost-fill); color: var(--color-ash);
}
/* ── Full-width shell (the tool itself) ──────────────────────────────────── */
.wrap {
  position: relative; z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 32px 40px;
  display: grid;
  grid-template-columns: minmax(380px, 460px) 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "options upload"
    "options actions"
    "options results";
  align-items: start;
  gap: 10px 28px;
}
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "options" "upload" "actions" "results";
    padding: 12px 16px 32px;
  }
}

.upload-col    { grid-area: upload;  display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.action-col    { grid-area: actions; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.options-panel { grid-area: options; }
.results-pane  { grid-area: results; min-width: 0; margin-top: 14px; }

/* ── Frosted glass panel mixin (dropzone / options / progress) ───────────── */
.dropzone, .options-panel, .progress-wrap {
  background: var(--frost-fill);
  backdrop-filter: var(--frost-blur);
  -webkit-backdrop-filter: var(--frost-blur);
  border: 1px solid var(--frost-border);
}

/* ── Drop zone ────────────────────────────────────────────────────────────── */
.dropzone {
  border-radius: var(--radius-panels);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, padding .2s, transform .3s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.dropzone::before {
  content: ''; position: absolute; inset: -40% -20% auto -20%; height: 220%;
  background: radial-gradient(circle at 50% 0%, var(--glow), transparent 60%);
  pointer-events: none;
}
.dropzone > * { position: relative; }
.dropzone.drag      { border-color: var(--accent); background: var(--frost-fill-2); transform: scale(1.006); }
.dropzone.has-files { padding: 16px 20px; }
.dropzone.has-files .dz-icon { display: none; }
.dropzone.has-files .dz-inner strong { font-size: 14px; }

.dz-icon   { width: 30px; height: 30px; stroke: var(--color-ash); stroke-width: 1.5; display: block; margin: 0 auto 12px; }
.dz-inner strong { display: block; font-family: var(--font-geist); font-size: 18px; font-weight: 500; color: var(--color-bone); }
.dz-inner span   { color: var(--color-ash); font-size: 14px; }
.dz-inner small  { display: block; margin-top: 8px; font-family: var(--font-mono); color: var(--color-slate); font-size: 11px; letter-spacing: .04em; }

.link {
  background: none; border: none; color: var(--accent-fg); font-weight: 500;
  cursor: pointer; font-family: inherit; font-size: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}

/* ── Queue list ───────────────────────────────────────────────────────────── */
.queue-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--frost-border) transparent;
}
.qi {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--frost-fill);
  backdrop-filter: var(--frost-blur); -webkit-backdrop-filter: var(--frost-blur);
  border: 1px solid var(--frost-border); border-radius: var(--radius-ui);
  transition: border-color .15s;
}
.qi--compressing { border-color: var(--accent); }
.qi--done        { border-color: var(--frost-border); box-shadow: inset 2px 0 0 var(--accent); }
.qi--error       { border-color: color-mix(in srgb, var(--danger) 55%, var(--frost-border)); }

.qi-progress { display: none; }
.qi--compressing .qi-progress {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
}
.qi--compressing .qi-progress::after {
  content: ''; position: absolute; top: 0; height: 100%; width: 35%;
  background: var(--accent); border-radius: var(--radius-pill);
  animation: qi-progress-slide 1.2s ease-in-out infinite;
}
@keyframes qi-progress-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}

.qi-thumb {
  width: 36px; height: 36px; object-fit: cover;
  border-radius: var(--radius-icons); background: var(--color-graphite); flex-shrink: 0;
}
.qi-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-size { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-slate); white-space: nowrap; flex-shrink: 0; }
.qi-status { flex-shrink: 0; font-size: 14px; width: 18px; text-align: center; }
.qi-done { color: var(--accent-fg); }
.qi-err  { color: var(--danger); }
.qi-spin {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid var(--frost-border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.qi-remove {
  background: none; border: none; color: var(--color-smoke);
  cursor: pointer; font-size: 15px; padding: 2px 5px;
  border-radius: var(--radius-icons); line-height: 1; flex-shrink: 0;
  transition: color .1s, background .1s;
}
.qi-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ── Options panel ────────────────────────────────────────────────────────── */
.options-panel {
  border-radius: var(--radius-cards); overflow: hidden;
}
.options-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-family: var(--font-geist); font-weight: 600; font-size: 15px; color: var(--color-bone); user-select: none;
}
.options-summary::-webkit-details-marker { display: none; }
.options-summary:hover { background: var(--tint-1); }
.chevron { width: 16px; height: 16px; stroke: var(--color-ash); stroke-width: 2; transition: transform .2s; }
details[open] .chevron { transform: rotate(180deg); }

.options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 28px; padding: 4px 24px 24px;
}
.opt       { display: flex; flex-direction: column; gap: 6px; }
.opt-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--color-slate); text-transform: uppercase; letter-spacing: .16em; }
.opt-help  { color: var(--color-slate); font-size: 12px; line-height: 1.4; }
.radios    { display: flex; gap: 12px; flex-wrap: wrap; }
.radios label, .checkbox { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--color-bone); }
.radios input, .checkbox input { accent-color: var(--accent); }
.opt-label.checkbox { font-family: var(--font-dm-sans); font-weight: 500; color: var(--color-bone); text-transform: none; letter-spacing: 0; font-size: 14px; }

/* Image/video settings groups - shown/hidden based on what's queued */
.opt-group {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 28px; padding-top: 16px; border-top: 1px solid var(--frost-border);
}
.opt-group[hidden] { display: none; }
.opt-group-title {
  grid-column: 1 / -1; margin: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: var(--color-bone); text-transform: uppercase; letter-spacing: .16em;
}

.opt-featured { grid-column: 1 / -1; }

.advanced { grid-column: 1 / -1; }
.advanced-summary {
  cursor: pointer; list-style: none; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: var(--color-slate); text-transform: uppercase; letter-spacing: .16em;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary:hover { color: var(--color-bone); }
.advanced[open] .advanced-summary { margin-bottom: 10px; }

input[type="number"], select {
  background: var(--tint-2); border: 1px solid var(--frost-border); color: var(--color-bone);
  border-radius: var(--radius-ui); padding: 9px 12px; font: inherit; font-family: var(--font-mono); font-size: 13.5px; width: 100%;
  transition: border-color .12s, background .12s;
}
input[type="number"]:focus, select:focus {
  outline: none; background: var(--tint-3); border-color: var(--accent);
}
input[type="number"]::placeholder { color: var(--color-slate); }
select { cursor: pointer; font-family: var(--font-dm-sans); }

/* Custom "Profile" dropdown - replaces the native <select> popup, whose
   translucent tint tokens (--tint-2 etc.) composite unpredictably in an
   OS-native listbox and can render as low-contrast text. Built on an opaque
   --panel-2 surface instead so contrast holds regardless of what's behind it. */
.custom-select { position: relative; }
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; background: var(--tint-2); border: 1px solid var(--frost-border); color: var(--color-bone);
  border-radius: var(--radius-ui); padding: 9px 12px; font: inherit; font-family: var(--font-dm-sans); font-size: 13.5px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.custom-select-trigger:hover { background: var(--tint-3); }
.custom-select-trigger:focus-visible,
.custom-select-trigger[aria-expanded="true"] { outline: none; background: var(--tint-3); border-color: var(--accent); }
.custom-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-caret { flex: none; width: 16px; height: 16px; color: var(--color-slate); transition: transform .15s; }
.custom-select-trigger[aria-expanded="true"] .custom-select-caret { transform: rotate(180deg); color: var(--accent); }

.custom-select-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--frost-border-2); border-radius: var(--radius-ui);
  box-shadow: var(--shadow); padding: 6px;
}
.custom-select-option {
  padding: 8px 10px; border-radius: calc(var(--radius-ui) - 4px); font-size: 13.5px; color: var(--color-bone);
  cursor: pointer; outline: none;
}
.custom-select-option:hover,
.custom-select-option:focus { background: var(--tint-3); }
.custom-select-option[aria-selected="true"] { background: var(--glow); color: var(--accent-fg); }

.minres { display: flex; align-items: center; gap: 8px; }
.minres input { width: 100%; }
.minres span  { color: var(--color-slate); }

/* Native range input (quality/zoom sliders), matching the reference's pill thumb */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--frost-border-2); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; height: 16px; width: 16px; margin-top: -7px; border-radius: 50%;
  background: var(--accent); border: none; box-shadow: 0 0 0 4px var(--glow); transition: box-shadow .2s, transform .2s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type=range]::-moz-range-track { height: 2px; background: var(--frost-border-2); border-radius: 2px; }
input[type=range]::-moz-range-thumb {
  height: 16px; width: 16px; border-radius: 50%; background: var(--accent); border: none; box-shadow: 0 0 0 4px var(--glow);
}

/* ── Action bar ───────────────────────────────────────────────────────────── */
.actionbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.actionbar-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.queue-count { color: var(--color-ash); font-size: 14px; }
.settings-pill {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--color-ash); background: var(--tint-2);
  border: 1px solid var(--frost-border); border-radius: var(--radius-pill);
  padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.settings-pill:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--frost-border); background: var(--panel); color: var(--color-bone);
  padding: 8px 16px; border-radius: var(--radius-pill); font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, opacity .15s, box-shadow .25s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--tint-3); border-color: var(--frost-border-2); }
/* Filled accent CTA - the only chromatic-fill control in the system. */
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--color-ink-black); font-weight: 500;
  box-shadow: 0 10px 30px -10px var(--glow);
}
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 16px 40px -10px var(--glow); }
.btn.ghost   { background: transparent; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-icon { width: 15px; height: 15px; flex-shrink: 0; }
.btn[hidden] { display: none; }

.error {
  background: color-mix(in srgb, var(--danger) 10%, var(--color-graphite));
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--frost-border));
  color: var(--danger); padding: 12px 16px; border-radius: var(--radius-ui); font-size: 14px;
}

.disabled-notice {
  background: var(--tint-2);
  border: 1px solid var(--frost-border);
  color: var(--muted); padding: 12px 16px; border-radius: var(--radius-ui);
  font-size: 14px; margin-bottom: 12px;
}
.disabled-notice a { color: var(--accent-fg); text-decoration: underline; }

.dropzone.disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 320px; max-width: calc(100vw - 40px);
  padding: 16px 20px;
  border-radius: var(--radius-cards);
  box-shadow: var(--shadow);
}
@media (max-width: 720px) {
  .progress-wrap {
    left: 0; right: 0; bottom: 0; width: 100%; max-width: none;
    border-radius: var(--radius-cards) var(--radius-cards) 0 0;
    border-left: none; border-right: none; border-bottom: none;
  }
}
.progress-track {
  height: 6px; background: var(--tint-4); border-radius: var(--radius-pill);
  overflow: hidden; margin-bottom: 10px;
}
.progress-fill {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: var(--radius-pill); transition: width .3s ease;
}
.progress-label {
  display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--color-ash);
}
#progressText  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 78%; }
#progressCount { white-space: nowrap; flex-shrink: 0; }

/* ── Results header ───────────────────────────────────────────────────────── */
.results-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px; flex-wrap: wrap; gap: 6px;
}
#resultsTitle    { font-family: var(--font-geist); font-weight: 600; font-size: 18px; color: var(--color-bone); letter-spacing: -.1px; }
.results-summary { font-family: var(--font-mono); font-size: 12.5px; color: var(--color-ash); }

/* ── Results grid ─────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--frost-fill); backdrop-filter: var(--frost-blur); -webkit-backdrop-filter: var(--frost-blur);
  border: 1px solid var(--frost-border);
  border-radius: var(--radius-cards); overflow: hidden;
  cursor: pointer; transition: border-color .15s, transform .1s, background .15s;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: var(--frost-border-2);
  background: var(--frost-fill-2);
  transform: translateY(-2px);
}
.card:active { transform: translateY(0); }
.card--error { cursor: default; }
.card--error:hover { border-color: var(--frost-border); background: var(--frost-fill); transform: none; }

.card-thumb-wrap {
  position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--color-graphite);
}
.card-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.card:hover .card-thumb { transform: scale(1.03); }
.card-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb[hidden], .card-video[hidden] { display: none; }

.badge {
  position: absolute; bottom: 8px; right: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(8,8,10,.55); backdrop-filter: blur(6px);
  border: 1px solid var(--frost-border);
  color: #fff; white-space: nowrap;
}
.badge.over        { background: color-mix(in srgb, var(--danger) 30%, rgba(8,8,10,.55)); border-color: color-mix(in srgb, var(--danger) 55%, var(--frost-border)); color: #ffd9df; }
.badge--pass       { background: rgba(8,8,10,.55); border-color: var(--frost-border); color: #fff; }

.card-body {
  padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px;
}
.fname {
  font-size: 14px; font-weight: 500; color: var(--color-bone); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.card-sizes {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--color-ash);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.card-format {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
  padding: 2px 8px; border-radius: var(--radius-ui);
  background: transparent; color: var(--color-smoke);
  border: 1px solid var(--frost-border);
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.overlay[hidden] { display: none; }

.overlay-bg {
  position: absolute; inset: 0;
  background: rgba(8,8,10,.7); backdrop-filter: blur(8px);
  cursor: pointer;
}

.overlay-panel {
  position: relative; z-index: 1;
  background: var(--color-graphite); border: 1px solid var(--frost-border);
  border-radius: var(--radius-panels); width: 100%; max-width: 880px;
  max-height: 92vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0;
  box-shadow: var(--panel-ring), var(--shadow);
}

.overlay-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--frost-border); flex-shrink: 0;
}
.overlay-fname {
  font-weight: 500; font-size: 16px; color: var(--color-bone); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: calc(100% - 40px);
}
.overlay-close {
  background: none; border: none; color: var(--color-ash);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-icons); line-height: 1; transition: color .1s, background .1s; flex-shrink: 0;
}
.overlay-close:hover { color: var(--color-bone); background: var(--tint-3); }

.overlay-compare { padding: 20px 22px 0; }
.overlay-video {
  display: block; width: 100%; max-height: 55vh;
  margin: 20px 22px 0; border-radius: var(--radius-ui); background: #000;
}
.overlay-video[hidden] { display: none; }

/* Before/After compare (shared by overlay) */
.compare-stage {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--radius-ui); background: #000; cursor: ew-resize; user-select: none;
  max-height: 55vh; border: 1px solid var(--frost-border);
}
.img-before, .img-after {
  display: block; width: 100%; height: 100%;
  object-fit: contain; max-height: 55vh;
}
.img-after {
  position: absolute; top: 0; left: 0;
  clip-path: inset(0 50% 0 0);
}
.divider-handle {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  height: 100%; width: 36px; display: flex; flex-direction: column;
  align-items: center; pointer-events: none; cursor: ew-resize;
}
.divider-line { width: 2px; height: 100%; background: var(--accent); }
.divider-pill {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--accent); color: var(--color-ink-black); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em;
  padding: 4px 7px; border-radius: var(--radius-pill); white-space: nowrap;
  user-select: none;
}
.slider {
  width: 100%; margin-top: 12px; cursor: ew-resize; accent-color: var(--accent);
}
.compare-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); color: var(--color-slate); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; padding-bottom: 16px;
}

.overlay-stats {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 0 22px 16px; font-size: 14px; color: var(--color-ash);
  border-top: 1px solid var(--frost-border); padding-top: 16px;
}
.overlay-stats b { color: var(--color-bone); font-weight: 600; }
.overlay-stats em { color: var(--accent-fg); font-style: normal; font-weight: 600; }

/* Conflict (in overlay) - neutral chooser, not an error, so it stays achromatic. */
.overlay-conflict {
  margin: 0 22px 16px; padding: 16px;
  border: 1px solid var(--frost-border); background: var(--tint-1);
  border-radius: var(--radius-ui);
}
.overlay-conflict h4 { color: var(--color-bone); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.overlay-conflict p  { color: var(--color-ash); font-size: 14px; margin-bottom: 12px; }
.conflict-choices    { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1 1 180px; border: 1px solid var(--frost-border); background: var(--tint-1);
  border-radius: var(--radius-ui); padding: 12px; cursor: pointer; text-align: left;
  color: var(--color-bone); font: inherit; transition: border-color .15s;
}
.choice:hover  { border-color: var(--frost-border-2); }
.choice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice .ctitle { font-weight: 600; display: block; margin-bottom: 3px; font-size: 14px; }
.choice .cmeta  { color: var(--color-ash); font-size: 12px; }

.overlay-actions {
  padding: 0 22px 22px; display: flex; gap: 10px;
}

a.dl {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; background: var(--accent); color: var(--color-ink-black);
  padding: 9px 20px; border-radius: var(--radius-pill); font: inherit; font-size: 14px; font-weight: 500;
  transition: background .15s; box-shadow: 0 10px 30px -10px var(--glow);
}
a.dl:hover    { background: var(--primary-hover); }
a.dl::before  { content: '↓'; font-size: 14px; }

/* ── Per-row edit affordance ──────────────────────────────────────────────── */
.qi-edit {
  background: none; border: 1px solid var(--frost-border); color: var(--color-smoke);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; line-height: 1;
  padding: 5px 10px; border-radius: var(--radius-ui); flex-shrink: 0;
  transition: color .1s, background .1s, border-color .1s;
}
.qi-edit:hover { color: var(--color-bone); background: var(--tint-3); border-color: var(--frost-border-2); }
.qi-chip {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-ui);
  background: transparent;
  color: var(--color-ash); border: 1px solid var(--frost-border);
}
.qi-chip[hidden] { display: none; }

/* ── Edit overlay ─────────────────────────────────────────────────────────── */
.edit-panel { max-width: 960px; }
.edit-body {
  display: grid; grid-template-columns: 1fr 280px; gap: 20px;
  padding: 20px 22px;
}
@media (max-width: 720px) {
  .edit-body { grid-template-columns: 1fr; }
}

.edit-stage-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.edit-stage {
  position: relative; align-self: center; max-width: 100%;
  background: #000; border-radius: var(--radius-ui); overflow: hidden;
  border: 1px solid var(--frost-border);
  touch-action: none; user-select: none; line-height: 0;
}
.edit-canvas { display: block; max-width: 100%; height: auto; }
.edit-dims { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-slate); text-align: center; min-height: 16px; }

/* Crop rectangle + 8 handles (positioned in CSS px over the canvas) */
.crop-rect {
  position: absolute; box-sizing: border-box;
  border: 1.5px solid var(--accent); cursor: move;
  box-shadow: 0 0 0 9999px rgba(8,8,10,.6);
}
.crop-rect[hidden] { display: none; }
.crop-rect::before, .crop-rect::after {
  content: ''; position: absolute; background: rgba(255,255,255,.28); pointer-events: none;
}
.crop-rect::before { left: 33.33%; top: 0; width: 1px; height: 100%; }
.crop-rect::after  { left: 66.66%; top: 0; width: 1px; height: 100%; }
.crop-handle {
  position: absolute; width: 12px; height: 12px; box-sizing: border-box;
  background: var(--accent); border: 1.5px solid var(--color-graphite); border-radius: 4px;
  transform: translate(-50%, -50%);
}
.crop-handle[data-h="nw"] { left: 0;   top: 0;   cursor: nwse-resize; }
.crop-handle[data-h="n"]  { left: 50%; top: 0;   cursor: ns-resize; }
.crop-handle[data-h="ne"] { left: 100%;top: 0;   cursor: nesw-resize; }
.crop-handle[data-h="e"]  { left: 100%;top: 50%; cursor: ew-resize; }
.crop-handle[data-h="se"] { left: 100%;top: 100%;cursor: nwse-resize; }
.crop-handle[data-h="s"]  { left: 50%; top: 100%;cursor: ns-resize; }
.crop-handle[data-h="sw"] { left: 0;   top: 100%;cursor: nesw-resize; }
.crop-handle[data-h="w"]  { left: 0;   top: 50%; cursor: ew-resize; }
.crop-rect--preview { cursor: default; border-style: dashed; }
.crop-rect--preview .crop-handle { display: none; }

.focus-marker {
  position: absolute; width: 22px; height: 22px; box-sizing: border-box;
  border: 2px solid var(--color-graphite); border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--accent), 0 1px 4px rgba(0,0,0,.6); pointer-events: none;
}
.focus-marker::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 4px; height: 4px; background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.focus-marker[hidden] { display: none; }

/* Controls column */
.edit-controls { display: flex; flex-direction: column; gap: 16px; }
.edit-group { display: flex; flex-direction: column; gap: 8px; }
.edit-group[hidden] { display: none; }
.edit-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--color-slate);
  text-transform: uppercase; letter-spacing: .16em;
}
.edit-chips, .edit-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.edit-chip {
  border: 1px solid var(--frost-border); background: transparent; color: var(--color-bone);
  padding: 6px 12px; border-radius: var(--radius-pill); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: border-color .1s, background .1s, color .1s;
}
.edit-chip:hover  { border-color: var(--frost-border-2); }
.edit-chip.active { border-color: var(--accent); background: var(--accent); color: var(--color-ink-black); }
.edit-hint { min-height: 15px; line-height: 1.35; color: var(--color-slate); }
.edit-custom { display: flex; align-items: center; gap: 6px; }
.edit-custom[hidden] { display: none; }
.edit-custom input { width: 62px; }
.edit-custom span { color: var(--color-slate); }
#zoomRange { width: 100%; cursor: pointer; }
.edit-scope .choice { flex: 1 1 120px; padding: 10px; }
.edit-actions { border-top: 1px solid var(--frost-border); padding-top: 16px; justify-content: flex-end; }

/* ── Stats strip ──────────────────────────────────────────────────────────── */
.stats-strip {
  margin: clamp(40px, 6vh, 72px) 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-cards); overflow: hidden;
}
.stat {
  background: var(--bg); padding: 26px 22px; display: flex; flex-direction: column; gap: 8px;
}
.stat-n { font-family: var(--font-mono); font-size: 20px; letter-spacing: -.02em; color: var(--accent-fg); }
.stat-t { font-size: 13px; color: var(--color-ash); line-height: 1.5; }

/* ── How it works ─────────────────────────────────────────────────────────── */
.section-heading {
  margin: 0 0 18px; font-family: var(--font-geist); font-weight: 400;
  font-size: clamp(26px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.035em;
}
.section-lede { margin: 0; max-width: 48ch; font-size: 15px; line-height: 1.65; color: var(--color-ash); }
.two-col {
  display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(56px, 9vh, 112px) 0 0;
}
@media (min-width: 880px) { .two-col { grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); } }

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-cards); overflow: hidden; }
.steps li {
  background: var(--bg); padding: 22px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 16px; align-items: start;
}
.step-n { font-family: var(--font-mono); font-size: 11px; color: var(--accent-fg); padding-top: 4px; }
.step-t { font-size: 16px; letter-spacing: -.01em; color: var(--color-bone); display: block; margin-bottom: 5px; }
.step-d { font-size: 13.5px; line-height: 1.6; color: var(--color-ash); }

/* ── Presets grid (landing quick-apply) ──────────────────────────────────── */
.section { padding: clamp(56px, 9vh, 112px) 0 0; scroll-margin-top: 84px; }
.section--last { padding-bottom: clamp(56px, 9vh, 112px); }
.presets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 22px; }
.preset-tile {
  text-align: left; padding: 18px; border-radius: var(--radius-cards); border: 1px solid var(--line);
  background: var(--frost-fill); cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .2s, transform .2s cubic-bezier(.16,1,.3,1), background .2s; font: inherit; color: inherit;
}
.preset-tile:hover { border-color: var(--frost-border-2); background: var(--frost-fill-2); transform: translateY(-3px); }
.preset-tile .pt-label { font-size: 14px; letter-spacing: -.01em; color: var(--color-bone); }
.preset-tile .pt-dim   { font-family: var(--font-mono); font-size: 11px; color: var(--accent-fg); }

/* ── Format guide ─────────────────────────────────────────────────────────── */
.format-table { border: 1px solid var(--line); border-radius: var(--radius-cards); overflow: hidden; margin-top: 22px; }
.format-row {
  display: grid; grid-template-columns: minmax(80px,100px) minmax(0,1fr) minmax(0,1.2fr); gap: 18px;
  padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: baseline;
}
.format-row:last-child { border-bottom: none; }
.format-row .f-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-fg); }
.format-row .f-best  { font-size: 13.5px; color: var(--color-bone); }
.format-row .f-note  { font-size: 13px; color: var(--color-ash); line-height: 1.55; }
@media (max-width: 640px) { .format-row { grid-template-columns: 1fr; gap: 4px; } }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--line); padding: 18px 0; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; list-style: none;
  font-size: 16px; letter-spacing: -.01em; color: var(--color-bone);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--font-mono); font-size: 14px; color: var(--accent-fg); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 12px 0 0; max-width: 64ch; font-size: 14px; line-height: 1.65; color: var(--color-ash); }

/* ── Footer nav (main app page) + standalone legal pages (privacy/terms/about) */
.site-footer {
  position: relative; z-index: 2;
  padding: 28px 32px; margin-top: 48px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 1360px; margin-left: auto; margin-right: auto;
  color: var(--color-slate); font-size: 13px;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--color-ash); text-decoration: none; }
.site-footer a:hover { color: var(--color-bone); text-decoration: underline; }
.site-footer .fine-print { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }

.legal-page { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; padding: 48px 24px 64px; color: var(--text); line-height: 1.6; }
.legal-page h1 { font-family: var(--font-geist); font-weight: 400; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; margin-bottom: 4px; }
.legal-page .legal-updated { font-family: var(--font-mono); color: var(--color-slate); font-size: 12px; letter-spacing: .04em; margin-bottom: 32px; }
.legal-page h2 { font-family: var(--font-geist); font-size: 18px; margin: 28px 0 8px; }
.legal-page p, .legal-page li { color: var(--color-ash); font-size: 15px; }
.legal-page ul { padding-left: 20px; margin: 8px 0; }
.legal-page a { color: var(--accent-fg); }
.legal-page .back-link { display: inline-block; margin-bottom: 24px; font-size: 14px; color: var(--color-ash); text-decoration: none; }
.legal-page .back-link:hover { color: var(--color-bone); }

/* ── Motion ───────────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
