/* ══════════════════════════════════════════════════════════════
   Converted — design system
   Apple HIG–grounded: system typography, semantic color tokens,
   light + dark appearance, materials for the control layer.
   ══════════════════════════════════════════════════════════════ */

/* ── 1. tokens ────────────────────────────────────────────── */

:root {
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Inter", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
               Menlo, Consolas, monospace;

  /* semantic color — light appearance */
  --bg:            #ffffff;   /* under-page background        */
  --bg-tint:       #ffffff;   /* sections stay white — rhythm comes from space */
  --surface:       #ffffff;   /* primary raised surface       */
  --surface-2:     #f8f8fa;   /* secondary fill — barely-there */
  --surface-3:     #efeff3;   /* tertiary fill                */
  --label:         #1d1d1f;   /* primary label                */
  --label-2:       #6e6e73;   /* secondary label  (5.0:1)     */
  --label-3:       #86868b;   /* tertiary label — never body  */
  --separator:     rgba(0, 0, 0, .10);
  --separator-2:   rgba(0, 0, 0, .05);
  --accent:        #0071e3;
  --accent-hover:  #0077ed;
  --accent-soft:   rgba(0, 113, 227, .10);
  --on-accent:     #ffffff;
  --green:         #1d8a4a;
  --red:           #d02b20;

  /* living colour — one accent gradient reused everywhere */
  --grad:      linear-gradient(120deg, #0071e3 0%, #5e5ce6 34%, #bf5af2 66%, #ff375f 100%);
  --grad-text: linear-gradient(90deg, #06b6d4, #0071e3, #bf5af2, #ff375f, #bf5af2, #0071e3, #06b6d4);
  /* the converter's border ring — same calm palette as the light behind it */
  --grad-ring: conic-gradient(from var(--angle), #4f6bff, #7c5cff, #b48cff, #f6b8c4, #f7a64a, #f6b8c4, #a98bff, #4f6bff);
  --glow-a:    rgba(0, 113, 227, .30);
  --glow-b:    rgba(191, 90, 242, .26);
  --glow-c:    rgba(255, 159, 10, .22);
  --fog:       rgba(255, 255, 255, .62);
  --fog-soft:  rgba(255, 255, 255, .22);

  /* material (control layer) */
  --material:      rgba(255, 255, 255, .72);
  --material-edge: rgba(0, 0, 0, .08);

  /* elevation — Apple keeps shadows barely-there */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .05);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .05), 0 18px 48px rgba(0, 0, 0, .09);

  /* geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 980px;

  /* layout */
  --page: 1040px;
  --gutter: 22px;
  --nav-h: 64px;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-liquid: cubic-bezier(.5, 1.8, .3, 1); /* a little overshoot — for the mode-switch thumb only */
}

@media (prefers-color-scheme: dark) {
  .hero__glow span { opacity: .42; }
  :root {
    --bg:            #000000;
    --bg-tint:       #0a0a0c;
    --surface:       #1c1c1e;
    --surface-2:     #2c2c2e;
    --surface-3:     #3a3a3c;
    --label:         #f5f5f7;
    --label-2:       #a1a1a6;
    --label-3:       #8e8e93;
    --separator:     rgba(255, 255, 255, .14);
    --separator-2:   rgba(255, 255, 255, .07);
    --accent:        #0a84ff;
    --accent-hover:  #3d9bff;
    --accent-soft:   rgba(10, 132, 255, .16);
    --green:         #30d158;
    --red:           #ff453a;
    --grad:      linear-gradient(120deg, #0a84ff 0%, #7d7aff 34%, #d17bff 66%, #ff6482 100%);
    --grad-text: linear-gradient(90deg, #22d3ee, #0a84ff, #d17bff, #ff6482, #d17bff, #0a84ff, #22d3ee);
    --glow-a:    rgba(10, 132, 255, .38);
    --glow-b:    rgba(191, 90, 242, .32);
    --glow-c:    rgba(255, 159, 10, .22);
    --fog:       rgba(0, 0, 0, .66);
    --fog-soft:  rgba(0, 0, 0, .24);
    --material:      rgba(22, 22, 24, .72);
    --material-edge: rgba(255, 255, 255, .10);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .5), 0 20px 50px rgba(0, 0, 0, .55);
  }
}

/* increased-contrast context */
@media (prefers-contrast: more) {
  :root { --label-2: #4b4b50; --label-3: #56565a; --separator: rgba(0,0,0,.28); }
  @media (prefers-color-scheme: dark) {
    :root { --label-2: #d8d8dc; --label-3: #c7c7cc; --separator: rgba(255,255,255,.34); }
  }
}

/* the ring angle has to be a typed custom property to animate */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ── 2. base ──────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;              /* HIG default reading size */
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; line-height: 1.08; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
/* `hidden` must win over any class that sets display (grid, inline-flex…) */
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.mono { font-family: var(--font-mono); font-size: .82em; letter-spacing: 0; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 12px 18px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-2);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

/* ── 3. buttons ───────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;          /* ≥44pt touch target */
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 500; letter-spacing: -.01em;
  cursor: pointer; background: none;
  transition: background-color .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .22s var(--ease), opacity .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }

.btn--primary {
  color: #fff;
  background: var(--grad);
  background-size: 220% 100%;
  background-position: 0% 50%;
  box-shadow: 0 4px 16px -4px var(--glow-a);
  transition: background-position .5s var(--ease), box-shadow .3s var(--ease), transform .22s var(--ease), opacity .2s;
}
.btn--primary:hover { background-position: 100% 50%; box-shadow: 0 8px 26px -6px var(--glow-b); }
.btn--primary:disabled {
  opacity: 1; cursor: not-allowed; transform: none;
  background: var(--surface-3); color: var(--label-3); box-shadow: none;
}

.btn--secondary { background: var(--surface-2); color: var(--label); }
.btn--secondary:hover { background: var(--surface-3); }

.btn--outline { border-color: var(--separator); color: var(--label); }
.btn--outline:hover { background: var(--surface-2); }

.btn--sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 30px; font-size: 17px; }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 15px;
}
.link:hover { text-decoration: underline; }

/* ── 4. navigation — no bar, three floating islands ───────── */

.nav {
  position: sticky; top: 0; z-index: 100;
  padding-top: 10px;
  pointer-events: none;            /* the gaps between islands stay clickable */
}
.nav__in {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  height: calc(var(--nav-h) - 10px);
  max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter);
}
.nav__in > *, .nav__sheet { pointer-events: auto; }

/* shared glass for every island */
.nav__brand, .nav__links, .nav__right, .nav__sheet {
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  transition: background-color .35s var(--ease), border-color .35s var(--ease),
              box-shadow .35s var(--ease);
}
.nav__links,
.nav.is-stuck .nav__brand,
.nav.is-stuck .nav__right,
.nav__sheet {
  background: var(--material);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
          backdrop-filter: saturate(160%) blur(12px);
  border-color: var(--material-edge);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -10px rgba(0, 0, 0, .14);
}

.nav__brand {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 16px 0 10px;
  color: var(--label); font-size: 17px; font-weight: 600; letter-spacing: -.02em;
}
.nav__brand:hover { text-decoration: none; }
.nav__mark {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 3px 10px -3px var(--glow-a);
}
.nav__mark svg { width: 13px; height: 13px; color: #fff; }

/* centre island — a segmented control; the pill slides to your section */
.nav__links {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 5px;
}
.nav__links a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; height: 34px; padding: 0 16px;
  border-radius: var(--r-pill);
  color: var(--label-2); font-size: 14px; font-weight: 500; letter-spacing: -.01em;
  transition: color .28s var(--ease);
}
.nav__links a:hover { color: var(--label); text-decoration: none; }
.nav__links a.is-active { color: var(--label); }

.nav__pill {
  position: absolute; top: 5px; left: 0; z-index: 0;
  height: 34px; width: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--separator-2);
  opacity: 0;
  transition: transform .42s var(--ease), width .42s var(--ease), opacity .3s var(--ease);
}
.nav__pill.is-on { opacity: 1; }
.nav__pill::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  background: var(--grad); opacity: .09;
}

.nav__right {
  display: flex; align-items: center; gap: 4px;
  height: 44px; padding: 0 4px 0 6px; margin-left: auto;
}
.nav__right .btn { min-height: 34px; padding: 0 16px; font-size: 14px; }
.nav__right .btn--ghost { color: var(--label); }
.nav__right .btn--ghost:hover { color: var(--accent); }

