/* =====================================================================
   VideoGrab — style.css  ·  Exaggerated Minimalism (monochrome)
   Black / white / gray · statement typography · generous whitespace.
   Light default + inverted dark mode (theme toggle preserved).
   All JS-facing IDs & class hooks are kept intact.
   ===================================================================== */

/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; color: inherit; }
input  { font-family: inherit; outline: none; }
code   { font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace; }
a { color: inherit; }
::selection { background: var(--text); color: var(--bg); }

/* ── Design tokens ────────────────────────────────────────────────── */
:root {
  /* neutral ramp — light */
  --bg:            #ffffff;
  --bg-2:          #fafafa;
  --bg-3:          #f4f4f5;
  --text:          #0a0a0a;
  --text-2:        #52525b;   /* the muted half of two-tone headings */
  --muted:         #71717a;   /* body copy */
  --subtle:        #a1a1aa;
  --border:        #e7e7ea;
  --border-2:      #d4d4d8;
  --card:          #ffffff;
  --chip:          #f4f4f5;   /* icon-chip background */
  --chip-border:   #e4e4e7;

  --solid:         #0a0a0a;   /* primary button / footer */
  --solid-text:    #ffffff;
  --solid-hover:   #262626;

  --footer-bg:     #0a0a0a;
  --footer-text:   #a1a1aa;
  --footer-head:   #ffffff;

  --link:          #2563eb;
  --ring:          rgba(10, 10, 10, .14);

  --success:       #16a34a;
  --success-bg:    rgba(22, 163, 74, .10);
  --error:         #dc2626;
  --error-bg:      rgba(220, 38, 38, .09);
  --warn:          #d97706;
  --warn-bg:       rgba(217, 119, 6, .10);

  /* accent kept neutral-dark for this theme */
  --accent:        #0a0a0a;
  --accent-lt:     #18181b;
  --accent-bg:     #f4f4f5;
  --accent-glow:   rgba(10, 10, 10, .12);

  /* shadows — very restrained */
  --shadow-xs:     0 1px 2px rgba(9, 9, 11, .05);
  --shadow-sm:     0 1px 3px rgba(9, 9, 11, .06), 0 1px 2px rgba(9, 9, 11, .04);
  --shadow-md:     0 4px 12px rgba(9, 9, 11, .07), 0 2px 4px rgba(9, 9, 11, .04);
  --shadow-lg:     0 12px 32px rgba(9, 9, 11, .1), 0 4px 8px rgba(9, 9, 11, .05);

  /* radii */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  /* motion */
  --ease:        cubic-bezier(.4, 0, .2, 1);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --t:      .2s var(--ease);
  --t-slow: .5s var(--ease-out);
}

[data-theme="dark"] {
  --bg:            #0a0a0a;
  --bg-2:          #101012;
  --bg-3:          #17171a;
  --text:          #fafafa;
  --text-2:        #a1a1aa;
  --muted:         #a1a1aa;
  --subtle:        #71717a;
  --border:        #232327;
  --border-2:      #333338;
  --card:          #111113;
  --chip:          #1a1a1e;
  --chip-border:   #2a2a30;

  --solid:         #fafafa;
  --solid-text:    #0a0a0a;
  --solid-hover:   #e4e4e7;

  --footer-bg:     #000000;
  --footer-text:   #a1a1aa;
  --footer-head:   #ffffff;

  --link:          #60a5fa;
  --ring:          rgba(250, 250, 250, .22);

  --accent:        #fafafa;
  --accent-lt:     #fafafa;
  --accent-bg:     #1a1a1e;
  --accent-glow:   rgba(250, 250, 250, .14);

  --shadow-xs:     0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, .6);
  --shadow-md:     0 4px 14px rgba(0, 0, 0, .55);
  --shadow-lg:     0 16px 40px rgba(0, 0, 0, .65);

  --success-bg:    rgba(22, 163, 74, .16);
  --error-bg:      rgba(220, 38, 38, .16);
  --warn-bg:       rgba(217, 119, 6, .16);
}

