/* ==========================================================================
   AI Image Compressor — Premium design system
   Pure CSS3 · no frameworks · dark & light themes · CSS3 3D hero
   --------------------------------------------------------------------------
   TABLE OF CONTENTS
   01. Design tokens (dark default + light)
   02. Reset & base
   03. Utilities
   04. Buttons
   05. Header & navigation & theme toggle
   06. Hero (aurora background, particles, 3D compression scene)
   07. Sections & headings
   08. Cards: steps, features, formats, tools, use cases, links
   09. Chips & accordion & CTA band
   10. Page head, breadcrumbs, prose (article content)
   11. Tool shell (dropzone, settings, progress, file cards, summary)
   12. Dialog & before/after compare
   13. Toasts, spinner, badges
   14. Forms (contact)
   15. Footer
   16. 404 page
   17. Scroll reveal system
   18. Responsive
   19. Reduced motion
   ========================================================================== */

/* ==========================================================
   01. DESIGN TOKENS
   ========================================================== */
:root {
  /* dark theme (default) */
  --bg: #060913;
  --bg-elev: #0a0e20;
  --bg-deep: #04060d;
  --surface: rgba(148, 158, 255, 0.055);
  --surface-2: rgba(148, 158, 255, 0.1);
  --surface-solid: #0c1126;
  --card-bg: linear-gradient(180deg, rgba(148, 158, 255, 0.075), rgba(148, 158, 255, 0.03));
  --border: rgba(148, 158, 255, 0.14);
  --border-2: rgba(148, 158, 255, 0.3);
  --text: #edf0fc;
  --muted: #a3accf;
  --faint: #7b84ad;

  --primary: #8b5cf6;
  --primary-hi: #a78bfa;
  --primary-soft: rgba(139, 92, 246, 0.16);
  --pink: #d946ef;
  --accent: #22d3ee;
  --accent-ink: #06222b;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --warning: #fbbf24;

  --grad: linear-gradient(115deg, #8b5cf6 0%, #d946ef 52%, #22d3ee 118%);
  --grad-btn: linear-gradient(135deg, #7c3aed, #b026d3);
  --grad-line: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.75), rgba(34, 211, 238, 0.75), transparent);

  --header-bg: rgba(6, 9, 19, 0.72);
  --footer-bg: #04060d;
  --shadow-1: 0 10px 30px -12px rgba(2, 4, 14, 0.75);
  --shadow-2: 0 24px 60px -24px rgba(2, 4, 14, 0.9);
  --glow: 0 12px 44px -10px rgba(139, 92, 246, 0.5);
  --glow-soft: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 14px 50px -14px rgba(139, 92, 246, 0.35);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.35);

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
  --header-h: 68px;
  --container: 1180px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f7fc;
  --bg-elev: #edeff9;
  --bg-deep: #e9ebf6;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-2: rgba(24, 28, 64, 0.05);
  --surface-solid: #ffffff;
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7));
  --border: rgba(24, 28, 64, 0.1);
  --border-2: rgba(24, 28, 64, 0.22);
  --text: #171c38;
  --muted: #4e5678;
  --faint: #7b83a6;

  --primary: #7c3aed;
  --primary-hi: #6d28d9;
  --primary-soft: rgba(124, 58, 237, 0.1);
  --pink: #c026d3;
  --accent: #0891b2;
  --accent-ink: #ffffff;
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.1);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.09);
  --warning: #b45309;

  --grad-btn: linear-gradient(135deg, #7c3aed, #c026d3);
  --header-bg: rgba(255, 255, 255, 0.78);
  --footer-bg: #0a0e20;
  --shadow-1: 0 10px 30px -14px rgba(23, 20, 60, 0.25);
  --shadow-2: 0 24px 60px -28px rgba(23, 20, 60, 0.3);
  --glow: 0 12px 40px -12px rgba(124, 58, 237, 0.4);
  --glow-soft: 0 0 0 1px rgba(124, 58, 237, 0.18), 0 14px 44px -16px rgba(124, 58, 237, 0.28);
  --ring: 0 0 0 3px rgba(124, 58, 237, 0.3);

  color-scheme: light;
}

/* ==========================================================
   02. RESET & BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--primary-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul, ol { padding: 0; }
summary { cursor: pointer; }
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

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

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ==========================================================
   03. UTILITIES
   ========================================================== */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page > main { flex: 1 0 auto; }