.nav__burger {
  display: none; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column;
}
.nav__burger span {
  display: block; width: 16px; height: 1.5px; border-radius: 2px; background: var(--label);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav__burger span + span { margin-top: 5px; }
.nav[data-open="true"] .nav__burger span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav[data-open="true"] .nav__burger span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

/* mobile menu — its own floating card under the islands */
.nav__sheet {
  display: none;
  position: absolute; top: calc(100% + 8px); left: var(--gutter); right: var(--gutter);
  border-radius: var(--r-lg);
  overflow: hidden;
  opacity: 0; transform: translateY(-6px) scale(.98); visibility: hidden;
  transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s .35s;
}
.nav[data-open="true"] .nav__sheet {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.nav__sheet ul { padding: 6px 18px; }
.nav__sheet li + li a { border-top: 1px solid var(--separator-2); }
.nav__sheet a {
  display: block; padding: 14px 2px;
  color: var(--label); font-size: 17px;
}
.nav__sheet a:hover { text-decoration: none; color: var(--accent); }

@media (max-width: 860px) {
  .nav__links, .nav__right .btn--ghost { display: none; }
  .nav__sheet { display: block; }
  .nav__burger { display: inline-flex; }
  /* on phones the two remaining islands are always glass */
  .nav__brand, .nav__right {
    background: var(--material);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
            backdrop-filter: saturate(160%) blur(12px);
    border-color: var(--material-edge);
  }
}

/* ── 5. hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(28px, 5vw, 56px)) 0 clamp(40px, 6vw, 72px);
  text-align: center;
}

/* three slow-drifting colour fields behind the converter */
.hero__glow { position: absolute; inset: -10% -5% auto; height: 900px; pointer-events: none; z-index: 0; }
.hero__glow span {
  position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: .30;
  will-change: transform;
}
.hero__glow span:nth-child(1) {
  width: 38vw; height: 38vw; max-width: 500px; max-height: 500px;
  left: 12%; top: 10%; background: var(--glow-a);
  animation: drift-a 22s var(--ease) infinite alternate;
}
.hero__glow span:nth-child(2) {
  width: 34vw; height: 34vw; max-width: 450px; max-height: 450px;
  right: 10%; top: 4%; background: var(--glow-b);
  animation: drift-b 26s var(--ease) infinite alternate;
}
.hero__glow span:nth-child(3) {
  width: 28vw; height: 28vw; max-width: 380px; max-height: 380px;
  left: 44%; top: 40%; background: var(--glow-c);
  animation: drift-c 30s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(9%, 7%, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-11%, 10%, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(6%, -9%, 0) scale(1.15); } }

.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--label-2);
  font-size: 13px; font-weight: 500; letter-spacing: 0;
}
.eyebrow b { color: var(--label); font-weight: 600; }
.eyebrow {
  border: 1px solid var(--separator-2);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.eyebrow i {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none;
}
.eyebrow i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.hero__title {
  margin: 22px 0 0;
  font-size: clamp(42px, 7.2vw, 76px);
  font-weight: 600; letter-spacing: -.03em; line-height: 1.04;
}
.hero__title span {
  display: block;
  background: var(--grad-text);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: flow 10s linear infinite;
}
/* 200% → 0% shifts the tile exactly one width to the right: an endless left-to-right drift */
@keyframes flow {
  from { background-position: 200% 50%; }
  to   { background-position: 0% 50%; }
}
@keyframes hue { to { background-position: 100% 50%; } }

.hero__sub {
  max-width: 33ch; margin: 20px auto 0;
  color: var(--label-2); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.45;
}

.hero__trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  margin-top: 26px;
  color: var(--label-2); font-size: 14px;
}
.hero__trust li { display: inline-flex; align-items: center; gap: 7px; }
.hero__trust svg { width: 15px; height: 15px; color: var(--green); flex: none; }

/* two columns: words on the left, the object on the right */
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center; gap: 24px;
  text-align: left;
}
.hero__copy .hero__title { margin-top: 20px; }
.hero__copy .hero__sub { margin: 20px 0 0; max-width: 30ch; }
.hero__copy .hero__trust { justify-content: flex-start; margin-top: 28px; }

.hero__art {
  position: relative;
  width: 100%; max-width: 540px; aspect-ratio: 1;
  justify-self: end;
}


.hero__art canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  display: block;
  /* the outermost tips dissolve into the page instead of ending on a hard line */
  -webkit-mask-image: radial-gradient(closest-side, #000 68%, rgba(0, 0, 0, .55) 84%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 68%, rgba(0, 0, 0, .55) 84%, transparent 100%);
}
/* milky fog around the silhouette — white on light, a faint mist on dark */
.hero__art::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side,
    transparent 52%,
    var(--fog-soft) 72%,
    var(--fog) 88%,
    transparent 100%);
}
/* colour bloom behind the glass — also the fallback when WebGL is missing */
.hero__art::before {
  content: ""; position: absolute; inset: 16%; border-radius: 50%;
  background: conic-gradient(from 0deg, #06b6d4, #0071e3, #bf5af2, #ff375f, #06b6d4);
  filter: blur(64px); opacity: .32;
  animation: bloom 18s linear infinite;
}
.hero__art.is-live::before { opacity: .24; }
@keyframes bloom { to { transform: rotate(360deg); } }

/* the conversion the core is acting out — a small glass pill under it */
.art-tag {
  position: absolute; left: 50%; bottom: 5%; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--r-pill);
  /* solid, not backdrop-blurred: blur over a WebGL canvas drops out on
     software rendering and some GPUs, and the fog behind it is soft anyway */
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--material-edge);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .25);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--label);
  transform: translateX(-50%);
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.art-tag:empty { display: none; }
.art-tag b { font-weight: 600; }
.art-tag i {
  font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.art-tag.is-swap { opacity: 0; transform: translateX(-50%) translateY(4px); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 0; text-align: center; }
  .hero__art { order: -1; max-width: 300px; justify-self: center; margin-bottom: -8px; }
  .hero__copy .hero__sub { margin-inline: auto; }
  .hero__copy .hero__trust { justify-content: center; }
}

/* ── 6. the converter ─────────────────────────────────────── */

/* ── work modes ─────────────────────────────────────────────
   .has-files — something is in the panel: the page calms down, the
   converter comes to the top, heavy motion stops, everything else
   stays reachable further down.
   .is-working — a conversion is running: nothing but the converter.
   app.js sets both; the logo, "Back to the site", Esc and the
   switch clear them. The layout itself switches in one step; the motion
   is done by app.js (animateMode): the hero fades out, the layout
   flips, and the panel and everything below glide from where they were
   to where they now are (FLIP), then the hero fades back in. */
.has-files .hero { padding-top: calc(var(--nav-h) + clamp(34px, 5vw, 60px)); padding-bottom: 26px; }
.has-files .hero__grid { grid-template-columns: 1fr; gap: 0; text-align: left; }
.has-files .hero__art,
.has-files .hero__copy .eyebrow,
.has-files .hero__sub,
.has-files .hero__trust { display: none; }
.has-files .hero__title { margin-top: 0; font-size: clamp(24px, 3.2vw, 32px); }
.has-files .hero__title span { display: inline; }
.has-files .conv-stage { margin-top: 16px; }
/* let the machine rest while someone is actually working */
.has-files .hero__glow span,
.has-files .ambient span,
.has-files .marquee__track,
.has-files .ribbon__track { animation-play-state: paused; }

.is-working .section,
.is-working .cta,
.is-working .foot { display: none; }

/* the way back out, above the panel */
.conv-exit { display: none; }
.has-files .conv-exit {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 13px; color: var(--label-3);
}
.conv-exit button {
  border: 0; padding: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 500;
}
.conv-exit button:hover { text-decoration: underline; }

/* holds the exit line and the stage together */
.conv-zone { position: relative; }

/* a liquid-glass capsule at the top-right of the page, just under the nav.
   Anchored to the page (not the viewport): it stays at the top and
   scrolls away with it. It sits outside the content, so the mode
   animation never moves it. Squarish rounded tiles, not circles. */
.mode-switch {
  position: absolute; z-index: 90;
  top: calc(var(--nav-h) + 14px);
  right: max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 6px; border-radius: 15px;   /* tile radius + padding, so the corners stay concentric */
  background: var(--material);
  border: 1px solid var(--material-edge);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: var(--shadow-2),
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 0 0 1px rgba(255, 255, 255, .06);
}
@media (prefers-color-scheme: dark) {
  .mode-switch { box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .08); }
}
.mode-switch__thumb {
  position: absolute; left: 6px; top: 6px; width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55));
  box-shadow: 0 2px 10px rgba(0, 113, 227, .30), inset 0 1px 1px rgba(255, 255, 255, .9);
  transition: transform .55s var(--ease-liquid);
}
@media (prefers-color-scheme: dark) {
  .mode-switch__thumb {
    background: linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
    box-shadow: 0 2px 12px rgba(10, 132, 255, .38), inset 0 1px 1px rgba(255, 255, 255, .25);
  }
}
.mode-switch[data-active="work"] .mode-switch__thumb { transform: translateY(41px); }
.mode-switch__opt {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--label-3);
  transition: color .4s var(--ease);
}
.mode-switch__opt svg { width: 17px; height: 17px; }
.mode-switch__opt:hover { color: var(--label-2); }
.mode-switch[data-active="landing"] .mode-switch__opt[data-mode="landing"],
.mode-switch[data-active="work"] .mode-switch__opt[data-mode="work"] { color: var(--accent); }