/* ── Layout helpers ───────────────────────────────────────────────── */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

/* ── Header ───────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.header.scrolled { background: color-mix(in srgb, var(--bg-2) 96%, transparent); box-shadow: var(--shadow-xs); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}

/* Text wordmark (no icon) */
.logo { display: inline-flex; align-items: baseline; gap: 2px; text-decoration: none; }
.logo-name {
  font-size: 1.15rem; font-weight: 800; letter-spacing: -.035em; color: var(--text);
  transition: opacity var(--t);
}
.logo-name .dot { color: var(--muted); }
.logo:hover .logo-name { opacity: .7; }

/* Nav */
.main-nav { display: flex; align-items: center; gap: clamp(4px, 1.6vw, 8px); flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  position: relative; display: inline-flex; align-items: center;
  min-height: 38px; padding: 6px 12px; border-radius: 8px;
  font-size: .88rem; font-weight: 500; color: var(--muted);
  text-decoration: none; white-space: nowrap;
  transition: color var(--t), background var(--t);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--text); background: var(--bg-3); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 9px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t), border-color var(--t), transform .3s var(--ease-spring);
}
.theme-toggle:hover { background: var(--bg-3); color: var(--text); transform: rotate(20deg); }
.theme-toggle:active { transform: rotate(20deg) scale(.92); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── Main ─────────────────────────────────────────────────────────── */
.main { padding: 0; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: clamp(56px, 11vw, 104px) 0 clamp(28px, 5vw, 40px); }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 500; color: var(--muted);
  padding: 5px 14px 5px 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-2);
  margin-bottom: 28px;
  animation: fadeUp .6s var(--ease-out) both;
}
.hero-eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(22,163,74,.5);
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); }
  70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

