:root {
  --bg: #000;
  --fg: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.56);
  --faint: rgba(245, 245, 247, 0.32);
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.035);
  --radius-sm: 999px;
  --radius: 22px;
  --radius-lg: 32px;
  --max: 1120px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
p { margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), background-color 0.25s ease, box-shadow 0.35s var(--ease);
}
.btn svg, .btn-icon { width: 18px; height: 18px; display: block; }
.btn:not(.btn-static):hover { transform: scale(1.04); }
.btn:not(.btn-static):active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.btn-sm { height: 38px; padding: 0 18px; font-size: 14px; }

.btn-solid {
  background: #f5f5f7;
  color: #000;
}
.btn-solid:not(.btn-static):hover { background: #fff; box-shadow: 0 10px 40px rgba(255, 255, 255, 0.18); }

.btn-glass {
  background: var(--glass);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}
.btn-glass:not(.btn-static):hover { background: var(--glass-hover); }

/* ---------- Header ---------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 12px 16px;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 60px;
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.header.scrolled .header-inner {
  background: rgba(20, 20, 22, 0.6);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; display: block; }
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
#pupil { transition: transform 0.12s linear; }

.nav { display: flex; gap: 32px; font-size: 14px; color: var(--muted); }
.nav a { transition: color 0.2s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

/* ---------- Layout ---------- */

main { padding: 0 16px; }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 180px 0 40px;
  text-align: center;
}
.eyebrow {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.lead {
  max-width: 600px;
  margin: 24px auto 0;
  font-size: clamp(18px, 2vw, 21px);
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 0 0;
}
.section-narrow { max-width: 860px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.08; }
.section-head p { margin-top: 18px; font-size: 19px; color: var(--muted); }

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

/* ---------- Screenshot placeholders ---------- */

.shot {
  margin: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
}
.shot-inner {
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius-lg) - 1px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    #0b0b0c;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 22px 26px;
}
.shot-inner span {
  font-size: 13px;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.shot-hero { margin-top: 80px; }
.shot-hero .shot-inner { aspect-ratio: 16 / 9; }
.shot-wide { margin-top: 40px; }
.shot-wide .shot-inner { aspect-ratio: 21 / 9; }

/* ---------- Points ---------- */

.points { margin-top: 64px; }
.point h3 { font-size: 19px; margin-bottom: 8px; }
.point p { color: var(--muted); font-size: 16px; }

/* ---------- Integrations ---------- */

.play-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 56px;
}
.play-demo .or { color: var(--faint); font-size: 14px; }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.45s var(--ease), background-color 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px) scale(1.015);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.card-logo { width: 44px; height: 44px; object-fit: contain; display: block; }
.card-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--glass);
}
.card h3 { font-size: 24px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }
.card-muted h3 { color: var(--muted); }

/* ---------- Jellyfin panel ---------- */