/* the stage holds the panel and the light behind it (the panel clips its
   own contents, so the glow has to live outside it) */
.conv-stage { position: relative; margin-top: 44px; }
/* a calm palette, not a rainbow: blue → violet → lilac → peach → warm orange,
   and back through lilac so the loop never passes through grey */
.conv-halo {
  position: absolute; inset: -6px; z-index: 0; pointer-events: none;
  border-radius: calc(var(--r-xl) + 6px);
  background: conic-gradient(from var(--angle),
    #4f6bff, #7c5cff, #b48cff, #f6b8c4, #f7a64a, #f6b8c4, #a98bff, #4f6bff);
  filter: blur(24px);
  opacity: .3;
  animation: turn 10s linear infinite;
  /* both ways: it brightens when work starts and settles back when it is done */
  transition: opacity .8s var(--ease);
}
/* a faster copy of the same light, faded in while converting — crossfading
   two layers instead of changing the duration keeps the spin from jumping */
.conv-halo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: conic-gradient(from var(--angle),
    #4f6bff, #7c5cff, #b48cff, #f6b8c4, #f7a64a, #f6b8c4, #a98bff, #4f6bff);
  opacity: 0;
  animation: turn 3.5s linear infinite;
  transition: opacity .8s var(--ease);
}
@media (prefers-color-scheme: dark) { .conv-halo { opacity: .42; } }
/* a file dragged over: a touch brighter */
.conv-stage:has(.conv.is-dragging) .conv-halo { opacity: .4; }
/* converting: same size, a little brighter and spinning faster */
.conv-stage:has(.conv.is-busy) .conv-halo { opacity: .42; }
.conv-stage:has(.conv.is-busy) .conv-halo::after { opacity: 1; }
@media (prefers-color-scheme: dark) {
  .conv-stage:has(.conv.is-busy) .conv-halo { opacity: .55; }
}

.conv {
  position: relative; z-index: 1;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
  text-align: left;
  /* no overflow:hidden — the "All formats" popover has to escape the panel.
     Children keep transparent backgrounds instead, so the corners stay round. */
}

/* the ring: a gradient painted only on the 1.5px border band */
.conv::before {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: inherit; padding: 1.5px;
  background: var(--grad-ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .45;
  pointer-events: none;
  animation: turn 10s linear infinite;         /* in step with the halo behind */
  transition: opacity .4s var(--ease);
}
.conv:focus-within::before, .conv.is-dragging::before, .conv.is-busy::before { opacity: 1; }
.conv.is-busy::before { animation-duration: 2.2s; }
@keyframes turn { to { --angle: 360deg; } }

/* drop area */
.drop {
  position: relative;
  display: grid; place-items: center; gap: 4px;
  padding: 52px 24px 46px;
  cursor: pointer;
  text-align: center;
  transition: background-color .25s var(--ease);
}
.drop::after {
  content: ""; position: absolute; inset: 12px;
  border: 1.5px dashed var(--separator); border-radius: var(--r-lg);
  pointer-events: none;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.drop:hover::after { border-color: var(--label-3); }
.conv.is-dragging .drop::after { border-color: transparent; background: var(--accent-soft); }

.drop__ic {
  width: 56px; height: 56px; border-radius: 18px; margin-bottom: 14px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--label);
  transition: transform .3s var(--ease), background-color .25s var(--ease);
}
.drop__ic svg { width: 26px; height: 26px; }
.drop:hover .drop__ic { transform: translateY(-2px); background: var(--surface-3); }
.conv.is-dragging .drop__ic {
  background: var(--grad); color: #fff; transform: scale(1.08);
  box-shadow: 0 10px 30px -8px var(--glow-b);
}

.drop__t { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.drop__s { color: var(--label-2); font-size: 15px; }
.drop__s u { color: var(--accent); text-decoration: none; }
.drop:hover .drop__s u { text-decoration: underline; }
.drop__hint { margin-top: 10px; color: var(--label-3); font-size: 13px; }

/* file list */
.files { position: relative; padding: 10px 12px 0; }

/* a long batch scrolls inside the panel instead of stretching the page;
   "Add more files" and the action bar stay put below it */
.files ul {
  max-height: min(46vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--separator) transparent;
}
.files ul::-webkit-scrollbar { width: 8px; }
.files ul::-webkit-scrollbar-thumb {
  border: 2px solid transparent; background-clip: content-box;
  border-radius: 8px; background-color: var(--separator);
}
.files ul::-webkit-scrollbar-track { background: transparent; }

.file {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; border-radius: var(--r-md);
  transition: background-color .2s var(--ease);
}
.file + .file { box-shadow: 0 -1px 0 var(--separator-2); }
/* only a row that has just arrived animates in — the rest stay put, so a
   status change never makes the list jump (app.js clears .is-new) */
.js .file.is-new { animation: rowin .45s var(--ease) backwards; animation-delay: var(--i, 0ms); }
@keyframes rowin { from { opacity: 0; transform: translateY(6px); } }
.file:hover { background: var(--surface-2); }

/* done / failed: one quiet sweep across the row, then nothing */
.file[data-state="done"], .file[data-state="failed"] { animation: file-land .7s var(--ease); }
@keyframes file-land {
  0%   { background: color-mix(in srgb, var(--green) 14%, transparent); }
  100% { background: transparent; }
}
.file[data-state="failed"] { animation-name: file-land-bad; }
@keyframes file-land-bad {
  0%   { background: color-mix(in srgb, #ff375f 12%, transparent); }
  100% { background: transparent; }
}

.file__ic {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); color: var(--label-2);
}
.file__ic svg { width: 21px; height: 21px; }
.file__ic img { width: 100%; height: 100%; object-fit: cover; }

.file__body { min-width: 0; flex: 1; }
.file__name {
  font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file__meta {
  margin-top: 2px; color: var(--label-2); font-size: 13px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.file__meta em { font-style: normal; color: var(--label-3); }

/* status is never colour-only — every state carries a glyph + word */
.file__state { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.file__state svg { width: 13px; height: 13px; flex: none; }
.file__state[data-s="done"]   { color: var(--green); }
.file__state[data-s="failed"] { color: var(--red); }

.file__spin {
  width: 13px; height: 13px; flex: none;
  border: 1.5px solid var(--separator); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.file__act { display: flex; align-items: center; gap: 6px; flex: none; }

.iconbtn {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--label-3);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.iconbtn:hover { background: var(--surface-3); color: var(--label); }
.iconbtn svg { width: 15px; height: 15px; }

/* when the list can actually scroll (.can-scroll from app.js), the footer
   overlaps the last row a little and fades/blurs what slides under it, as
   a "there's more below" hint. A short list (one file, nothing hidden)
   gets plain padding instead — nothing to hint at, nothing to blur. */
.files__foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px;
}
.files.can-scroll .files__foot {
  margin-top: -18px; padding-top: 20px;
  background: linear-gradient(to bottom, transparent, var(--surface) 62%);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.files__foot .link { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; }
.files__foot svg { width: 14px; height: 14px; }
.files__note { color: var(--label-3); font-size: 13px; }

/* a finished batch: nothing left to choose, only "Convert more" */
.conv.is-finished .quick,
.conv.is-finished .picker,
.conv.is-finished .opts__btn { display: none; }
.conv.is-finished .conv__bar { gap: 0; }

/* recent files — finished batches under the panel, work view only.
   Same rows as the panel (.file), on a quieter surface of their own. */
.recent { display: none; }
.has-files .recent:not([hidden]) {
  display: block;
  position: relative; z-index: 1;
  margin-top: 28px;
}
.recent__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 0 4px 10px;
}
.recent__title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.recent__note { color: var(--label-3); font-size: 13px; }
.recent__list {
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
}
.recent__left { color: var(--label-3); font-variant-numeric: tabular-nums; }

/* action bar */
.conv__bar {
  display: grid; gap: 14px;
  padding: 16px 18px 18px;
  background: transparent;                 /* the panel's own white shows; corners stay round */
  border-top: 1px solid var(--separator);
}

/* row one: pick the target in a single click */
.quick { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quick__lb { color: var(--label-2); font-size: 13px; font-weight: 500; flex: none; }
.quick__list {
  display: flex; gap: 6px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; padding: 2px;
  scroll-snap-type: x proximity;
}
.quick__list::-webkit-scrollbar { display: none; }

.qfmt {
  position: relative; scroll-snap-align: start;
  min-height: 38px; padding: 0 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--separator); border-radius: var(--r-pill);
  background: var(--surface); color: var(--label);
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .3s var(--ease);
}
.qfmt::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  background: var(--grad); opacity: 0;
  transition: opacity .3s var(--ease);
}
.qfmt span { position: relative; z-index: 1; }
.qfmt:hover { transform: translateY(-1px); border-color: transparent; }
.qfmt:hover::before { opacity: .12; }
.qfmt[aria-pressed="true"] {
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px -4px var(--glow-a);
}
.qfmt[aria-pressed="true"]::before { opacity: 1; }
.qfmt--more { font-weight: 500; color: var(--label-2); }
.qfmt:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* row two: what will happen, and the button that does it */
.conv__go { display: flex; align-items: center; gap: 14px; }
.conv__go .btn--primary { margin-left: auto; flex: none; }

.recap { min-width: 0; color: var(--label-2); font-size: 13px; }
.recap b { color: var(--label); font-weight: 600; }
.recap__arrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; margin-right: 2px;
  border-radius: var(--r-pill); background: var(--surface);
  border: 1px solid var(--separator-2);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0;
}
.recap__arrow i { font-style: normal; color: var(--label-3); }

.picker { position: relative; }
.picker__btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--separator); border-radius: var(--r-pill);
  background: var(--surface); color: var(--label);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color .2s, background-color .2s, opacity .2s;
}
.picker__btn:hover:not(:disabled) { border-color: var(--label-3); }
.picker__btn:disabled { opacity: .45; cursor: not-allowed; }
.picker__btn svg { width: 11px; height: 11px; color: var(--label-2); transition: transform .25s var(--ease); }
.picker__btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* format popover */
.pop {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 60;
  width: min(360px, calc(100vw - 44px));
  background: var(--surface);
  border: 1px solid var(--separator); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transform-origin: bottom right;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.pop[hidden] { display: none; }

.pop__search { padding: 12px 12px 8px; }
.pop__search input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--separator); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 15px;
  -webkit-appearance: none; appearance: none;
}
.pop__search input::placeholder { color: var(--label-3); }
.pop__search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.pop__body { max-height: 300px; overflow-y: auto; padding: 0 12px 12px; overscroll-behavior: contain; }
.pop__group + .pop__group { margin-top: 14px; }
.pop__gt {
  padding: 6px 2px; color: var(--label-3);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.pop__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.fmt {
  min-height: 40px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--separator); border-radius: var(--r-sm);
  background: var(--surface); color: var(--label);
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s;
}
.fmt:hover { background: var(--surface-2); }
.fmt[aria-selected="true"] {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px -4px var(--glow-a);
}
.pop__empty { padding: 22px 4px; color: var(--label-2); font-size: 15px; text-align: center; }
/* who the popover is choosing for — a group ("3 images") or one file */
.pop__for {
  padding: 2px 2px 10px; font-size: 12px; color: var(--label-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pop__for b { color: var(--label); font-weight: 600; }
/* a file with its own format can go back to following its group */
.pop__reset {
  display: block; width: 100%; margin-bottom: 12px; padding: 9px 12px;
  border: 1px dashed var(--separator); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--accent);
  font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background-color .2s;
}
.pop__reset:hover { background: var(--accent-soft); }

/* conversion settings — the same popover shell, a slider and a switch */
.opts__btn { flex: none; }
.opts__btn svg { width: 14px; height: 14px; color: var(--label-2); }
.opts__btn[aria-expanded="true"] svg { transform: none; }
.opts { width: min(320px, calc(100vw - 44px)); padding: 16px 18px 18px; overflow: visible; }
.opts__head { display: flex; align-items: baseline; justify-content: space-between;
  color: var(--label); font-size: 14px; font-weight: 500; }
.opts__head output { color: var(--accent); font-variant-numeric: tabular-nums; }
.opts input[type="range"] { display: block; width: 100%; margin-top: 12px; accent-color: var(--accent); cursor: pointer; }
.opts__hint { margin-top: 8px; color: var(--label-3); font-size: 12px; line-height: 1.45; }
.opts__row { transition: opacity .25s var(--ease); }
.opts__row.is-off { opacity: .45; }
.opts__switch {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--separator-2); cursor: pointer;
}
.opts__switch b { display: block; color: var(--label); font-size: 14px; font-weight: 500; }
.opts__switch small { display: block; margin-top: 2px; color: var(--label-3); font-size: 12px; }
.opts__switch input { position: absolute; opacity: 0; pointer-events: none; }
.opts__switch i {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px;
  background: var(--surface-3); transition: background-color .25s var(--ease);
}
.opts__switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease);
}
.opts__switch input:checked + i { background: var(--accent); }
.opts__switch input:checked + i::after { transform: translateX(16px); }
.opts__switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* per-file format chip in each row — follows the group until the file
   gets its own (then it is tinted and tagged OWN) */
