:root {
  color-scheme: dark;
  --bg: #060913;
  --surface: #0d1425;
  --card: #121c33;
  --border: #243554;
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --target: 44px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: break-word;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 18% 8%, rgba(34, 211, 238, 0.14), transparent 70%),
    radial-gradient(50% 40% at 85% 15%, rgba(167, 139, 250, 0.14), transparent 70%);
  pointer-events: none;
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

:where(a.btn, button) {
  min-block-size: var(--target);
  min-inline-size: var(--target);
  font: inherit;
  cursor: pointer;
  transition: transform 130ms ease-out, filter 130ms ease-out, border-color 130ms ease-out;
}

:where(a.btn, button):active {
  transform: scale(0.97);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(6, 9, 19, 0.84);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  color: var(--cyan);
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text);
}

.hero {
  padding-block: 44px 28px;
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

h1, h2, h3 {
  margin: 0;
  text-wrap: balance;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  margin-bottom: 14px;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.06rem;
  text-wrap: pretty;
}

.lead strong {
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-link {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.df-featured {
  padding-block: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.df-banner-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #040d1f;
}

.df-banner-img {
  display: block;
  width: 100%;
  max-height: 92px;
  object-fit: cover;
}

.df-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
  align-items: center;
}

.df-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.df-copy h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.7rem);
  line-height: 1.12;
}

.df-art-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.df-crest-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.df-crest-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 22%;
  filter: brightness(0.72) saturate(1.1);
}

.df-web-fly {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.df-web-ring {
  position: absolute;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  border: 1.5px dashed rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.25), inset 0 0 24px rgba(168, 85, 247, 0.25);
  animation: webRuneSpin 20s linear infinite;
}

.df-web-svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.7));
  animation: webDfHover 3.4s ease-in-out infinite;
}

.df-w { transform-box: fill-box; }
.df-wtl { transform-origin: 96% 65%; animation: webWingTL 0.14s ease-in-out infinite alternate; }
.df-wtr { transform-origin: 4% 65%; animation: webWingTR 0.14s ease-in-out infinite alternate; }
.df-wbl { transform-origin: 96% 20%; animation: webWingBL 0.14s ease-in-out infinite alternate-reverse; }
.df-wbr { transform-origin: 4% 20%; animation: webWingBR 0.14s ease-in-out infinite alternate-reverse; }

@keyframes webRuneSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes webDfHover {
  0%, 100% { transform: translateY(2px) rotate(-2deg) scale(1); }
  50% { transform: translateY(-10px) rotate(2deg) scale(1.04); }
}
@keyframes webWingTL { from { transform: rotate(-16deg) scaleY(0.92); opacity: 0.96; } to { transform: rotate(10deg) scaleY(0.68); opacity: 0.72; } }
@keyframes webWingTR { from { transform: rotate(16deg) scaleY(0.92); opacity: 0.96; } to { transform: rotate(-10deg) scaleY(0.68); opacity: 0.72; } }
@keyframes webWingBL { from { transform: rotate(-12deg) scaleY(0.94); opacity: 0.92; } to { transform: rotate(12deg) scaleY(0.72); opacity: 0.68; } }
@keyframes webWingBR { from { transform: rotate(12deg) scaleY(0.94); opacity: 0.92; } to { transform: rotate(-12deg) scaleY(0.72); opacity: 0.68; } }

.df-clips-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.clip-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.clip-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #020817;
}

.clip-card figcaption {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.df-clash-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.df-clash-strip img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.df-video-block {
  margin-top: 4px;
}

.featured-border {
  border-color: rgba(34, 211, 238, 0.55);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 750;
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn.primary {
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  color: #06101e;
}

.btn.primary:hover {
  filter: brightness(1.07);
}

.btn.secondary, .btn.ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover, .btn.ghost:hover {
  border-color: var(--cyan);
}

.video-section, .downloads-section, .setup-section {
  padding-block: 28px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.55rem;
  margin-bottom: 4px;
}

.muted {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.video-frame {
  background: #040710;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #040710;
}

.chapter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chapter-btn {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.chapter-btn.active, .chapter-btn:hover {
  color: var(--text);
  border-color: var(--cyan);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.product-card {
  background: linear-gradient(160deg, #131e36, #0d1527);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.badge-violet {
  background: rgba(167, 139, 250, 0.14);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.file-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.product-card h3 {
  font-size: 1.38rem;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.provider-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-pills span {
  background: #0a1020;
  border: 1px solid var(--border);
  color: #dbeafe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.step-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
}

.step-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-wrap: pretty;
}

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-block: 18px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-row a {
  color: var(--cyan);
  text-decoration: none;
}

/* Native accessible dialogs */
dialog {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #0f172a;
  color: var(--text);
  width: min(92vw, 520px);
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dlg-inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dlg-head h1 {
  font-size: 1.22rem;
}

.dlg-close {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
}

.dlg-list {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dlg-list code {
  background: #1e293b;
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .product-card, .step-box, dialog, .btn.secondary {
    border: 1px solid ButtonText;
  }
}
