/* Colours & shapes of the extension's popup: orange → pink gradient, cinema photo.
   Follows the system theme like the popup: dark by default, light with a light system theme. */
:root {
  color-scheme: dark;
  --bg: #1c1c1c;
  --surface: #252525;
  --surface-2: #2f2f2f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.25);
  --text: #f1f1f1;
  --text-soft: #dddddd;
  --muted: #a0a0a0;
  --header-bg: rgba(28, 28, 28, 0.85);
  --hero-photo-filter: grayscale(1) blur(4px) brightness(0.4);
  --hero-photo-opacity: 1;
  --shadow: rgba(0, 0, 0, 0.6);
  --orange: #ee592a;
  --pink: #ea0986;
  --gradient: linear-gradient(to right, var(--orange), var(--pink));
  --radius: 12px;
  --max-width: 1120px;
  --heading: 'Lato', 'Segoe UI', Tahoma, sans-serif;
  --body: 'Segoe UI', Tahoma, system-ui, sans-serif;
}

/* The popup's light colours */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #f1f1f1;
    --surface-2: #e6e6e6;
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.3);
    --text: #252525;
    --text-soft: #3a3a3a;
    --muted: #606060;
    --header-bg: rgba(255, 255, 255, 0.85);
    /* A faint, light cinema photo behind dark text */
    --hero-photo-filter: grayscale(1) blur(4px) brightness(1.3);
    --hero-photo-opacity: 0.35;
    --shadow: rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.container { width: min(100% - 32px, var(--max-width)); margin-inline: auto; }

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