.file__fmt {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 0 10px; border-radius: var(--r-pill);
  border: 1px solid var(--separator); background: var(--surface); color: var(--label);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0;
  cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.file__fmt:hover { border-color: var(--label-3); }
.file__fmt i { font-style: normal; color: var(--label-3); }
.file__fmt.is-empty { border-style: dashed; color: var(--label-3); }
.file__fmt.is-own { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.file__fmt em {
  font-style: normal; font-family: var(--font); font-size: 9px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #fff;
}
.file__fmt:disabled { opacity: .5; cursor: default; }

/* several file types in one batch: the bar shows one picker per group */
.grp {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 12px 0 6px; border-radius: var(--r-pill);
  border: 1px solid var(--separator); background: var(--surface); color: var(--label);
  font-size: 13px; cursor: pointer;
  transition: border-color .2s, box-shadow .3s var(--ease);
}
.grp:hover { border-color: var(--label-3); box-shadow: 0 6px 16px -10px var(--glow-a); }
.grp__ic {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface-2);
}
.grp__ic svg { width: 14px; height: 14px; }
.grp__lb { color: var(--label-2); font-weight: 500; white-space: nowrap; }
.grp i { font-style: normal; color: var(--label-3); }
.grp b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.grp:not(.is-empty) b {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.grp.is-empty { border-style: dashed; }
.grp.is-empty b { color: var(--accent); }
.grp__chev { width: 11px; height: 11px; color: var(--label-3); }
.grp:disabled { opacity: .5; cursor: default; }

/* status line */
.conv__status {
  padding: 0 18px 16px;
  background: transparent;
  color: var(--label-2); font-size: 13px;
}
.conv__status:empty { display: none; }
.conv__status[data-tone="error"] { color: var(--red); }

/* progress */
.bar { height: 3px; background: var(--separator-2); overflow: hidden; }
.bar__fill {
  position: relative; overflow: hidden;
  height: 100%; width: 0; background: var(--grad); background-size: 200% 100%;
  transition: width .4s var(--ease);
  animation: hue 2.4s linear infinite alternate;
}
.bar__fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.bar[hidden] { display: none; }

/* ── 7. sections ──────────────────────────────────────────── */

.section { padding: clamp(64px, 9vw, 116px) 0; }
.section--tint { background: var(--bg-tint); }

.section__head { max-width: 640px; margin-bottom: clamp(34px, 5vw, 56px); }
.section__head--mid { margin-inline: auto; text-align: center; }
.section__eyebrow {
  color: var(--label-3); font-size: 13px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.section__title {
  margin-top: 12px;
  font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.028em;
}
.section__sub { margin-top: 14px; color: var(--label-2); font-size: 19px; line-height: 1.45; }

/* ambient colour — blurred fields drifting behind every section */
/* no per-section clipping — fields bleed into neighbours, so no seams */
main { overflow-x: clip; }
.section, .cta { position: relative; }
.section > .wrap, .cta > .wrap { position: relative; z-index: 1; }

.ambient { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.ambient span {
  position: absolute; border-radius: 50%;
  width: 42vw; height: 42vw; max-width: 560px; max-height: 560px;
  filter: blur(120px); opacity: .20;
  will-change: transform;
}
.ambient span:nth-child(1) { background: var(--glow-a); animation: drift-a 24s var(--ease) infinite alternate; }
.ambient span:nth-child(2) { background: var(--glow-b); animation: drift-b 28s var(--ease) infinite alternate; }
.ambient span:nth-child(3) { background: var(--glow-c); animation: drift-c 32s var(--ease) infinite alternate; }

/* left-leaning: blue top-left, violet bottom-right */
.ambient--l span:nth-child(1) { left: -12%; top: -8%; }
.ambient--l span:nth-child(2) { right: -10%; bottom: -14%; }
/* right-leaning: mirrored, with a warm accent */
.ambient--r span:nth-child(1) { right: -12%; top: -6%; }
.ambient--r span:nth-child(2) { left: -8%; bottom: -16%; }
.ambient--r span:nth-child(3) { left: 38%; top: 30%; width: 26vw; height: 26vw; opacity: .14; }
/* centred: a soft bloom behind a single statement */
.ambient--c span:nth-child(1) { left: 14%; top: 12%; }
.ambient--c span:nth-child(2) { right: 12%; top: 18%; }
.ambient--c span:nth-child(3) { left: 36%; bottom: -10%; }

@media (prefers-color-scheme: dark) {
  .ambient span { opacity: .46; }
  .ambient--r span:nth-child(3) { opacity: .32; }
}

/* generic card */
.card {
  position: relative;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: 0;
  border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.card > * { position: relative; z-index: 1; }
.cat:hover::before { opacity: .75; }

.card__h { margin-top: 16px; font-size: 19px; }
.card__p { margin-top: 8px; color: var(--label-2); font-size: 15px; line-height: 1.5; }

.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* steps */
.step__n {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad); color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px -5px var(--glow-a);
}

/* ── how it works: each card plays its own step ────────────
   One 9s loop shared by all three; --at shifts a card into its
   3s window (0s / 3s / 6s). Base styles are the FINAL state, so a
   card that is not animating (reduced motion, before it starts)
   still reads as a finished step. */
.how { --loop: 9s; }
.how::before { animation: how-ring var(--loop) var(--ease) infinite; animation-delay: var(--at); }
.how .step__n { animation: how-num var(--loop) var(--ease) infinite; animation-delay: var(--at); }
@keyframes how-ring { 0% { opacity: 0; } 4%, 30% { opacity: .9; } 38%, 100% { opacity: 0; } }
@keyframes how-num  { 0%, 100% { transform: none; } 4% { transform: scale(1.14); } 9% { transform: none; } }

/* progress under each step, stories-style: done steps full, the current one
   filling over its 3s, upcoming ones empty; all reset together at the loop.
   Runs on the shared timeline (no --at delay) so bar n fills exactly while
   card n plays. Base = full, the finished state. */
.how { padding-bottom: 44px; }
.how::after {
  content: ""; position: absolute; left: 26px; right: 26px; bottom: 18px;
  height: 3px; border-radius: 3px;
  background: var(--grad) 0 0 / 100% 100% no-repeat, var(--separator);
  animation: var(--loop) linear infinite;
}
.how:nth-child(1)::after { animation-name: how-prog-1; }
.how:nth-child(2)::after { animation-name: how-prog-2; }
.how:nth-child(3)::after { animation-name: how-prog-3; }
@keyframes how-prog-1 { 0% { background-size: 0% 100%, auto; } 33.333%, 100% { background-size: 100% 100%, auto; } }
@keyframes how-prog-2 { 0%, 33.333% { background-size: 0% 100%, auto; } 66.666%, 100% { background-size: 100% 100%, auto; } }
@keyframes how-prog-3 { 0%, 66.666% { background-size: 0% 100%, auto; } 100% { background-size: 100% 100%, auto; } }
.js .how:not(.is-in)::after { animation-play-state: paused; }

.how__demo {
  position: relative; height: 132px; margin-bottom: 22px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--separator-2);
  overflow: hidden;
}
.how__demo *,
.how__demo *::before,
.how__demo *::after {
  /* !important on both: each element's own `animation:` shorthand further down
     would otherwise reset iteration-count to 1 and the demos play only once */
  animation-delay: var(--at) !important;
  animation-iteration-count: infinite !important;
}
/* start the loop only once the card is on screen */
.js .how:not(.is-in)::before,
.js .how:not(.is-in) .step__n,
.js .how:not(.is-in) .how__demo *,
.js .how:not(.is-in) .how__demo *::before,
.js .how:not(.is-in) .how__demo *::after { animation-play-state: paused; }

/* 1 · drop — a file falls into the zone, the zone lights up, the type is read */
.dd__zone {
  position: absolute; inset: 12px;
  border: 1.5px dashed var(--separator); border-radius: 12px;
}
.dd__zone::before, .dd__zone::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit;
}
.dd__zone::before { background: var(--accent-soft); opacity: .35; animation: dd-zone var(--loop) var(--ease); }
.dd__zone::after {
  padding: 1.5px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .35; animation: dd-zone var(--loop) var(--ease);
}
@keyframes dd-zone { 0%, 12% { opacity: 0; } 15%, 32% { opacity: 1; } 44%, 92% { opacity: .35; } 98%, 100% { opacity: 0; } }

.dd__file {
  position: absolute; left: 50%; top: 42%;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 7px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--separator);
  box-shadow: var(--shadow-1);
  transform: translate(-50%, -50%);
  animation: dd-file var(--loop) var(--ease);
  white-space: nowrap;
}
.dd__file i {
  font-style: normal; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0;
  padding: 3px 6px; border-radius: 6px; background: var(--grad); color: #fff;
}
.dd__file b { font-size: 12px; font-weight: 500; }
@keyframes dd-file {
  0%        { opacity: 0; transform: translate(-50%, calc(-50% - 52px)) rotate(-10deg); }
  5%        { opacity: 1; transform: translate(-50%, calc(-50% - 44px)) rotate(-8deg); }
  13%       { transform: translate(-50%, calc(-50% + 3px)) rotate(1deg); }
  16%, 93%  { opacity: 1; transform: translate(-50%, -50%); }
  98%, 100% { opacity: 0; transform: translate(-50%, -50%); }
}

.dd__state { position: absolute; left: 0; right: 0; bottom: 20px; height: 16px; text-align: center; }
.dd__state em {
  position: absolute; inset: 0; font-style: normal; font-size: 11px; color: var(--label-2);
}
.dd__state em:first-child { opacity: 0; animation: dd-s1 var(--loop) linear; }
.dd__state em:last-child  { color: var(--green); font-weight: 600; animation: dd-s2 var(--loop) linear; }
@keyframes dd-s1 { 0%, 6% { opacity: 0; } 9%, 17% { opacity: 1; } 20%, 100% { opacity: 0; } }
@keyframes dd-s2 { 0%, 18% { opacity: 0; } 22%, 93% { opacity: 1; } 97%, 100% { opacity: 0; } }

/* 2 · choose — a highlight scans the formats and settles on JPG */
.dp__from {
  position: absolute; top: 22px; left: 0; right: 0; text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; color: var(--label-2);
}
.dp__from i { font-style: normal; color: var(--label-3); }
.dp__row {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 52px); gap: 6px;
}
.dp__chip {
  position: relative; z-index: 1;
  display: grid; place-items: center; height: 32px;
  border: 1px solid var(--separator); border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 11px; font-weight: 600; color: var(--label-2);
}
.dp__chip--pick { color: #fff; background: transparent; border-color: transparent; animation: dp-pick var(--loop) linear; }
@keyframes dp-pick {
  0%, 26%   { color: var(--label-2); background: var(--surface); border-color: var(--separator); }
  30%, 93%  { color: #fff; background: transparent; border-color: transparent; }
  97%, 100% { color: var(--label-2); background: var(--surface); border-color: var(--separator); }
}
.dp__pill {
  position: absolute; z-index: 2; left: 0; top: 0; width: 52px; height: 32px;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1.5px var(--accent), 0 6px 18px -6px var(--glow-a);
  animation: dp-pill var(--loop) var(--ease);
}
.dp__pill::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--grad);
  animation: dp-fill var(--loop) linear;
}
/* the fill sits under the chip text: pill is above chips only as a ring */
.dp__chip--pick { z-index: 3; }
@keyframes dp-pill {
  0%        { opacity: 0; transform: translateX(58px); }
  6%        { opacity: 1; transform: translateX(58px); }
  12%       { transform: translateX(116px); }
  18%       { transform: translateX(174px); }
  26%, 93%  { opacity: 1; transform: translateX(0); }
  98%, 100% { opacity: 0; transform: translateX(0); }
}
@keyframes dp-fill { 0%, 25% { opacity: 0; } 30%, 93% { opacity: 1; } 97%, 100% { opacity: 0; } }