.page > .site-footer { margin-top: auto; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 32px);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px; left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.spacer { flex: 1 1 auto; }
.hint { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

/* Callout notices (contact pre-launch note, etc.) */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 34%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.callout svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; color: var(--warning); }
.callout strong { font-weight: 700; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-hi);
}
.kicker::before {
  content: "";
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================
   04. BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:hover { text-decoration: none; }

.btn-lg { padding: 15px 30px; border-radius: 14px; font-size: 1.02rem; }
.btn-sm { padding: 7px 14px; border-radius: 9px; font-size: 0.84rem; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon { padding: 8px; border-radius: 9px; }
.btn-icon svg { width: 17px; height: 17px; }

.btn-primary {
  position: relative;
  background: var(--grad-btn);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, var(--glow);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 16px 54px -10px rgba(139, 92, 246, 0.65); }
.btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }

.btn-outline {
  border-color: var(--border-2);
  background: var(--surface);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-hi); }

.btn-ghost { color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-white {
  background: #fff;
  color: #171c38;
  box-shadow: 0 10px 34px -10px rgba(2, 4, 14, 0.5);
}
.btn-white:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 44px -12px rgba(2, 4, 14, 0.55); }

/* ==========================================================
   05. HEADER & NAVIGATION & THEME TOGGLE
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 30px -18px rgba(2, 4, 14, 0.55);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px -4px rgba(139, 92, 246, 0.6);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-nav { display: flex; align-items: center; gap: 10px; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.site-nav ul a {
  display: block;
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.site-nav ul a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav ul a[aria-current="page"] { color: var(--primary-hi); background: var(--primary-soft); }
.nav-cta { flex: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.3s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); transform: rotate(12deg); }
.theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: opacity 0.25s ease, transform 0.35s ease; }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

.nav-toggle {
  display: none;
  position: relative;
  width: 40px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  place-items: center;
}
.nav-toggle svg { width: 20px; height: 20px; position: absolute; transition: opacity 0.2s ease, transform 0.25s ease; }
.nav-toggle .icon-menu { opacity: 1; }
.nav-toggle .icon-close { opacity: 0; transform: rotate(-90deg); }
.nav-toggle[aria-expanded="true"] .icon-menu { opacity: 0; transform: rotate(90deg); }
.nav-toggle[aria-expanded="true"] .icon-close { opacity: 1; transform: none; }

/* ==========================================================
   06. HERO
   ========================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 104px) clamp(48px, 7vw, 88px);
  isolation: isolate;
}

/* soft aurora backdrop (static gradients — cheap) */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 130%;
  z-index: -2;
  background:
    radial-gradient(42% 38% at 18% 22%, rgba(124, 58, 237, 0.32), transparent 70%),
    radial-gradient(36% 34% at 82% 18%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(46% 44% at 62% 78%, rgba(217, 70, 239, 0.14), transparent 72%);
  pointer-events: none;
}
[data-theme="light"] .hero::before { opacity: 0.5; }

/* faint grid overlay */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

/* animated glow blobs (transform-only) */
.aurora { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  will-change: transform;
}
.aurora .a1 {
  width: 480px; height: 480px;
  left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 65%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora .a2 {
  width: 420px; height: 420px;
  right: -120px; top: -40px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.26), transparent 65%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
.aurora .a3 {
  width: 380px; height: 380px;
  left: 42%; bottom: -200px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.22), transparent 65%);
  animation: drift-a 38s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(70px, 40px, 0) scale(1.15); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-60px, 50px, 0) scale(0.95); }
}

/* floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.9), rgba(167, 139, 250, 0) 70%);
  animation: particle-float var(--pd, 12s) ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.particle.p-cyan { background: radial-gradient(circle, rgba(34, 211, 238, 0.8), rgba(34, 211, 238, 0) 70%); }
.particle.p-pink { background: radial-gradient(circle, rgba(217, 70, 239, 0.8), rgba(217, 70, 239, 0) 70%); }
@keyframes particle-float {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
  50%  { opacity: 0.75; }
  100% { transform: translate3d(var(--px, 20px), calc(var(--py, -28px)), 0) scale(1.25); opacity: 0.4; }
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.hero-kicker svg { width: 15px; height: 15px; color: var(--accent); }
.hero-kicker .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.6rem, 6.4vw, 4.3rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.hero-sub {
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 30px;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* ---------- 3D compression scene ---------- */
.hero-visual {
  position: relative;
  perspective: 1300px;
  display: grid;
  place-items: center;
  min-height: 420px;
}
.hv-scene {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 13 / 11;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 9deg)) rotateY(var(--ry, -13deg));
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.hv-card {
  position: absolute;
  width: clamp(180px, 44%, 232px);
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-solid), var(--bg-elev));
  box-shadow: var(--shadow-2);
  animation: hv-float 7s ease-in-out infinite alternate;
  will-change: transform;
}
.hv-card.hv-original { left: 0; top: 6%; transform: translateZ(46px); }
.hv-card.hv-compressed {
  right: 0; bottom: 4%;
  transform: translateZ(90px);
  animation-duration: 8.5s;
  animation-delay: -3s;
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 26px 70px -26px rgba(34, 211, 238, 0.4), var(--shadow-2);
}
@keyframes hv-float {
  from { margin-top: -9px; }
  to   { margin-top: 9px; }
}

