:root {
  color-scheme: dark;
  --bg: #050607;
  --panel: #121316;
  --panel-2: #181a1f;
  --text: #f5f6fb;
  --muted: #9ca0aa;
  --line: rgba(255,255,255,.1);
  --brand: #6047ff;
  --violet: #a855f7;
  --red: #ef233c;
  --teal: #16c7a4;
  --amber: #f4b942;
  --input: #08090b;
  --shadow: 0 24px 70px rgba(0,0,0,.48);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #eef1f7;
  --text: #11141b;
  --muted: #5e6573;
  --line: rgba(17,20,27,.12);
  --input: #f8f9fc;
  --shadow: 0 22px 55px rgba(32,42,68,.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% -10%, rgba(96,71,255,.22), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(22,199,164,.12), transparent 28%);
  opacity: .8;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, iframe { max-width: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 56px);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 40px rgba(0,0,0,.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  box-shadow: 0 12px 34px rgba(96,71,255,.34);
}

.brand strong { display: block; font-size: 1.15rem; line-height: 1; }
.brand strong span { color: var(--brand); }
.brand small { display: block; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .18em; margin-top: 4px; }

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.desktop-nav a,
.ghost-btn,
.primary-btn,
.primary-red,
.icon-btn,
.theme-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.desktop-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .82rem;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--text);
  background: var(--panel-2);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 42px; display: grid; place-items: center; padding: 0; }
.ghost-btn, .primary-btn, .primary-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 800;
}
.primary-btn { background: linear-gradient(135deg, var(--brand), #4f46e5); color: #fff; border-color: transparent; }
.primary-red { background: #e50914; color: #fff; border-color: transparent; }

.theme-toggle {
  width: 72px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: var(--input);
}
.theme-toggle span { display: grid; place-items: center; z-index: 1; color: var(--muted); }
.theme-toggle::before {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  top: 4px;
  left: 4px;
  border-radius: 7px;
  background: var(--amber);
  transition: transform .22s ease, background .22s ease;
}
[data-theme="dark"] .theme-toggle::before { transform: translateX(32px); background: var(--brand); }
[data-theme="light"] .theme-toggle .sun,
[data-theme="dark"] .theme-toggle .moon { color: #fff; }

.mobile-only, .mobile-menu { display: none; }

.hero {
  min-height: 760px;
  position: relative;
  display: grid;
  align-items: end;
  padding: clamp(96px, 12vw, 160px) clamp(16px, 5vw, 88px) 34px;
  overflow: hidden;
}

.hero-media,
.hero-scrim {
  position: absolute;
  inset: 0;
}
.hero-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  opacity: .32;
  transform: scale(1.18);
}
.hero-scrim {
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 45%, color-mix(in srgb, var(--bg) 22%, transparent)),
              linear-gradient(0deg, var(--bg) 0%, transparent 42%);
}
.hero-copy {
  position: relative;
  width: min(820px, 100%);
  z-index: 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .1em;
  font-size: .78rem;
}
.eyebrow.red { color: var(--red); }
.eyebrow.violet { color: var(--violet); }
.eyebrow.teal { color: var(--teal); }
.eyebrow.amber { color: var(--amber); }

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 14px 0;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: .98;
  max-width: 940px;
  text-transform: uppercase;
}
.hero-copy p { color: color-mix(in srgb, var(--text) 78%, var(--muted)); max-width: 680px; font-size: 1.05rem; line-height: 1.65; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 26px; }
.hero-stats strong { color: var(--red); font-size: clamp(1.55rem, 4vw, 2.2rem); }
.hero-stats span { color: var(--muted); font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-search {
  position: relative;
  z-index: 2;
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr) auto;
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label { display: grid; gap: 7px; }
label span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 0 13px;
  outline: none;
}
textarea { min-height: 96px; padding-top: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(96,71,255,.16); }

.ad-row,
.section,
.footer {
  width: min(1760px, calc(100% - 32px));
  margin-inline: auto;
}
.ad-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.ad-row article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
}
.ad-row span { color: var(--amber); font-size: .72rem; text-transform: uppercase; font-weight: 900; }
.ad-row strong, .ad-row small { display: block; }
.ad-row small { color: var(--muted); margin-top: 4px; }

.category-strip {
  width: min(1760px, calc(100% - 32px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.category-strip button {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 12px 34px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.category-strip button:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  background: var(--panel-2);
}
.category-strip svg { color: var(--amber); }

.section { padding: 76px 0 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 26px;
}
.section h2 { font-size: clamp(1.65rem, 3vw, 2.55rem); margin: 8px 0 0; }
.mono { color: var(--violet); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.video-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.video-card:hover { transform: translateY(-4px); border-color: rgba(96,71,255,.7); }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #1f2937; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.72), transparent 52%); }
.play-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.68);
  color: #fff;
  font-weight: 900;
  font-size: .78rem;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  font-size: .68rem;
}
.video-card .body { padding: 14px; }
.video-card h3 { font-size: 1rem; line-height: 1.25; margin: 0 0 8px; }
.meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; }
.price-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 12px; font-weight: 900; }
.price-line strong { color: var(--red); }
.price-line span { color: var(--muted); }