/* 3 · take it away — progress fills, a check lands, Download wakes up */
.dt__row {
  position: absolute; left: 14px; right: 14px; top: 18px;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--separator);
  box-shadow: var(--shadow-1);
}
.dt__ic {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); color: var(--label-2);
  font-style: normal; font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0;
}
.dt__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.dt__body b { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt__bar { height: 4px; border-radius: 4px; background: var(--separator-2); overflow: hidden; }
.dt__bar span {
  display: block; height: 100%; width: 100%; border-radius: inherit;
  background: var(--grad); animation: dt-bar var(--loop) var(--ease);
}
@keyframes dt-bar { 0%, 4% { width: 0; } 22%, 93% { width: 100%; } 97%, 100% { width: 0; } }
.dt__done {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: #fff;
  animation: dt-done var(--loop) var(--ease);
}
.dt__done svg { width: 12px; height: 12px; }
@keyframes dt-done {
  0%, 22%   { opacity: 0; transform: scale(0); }
  26%       { opacity: 1; transform: scale(1.2); }
  29%, 93%  { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; transform: scale(0); }
}
.dt__btn {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 600;
  animation: dt-btn var(--loop) var(--ease);
}
.dt__btn svg { width: 12px; height: 12px; }
@keyframes dt-btn {
  0%, 24%   { opacity: .3; box-shadow: 0 0 0 0 var(--glow-b); }
  28%       { opacity: 1; box-shadow: 0 0 0 0 var(--glow-b); }
  34%       { box-shadow: 0 0 0 12px transparent; }
  93%       { opacity: 1; }
  97%, 100% { opacity: .3; }
}

/* converter cards */
.cat { display: flex; flex-direction: column; height: 100%; color: inherit; cursor: pointer; }
.cat:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-1); }
.cat__ic {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--label);
  transition: background-color .35s var(--ease), color .35s var(--ease),
              transform .45s var(--ease), box-shadow .35s var(--ease);
}
.cat__ic svg { width: 22px; height: 22px; }
.cat:hover .cat__ic {
  background: var(--grad); color: #fff;
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 8px 22px -8px var(--glow-a);
}
.cat__top { display: flex; align-items: center; justify-content: space-between; }
.tag {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--label-2);
  font-size: 12px; font-weight: 500;
}
.cat__list { margin: 16px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.cat__list span {
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--label-2);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
  transition-delay: calc(var(--i, 0) * 35ms);          /* chips light up one after another */
}
.cat:hover .cat__list span { background: var(--accent-soft); color: var(--accent); transform: translateY(-1px); }