.hv-photo {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.hv-photo svg { width: 100%; height: 100%; }
.hv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 2px;
}
.hv-name {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hv-size {
  flex: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
}
.hv-compressed .hv-size {
  background: var(--success-soft);
  color: var(--success);
}

.hv-badge {
  position: absolute;
  z-index: 2;
  top: -18px; right: -12px;
  transform: translateZ(130px);
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--grad-btn);
  color: #fff;
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  box-shadow: var(--glow);
  animation: hv-float 6s ease-in-out infinite alternate-reverse;
}
.hv-badge small {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* flow connector */
.hv-flow {
  position: absolute;
  left: 12%; right: 12%;
  top: 47%;
  height: 2px;
  transform: translateZ(20px);
}
.hv-flow .line {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--grad-line);
  opacity: 0.85;
}
.hv-flow .dots {
  position: absolute;
  inset: -3px 0;
  overflow: hidden;
}
.hv-flow .dots::before,
.hv-flow .dots::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(34, 211, 238, 0.75);
  animation: flow-dot 2.6s linear infinite;
}
.hv-flow .dots::after { animation-delay: -1.3s; }
@keyframes flow-dot {
  from { left: -4%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  to   { left: 102%; opacity: 0; }
}
.hv-core {
  position: absolute;
  left: 50%; top: 47%;
  translate: -50% -50%;
  transform: translateZ(64px);
  display: grid;
  place-items: center;
  width: 62px; height: 62px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-solid), var(--bg-elev));
  border: 1px solid var(--border-2);
  box-shadow: var(--glow);
}
.hv-core svg {
  width: 30px; height: 30px;
  color: var(--primary-hi);
  animation: core-squeeze 2.6s ease-in-out infinite;
}
@keyframes core-squeeze {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.72) scaleX(1.06); }
}
.hv-core::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 26px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  animation: core-ring 2.6s ease-out infinite;
}
@keyframes core-ring {
  0%   { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}
.hv-label {
  position: absolute;
  z-index: 2;
  left: 50%; top: calc(47% - 58px);
  translate: -50% 0;
  transform: translateZ(140px);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-1);
}

/* floating info chips */
.hv-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  animation: hv-float 9s ease-in-out infinite alternate;
}
.hv-chip svg { width: 14px; height: 14px; color: var(--accent); }
.hv-chip.c1 { left: 4%; bottom: 20%; transform: translateZ(110px); animation-delay: -2s; }
.hv-chip.c2 { right: 2%; top: 12%; transform: translateZ(120px); animation-delay: -5s; }
.hv-chip.c3 { left: 20%; top: -2%; transform: translateZ(80px); animation-delay: -7s; }

/* ==========================================================
   07. SECTIONS & HEADINGS
   ========================================================== */
.section { padding-block: clamp(64px, 8vw, 96px); }
.section-tight { padding-block: clamp(40px, 6vw, 64px); }

.section-alt {
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(124, 58, 237, 0.05), transparent 70%),
    var(--bg-elev);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.72rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 14px 0 14px;
}
.section-head p { color: var(--muted); font-size: 1.02rem; }

/* ==========================================================
   08. CARDS
   ========================================================== */
