/* Filter Search for Jellyfin — project site. Self-contained, dependency-free, theme-aware.
   Same structure as the Simple Fileshare and Cirrust sites; the violet accent comes from the plugin icon. */

:root {
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  /* Palette literals live here once; the theme rules below only point the live
     tokens at one set or the other. */
  --l-accent: #7c3aed;
  --l-accent-ink: #6d28d9;
  --l-accent-soft: rgba(124, 58, 237, 0.1);
  --l-canvas: #f7f6fb;
  --l-surface: #ffffff;
  --l-surface-2: #f0eef7;
  --l-line: #e2dfec;
  --l-ink: #17141f;
  --l-ink-soft: #5e5872;
  --l-shadow: 0 10px 40px -12px rgba(40, 20, 70, 0.2);
  --l-love: #e11d48;

  --d-accent: #a78bfa;
  --d-accent-ink: #7c3aed;
  --d-accent-soft: rgba(167, 139, 250, 0.13);
  --d-canvas: #100e16;
  --d-surface: #19161f;
  --d-surface-2: #221e2b;
  --d-line: #2e2939;
  --d-ink: #ebe8f2;
  --d-ink-soft: #9a93ab;
  --d-shadow: 0 16px 50px -14px rgba(0, 0, 0, 0.75);
  --d-love: #fb7185;
}

/* Light is the default. `data-theme` on <html> is an explicit visitor choice and
   overrides the OS preference in either direction; with no attribute set, the OS
   decides. Keep this order: defaults, then system-dark, then forced dark. */
:root,
:root[data-theme="light"] {
  --accent: var(--l-accent);
  --accent-ink: var(--l-accent-ink);
  --accent-soft: var(--l-accent-soft);
  --canvas: var(--l-canvas);
  --surface: var(--l-surface);
  --surface-2: var(--l-surface-2);
  --line: var(--l-line);
  --ink: var(--l-ink);
  --ink-soft: var(--l-ink-soft);
  --shadow: var(--l-shadow);
  --love: var(--l-love);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --accent: var(--d-accent);
    --accent-ink: var(--d-accent-ink);
    --accent-soft: var(--d-accent-soft);
    --canvas: var(--d-canvas);
    --surface: var(--d-surface);
    --surface-2: var(--d-surface-2);
    --line: var(--d-line);
    --ink: var(--d-ink);
    --ink-soft: var(--d-ink-soft);
    --shadow: var(--d-shadow);
    --love: var(--d-love);
  }
}

:root[data-theme="dark"] {
  --accent: var(--d-accent);
  --accent-ink: var(--d-accent-ink);
  --accent-soft: var(--d-accent-soft);
  --canvas: var(--d-canvas);
  --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);
  --line: var(--d-line);
  --ink: var(--d-ink);
  --ink-soft: var(--d-ink-soft);
  --shadow: var(--d-shadow);
  --love: var(--d-love);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code, kbd, pre { font-family: var(--mono); }
kbd {
  font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent-ink); color: #fff; }
.btn--primary:hover { background: #5b21b6; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
}
.brand__mark { display: block; width: 32px; height: 32px; border-radius: 9px; }
.brand--sm { font-size: 1rem; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; font-size: 0.95rem; color: var(--ink-soft); }
.site-nav a:not(.btn):hover { color: var(--ink); }
.brand, .site-nav .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .site-nav a:not(.btn) { display: none; }
}
@media (max-width: 400px) {
  .site-header { gap: 0.5rem; }
  .brand { font-size: 1rem; gap: 0.45rem; }
  .site-nav { gap: 0.5rem; }
  .site-nav .btn { padding: 0.5rem 0.85rem; font-size: 0.88rem; }
}

/* ─── Theme toggle ────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { display: block; width: 17px; height: 17px; }

/* Show the icon for the theme you would switch *to*. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ─── Layout helpers ──────────────────────────────────────────────────── */
main { display: block; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem); }
.section--muted { background: var(--surface); max-width: none; }
.section--muted > * { max-width: var(--maxw); margin-inline: auto; }
.section__head { max-width: 720px; margin-bottom: 2.5rem; }
/* Full-width section (Security): centre the heading above the centred card grid. */
.section--muted .section__head { margin-inline: auto; text-align: center; }
.section__head h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.section__head p { color: var(--ink-soft); margin-top: 0.75rem; }

/* ─── Hero ────────────────────────────────────────────────────────────── */
/* One column: centred copy on top, the app screenshot full-width below it. */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) 0;
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 2.5rem);
}
.hero__copy { max-width: 800px; margin-inline: auto; text-align: center; }
.hero__copy .lede { max-width: 68ch; margin-inline: auto; }
.hero__copy .hero__cta { justify-content: center; }
.hero > .shot { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.3rem); margin: 0.9rem 0 1rem; }
.lede { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--ink-soft); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1rem; }
.hero__meta { font-size: 0.85rem; color: var(--ink-soft); }

/* ─── Screenshot frames ───────────────────────────────────────────────── */
.shot {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.shot img { display: block; width: 100%; height: auto; }

/* Theme-matched screenshots: a figure holds both the light and the dark capture
   and only one is displayed. `display: none` also drops the hidden one from the
   accessibility tree, so a screen reader announces the alt text just once —
   which is why both images carry the same alt.
   Same cascade order as the palette: default, then system-dark, then forced. */
.shot img.shot__light { display: block; }
.shot img.shot__dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .shot img.shot__light { display: none; }
  :root:not([data-theme]) .shot img.shot__dark { display: block; }
}
:root[data-theme="dark"] .shot img.shot__light { display: none; }
:root[data-theme="dark"] .shot img.shot__dark { display: block; }
:root[data-theme="light"] .shot img.shot__light { display: block; }
:root[data-theme="light"] .shot img.shot__dark { display: none; }

