:root {
  --bg: #0b1220;
  --panel: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --brand: #0ea5e9;
  --brand-700: #0284c7;
  --ring: 0 0 0 3px rgba(14,165,233,0.35);
  --card: #0b1220;
  --tile-a: linear-gradient(135deg,#0ea5e9, #22d3ee);
  --tile-b: linear-gradient(135deg,#a78bfa, #22d3ee);
  --tile-c: linear-gradient(135deg,#34d399, #10b981);
  --shadow: 0 6px 24px rgba(0,0,0,0.25);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(2,6,23,0.08);
  }
}

[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(2,6,23,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(14,165,233,0.14), transparent 60%),
              radial-gradient(900px 500px at 120% 10%, rgba(167,139,250,0.12), transparent 60%),
              var(--bg);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.centered { text-align: center; }
.centered .form { margin: 0 auto; text-align: left; }

.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 16px; top: 16px; width: auto; height: auto; padding: 8px 12px; z-index: 1000;
  background: var(--panel); color: var(--text); border-radius: 8px; box-shadow: var(--shadow);
}

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(148,163,184,0.12);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 12px 20px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.3px; text-decoration: none; color: var(--text);
}
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 6px rgba(14,165,233,0.2); }

.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 8px; border-radius: 10px;
}
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.menu { display: flex; align-items: center; gap: 14px; list-style: none; padding: 0; margin: 0; }
.menu a { color: var(--text); text-decoration: none; opacity: 0.9; }
.menu a:hover { opacity: 1; color: var(--brand); }

/* Mobile nav */
@media (max-width: 800px) {
  #navToggle { display: inline-flex; }
  .menu[data-collapsible] { position: absolute; right: 16px; top: 60px; flex-direction: column; gap: 10px; background: var(--panel); padding: 12px; border-radius: 12px; box-shadow: var(--shadow); min-width: 180px; display: none; }
  .menu[data-collapsible].open { display: flex; }
}
@media (min-width: 801px) {
  #navToggle { display: none; }
}

.content { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.1; margin: 0 0 12px; }
.hero p { margin: 0 auto 18px; max-width: 56ch; color: var(--muted); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.2); background: var(--panel); color: var(--text); text-decoration: none; cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-1px); border-color: rgba(14,165,233,0.5); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-700)); border-color: transparent; color: white; }
.btn.ghost { background: transparent; }

.section { padding: 36px 0; }
.section h2 { font-size: clamp(22px, 3.2vw, 32px); margin: 0 0 18px; }

.grid { display: grid; gap: 16px; }
.features-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.card { background: var(--card); border: 1px solid rgba(148,163,184,0.15); padding: 18px; border-radius: 14px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.tile { aspect-ratio: 4 / 3; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid rgba(148,163,184,0.18); background: var(--tile-a); }
.tile:nth-child(2) { background: var(--tile-b); }
.tile:nth-child(3) { background: var(--tile-c); }
.tile:nth-child(4) { background: var(--tile-b); }
.tile:nth-child(5) { background: var(--tile-c); }
.tile:nth-child(6) { background: var(--tile-a); }

.form { display: grid; gap: 14px; max-width: 680px; }
.field { display: grid; gap: 6px; }
label { font-weight: 600; }
input, textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.35); background: var(--panel); color: var(--text); }
input:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring); border-color: transparent; }
.help { margin: 0; color: var(--muted); font-size: 14px; }

.site-footer { border-top: 1px solid rgba(148,163,184,0.12); padding: 18px 0; text-align: center; }
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-direction: column; }
.footer-link { color: var(--muted); text-decoration: none; }
.footer-link:hover { color: var(--brand); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Movies */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.movie { background: var(--card); border: 1px solid rgba(148,163,184,0.15); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.movie img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.movie h2 { font-size: 15px; margin: 8px 10px; line-height: 1.2; }
.watch-btn { width: calc(100% - 20px); margin: 0 10px 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-weight: 700; cursor: pointer; }
.watch-btn:focus-visible { outline: none; box-shadow: var(--ring); }

#next-page { margin-top: 14px; }

/* Controls (search + category) */
.controls { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.controls input[type="search"], .controls select {
  padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.35); background: var(--panel); color: var(--text);
}
.controls input:focus-visible, .controls select:focus-visible { outline: none; box-shadow: var(--ring); border-color: transparent; }
.movie .meta { margin: 0 10px 10px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

/* Player */
.server-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; justify-content: center; }
.server-controls label { font-weight: 600; }
.server-controls select {
  padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.35); background: var(--panel); color: var(--text);
}
.server-controls select:focus-visible { outline: none; box-shadow: var(--ring); border-color: transparent; }

.player-container { margin-top: 8px; width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; background: #111; border-radius: 14px; overflow: hidden; border: 1px solid rgba(148,163,184,0.18); box-shadow: var(--shadow); display: grid; place-items: center; }
.player-container iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-note { margin-top: 10px; }

/* Utils */
.hidden { display: none !important; }