.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg), var(--surface-solid);
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .card { background: var(--card-bg); }
.card-pad { padding: 26px; }
.card-hover { transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease; }
.card-hover:hover {
  transform: translateY(-5px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-2), var(--glow-soft);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step-card { overflow: visible; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 1.12rem;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px -6px rgba(139, 92, 246, 0.65);
}
.step-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.step-card p { color: var(--muted); font-size: 0.94rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--primary-hi);
  margin-bottom: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card:hover .feature-icon {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px -8px rgba(139, 92, 246, 0.55);
}
.feature-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature-card p { color: var(--muted); font-size: 0.92rem; }

.format-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.format-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px -4px rgba(139, 92, 246, 0.5);
}
.format-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; }
.format-card p { color: var(--muted); font-size: 0.9rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.tool-card h3 { font-size: 1.14rem; font-weight: 700; margin-bottom: 10px; }
.tool-card h3 a { color: var(--text); }
.tool-card h3 a:hover { color: var(--primary-hi); text-decoration: none; }
.tool-card p { color: var(--muted); font-size: 0.93rem; margin-bottom: 18px; }
.go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.92rem;
}
.go svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.go:hover svg { transform: translateX(4px); }

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.link-card {
  display: block;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg), var(--surface-solid);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.25s ease;
}
[data-theme="dark"] .link-card { background: var(--card-bg); }
.link-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-1), var(--glow-soft);
}
.link-card strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 1rem; }
.link-card span { color: var(--muted); font-size: 0.88rem; }

.usecase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.usecase-card { text-align: left; }
.usecase-card .feature-icon { margin-bottom: 14px; }
.usecase-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.usecase-card p { color: var(--muted); font-size: 0.88rem; }

/* format strip under hero */
.format-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}
.fs-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.fs-chip b { color: var(--text); font-weight: 700; }

/* ==========================================================
   09. CHIPS & ACCORDION & CTA BAND
   ========================================================== */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.2s ease;
}
a.chip:hover { border-color: var(--primary); color: var(--primary-hi); text-decoration: none; transform: translateY(-2px); box-shadow: var(--glow-soft); }
button.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--grad-btn);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px -6px rgba(139, 92, 246, 0.65);
}

.accordion {
  display: grid;
  gap: 12px;
}
.accordion details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg), var(--surface-solid);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
[data-theme="dark"] .accordion details { background: var(--card-bg); }
.accordion details[open] { border-color: var(--border-2); }
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  user-select: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--primary-hi); }
.accordion .chev {
  flex: none;
  width: 18px; height: 18px;
  color: var(--faint);
  transition: transform 0.25s ease;
}
.accordion details[open] .chev { transform: rotate(180deg); color: var(--primary-hi); }
.acc-body {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.7;
}
.acc-body a { word-break: break-word; }

.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(44px, 6vw, 72px) clamp(20px, 5vw, 64px);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background:
    radial-gradient(80% 120% at 50% -20%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(60% 90% at 85% 110%, rgba(34, 211, 238, 0.18), transparent 65%),
    var(--surface-solid);
  box-shadow: var(--shadow-2), var(--glow-soft);
}
.cta-band h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.cta-band p { color: var(--muted); max-width: 56ch; margin: 0 auto 26px; }
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--grad-line);
}

/* ==========================================================
   10. PAGE HEAD, BREADCRUMBS, PROSE
   ========================================================== */
.page-head {
  max-width: 800px;
  margin: clamp(20px, 4vw, 36px) auto clamp(20px, 3vw, 28px);
  text-align: center;
}
.page-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 14px;
}
.lede { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.page-head-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.breadcrumbs {
  padding-top: 20px;
  font-size: 0.84rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  color: var(--faint);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 1px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 4px;
  opacity: 0.6;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary-hi); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

.prose {
  max-width: 800px;
  margin-inline: auto;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}
.prose h2 {
  color: var(--text);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.6em 0 0.8em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.prose p { margin-bottom: 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.2em 1.3em; display: grid; gap: 0.45em; }
.prose li::marker { color: var(--primary-hi); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--primary-hi);
}
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 10px 18px;
  margin: 1.4em 0;
  border-radius: 0 12px 12px 0;
  background: var(--primary-soft);
  color: var(--text);
}
.prose hr {
  border: none;
  height: 1px;
  margin: 2.4em 0;
  background: var(--grad-line);
}

.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 700; white-space: nowrap; }
.prose tr:last-child td { border-bottom: none; }

/* ==========================================================
   11. TOOL SHELL
   ========================================================== */
.tool-shell {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg), var(--surface-solid);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
[data-theme="dark"] .tool-shell { background: var(--card-bg); }
.tool-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--grad-line);
  z-index: 1;
}

.tool-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tool-toolbar h2 {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tool-toolbar h2 svg { width: 20px; height: 20px; color: var(--primary-hi); }
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
}
.privacy-pill svg { width: 14px; height: 14px; }

