/* =========================================================
   DarkYTX World — Design System
   Palette: slate-black base, chaos-emerald teal, ring gold
   Type: Space Grotesk (display) / Inter (body) / JetBrains Mono (code)
   ========================================================= */

:root {
  /* Color */
  --bg: #0b0e14;
  --bg-elevated: #10141c;
  --surface: #141a24;
  --surface-2: #1a2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #edeff3;
  --text-muted: #8b93a3;
  --text-faint: #5b6577;

  --teal: #2fd1c5;
  --teal-dim: #1f8f87;
  --gold: #f2b705;
  --gold-dim: #b98b06;
  --red: #ff4655;

  --grad-signature: linear-gradient(135deg, var(--teal) 0%, #4a8cff 50%, var(--gold) 100%);
  --grad-card: linear-gradient(160deg, rgba(47, 209, 197, 0.08), rgba(242, 183, 5, 0.04));

  /* Spacing (8px system) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-8: 64px;
  --s-10: 80px;
  --s-12: 96px;
  --s-16: 128px;

  /* Radius / shadow */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(47, 209, 197, 0.25), 0 16px 40px rgba(47, 209, 197, 0.08);

  --container: 1120px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Light mode override (toggle) */
[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: rgba(15, 20, 30, 0.08);
  --border-strong: rgba(15, 20, 30, 0.14);

  --text: #10141c;
  --text-muted: #4d5566;
  --text-faint: #838ba0;

  --shadow-sm: 0 2px 8px rgba(20, 26, 40, 0.06);
  --shadow-md: 0 12px 32px rgba(20, 26, 40, 0.1);
  --shadow-glow: 0 0 0 1px rgba(47, 209, 197, 0.3), 0 16px 40px rgba(47, 209, 197, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

code,
.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-3);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* =========================
   Nav
   ========================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: clamp(44px, 5.5vw, 64px);
  width: auto;
  display: block;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.brand:hover .brand-logo {
  transform: scale(1.04);
}

.brand-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: conic-gradient(from 180deg, var(--teal), #4a8cff, var(--gold), var(--teal)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 2px;
  position: relative;
  transition: color 0.2s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--grad-signature);
  transition: width 0.25s var(--ease);
  border-radius: 2px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* =========================
   Hero
   ========================= */
.hero {
  position: relative;
  padding: var(--s-16) 0 var(--s-12);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 600px;
  background: radial-gradient(600px 300px at 20% 0%, rgba(47, 209, 197, 0.18), transparent 60%),
    radial-gradient(500px 260px at 85% 10%, rgba(242, 183, 5, 0.12), transparent 60%);
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(47, 209, 197, 0.1);
  border: 1px solid rgba(47, 209, 197, 0.25);
  padding: 6px 14px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-3);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  max-width: 16ch;
  margin-bottom: var(--s-3);
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--s-5);
}

.hero-ctas {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* Speed streak divider — signature element */
.speed-divider {
  position: relative;
  height: 48px;
  margin: var(--s-2) 0;
  overflow: hidden;
}

.speed-divider::before,
.speed-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  transform: translateY(-50%) skewX(-25deg);
}

.speed-divider::before {
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--teal));
}

.speed-divider::after {
  right: 0;
  width: 22%;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* =========================
   Buttons
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.btn-primary {
  background: var(--grad-signature);
  color: #06110f;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(47, 209, 197, 0.28);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}

/* =========================
   Sections / cards
   ========================= */
section {
  padding: var(--s-10) 0;
}

.section-head {
  margin-bottom: var(--s-5);
  max-width: 62ch;
}

.section-head .eyebrow {
  margin-bottom: var(--s-2);
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: var(--s-2);
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.grid {
  display: grid;
  gap: var(--s-3);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 209, 197, 0.35);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-card);
  border: 1px solid var(--border);
  margin-bottom: var(--s-3);
  color: var(--teal);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-3);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teal);
}

/* Media card (video embeds) */
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-2);
  box-shadow: var(--shadow-sm);
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
}

.media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-title {
  padding: var(--s-2) var(--s-1) 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Tag / pill */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-6) 0 var(--s-5);
  margin-top: var(--s-8);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.footer-links {
  display: flex;
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--teal);
}

.copyright {
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* Link list rows (community/support link tables) */
.link-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 0.92rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}

.link-row:hover {
  border-color: rgba(47, 209, 197, 0.4);
  background: var(--surface-2);
  transform: translateX(2px);
}

.link-row .arrow {
  color: var(--teal-dim);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
  flex-shrink: 0;
}

.link-row:hover .arrow {
  color: var(--teal);
  transform: translateX(3px);
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  margin: var(--s-6) 0 var(--s-3);
}

.subsection-title .count {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
}

/* Search / filter input */
.filter-bar {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-full);
  font-size: 0.95rem;
  font-family: inherit;
}

.filter-input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.filter-input::placeholder {
  color: var(--text-faint);
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================
   Installation Guides page
   ========================= */
.guides-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--s-6);
  align-items: start;
}

.guides-sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: var(--s-2);
  border-right: 1px solid var(--border);
}

.guides-sidebar::-webkit-scrollbar {
  width: 6px;
}
.guides-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s-2);
}

.sidebar-link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.35;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar-link.is-active {
  color: var(--teal);
  border-left-color: var(--teal);
  background: rgba(47, 209, 197, 0.08);
}

.video-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}

.video-strip-card .media-title {
  font-size: 0.85rem;
}

.guide-section {
  scroll-margin-top: 84px;
  margin-bottom: var(--s-5);
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.guide-title {
  font-size: 1.4rem;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}

.mod-subhead {
  font-size: 1rem;
  color: var(--gold);
  margin: var(--s-4) 0 8px;
  font-family: "Space Grotesk", sans-serif;
}

.mod-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.mod-link-grid {
  margin-bottom: var(--s-3);
}

.guide-step {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 var(--s-3);
}

.guide-step strong {
  color: var(--text);
  font-weight: 600;
}

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

@media (max-width: 900px) {
  .guides-layout {
    grid-template-columns: 1fr;
  }
  .guides-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--s-3);
    margin-bottom: var(--s-3);
  }
}

/* =========================
   404 Page
   ========================= */
.error-hero {
  text-align: center;
  padding: var(--s-12) 0 var(--s-6);
}

.error-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 700;
  line-height: 1;
  background: var(--grad-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
}

.error-code::after {
  content: "404";
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(47, 209, 197, 0.15);
  z-index: -1;
  transform: translate(6px, 6px);
}

.error-tagline {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  color: var(--text-muted);
  margin: var(--s-2) 0 var(--s-6);
}

.character-banter {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.banter-bubble {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-sm);
}

.banter-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #06110f;
}

.banter-avatar.sonic {
  background: conic-gradient(from 180deg, var(--teal), #4a8cff, var(--teal));
}

.banter-avatar.goku {
  background: conic-gradient(from 180deg, var(--gold), #ff9a3c, var(--gold));
}

.banter-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.banter-bubble.sonic .banter-name {
  color: var(--teal);
}

.banter-bubble.goku .banter-name {
  color: var(--gold);
}

.banter-line {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
}

/* Responsive */
@media (max-width: 860px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .link-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--s-3);
    gap: var(--s-2);
    transform: translateY(-130%);
    transition: transform 0.3s var(--ease);
    z-index: 99;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle-btn {
    display: inline-flex;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  section {
    padding: var(--s-8) 0;
  }
}