.panel {
  text-align: center;
  padding: 64px 40px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.panel-logo { width: 64px; height: 64px; display: block; margin: 0 auto 24px; }
.panel h2 { font-size: clamp(30px, 4vw, 44px); }
.panel p { margin: 18px auto 0; max-width: 600px; color: var(--muted); }
.panel .actions { margin-top: 30px; }

/* ---------- Footer ---------- */

.footer {
  margin-top: 140px;
  padding: 0 16px 32px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-logo { width: 26px; height: 26px; display: block; }
.footer .muted { margin-left: 4px; }
.footer .brand-name { font-size: 16px; }
.muted { color: var(--faint); font-size: 14px; }

/* ---------- Documentation ---------- */

.docs {
  max-width: calc(var(--max) + 32px);
  margin: 0 auto;
  padding: 140px 16px 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.docs-nav { position: sticky; top: 112px; }
.docs-nav-title { font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.docs-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.docs-nav a:hover { color: var(--fg); background: var(--surface); }
.docs-nav a.active { color: var(--fg); background: var(--glass); }

.docs-body { max-width: 720px; }
.docs-body section + section { margin-top: 80px; padding-top: 80px; border-top: 1px solid var(--line); }
.docs-body .eyebrow { margin-bottom: 14px; }
.docs-body h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.035em; }
.docs-body h2 { font-size: 30px; margin-bottom: 20px; }
.docs-body h3 { font-size: 19px; margin: 40px 0 10px; }
.docs-body p, .docs-body li { color: var(--muted); }
.docs-body p + p, .docs-body ul + p, .docs-body ol + p, .docs-body .code + p { margin-top: 16px; }
.docs-body strong { color: var(--fg); font-weight: 500; }
.docs-body ul, .docs-body ol { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.lead-sm { margin-top: 18px; font-size: 19px; }

.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 3px 0 0 42px; min-height: 28px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--glass);
  color: var(--fg);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

code, kbd, pre {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}
:not(pre) > code, kbd {
  color: var(--fg);
  background: var(--glass);
  padding: 2px 7px;
  border-radius: 7px;
}
kbd { border: 1px solid rgba(255, 255, 255, 0.12); }

.code {
  position: relative;
  margin-top: 18px;
  border-radius: 18px;
  background: #0b0b0c;
  border: 1px solid var(--line);
}
.code pre { margin: 0; padding: 20px 22px; overflow-x: auto; line-height: 1.65; color: #e8e8ea; }
.code-copy {
  position: absolute; top: 10px; right: 10px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--glass);
  color: var(--muted);
  font: inherit; font-size: 12px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.code-copy:hover { color: var(--fg); background: var(--glass-hover); }

.docs-body .shot { margin-top: 28px; }

.note {
  margin-top: 20px !important;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 15px;
}

.table { margin-top: 28px; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.row { display: grid; grid-template-columns: 1fr 1fr; padding: 14px 20px; font-size: 15px; }
.row + .row { border-top: 1px solid var(--line); }
.row span { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.row span:first-child { color: var(--fg); }
.row img { width: 20px; height: 20px; object-fit: contain; }
.row-head { background: var(--surface); }
.row-head span, .row-head span:first-child { color: var(--faint); font-size: 13px; }

.actions-left { justify-content: flex-start; margin-top: 24px; }

/* ---------- Support modal ---------- */

.btn { cursor: pointer; border: 0; font-family: inherit; }
.btn-glass { border: 1px solid rgba(255, 255, 255, 0.12); }

.modal {
  width: min(520px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  overflow: visible;
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.modal[open] { animation: modal-in 0.45s var(--ease); }
.modal[open]::backdrop { animation: fade-in 0.3s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes fade-in { from { opacity: 0; } }

.modal-card {
  position: relative;
  padding: 36px 28px 28px;
  border-radius: var(--radius-lg);
  background: rgba(28, 28, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 120px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}
.modal-card h2 { font-size: 26px; text-align: center; }
.modal-lead { margin: 10px auto 0; max-width: 380px; text-align: center; color: var(--muted); font-size: 15px; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--glass);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { background: var(--glass-hover); color: var(--fg); }

.support-options { display: grid; gap: 12px; margin-top: 28px; }
.support-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.35s var(--ease), background-color 0.25s ease, border-color 0.25s ease;
}
.support-option:hover { transform: scale(1.02); background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.16); }
.support-option:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.support-option img { width: 48px; height: 48px; flex: none; }
.support-text { display: grid; gap: 3px; flex: 1; }
.support-text strong { font-size: 17px; font-weight: 600; }
.support-text span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.support-arrow { color: var(--faint); font-size: 26px; line-height: 1; }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, #pupil, .support-option { transition: none; }
  .modal[open], .modal[open]::backdrop { animation: none; }
}

/* ---------- Responsive ---------- */

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

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 120px 16px 0; }
  .docs-nav { display: none; }
}

@media (max-width: 680px) {
  .nav { gap: 18px; }
  .brand-name { display: none; }
  .footer .brand-name { display: inline; }
  .btn-label { display: none; }
  .header .btn-sm { width: 38px; padding: 0; }
  .docs-body section + section { margin-top: 56px; padding-top: 56px; }
  .hero { padding-top: 140px; }
  .section { padding-top: 100px; }
  .grid-2, .cards { grid-template-columns: 1fr; }
  .shot-hero { margin-top: 56px; }
  .shot-wide .shot-inner { aspect-ratio: 16 / 10; }
  .panel { padding: 48px 24px; }
  .footer { margin-top: 100px; }
  .header-inner { padding: 0 8px 0 10px; }
}