.reels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.reel-card {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.reel-card img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.04); }
.reel-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.74), transparent 48%); }
.reel-card div { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; color: #fff; }
.reel-card strong { display: block; }
.reel-card span { color: #d6b4ff; font-weight: 900; font-size: .78rem; text-transform: uppercase; }

.developer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr);
  gap: 28px;
}
.cinema-frame {
  aspect-ratio: 16 / 9;
  background: #242629;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.cinema-frame iframe { width: 100%; height: 100%; border: 0; }
.developer-info {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.developer-info h3 { font-size: 2rem; margin: 10px 0; }
.developer-info p { color: var(--muted); line-height: 1.65; }
.developer-info p svg { width: 16px; vertical-align: text-bottom; color: var(--brand); }
.units { display: grid; gap: 12px; margin-top: 24px; }
.units button {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font-weight: 800;
}
.units img { width: 76px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.units strong { display: block; color: var(--brand); margin-top: 4px; }

.pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.pricing article {
  position: relative;
  min-height: 430px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.pricing .featured { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(96,71,255,.3), var(--shadow); }
.pricing .featured > b {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 230px;
  text-align: center;
  background: var(--brand);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  text-transform: uppercase;
  font-size: .78rem;
}
.price { font-size: clamp(2.1rem, 4vw, 3.3rem); font-weight: 950; margin: 18px 0; }
.price span { color: var(--muted); font-size: 1rem; }
.pricing ul { padding: 0; margin: 28px 0; list-style: none; display: grid; gap: 14px; }
.pricing li::before { content: "✓"; color: var(--brand); margin-right: 10px; font-weight: 900; }

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--panel-2) 72%, var(--brand)));
}
.admin-hero h2 { margin: 8px 0; }
.role-switcher, .admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.role-switcher button,
.admin-tabs button,
.segmented button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);
  font-weight: 900;
}
.role-switcher button.active,
.admin-tabs button.active,
.segmented button.active { color: #fff; background: var(--brand); border-color: transparent; }
.admin-tabs { margin: 22px 0; }
.admin-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.admin-list { display: grid; gap: 10px; }
.admin-row {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-row img { width: 88px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.admin-row h3 { margin: 0 0 4px; font-size: 1rem; }
.admin-row p { margin: 0; color: var(--muted); }
.admin-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-form .wide { grid-column: 1 / -1; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.blog-grid article {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.blog-grid img { height: 100%; min-height: 260px; object-fit: cover; }
.blog-grid div { padding: 24px; }
.blog-grid span { color: var(--brand); font-weight: 900; text-transform: uppercase; font-size: .75rem; }
.blog-grid p { color: var(--muted); line-height: 1.6; }
.blog-grid a { color: var(--brand); font-weight: 900; display: inline-flex; align-items: center; gap: 6px; }

.footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 44px;
  padding: 72px 0 42px;
  margin-top: 50px;
  border-top: 1px solid var(--line);
}
.footer p, .footer a, .footer address { color: var(--muted); font-style: normal; line-height: 1.7; }
.footer h3 { text-transform: uppercase; font-size: .86rem; letter-spacing: .08em; }
.footer nav { display: grid; align-content: start; gap: 8px; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.modal {
  width: min(920px, calc(100vw - 24px));
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.modal.auth { width: min(460px, calc(100vw - 24px)); display: grid; gap: 16px; }
.close { float: right; }
.offer-modal .cinema-frame { margin: 16px 0; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.detail-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.detail-grid span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; font-weight: 900; }
.contact-box { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px; background: var(--input); border-radius: 8px; border: 1px solid var(--line); }

.empty { color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: 8px; }

@media (max-width: 1180px) {
  .desktop-nav { display: none; }
  .mobile-only { display: grid; }
  .topbar { gap: 12px; }
  .header-actions { margin-left: auto; }
  .hero-search, .filter-panel, .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .developer-layout, .footer { grid-template-columns: 1fr 1fr; }
  .mobile-menu.open {
    display: grid;
    position: fixed;
    top: 75px;
    right: 16px;
    z-index: 30;
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .mobile-menu a { padding: 14px; border-radius: 8px; color: var(--muted); font-weight: 900; }
  .mobile-menu a:hover { background: var(--panel-2); color: var(--text); }
}

@media (max-width: 760px) {
  .topbar { padding: 12px; }
  .brand small, #loginBtn, #adminBtn { display: none; }
  .hero { min-height: 720px; padding: 104px 16px 24px; }
  .hero-search, .filter-panel, .video-grid, .pricing, .developer-layout, .blog-grid, .footer, .admin-form, .ad-row, .category-strip { grid-template-columns: 1fr; }
  .reels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section { padding-top: 52px; }
  .section-head, .admin-hero { align-items: stretch; flex-direction: column; }
  .blog-grid article { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 72px 1fr; }
  .admin-row .ghost-btn, .admin-row .primary-btn { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-box { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .reels, .detail-grid { grid-template-columns: 1fr; }
  .theme-toggle { width: 62px; }
  .theme-toggle::before { width: 27px; }
  [data-theme="dark"] .theme-toggle::before { transform: translateX(27px); }
}