/* ─── Strip ───────────────────────────────────────────────────────────── */
.strip {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 720px) { .strip { grid-template-columns: repeat(2, 1fr); } }
.strip__item { background: var(--surface); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.15rem; }
.strip__k { font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.strip__v { color: var(--ink-soft); font-size: 0.9rem; }

/* ─── Features ────────────────────────────────────────────────────────── */
.features { max-width: var(--maxw); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem); display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5.5rem); }
.feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.feature--reverse .feature__text { order: 2; }
@media (max-width: 860px) {
  .feature, .feature--reverse { grid-template-columns: 1fr; }
  .feature--reverse .feature__text { order: 0; }
}
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 1rem;
}
.tag--accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.feature__text h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.85rem; }
.feature__text > p { color: var(--ink-soft); }
.feature__text code {
  font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px;
}
.checks { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; }
.checks li { position: relative; padding-left: 1.7rem; color: var(--ink); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.85rem; height: 0.45rem;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ─── Card grids ──────────────────────────────────────────────────────── */
.grid3 { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 800px) { .grid3 { grid-template-columns: 1fr; } }
.card { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.card__icon { color: var(--accent); margin-bottom: 0.75rem; line-height: 0; }
.card__icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ─── Setup / downloads ───────────────────────────────────────────────── */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
@media (max-width: 800px) { .downloads { grid-template-columns: 1fr; } }
.dl {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.dl:hover { border-color: var(--accent); transform: translateY(-2px); }
.dl__name { font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.dl__sub { font-size: 0.85rem; color: var(--ink-soft); }

.dl--primary { border-color: var(--accent); background: var(--accent-soft); }
.dl__tag {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: var(--accent-ink); color: #fff;
}
.codeblock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.codeblock__title { padding: 0.6rem 1rem; font-size: 0.8rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.codeblock pre { margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto; font-size: 0.9rem; }
.fineprint { margin-top: 1.25rem; font-size: 0.9rem; color: var(--ink-soft); }
.fineprint code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* ─── Footer ──────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__row { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer__nav { display: flex; gap: 1.25rem; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer__nav a:hover { color: var(--ink); }
.disclaimer { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 2rem; font-size: 0.8rem; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ─── Additions for the Filter Search site ─────────────────────────────── */
body { overflow-x: hidden; }
.skip-link { position: absolute; left: -9999px; top: 0.5rem; z-index: 100; background: var(--accent-ink); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; }
.skip-link:focus { left: 0.5rem; }

/* Demo video in the hero */
.shot video { display: block; width: 100%; height: auto; background: #101010; }
.shot figcaption { padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--ink-soft); border-top: 1px solid var(--line); background: var(--surface); }

/* "Show some love" counter */
.love {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.95rem 0.45rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.love:hover { border-color: var(--love); }
.love:active { transform: scale(0.97); }
.love:focus-visible { outline: 2px solid var(--love); outline-offset: 2px; }
.love__heart { width: 18px; height: 18px; color: var(--love); flex: none; transition: transform 0.2s ease; }
.love__heart path { fill: transparent; stroke: currentColor; stroke-width: 2; transition: fill 0.2s ease; }
.love.is-loved .love__heart path { fill: currentColor; }
.love.is-popping .love__heart { transform: scale(1.35); }
.love__count {
  min-width: 2ch; padding: 0.05rem 0.5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 0.85rem;
}
.love__count:empty { display: none; }
.hero__love { margin-top: 0.4rem; display: flex; justify-content: center; }

/* Install steps */
.steps { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding: 1.1rem 1.25rem 1.1rem 3.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps li::before {
  content: counter(step); position: absolute; left: 1.1rem; top: 1.05rem;
  width: 1.8rem; height: 1.8rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 0.9rem;
}
.steps h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.steps p { color: var(--ink-soft); font-size: 0.95rem; }
.steps code, .faq code, .note code {
  font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere;
}
.copyline {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.7rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.35rem 0.35rem 0.35rem 0.8rem;
}
.copyline code { flex: 1; min-width: 0; font-size: 0.85rem; overflow-x: auto; white-space: nowrap; background: none; border: 0; padding: 0; }
.copy-btn {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 0.35rem 0.7rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.note {
  margin-top: 0.8rem; padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.92rem;
  background: var(--accent-soft); color: var(--ink); border: 1px solid transparent;
}
.note strong { color: var(--accent); }

/* Compatibility table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.compat { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.compat th, .compat td { text-align: left; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.compat tr:last-child td { border-bottom: 0; }
.compat th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); background: var(--surface-2); }
.compat .current td { font-weight: 700; }
@media (max-width: 560px) { .compat th, .compat td { white-space: normal; padding: 0.7rem 0.8rem; } }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 0.4rem; }

/* FAQ */
.faq { display: grid; gap: 0.75rem; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.25rem; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 0; font-weight: 700; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); padding-bottom: 1.1rem; }
.faq details p + p { margin-top: -0.5rem; }

/* Footer extras */
.site-footer__more { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.9rem; color: var(--ink-soft); }
.site-footer__more a { color: var(--accent); }
.site-footer__more a:hover { text-decoration: underline; }
@media (max-width: 560px) { .site-footer__row { flex-direction: column; align-items: flex-start; } }

.codeblock--step { margin-top: 0.8rem; }
.downloads--spaced { margin-top: 2rem; }
.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; }
.hero__copy { max-width: 920px; }
.hero h1 { text-wrap: balance; }
.faq { margin-inline: auto; }