/* ── living category icons ─────────────────────────────────
   Each glyph moves in its own small way, in place: the sun rises over
   the hills, text lines write themselves, cells fill in, bars bounce,
   the camera's lens winks, the zipper runs. Scoped to .cat__ic, so the
   same glyphs in the converter's file list stay still. They run while
   the grid is on screen (.is-playing, set by app.js) and freeze
   otherwise and under reduced motion. !important on delay/play-state
   because each part's own `animation:` shorthand below would reset them. */
.cat__ic svg * { transform-box: fill-box; transform-origin: center; }
.cat__ic svg * {
  animation-delay: calc(var(--o, 0s) + var(--n, 0) * .28s) !important;
  animation-play-state: paused !important;
}
.is-playing .cat__ic svg * { animation-play-state: running !important; }

.cat__ic .ai-sun   { animation: ai-sun 3.2s var(--ease) infinite; }
.cat__ic .ai-hills { animation: ai-hills 3.2s var(--ease) infinite; }
.cat__ic .ai-line  { stroke-dasharray: 1; animation: ai-write 3.2s var(--ease) infinite; }
.cat__ic .ai-cell  { fill: currentColor; stroke: none; opacity: 0; animation: ai-cell 3.2s var(--ease) infinite; }
.cat__ic .ai-bar   { animation: ai-bar .9s ease-in-out infinite alternate; }
.cat__ic .ai-play  { transform-origin: left center; animation: ai-play 1.6s var(--ease) infinite; }
.cat__ic .ai-zip   { stroke-dasharray: 1.2 1.4; animation: ai-zip 1.2s linear infinite; }

@keyframes ai-sun   { 0%, 100% { transform: translateY(2.4px); opacity: .35; } 45%, 70% { transform: none; opacity: 1; } }
@keyframes ai-hills { 0%, 100% { transform: none; } 50% { transform: translateY(-.6px); } }
@keyframes ai-write { 0%, 8% { stroke-dashoffset: 1; } 38%, 78% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 1; } }
@keyframes ai-cell  { 0%, 10% { opacity: 0; } 28%, 72% { opacity: .9; } 90%, 100% { opacity: 0; } }
@keyframes ai-bar   { from { transform: scaleY(.45); } to { transform: scaleY(1.1); } }
@keyframes ai-play  { 0%, 55%, 100% { transform: none; } 70% { transform: scaleX(1.25); } }
@keyframes ai-zip   { to { stroke-dashoffset: -2.6; } }