.tool-body {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 3vw, 28px);
}

/* ---------- dropzone ---------- */
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(30px, 5vw, 52px) 20px;
  border: 1.5px dashed var(--border-2);
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(50% 70% at 50% 0%, rgba(124, 58, 237, 0.06), transparent 75%);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background:
    radial-gradient(50% 70% at 50% 0%, rgba(124, 58, 237, 0.14), transparent 75%),
    var(--primary-soft);
}
.dropzone.dragover { transform: scale(1.008); }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone:focus-within {
  outline: 2px solid var(--primary-hi);
  outline-offset: 3px;
}
.dz-icon {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
  margin-bottom: 10px;
  box-shadow: var(--glow);
  transition: transform 0.25s ease;
}
.dropzone:hover .dz-icon, .dropzone.dragover .dz-icon { transform: translateY(-4px) scale(1.05); }
.dz-icon svg { width: 27px; height: 27px; }
.dz-title { font-weight: 700; font-size: 1.05rem; }
.dz-title .browse { color: var(--primary-hi); text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { color: var(--faint); font-size: 0.8rem; }

/* ---------- settings ---------- */
.settings {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: clamp(16px, 2.5vw, 22px);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}
.setting-block { min-width: 0; }
.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 11px;
}
.setting-label .val {
  color: var(--primary-hi);
  font-size: 0.8rem;
  letter-spacing: 0;
  background: var(--primary-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.seg button {
  flex: 1 1 0;
  min-width: max-content;
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.2s ease;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 4px 16px -6px rgba(139, 92, 246, 0.7);
}

.field { display: grid; gap: 7px; }
.field label { font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3accf' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
}
.select:disabled { opacity: 0.55; cursor: not-allowed; }
.input-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}
.field-error {
  display: none;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}
.invalid .field-error, .field-error.visible { display: block; }
.invalid .input, .invalid .textarea { border-color: var(--danger); }

/* range sliders */
input[type="range"] {
  --fill: 50%;
  width: 100%;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) var(--fill), var(--surface-2) var(--fill));
  border: 1px solid var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 10px rgba(2, 4, 14, 0.4);
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 10px rgba(2, 4, 14, 0.4);
}

/* ---------- actions & progress ---------- */
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.progress-wrap { display: none; }
.progress-wrap.visible { display: grid; gap: 8px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.6);
  transition: width 0.3s ease;
}

/* ---------- file cards ---------- */
.file-list-scroll {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding: 2px;
  border-radius: 14px;
  scrollbar-width: thin;
}

.file-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  animation: card-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.file-card:hover { border-color: var(--border-2); }
.file-card.is-processing { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.file-card.is-done { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.file-card.is-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: var(--danger-soft); }

.file-thumb {
  width: 72px; height: 72px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center;
}
.file-info { min-width: 0; display: grid; gap: 3px; }
.file-name {
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  color: var(--faint);
  font-size: 0.78rem;
}
.file-status { color: var(--muted); font-weight: 600; }
.is-done .file-status { color: var(--success); }
.is-processing .file-status { color: var(--primary-hi); }
.error-text, .file-card.is-error .file-status { color: var(--danger); }

.file-result {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}
.result-size { font-weight: 800; font-size: 1.02rem; letter-spacing: -0.02em; }
.result-old { color: var(--faint); font-size: 0.78rem; text-decoration: line-through; }

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- summary bar ---------- */
.summary-bar {
  display: none;
}
.summary-bar.visible {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  background: linear-gradient(90deg, var(--success-soft), transparent 65%), var(--surface);
}
.summary-stat { display: grid; gap: 2px; }
.summary-stat .k {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.summary-stat .v { font-weight: 750; font-size: 1.06rem; letter-spacing: -0.02em; }
.saved-big { color: var(--success); }

/* ==========================================================
   12. DIALOG & COMPARE
   ========================================================== */
.dialog {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  color: var(--text);
  padding: 0;
  width: min(880px, calc(100vw - 32px));
  box-shadow: var(--shadow-2);
}
.dialog::backdrop {
  background: rgba(3, 5, 14, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.dialog-head h3 {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialog-body { padding: 22px; }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.compare-pane { display: grid; gap: 9px; align-content: start; }
.compare-img-wrap {
  aspect-ratio: 4 / 3;
  border-radius: 13px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    repeating-conic-gradient(var(--surface-2) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px;
}
.compare-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.compare-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.error-wrap {
  min-height: 46vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.error-code {
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 40px rgba(139, 92, 246, 0.35));
}

/* ==========================================================
   13. TOASTS, SPINNER, BADGES
   ========================================================== */
.toast-region {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 300;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--primary-hi); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--primary-soft);
  border-top-color: var(--primary-hi);
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-soft); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 32%, transparent); }
.badge-warning { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ==========================================================
   14. FORMS (contact page)
   ========================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}
.contact-side { display: grid; gap: 16px; }
.contact-side h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.contact-side h3 svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--primary-hi);
}
.form-grid { display: grid; gap: 16px; }