.hero-title {
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  font-weight: 800; letter-spacing: -.05em; line-height: .98;
  color: var(--text);
  max-width: 14ch; margin: 0 auto 26px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word {
  display: inline-block;
  animation: wordUp .8s var(--ease-out) both;
}
.hero-title .muted { color: var(--text-2); }
.hero-title .line:nth-child(1) .word { animation-delay: .05s; }
.hero-title .line:nth-child(2) .word { animation-delay: .13s; }
@keyframes wordUp { from { opacity: 0; transform: translateY(105%); } to { opacity: 1; transform: none; } }

.hero-sub {
  font-size: clamp(1rem, 2.3vw, 1.15rem); color: var(--muted);
  line-height: 1.6; max-width: 560px; margin: 0 auto 20px;
  animation: fadeUp .7s var(--ease-out) .28s both;
}
.hero-platforms {
  font-size: .84rem; color: var(--subtle); letter-spacing: .01em;
  animation: fadeUp .7s var(--ease-out) .36s both;
}
.hero-platforms b { color: var(--muted); font-weight: 600; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Cards (generic) ──────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t);
  animation: cardIn .5s var(--ease-out) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* The interactive tool cards live in a tighter column */
.tool { max-width: 760px; margin-inline: auto; }

/* ── URL card ─────────────────────────────────────────────────────── */
.url-card { padding: 22px; box-shadow: var(--shadow-md); }

.platform-badge {
  display: none; align-items: center; gap: 8px; margin-bottom: 14px;
  animation: chip-in .3s var(--ease-out) both;
}
.platform-badge.visible { display: flex; }
@keyframes chip-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.platform-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--text); flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent);
}
.platform-name { font-size: .74rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .09em; }
.platform-dot.youtube{background:#ff0000;box-shadow:0 0 0 3px rgba(255,0,0,.18)}
.platform-dot.tiktok{background:#ff0050;box-shadow:0 0 0 3px rgba(255,0,80,.18)}
.platform-dot.instagram{background:#e1306c;box-shadow:0 0 0 3px rgba(225,48,108,.18)}
.platform-dot.facebook{background:#1877f2;box-shadow:0 0 0 3px rgba(24,119,242,.18)}
.platform-dot.twitter{background:#1da1f2;box-shadow:0 0 0 3px rgba(29,161,242,.18)}
.platform-dot.vimeo{background:#1ab7ea;box-shadow:0 0 0 3px rgba(26,183,234,.18)}
.platform-dot.reddit{background:#ff4500;box-shadow:0 0 0 3px rgba(255,69,0,.18)}
.platform-dot.twitch{background:#9146ff;box-shadow:0 0 0 3px rgba(145,70,255,.18)}
.platform-dot.dailymotion{background:#0066dc;box-shadow:0 0 0 3px rgba(0,102,220,.18)}
.platform-dot.soundcloud{background:#ff5500;box-shadow:0 0 0 3px rgba(255,85,0,.18)}
.platform-dot.bilibili{background:#00a1d6;box-shadow:0 0 0 3px rgba(0,161,214,.18)}
.platform-dot.pinterest{background:#e60023;box-shadow:0 0 0 3px rgba(230,0,35,.18)}

.url-row { display: flex; gap: 10px; align-items: stretch; }
.url-field-wrap { position: relative; flex: 1; }
.url-field-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--subtle); pointer-events: none; transition: color var(--t);
}
.url-input {
  width: 100%; height: 54px; padding: 0 46px 0 46px;
  background: var(--bg); border: 1px solid var(--border-2);
  border-radius: var(--radius-md); color: var(--text); font-size: .98rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.url-input::placeholder { color: var(--subtle); }
.url-input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.url-field-wrap:focus-within .url-field-icon { color: var(--text); }

.url-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 7px; background: var(--bg-3); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t), transform var(--t);
}
.url-clear:hover { background: var(--error-bg); color: var(--error); transform: translateY(-50%) rotate(90deg); }
.url-clear svg { width: 13px; height: 13px; }

.url-hint { margin-top: 12px; font-size: .8rem; color: var(--subtle); line-height: 1.5; }
.url-hint code { color: var(--muted); font-size: .76rem; background: var(--bg-3); padding: 1px 6px; border-radius: 5px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 54px; padding: 0 26px; border-radius: var(--radius-md);
  font-size: .92rem; font-weight: 600; white-space: nowrap;
  transition: background var(--t), box-shadow var(--t), transform var(--t), opacity var(--t);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform var(--t); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.btn-primary, .btn-download {
  background: var(--solid); color: var(--solid-text); box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--solid-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:hover:not(:disabled) svg:last-child { transform: translateX(2px); }
.btn-primary.loading { pointer-events: none; opacity: .7; }

.btn-download { width: 100%; height: 56px; font-size: .96rem; }
.btn-download:hover:not(:disabled) { background: var(--solid-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-download:disabled { background: var(--bg-3); color: var(--subtle); box-shadow: none; cursor: not-allowed; }

.btn-spinner {
  width: 17px; height: 17px; border: 2px solid color-mix(in srgb, var(--solid-text) 30%, transparent);
  border-top-color: var(--solid-text); border-radius: 50%; animation: spin .7s linear infinite;
}

/* ── Skeleton ─────────────────────────────────────────────────────── */
.skeleton-card { display: flex; gap: 22px; align-items: flex-start; }
.skeleton-thumb { width: 210px; height: 120px; border-radius: var(--radius-md); flex-shrink: 0; position: relative; overflow: hidden; background: var(--bg-3); }
.skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.skeleton-line { height: 13px; border-radius: 99px; position: relative; overflow: hidden; background: var(--bg-3); }
.skeleton-chips { display: flex; gap: 10px; margin-top: 8px; }
.skeleton-chip { width: 84px; height: 42px; border-radius: var(--radius-sm); position: relative; overflow: hidden; background: var(--bg-3); }
.skeleton-thumb::after, .skeleton-line::after, .skeleton-chip::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s var(--ease) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Video info card ──────────────────────────────────────────────── */
.video-meta { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 28px; }
.video-thumb-wrap { position: relative; flex-shrink: 0; width: 210px; }
.video-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-md);
  border: 1px solid var(--border); transition: transform var(--t);
}
.video-thumb-wrap:hover .video-thumb { transform: scale(1.02); }
.video-duration-badge {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.82); color: #fff;
  font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 3px 8px;
  border-radius: 6px; letter-spacing: .02em; backdrop-filter: blur(4px);
}
.video-details { flex: 1; min-width: 0; }
.video-platform-row { margin-bottom: 10px; }
.video-platform-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  background: var(--chip); border: 1px solid var(--chip-border); padding: 4px 10px; border-radius: 99px;
}
.video-title { font-size: 1.14rem; font-weight: 700; line-height: 1.35; color: var(--text); margin-bottom: 12px; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.video-uploader { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }

/* ── Format selection ─────────────────────────────────────────────── */
.format-section { margin-bottom: 24px; }
.format-heading { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }
.format-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.format-card {
  --stagger: 0ms;
  flex: 0 0 auto; min-width: 104px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius-md);
  cursor: pointer; text-align: center; position: relative; overflow: hidden;
  transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t);
  animation: chipPop .4s var(--ease-spring) both; animation-delay: var(--stagger);
}
@keyframes chipPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.format-card:hover { border-color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.format-card.selected { border-color: var(--text); background: var(--bg-2); box-shadow: 0 0 0 1px var(--text); }
.format-card.selected::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
  animation: pop-check .3s var(--ease-spring) both;
}
[data-theme="dark"] .format-card.selected::after { background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat; }
@keyframes pop-check { from { transform: scale(0); } to { transform: scale(1); } }
.format-card.audio-card .format-icon { color: var(--success); }
.format-icon { width: 22px; height: 22px; margin: 0 auto 8px; color: var(--muted); transition: color var(--t); }
.format-card.selected .format-icon { color: var(--text); }
.format-label { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px; }
.format-meta { font-size: .72rem; color: var(--muted); }
.format-ext { display: inline-block; background: var(--chip); color: var(--subtle); font-size: .64rem; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; margin-top: 5px; }

.download-row { display: flex; gap: 12px; }

/* ── Progress card ────────────────────────────────────────────────── */
.progress-card { padding: 24px 26px; box-shadow: var(--shadow-md); }
.progress-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.progress-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px; background: var(--chip);
  border: 1px solid var(--chip-border); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.progress-spin { width: 22px; height: 22px; color: var(--text); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-label { font-size: .96rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.progress-stats { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress-bar-track { width: 100%; height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress-bar-fill {
  height: 100%; background: var(--text); border-radius: 99px; transition: width .4s var(--ease-out); position: relative; overflow: hidden;
}
.progress-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg) 45%, transparent), transparent);
  transform: translateX(-100%); animation: barsweep 1.4s var(--ease) infinite;
}
@keyframes barsweep { to { transform: translateX(100%); } }
.progress-footer { display: flex; justify-content: space-between; align-items: center; }
.progress-pct { font-size: .86rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.progress-eta { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Toasts ───────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 9999; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 13px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); max-width: 350px; pointer-events: all;
  animation: toastIn .4s var(--ease-spring) both;
}
.toast.removing { animation: toastOut .28s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(44px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(44px) scale(.94); } }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.toast-dot.success { background: var(--success); }
.toast-dot.error   { background: var(--error); }
.toast-dot.info    { background: var(--text); }
.toast-dot.warn    { background: var(--warn); }
.toast-body { flex: 1; }
.toast-title { font-size: .84rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.toast-msg { font-size: .79rem; color: var(--muted); line-height: 1.45; }
.toast-close { width: 24px; height: 24px; border-radius: 7px; background: var(--bg-3); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--t), color var(--t), transform var(--t); }
.toast-close:hover { background: var(--error-bg); color: var(--error); transform: rotate(90deg); }
.toast-close svg { width: 11px; height: 11px; }

/* ── Cookie / FFmpeg banners ──────────────────────────────────────── */
.cookie-banner {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-size: .84rem; line-height: 1.5; margin-bottom: 18px; flex-wrap: wrap;
  animation: cardIn .5s var(--ease-out) both;
}
.cookie-banner.has-cookies { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 32%, transparent); }
.cookie-banner svg { color: var(--muted); flex-shrink: 0; }
.cookie-banner.has-cookies svg { color: var(--success); }
.cookie-banner-text { flex: 1; min-width: 0; }
.cookie-banner strong { color: var(--text); }
.cookie-banner.has-cookies strong { color: var(--success); }
.cookie-upload-btn { display: inline-flex; align-items: center; padding: 6px 14px; background: var(--solid); color: var(--solid-text); border-radius: 8px; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background var(--t), transform var(--t); }
.cookie-upload-btn:hover { background: var(--solid-hover); transform: translateY(-1px); }
.cookie-delete-btn { background: transparent; border: 1px solid var(--error); color: var(--error); border-radius: 8px; padding: 5px 10px; font-size: .78rem; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.cookie-delete-btn:hover { background: var(--error-bg); }

.ffmpeg-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px;
  background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  border-radius: var(--radius-md); color: var(--text); font-size: .84rem; line-height: 1.5; margin-bottom: 18px;
  animation: cardIn .5s var(--ease-out) both;
}
.ffmpeg-banner svg { color: var(--warn); margin-top: 1px; }
.ffmpeg-banner strong { color: var(--warn); }
.ffmpeg-banner code { background: var(--warn-bg); color: var(--warn); padding: 1px 6px; border-radius: 5px; font-size: .78rem; }
.format-card.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ── Content sections ─────────────────────────────────────────────── */
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(40px, 6vw, 60px); }
.section-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); background: var(--chip);
  border: 1px solid var(--chip-border); padding: 5px 13px; border-radius: 99px; margin-bottom: 18px;
}
.section-title { font-size: clamp(1.9rem, 5.2vw, 3.1rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; margin-bottom: 14px; color: var(--text); }
.section-sub { color: var(--muted); font-size: clamp(.95rem, 2.2vw, 1.08rem); line-height: 1.6; }
.section-sub a { color: var(--link); text-decoration: none; }
.section-sub a:hover { text-decoration: underline; }

/* Feature / step grid — bordered cards w/ icon chips */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }
.step-card {
  position: relative; padding: 34px 30px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.step-card:hover { background: var(--bg-2); }
.step-card:nth-child(3n) { border-right: none; }
.step-num {
  width: 44px; height: 44px; border-radius: 12px; background: var(--chip);
  border: 1px solid var(--chip-border); color: var(--text);
  font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; transition: background var(--t), transform var(--t);
}
.step-card:hover .step-num { background: var(--text); color: var(--bg); transform: translateY(-2px); }
.step-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; color: var(--text); }
.step-text { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.step-text strong { color: var(--text); font-weight: 600; }

/* FAQ — 2-column bordered cards */
.faq-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 940px; margin: 0 auto; align-items: start; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color var(--t), box-shadow var(--t); }
.faq-item[open] { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 22px; font-size: .98rem; font-weight: 600;
  letter-spacing: -.01em; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: color var(--t);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ''; width: 11px; height: 11px; flex-shrink: 0; position: relative;
  background:
    linear-gradient(var(--muted), var(--muted)) center/100% 2px no-repeat,
    linear-gradient(var(--muted), var(--muted)) center/2px 100% no-repeat;
  transition: transform .3s var(--ease-spring);
}
.faq-item[open] summary::after { transform: rotate(135deg); }
.faq-item summary:hover { color: var(--muted); }
.faq-answer { padding: 0 22px 20px; font-size: .9rem; color: var(--muted); line-height: 1.65; animation: faqOpen .3s var(--ease-out) both; }
@keyframes faqOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Contact */
.contact-card { max-width: 560px; margin: 0 auto; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 52px 36px; box-shadow: var(--shadow-sm); }
.contact-icon { width: 58px; height: 58px; margin: 0 auto 22px; border-radius: 15px; background: var(--chip); border: 1px solid var(--chip-border); color: var(--text); display: flex; align-items: center; justify-content: center; }
.contact-icon svg { width: 26px; height: 26px; }
.contact-text { color: var(--muted); font-size: .95rem; line-height: 1.65; margin: 12px auto 26px; max-width: 440px; }
.contact-email { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: var(--solid-text); text-decoration: none; padding: 14px 30px; border-radius: var(--radius-md); background: var(--solid); transition: background var(--t), transform var(--t), box-shadow var(--t); }
.contact-email:hover { background: var(--solid-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-note { margin-top: 18px; font-size: .8rem; color: var(--subtle); }

/* Final CTA band */
.cta-band { text-align: center; padding: clamp(56px, 9vw, 96px) 0; }
.cta-band .section-title { margin-bottom: 12px; }
.cta-band .section-sub { margin-bottom: 32px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer { background: var(--footer-bg); color: var(--footer-text); padding: 56px 0 40px; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand { max-width: 300px; }
.footer-logo { font-size: 1.25rem; font-weight: 800; letter-spacing: -.035em; color: var(--footer-head); margin-bottom: 12px; }
.footer-logo .dot { color: var(--footer-text); }
.footer-tagline { font-size: .88rem; line-height: 1.6; color: var(--footer-text); }
.footer-cols { display: flex; gap: clamp(32px, 8vw, 72px); flex-wrap: wrap; }
.footer-col h4 { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--footer-head); margin-bottom: 14px; }
.footer-col a { display: block; font-size: .88rem; color: var(--footer-text); text-decoration: none; margin-bottom: 10px; transition: color var(--t); }
.footer-col a:hover { color: var(--footer-head); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.1); }
.footer-copy { font-size: .82rem; color: var(--footer-text); }
.footer-copy b { color: var(--footer-head); font-weight: 700; }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 36px; height: 36px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; color: var(--footer-text); transition: background var(--t), color var(--t), border-color var(--t); }
.footer-social a:hover { background: rgba(255,255,255,.08); color: var(--footer-head); border-color: rgba(255,255,255,.24); }
.footer-social svg { width: 17px; height: 17px; }

/* ── Scroll-reveal ────────────────────────────────────────────────── */
.reveal .section-head, .reveal .reveal-item {
  opacity: 0; transform: translateY(26px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.in-view .section-head, .reveal.in-view .reveal-item { opacity: 1; transform: none; }
.reveal.in-view .reveal-item:nth-child(1) { transition-delay: .04s; }
.reveal.in-view .reveal-item:nth-child(2) { transition-delay: .1s; }
.reveal.in-view .reveal-item:nth-child(3) { transition-delay: .16s; }
.reveal.in-view .reveal-item:nth-child(4) { transition-delay: .22s; }
.reveal.in-view .reveal-item:nth-child(5) { transition-delay: .28s; }
.reveal.in-view .reveal-item:nth-child(6) { transition-delay: .34s; }

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .05s !important; scroll-behavior: auto !important;
  }
  .hero-title .word { opacity: 1 !important; transform: none !important; }
  .reveal .section-head, .reveal .reveal-item { opacity: 1 !important; transform: none !important; }
}

/* ── Utility ──────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .step-card { border-right: none; }
  .faq-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .header-inner { height: 58px; }
  .nav-link { padding: 6px 8px; font-size: .84rem; }
  .card { padding: 20px 18px; }
  .url-row { flex-direction: column; }
  .btn-primary { width: 100%; }
  .video-meta { flex-direction: column; }
  .video-thumb-wrap { width: 100%; }
  .skeleton-card { flex-direction: column; }
  .skeleton-thumb { width: 100%; height: 190px; }
  .format-card { min-width: 88px; padding: 12px; }
  .contact-card { padding: 40px 22px; }
  .footer-top { flex-direction: column; gap: 28px; }
  .toast-container { right: 12px; bottom: 12px; left: 12px; }
  .toast { max-width: 100%; }
}
/* Narrow widths: drop the whole nav to a full-width second row (instead of
   letting individual buttons wrap). Buttons spread evenly across the line. */
@media (max-width: 480px) {
  .header-inner { height: auto; flex-wrap: wrap; padding: 10px 24px; row-gap: 10px; }
  .main-nav { width: 100%; justify-content: flex-end; }
}

/* =====================================================================
   Admin analytics dashboard (/admin)
   Scoped under .admin-wrap so it never touches the main page. Uses this
   theme's monochrome tokens so light/dark both stay consistent.
   ===================================================================== */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }

.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.admin-title { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--text); }
.admin-title em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; }
.admin-sub { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.admin-sub a { color: var(--link); text-decoration: none; }
.admin-sub a:hover { text-decoration: underline; }

/* Summary cards */
.admin-wrap .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 34px; }
.admin-wrap .stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
  animation: cardIn .5s var(--ease-out) both;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.admin-wrap .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.admin-wrap .stat-card .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.admin-wrap .stat-card .value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Two-column layout */
.admin-wrap .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Sections */
.admin-section { margin-bottom: 34px; animation: cardIn .5s var(--ease-out) both; }
.admin-section h2 {
  font-size: 1rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); display: flex; align-items: baseline;
  flex-wrap: wrap; gap: 6px; color: var(--text);
}
.admin-section h2 .muted { font-weight: 400; }

/* Tables */
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.admin-wrap table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 460px; }
.admin-wrap th {
  text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 600;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-2);
}
.admin-wrap td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-wrap tbody tr:last-child td { border-bottom: none; }
.admin-wrap tbody tr { transition: background var(--t); }
.admin-wrap tbody tr:hover td { background: var(--bg-2); }
.admin-wrap th[data-sort] { cursor: pointer; user-select: none; }
.admin-wrap th[data-sort]:hover { color: var(--text); }
.admin-wrap th[data-sort] .arrow { opacity: .6; font-size: .7em; margin-left: 2px; }