/* card foot: the conversion the card is acting out right now, and the action */
.cat__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--separator-2);
}
.cat__live { position: relative; flex: 1; min-width: 0; height: 24px; overflow: hidden; }
.cat__pair {
  position: absolute; left: 0; top: 0; height: 24px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; color: var(--label-2);
  white-space: nowrap;
  animation: pair-in .45s var(--ease) both;
}
.cat__pair b { font-weight: 600; color: var(--label); }
.cat__pair i {
  font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cat__pair.is-out { animation: pair-out .42s var(--ease) both; }
@keyframes pair-in  { from { opacity: 0; transform: translateY(12px); } }
@keyframes pair-out { to   { opacity: 0; transform: translateY(-12px); } }

.cat__go {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 13px; font-weight: 600;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.cat__go svg { width: 14px; height: 14px; }
/* pointer devices: the action appears on hover; touch keeps it visible */
@media (hover: hover) {
  .cat__go { opacity: 0; transform: translateX(-6px); }
  .cat:hover .cat__go, .cat:focus-visible .cat__go { opacity: 1; transform: none; }
}

/* popular pairs — two rows drifting in opposite directions, fading at the edges */
.pairs { margin-top: 40px; }
.pairs__lb { color: var(--label-3); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.marquee {
  display: grid; gap: 6px; margin-top: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee__row { overflow: hidden; padding-block: 6px; }   /* room for the hover shadow */
.marquee__track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.marquee__row--rev .marquee__track { animation-direction: reverse; animation-duration: 54s; }
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__set { display: flex; gap: 8px; padding-right: 8px; }   /* padding = gap, so -50% is exact */
@keyframes marquee { to { transform: translateX(-50%); } }

/* no motion: one static, wrapping set per row */
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track { width: auto; animation: none !important; }
  .marquee__set { flex-wrap: wrap; }
  .marquee__set[aria-hidden] { display: none; }
}
.pair {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--separator); border-radius: var(--r-pill);
  background: var(--surface); color: var(--label);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.pair:hover { background: var(--surface-2); border-color: transparent; text-decoration: none;
  box-shadow: 0 0 0 1px var(--accent-soft), 0 6px 18px -8px var(--glow-a); }
.pair:active { transform: scale(.97); }
.pair em { font-style: normal; color: var(--label-3); font-weight: 400; }

/* statement — every word starts faint and inks in as you scroll past it
   (app.js wraps the words in .w and toggles .is-on) */
.statement {
  max-width: 24ch; margin-inline: auto; text-align: center;
  font-size: clamp(28px, 4vw, 48px); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.16;
}
.statement b, .statement span { display: block; font-weight: 600; }
.statement b { color: var(--label); }
.statement span { margin-top: .3em; color: var(--label-2); }
.statement .w {
  font-style: normal;
  color: color-mix(in srgb, var(--label) 16%, transparent);
  transition: color .45s var(--ease);
}
.statement b .w.is-on    { color: var(--label); }
.statement span .w.is-on { color: var(--label-2); }

/* metrics — small cards: a living glyph, a number that counts in, a label */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: clamp(44px, 6vw, 72px);
}
.metric {
  display: flex; flex-direction: column;
  padding: 22px;
  background: var(--surface); border: 1px solid var(--separator); border-radius: var(--r-lg);
}
.metric__n {
  display: block; font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.metric__l { display: block; margin-top: 6px; color: var(--label-2); font-size: 14px; }

/* the glyphs run only while the metrics are on screen (.is-playing from
   app.js); base styles are the finished frames */
.metric__viz { display: flex; align-items: center; gap: 5px; height: 36px; margin-bottom: 14px; }
.metric__viz * { animation-play-state: paused !important; }
.metrics.is-playing .metric__viz * { animation-play-state: running !important; }

.mv-formats i {
  display: block; width: 14px; height: 14px; border-radius: 4px;
  background: var(--grad); background-size: 500% 100%; background-position: calc(var(--k) * 25%) 0;
  animation: mv-hop 2.4s var(--ease) infinite;
  animation-delay: calc(var(--k) * .14s);
}
@keyframes mv-hop { 0%, 40%, 100% { transform: none; } 20% { transform: translateY(-7px) rotate(12deg); } }

.mv-size i { display: block; flex: 1; height: 8px; border-radius: 8px; background: var(--separator-2); overflow: hidden; }
.mv-size b { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--grad); animation: mv-fill 3.2s var(--ease) infinite; }
@keyframes mv-fill { 0% { width: 0; opacity: 1; } 60%, 88% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }

.mv-timer svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.mv-timer circle { fill: none; stroke: var(--separator); stroke-width: 3; }
.mv-timer .mv-timer__run {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: mv-drain 6s linear infinite;
}
@keyframes mv-drain { to { stroke-dashoffset: 1; } }

.mv-zero svg { width: 32px; height: 32px; color: var(--label-2); }
.mv-zero__slash { stroke: #ff375f; stroke-width: 2; stroke-dasharray: 1; animation: mv-slash 3s var(--ease) infinite; }
@keyframes mv-slash { 0%, 10% { stroke-dashoffset: 1; } 35%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }

/* ribbon — every supported format drifting past in giant faint type */
.ribbon {
  position: relative; z-index: 1;
  margin-top: clamp(48px, 7vw, 88px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ribbon__track { display: flex; width: max-content; animation: marquee 90s linear infinite; }
.ribbon__set {
  padding-right: .6em; white-space: nowrap; word-spacing: .25em;
  font-size: clamp(34px, 5vw, 64px); font-weight: 600; letter-spacing: -.03em;
  color: var(--label); opacity: .07;
}
@media (prefers-color-scheme: dark) { .ribbon__set { opacity: .1; } }
@media (prefers-reduced-motion: reduce) { .ribbon__track { animation: none !important; } }

/* privacy — the four rules, each with a small living icon */
.privacy { display: block; }

/* privacy rules — rows with a living icon, hairline separated */
.rules { border-top: 1px solid var(--separator); }
.rule {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; row-gap: 4px;
  padding: 20px 0; border-bottom: 1px solid var(--separator);
}
.rule__ic {
  grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--label);
  transition: background-color .35s var(--ease), color .35s var(--ease), transform .45s var(--ease);
}
.rule__ic svg { width: 20px; height: 20px; }
.rule:hover .rule__ic { background: var(--grad); color: #fff; transform: rotate(-6deg); }
.rule__h { font-size: 17px; }
.rule__p { color: var(--label-2); font-size: 15px; max-width: 58ch; }

/* icon motion — runs while the section is on screen (.is-playing on .privacy) */
.rule__ic svg * { transform-box: fill-box; transform-origin: center; animation-play-state: paused !important; }
.privacy.is-playing .rule__ic svg * { animation-play-state: running !important; }
.rule__ic .pr-hand  { transform-box: view-box; transform-origin: 12px 12px; animation: pr-hand 6s linear infinite; }
.rule__ic .pr-slash { stroke: #ff375f; stroke-width: 1.9; stroke-dasharray: 1; animation: pr-slash 3.4s var(--ease) infinite; }
.rule__ic .pr-ghost { animation: pr-ghost 3.4s var(--ease) infinite; }
.rule__ic .pr-lid   { transform-origin: 20% 100%; animation: pr-lid 2.8s var(--ease) infinite; }
@keyframes pr-hand  { to { transform: rotate(360deg); } }
@keyframes pr-slash { 0%, 10% { stroke-dashoffset: 1; } 38%, 82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes pr-ghost { 0%, 100% { opacity: 1; transform: none; } 45%, 60% { opacity: .15; transform: translateY(-1.5px) scale(.94); } }
@keyframes pr-lid   { 0%, 55%, 100% { transform: none; } 68% { transform: translateY(-1.5px) rotate(-16deg); } 80% { transform: none; } }

/* faq — a sticky heading on the left, the questions on the right */
.faq {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px); align-items: start;
}
.faq__head { position: sticky; top: calc(var(--nav-h) + 24px); margin-bottom: 0; }
.faq__more { margin-top: 22px; font-size: 15px; color: var(--label-2); }
.faq__more a { font-weight: 500; }
@media (max-width: 900px) {
  .faq { grid-template-columns: 1fr; gap: 8px; }
  .faq__head { position: static; }
}

.qa { border-top: 1px solid var(--separator); }
.q { border-bottom: 1px solid var(--separator); }
.q__s {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 2px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 500; letter-spacing: -.015em;
}
.q__s::-webkit-details-marker { display: none; }
.q__s:hover { color: var(--accent); }
.q__i {
  position: relative; width: 18px; height: 18px; flex: none;
  transition: transform .3s var(--ease);
}
.q__i::before, .q__i::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  width: 13px; height: 1.6px; border-radius: 2px; background: var(--label-2);
  transform: translate(-50%, -50%);
}
.q__i::after { transform: translate(-50%, -50%) rotate(90deg); transition: opacity .3s var(--ease); }
/* the icon and the answer follow .is-open (set by app.js the moment
   you click); without JS the native [open] state drives them */
.q.is-open .q__i, html:not(.js) .q[open] .q__i { transform: rotate(90deg); }
.q.is-open .q__i::after, html:not(.js) .q[open] .q__i::after { opacity: 0; }
.q__a { padding: 0 44px 22px 2px; color: var(--label-2); font-size: 16px; line-height: 1.55; }
.js .q__a { opacity: 0; transform: translateY(-4px); transition: opacity .3s var(--ease), transform .36s var(--ease); }
.js .q.is-open .q__a { opacity: 1; transform: none; transition-delay: .06s; }

/* closing call */
.cta { padding: clamp(72px, 10vw, 128px) 0; text-align: center; }
.cta__h { font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -.03em; }
.cta__p { margin: 14px auto 30px; max-width: 46ch; color: var(--label-2); font-size: 19px; }

/* the closing button: a slow turning light behind it, same palette as the
   converter's halo, weaker — the end of the page rhymes with its start */
.cta__btn { position: relative; display: inline-block; }
.cta__halo {
  position: absolute; inset: -7px -13px; z-index: 0; pointer-events: none;
  border-radius: var(--r-pill);
  background: conic-gradient(from var(--angle),
    #4f6bff, #7c5cff, #b48cff, #f6b8c4, #f7a64a, #f6b8c4, #a98bff, #4f6bff);
  filter: blur(16px);
  opacity: .45;
  animation: turn 12s linear infinite;
  transition: opacity .45s var(--ease);
}
@media (prefers-color-scheme: dark) { .cta__halo { opacity: .55; } }
.cta__btn:hover .cta__halo { opacity: .62; }
/* app.js writes transform here, so the button keeps its own shadow/colour */
.cta__btn .btn { position: relative; z-index: 1; will-change: transform; }

/* ── 7b. inner pages — privacy, help, about ───────────────── */

/* the page title block, sitting under the floating nav like the hero */
.page-head {
  position: relative;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 76px)) 0 clamp(36px, 5vw, 56px);
}
.page-head .section__head { margin-bottom: 0; }
.page-head .section__title { font-size: clamp(36px, 5.6vw, 58px); }
.page-head__meta { margin-top: 18px; color: var(--label-3); font-size: 14px; }

/* long text: contents pinned on the left, the text on the right */
.doc {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 84px); align-items: start;
  padding-bottom: clamp(64px, 9vw, 116px);
}
.doc__toc { position: sticky; top: calc(var(--nav-h) + 28px); }
.doc__toc-h {
  color: var(--label-3); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.doc__toc ol { margin-top: 12px; border-left: 1px solid var(--separator); }
.doc__toc a {
  display: block; margin-left: -1px; padding: 6px 0 6px 14px;
  border-left: 1px solid transparent;
  color: var(--label-2); font-size: 14px; line-height: 1.35;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.doc__toc a:hover { color: var(--label); text-decoration: none; }
.doc__toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

.prose { max-width: 680px; color: var(--label-2); font-size: 17px; line-height: 1.65; }
.prose > section + section { margin-top: 52px; }
.prose h2 {
  color: var(--label); font-size: 25px; letter-spacing: -.02em; line-height: 1.25;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}
.prose h3 { margin-top: 26px; color: var(--label); font-size: 17px; }
.prose p, .prose ul { margin-top: 14px; }
.prose ul { padding-left: 20px; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--label-3); }
.prose strong { color: var(--label); font-weight: 600; }
.prose__lead { color: var(--label); font-size: 20px; line-height: 1.5; }
.note {
  margin-top: 18px; padding: 16px 20px;
  border-radius: var(--r-md); border: 1px solid var(--separator-2);
  background: var(--surface-2); font-size: 15px; line-height: 1.55;
}
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; }
  .doc__toc { position: static; }
}

/* help — a search, the topics as cards, then the answers by topic */
.help-search { position: relative; max-width: 580px; margin: 30px auto 0; }
.help-search svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  z-index: 1;   /* the field's blur makes it its own layer, which would paint over the icon */
  width: 18px; height: 18px; color: var(--label-3); pointer-events: none;
}
.help-search input {
  width: 100%; height: 56px; padding: 0 22px 0 50px;
  border: 1px solid var(--material-edge); border-radius: var(--r-pill);
  background: var(--material);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
          backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -10px rgba(0, 0, 0, .14);
  color: var(--label); font: inherit; font-size: 17px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.help-search input::placeholder { color: var(--label-3); }
.help-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.help-search input::-webkit-search-cancel-button { cursor: pointer; }
.help-popular { margin-top: 16px; text-align: center; color: var(--label-3); font-size: 14px; }
.help-popular a { margin-left: 10px; color: var(--label-2); }
.help-popular a:hover { color: var(--accent); }

.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.topic { display: flex; flex-direction: column; color: inherit; }
.topic:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-1); }
.topic:hover::before { opacity: .75; }
.topic:hover .cat__ic {
  background: var(--grad); color: #fff;
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 8px 22px -8px var(--glow-a);
}
.topic__n { margin-top: auto; padding-top: 14px; color: var(--label-3); font-size: 13px; }
@media (max-width: 900px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .topics { grid-template-columns: 1fr; } }

.help-popular--left { margin-top: 12px; text-align: left; }
.help-popular--left a { margin: 0 18px 0 0; }
.help-empty { padding: 40px 0; text-align: center; color: var(--label-2); font-size: 17px; }