h1, h2, h3 { font-family: var(--heading); font-weight: 900; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 20px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--heading); font-weight: 900; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 600; transition: color 0.2s; }
.site-nav a:hover { color: var(--text); }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s, border-color 0.15s;
}
.button:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.button--primary { background: var(--gradient); border-color: transparent; color: #fff; }
.button--primary:hover { opacity: 0.9; }
.button svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.button--small { padding: 8px 16px; font-size: 14px; }

/* Hero */
.hero { position: relative; overflow: hidden; text-align: center; padding: 88px 0 72px; }
.hero::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: url('images/header.webp') center / cover;
  filter: var(--hero-photo-filter);
  opacity: var(--hero-photo-opacity);
  z-index: -2;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg));
  z-index: -1;
}
.hero__logo { width: 132px; height: 132px; margin: 0 auto 20px; filter: drop-shadow(0 10px 30px rgba(234, 9, 134, 0.35)); }
.hero h1 { font-size: clamp(36px, 6vw, 64px); margin-bottom: 16px; }
.hero__tagline { max-width: 640px; margin: 0 auto 32px; font-size: clamp(17px, 2vw, 20px); color: var(--text-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero__version { margin-top: 20px; font-size: 14px; color: var(--muted); min-height: 1.6em; }
.hero__shot { margin: 48px auto 0; width: min(100%, 960px); border-radius: var(--radius); box-shadow: 0 20px 60px var(--shadow); }

/* Sections */
.section { padding: 72px 0; }
.section--alt { background: var(--surface); }
.section__intro { max-width: 680px; margin-bottom: 40px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.feature__image { background: #fff; aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.feature__image img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.feature__image--contain img { object-fit: contain; object-position: center; }
.feature__image--placeholder { background: var(--gradient); }
.feature__image--placeholder svg { width: 64px; height: 64px; fill: #fff; opacity: 0.9; }
.feature__body { padding: 20px; }
.feature__body p { color: var(--muted); margin: 0; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--gradient); color: #fff; font-family: var(--body); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }

/* Install */
.install { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.install__card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.install__card h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.install__card h3 svg { width: 28px; height: 28px; flex: none; }
.install__card h4 { margin: 8px 0 0; font-family: var(--heading); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.install__card ol { margin: 0; padding-left: 20px; color: var(--text-soft); }
.install__card li { margin-bottom: 6px; }
.install__card p { color: var(--text-soft); margin: 0; }
.install__card .button { align-self: flex-start; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; overflow-wrap: anywhere; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
details { border-top: 1px solid var(--border); padding-top: 12px; }
summary { cursor: pointer; font-weight: 700; color: var(--text); }
details[open] summary { margin-bottom: 10px; }
details ol + p, details p + ol { margin-top: 10px; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .shots { grid-template-columns: repeat(2, 1fr); } }
.shots a { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); transition: transform 0.2s; }
.shots a:hover { transform: scale(1.02); }

/* Privacy & support */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: center; }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.site-footer small { display: block; max-width: 520px; }

/* Privacy page */
.page { padding: 56px 0 72px; max-width: 760px; }
.page h1 { font-size: clamp(32px, 5vw, 44px); }
.page h2 { font-size: 24px; margin-top: 32px; }
.page li { margin-bottom: 8px; }

@media (max-width: 720px) {
  .brand span { display: none; }
  .site-nav { display: none; }
  .site-header .button { margin-left: auto; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 56px 0; }
  .features, .shots { grid-template-columns: 1fr; }
}

/* Progress bar previews: the extension's own theme styles (css/bars) on a player-like track */
.feature__image--player { background: #0f0f0f; padding: 0 32px; }
/* The single preview in the feature card, enlarged to fill it */
.feature__image--player .bar-preview { width: 55%; margin: 0 auto; transform: scale(1.8); }
.bars { width: 100%; }
.bars--gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bar-card { margin: 0; padding: 28px 28px 16px; border-radius: var(--radius); background: #0f0f0f; border: 1px solid var(--border); }
/* The preview cards stay dark like a player in both themes, so their captions stay light */
.bar-card figcaption { margin-top: 14px; color: #a0a0a0; font-weight: 700; font-size: 14px; }
/* YouTube's own geometry, which the themes' offsets are tuned for: a 5px bar area (at --bar-y) with
   a 3px track in its middle, and the scrubber at top -4px & left -6.5px of it */
.bars .bar-preview { --bar-y: 22px; position: relative; padding-top: calc(var(--bar-y) + 5px); }
.bars .bar-preview .bar-preview__track { position: absolute; left: 0; right: 0; top: calc(var(--bar-y) + 1px); height: 3px; background: rgba(255, 255, 255, 0.25); }
/* Fills up like a playing video, the theme's character running along */
.bars .bar-preview .bar-preview__progress { position: absolute; left: 0; top: calc(var(--bar-y) + 1.5px); height: 1px; animation: bar-play 12s linear infinite; animation-delay: var(--delay, 0s); }
.bars .bar-preview .bar-preview__progress .ytp-play-progress { position: absolute; left: 0; top: 0; width: 100%; height: 1px; }
.bars .bar-preview .preview__center { position: absolute; top: var(--bar-y); left: 0; animation: bar-scrub 12s linear infinite; animation-delay: var(--delay, 0s); }
.bars .bar-preview .preview__center .ytp-scrubber-container { position: absolute; top: -4px; left: -6.5px; }
.bars .bar-preview--paused .bar-preview__progress,
.bars .bar-preview--paused .preview__center { animation-play-state: paused; }
@keyframes bar-play { from { width: 2%; } to { width: 98%; } }
@keyframes bar-scrub { from { left: 2%; } to { left: 98%; } }
@media (prefers-reduced-motion: reduce) {
  .bars .bar-preview .bar-preview__progress { animation: none; width: 55%; }
  .bars .bar-preview .preview__center { animation: none; left: 55%; }
}
/* Player controls under the bar (added by main.js): the time follows the bar */
.player-controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #eee; font: 13px/1 Roboto, Arial, sans-serif; }
.player-controls svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.player-controls__button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 4px; }
.player-controls__button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.player-controls__time { margin-left: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; background: var(--surface); }
.faq summary { font-family: var(--heading); font-size: 18px; }
.faq p { color: var(--text-soft); margin: 0; }