/* Bars */
.admin-wrap .bar-wrap { display: flex; align-items: center; gap: 10px; }
.admin-wrap .bar { height: 7px; background: var(--text); border-radius: 4px; min-width: 4px; }

/* Badges */
.admin-wrap .badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: .72rem;
  font-weight: 600; background: var(--chip); border: 1px solid var(--chip-border);
  color: var(--text); text-transform: capitalize;
}
.admin-wrap .badge.dl { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }

/* Text helpers */
.admin-wrap .ts { color: var(--muted); font-size: .78rem; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.admin-wrap .muted { color: var(--muted); font-size: .82rem; }
.admin-wrap .muted-status { color: var(--subtle); font-size: .78rem; }
.admin-wrap .title-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Filters */
.admin-wrap .filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.admin-wrap .filters input, .admin-wrap .filters select {
  padding: 8px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: .82rem; font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.admin-wrap .filters input:focus, .admin-wrap .filters select:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.admin-wrap .filters input { min-width: 220px; flex: 1; }

/* Pagination bar */
.admin-wrap .pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.admin-wrap .pager .pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.admin-wrap .pager a.pg:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-2); }
.admin-wrap .pager .pg.active { background: var(--text); color: var(--bg); border-color: var(--text); cursor: default; }
.admin-wrap .pager .pg.disabled { opacity: .4; pointer-events: none; }
.admin-wrap .pager .pg-ellipsis { color: var(--subtle); padding: 0 4px; }

/* Cookie manager */
.cookie-admin { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.cookie-admin-status { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cookie-admin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex-shrink: 0; box-shadow: 0 0 0 4px var(--warn-bg); }
.cookie-admin-dot.on { background: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.cookie-admin-status strong { font-size: .9rem; font-weight: 600; display: block; color: var(--text); }
.cookie-admin-status .muted { font-size: .78rem; word-break: break-all; }
.cookie-admin-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cookie-admin-msg { margin-top: 10px; min-height: 1em; font-size: .8rem; }

@media (max-width: 720px) {
  .admin-wrap .two-col { grid-template-columns: 1fr; }
  .admin-head { flex-wrap: wrap; }
  .cookie-admin { flex-direction: column; align-items: flex-start; }
}