/* suggestions under the search field */
.hs-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  padding: 6px; border-radius: 20px; text-align: left;
  background: var(--surface); border: 1px solid var(--material-edge);
  box-shadow: var(--shadow-2);
}
.hs-item, .hs-all { display: block; padding: 10px 14px; border-radius: 14px; color: var(--label); }
.hs-item b { display: block; font-weight: 500; font-size: 15px; }
.hs-item small { display: block; margin-top: 2px; color: var(--label-3); font-size: 13px; }
.hs-item:hover, .hs-item.is-on, .hs-all:hover, .hs-all.is-on { background: var(--surface-2); text-decoration: none; }
.hs-all { margin-top: 4px; border-top: 1px solid var(--separator-2); border-radius: 0 0 14px 14px;
  color: var(--accent); font-size: 14px; font-weight: 500; }
.hs-none { padding: 12px 14px; color: var(--label-2); font-size: 15px; }

/* topic and article pages: a smaller head with the search beside it */
.page-head--sm { padding-bottom: clamp(28px, 4vw, 44px); }
.page-head--sm .section__title { font-size: clamp(30px, 4.4vw, 46px); }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.help-search--sm { flex: 0 1 360px; margin: 0; }
.help-search--sm input { height: 46px; font-size: 15px; padding-left: 44px; }
.help-search--sm svg { left: 16px; width: 16px; height: 16px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
  color: var(--label-3); font-size: 14px; }
.crumbs a { color: var(--label-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs i { font-style: normal; color: var(--label-3); opacity: .6; }
.crumbs span { color: var(--label-3); }

/* a list of articles: title, one line, a chevron */
.art-list { border-top: 1px solid var(--separator); }
.art-list--wide { max-width: 820px; }
.art-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 4px; border-bottom: 1px solid var(--separator); color: var(--label);
}
.art-row:hover { text-decoration: none; }
.art-row b { display: block; font-size: 17px; font-weight: 500; transition: color .25s var(--ease); }
.art-row small { display: block; margin-top: 4px; color: var(--label-2); font-size: 14px; }
.art-row__go { flex: none; width: 16px; height: 16px; color: var(--label-3);
  transition: transform .3s var(--ease), color .25s var(--ease); }
.art-row:hover b, .art-row:hover .art-row__go { color: var(--accent); }
.art-row:hover .art-row__go { transform: translateX(3px); }
.more-topics { margin-top: clamp(40px, 6vw, 64px); }

/* the article itself */
.art-title { color: var(--label); font-size: clamp(30px, 4vw, 42px); letter-spacing: -.028em; line-height: 1.12; margin-bottom: 22px; }
.prose ol.steps { margin-top: 18px; padding: 0; list-style: none; counter-reset: step; }
.prose ol.steps li { position: relative; padding-left: 44px; counter-increment: step; }
.prose ol.steps li + li { margin-top: 14px; }
.prose ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600;
}
.prose .fmts { margin-top: 18px; border-top: 1px solid var(--separator); }
.prose .fmts dt { padding-top: 14px; color: var(--label); font-weight: 600; font-size: 15px; }
.prose .fmts dd { margin: 4px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--separator); font-size: 16px; }
.helpful {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px;
  margin-top: 48px; padding: 18px 22px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--separator-2);
}
.helpful p { margin: 0; color: var(--label); font-size: 15px; font-weight: 500; }
.helpful__btns { display: flex; gap: 8px; }
.prose .helpful__thanks { color: var(--label-2); font-weight: 400; }
.related { margin-top: 52px; }
.related h2 { margin-bottom: 14px; font-size: 20px; }
@media (max-width: 900px) {
  .doc--article .doc__toc { order: 2; }
}

/* a quiet closing block: where to go when the answers ran out */
.reach {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.reach__h { font-size: 22px; letter-spacing: -.02em; }
.reach__p { margin-top: 6px; color: var(--label-2); font-size: 15px; }

/* about — principles and plain facts */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--separator); border-bottom: 1px solid var(--separator);
}
.fact { padding: 28px 20px 26px 0; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--separator); }
.fact__n {
  display: block; font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.fact__l { display: block; margin-top: 6px; color: var(--label-2); font-size: 14px; }
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--separator); }
}

/* ── 8. footer ────────────────────────────────────────────── */

.foot { position: relative; z-index: 1;   /* sits above any glow bleeding down */
  padding: 44px 0 52px; background: var(--bg); border-top: 1px solid var(--separator);
  overflow: hidden; }                     /* clips the sunken wordmark below */

/* the name across the bottom: fades out downwards, its last third cut off by
   the page edge. Colour drifts along the letters — visible only if you linger. */
.foot__mark {
  margin: clamp(26px, 5vw, 52px) 0 -.3em;
  font-size: clamp(72px, 17vw, 240px); font-weight: 600;
  letter-spacing: -.045em; line-height: .84; text-align: center; white-space: nowrap;
  pointer-events: none; -webkit-user-select: none; user-select: none;
  /* held still: violet on the left, warm orange on the right */
  background: linear-gradient(90deg, #7c5cff, #b48cff, #f6b8c4, #f7a64a);
  /* the drifting version — swap these three lines back in to restart it:
  background: linear-gradient(90deg, #4f6bff, #7c5cff, #b48cff, #f6b8c4, #f7a64a, #b48cff, #4f6bff);
  background-size: 200% 100%;
  animation: flow 26s linear infinite;
  */
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: .16;
  -webkit-mask-image: linear-gradient(#000 32%, transparent 92%);
          mask-image: linear-gradient(#000 32%, transparent 92%);
}
@media (prefers-color-scheme: dark) { .foot__mark { opacity: .22; } }
@media (prefers-reduced-motion: reduce) { .foot__mark { animation: none !important; } }
.foot__cols {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px;
}
.foot__h { color: var(--label); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.foot__cols li + li { margin-top: 9px; }
.foot__cols a { color: var(--label-2); font-size: 13px; }
.foot__cols a:hover { color: var(--label); }
.foot__about { color: var(--label-2); font-size: 13px; max-width: 30ch; margin-top: 12px; }
.foot__base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--separator);
  color: var(--label-3); font-size: 12px;
}
.foot__base nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot__base a { color: var(--label-3); }

/* ── 8b. toasts ───────────────────────────────────────────── */

/* a stack of glass cards sliding in from the right edge — same material
   as the popovers, fixed to the viewport so they sit above everything
   and stay put while the page scrolls */
.toasts {
  position: fixed; z-index: 200;
  right: var(--gutter); bottom: var(--gutter);   /* the screen corner, not the content column */
  display: flex; flex-direction: column-reverse; gap: 10px;
  width: min(360px, calc(100vw - 2 * var(--gutter)));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 14px 16px; border-radius: var(--r-md);
  background: var(--material); border: 1px solid var(--material-edge);
  -webkit-backdrop-filter: saturate(140%) blur(9px);
          backdrop-filter: saturate(140%) blur(9px);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  opacity: 0; transform: translateX(24px) scale(.98);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast__ic { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--label-3); }
.toast.is-error .toast__ic { color: var(--red); }
.toast__msg { flex: 1; min-width: 0; color: var(--label); font-size: 14px; line-height: 1.45; }
.toast__x {
  flex: none; width: 22px; height: 22px; margin: -3px -3px 0 0; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--label-3); cursor: pointer;
  transition: background-color .2s, color .2s;
}
.toast__x svg { width: 11px; height: 11px; }
.toast__x:hover { background: var(--surface-3); color: var(--label); }
@media (max-width: 640px) {
  .toasts { left: var(--gutter); right: var(--gutter); width: auto; bottom: 14px; }
  .toast { transform: translateY(16px) scale(.98); }
}

/* ── 9. motion ────────────────────────────────────────────── */

/* hidden only once JS is confirmed — without it the page reads normally */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__glow span, .ambient span, .hero__art::before, .conv::before, .conv-halo, .conv-halo::after, .bar__fill, .bar__fill::after,
  .hero__title span, .metric__n, .eyebrow i::after, .js .file { animation: none !important; }
  /* the how-it-works demos force infinite loops with !important — stop them
     outright here, their base styles are the finished frames */
  .how::before, .how::after, .how .step__n,
  .how__demo *, .how__demo *::before, .how__demo *::after { animation: none !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ── 10. adaptivity ───────────────────────────────────────── */

@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 30px 18px; }
  .foot__cols { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

@media (max-width: 620px) {
  :root { --gutter: 18px; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .hero__sub { max-width: 26ch; }
  .conv { border-radius: var(--r-lg); }
  .drop { padding: 42px 18px 38px; }
  .quick__lb { display: none; }
  .conv__go { flex-wrap: wrap; }
  .recap { width: 100%; }
  .conv__bar .btn--primary { width: 100%; margin-left: 0; }
  .pop { width: min(340px, calc(100vw - 36px)); }
  .statement { max-width: none; }
}