/* ==========================================================
   15. FOOTER
   ========================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 80px);
  background: var(--footer-bg);
  color: #b6bdd9;
  border-top: 1px solid rgba(148, 158, 255, 0.12);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: var(--grad-line);
  opacity: 0.9;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
  padding-block: clamp(44px, 6vw, 64px) 36px;
}
.footer-brand .brand { color: #fff; margin-bottom: 16px; }
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #8b93b8;
  max-width: 40ch;
}
.footer-col h3 {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: grid;
  gap: 10px;
}
.footer-col a {
  color: #8b93b8;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 22px;
  border-top: 1px solid rgba(148, 158, 255, 0.1);
  font-size: 0.82rem;
  color: #767ea6;
}

/* ==========================================================
   17. SCROLL REVEAL SYSTEM
   Applied via JS (html.js) — without JS everything stays visible.
   ========================================================== */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ==========================================================
   18. RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {
  .feature-grid, .tool-grid, .link-grid { grid-template-columns: repeat(2, 1fr); }
  .format-grid { grid-template-columns: repeat(2, 1fr); }
  .usecase-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  .footer-grid .footer-col:last-child { grid-column: 2 / -1; }
}

@media (max-width: 960px) {
  .nav-toggle { display: grid; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 18px clamp(16px, 5vw, 32px) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 30px 50px -20px rgba(2, 4, 14, 0.5);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .site-nav.open {
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .site-nav ul a {
    padding: 13px 14px;
    font-size: 1rem;
    border-radius: 12px;
  }
  .nav-cta { justify-content: center; margin-top: 6px; }

  .hero-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-visual { order: 2; min-height: 360px; margin-top: 24px; }
  .hv-scene { max-width: 460px; }
}

@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
  .footer-grid .footer-col:last-child { grid-column: auto; }

  .file-card { grid-template-columns: 56px minmax(0, 1fr); }
  .file-thumb { width: 56px; height: 56px; }
  .file-result { grid-column: 2 / -1; justify-items: start; text-align: left; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }

  .hv-scene { transform: scale(0.92) rotateX(var(--rx, 9deg)) rotateY(var(--ry, -13deg)); }
  .hv-chip.c3 { display: none; }
  .hv-label { display: none; }
}

@media (max-width: 560px) {
  .hero { padding-top: 44px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .feature-grid, .tool-grid, .link-grid, .format-grid, .usecase-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 330px; }
  .hv-scene { max-width: 340px; aspect-ratio: auto; height: 320px; }
  .hv-card { width: clamp(150px, 46%, 190px); }
  .hv-badge { top: -14px; right: -6px; font-size: 0.92rem; padding: 7px 12px; }
  .hv-chip.c1, .hv-chip.c2 { padding: 6px 10px; font-size: 0.68rem; }
  .particle { display: none; }
  .summary-bar.visible { gap: 12px; }
  .summary-stat .v { font-size: 0.96rem; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* Ultra-narrow header: keep brand + theme toggle + menu button on one line (320px) */
@media (max-width: 400px) {
  .header-inner { gap: 8px; }
  .brand { gap: 7px; font-size: 0.9rem; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .brand-mark svg { width: 17px; height: 17px; }
  .header-actions { gap: 5px; }
  .theme-toggle, .nav-toggle { width: 36px; height: 36px; }
}

@media (min-width: 961px) {
  /* gentle mouse parallax handled by JS via --ry/--rx; no extra CSS needed */
}

/* ==========================================================
   19. REDUCED MOTION
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .particle, .aurora span { display: none; }
  .hv-scene { transform: none !important; transition: none !important; }
  .hv-card, .hv-chip, .hv-badge { animation: none !important; }
  .hv-flow .dots::before, .hv-flow .dots::after { animation: none !important; opacity: 0; }
  .hv-core svg, .hv-core::after { animation: none !important; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
