/* ===== 1. Reset & Tokens ===== */
:root {
  --bg: #0A0F1E;
  --panel: #111A33;
  --panel2: #182246;
  --purple: #8A2BE2;
  --green: #39FF14;
  --text: #F0F2F5;
  --muted: #A0A8B8;
  --line: #1E2235;
  --translucent: rgba(255, 255, 255, 0.08);
  --font-head: "Noto Sans SC", "Roboto Condensed", system-ui, -apple-system, sans-serif;
  --font-body: "Noto Sans SC", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --width: 1200px;
  --topbar-h: 32px;
  --header-h: 72px;
  --space-sm: .75rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
}
h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}
h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}
h3 {
  font-size: 1.1rem;
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--green);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
a:hover {
  color: var(--purple);
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
img, svg {
  display: block;
  max-width: 100%;
}
ul, ol {
  margin: 0;
  padding: 0;
}
li {
  list-style: none;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== 2. Layout & Utilities ===== */
.shell {
  max-width: var(--width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}
.section {
  padding-block: clamp(2rem, 5vw, 5rem);
}
.section--tight {
  padding-block: 1.5rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  white-space: nowrap;
}
.is-hidden {
  display: none !important;
}
#main-content {
  min-height: 70vh;
  outline: none;
}
.display-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: .01em;
  text-transform: uppercase;
  transform: skewX(-5deg);
  margin: 0 0 .4em;
}
.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: .03em;
  transform: skewX(-5deg);
  margin: 0 0 .5em;
}
.prose {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}
.prose p {
  margin: 0 0 1.25em;
}
.prose strong {
  color: var(--text);
}
.prose h1,
.prose h2,
.prose h3 {
  color: var(--text);
  margin-top: 1.5em;
}
.prose a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: rgba(57, 255, 20, .4);
  text-underline-offset: 2px;
}
.prose a:hover {
  text-decoration-color: var(--green);
  color: var(--green);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  margin: 0 0 2rem;
  padding: 0;
  font-size: .8rem;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: .75rem;
  color: var(--purple);
}
.breadcrumb a {
  color: var(--muted);
}
.breadcrumb a:hover {
  color: var(--green);
}
.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

/* ===== 3. Buttons & Tags ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: .6em 1.4em;
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--purple);
  transform: skewX(-6deg);
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.btn--primary {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.btn--primary:hover {
  background: #9d3fe8;
  box-shadow: 0 0 18px rgba(138, 43, 226, .4);
}
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--green);
  color: var(--green);
  background: transparent;
}
.btn--sm {
  min-height: 36px;
  font-size: .8rem;
  padding: .35em 1em;
}
.data-tag {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .2em .65em;
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--line);
}
.data-tag--purple {
  border-color: var(--purple);
  color: var(--purple);
}
.data-tag--green {
  border-color: var(--green);
  color: var(--green);
  background: rgba(57, 255, 20, .1);
}
.stat-num {
  display: inline-block;
  padding: .15em .45em;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.2;
  color: var(--green);
  background: #05070d;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 2px rgba(57, 255, 20, .12);
}
.slant-text {
  display: inline-block;
  transform: skewX(-6deg);
}
.slant-divider {
  height: 1.5rem;
  margin: 2rem 0;
  background: linear-gradient(-10deg, transparent 40%, var(--purple) 40%, var(--purple) 46%, transparent 46%);
  opacity: .8;
}

/* ===== 4. Bento & Card System ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
.bento-cell {
  grid-column: 1 / -1;
  min-width: 0;
}
@media (min-width: 640px) {
  .bento-cell--3 { grid-column: span 3; }
  .bento-cell--4 { grid-column: span 4; }
  .bento-cell--5 { grid-column: span 5; }
  .bento-cell--6 { grid-column: span 6; }
  .bento-cell--7 { grid-column: span 7; }
  .bento-cell--8 { grid-column: span 8; }
  .bento-cell--9 { grid-column: span 9; }
  .bento-cell--12 { grid-column: span 12; }
}
.focus-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: inset 0 0 0 1px var(--translucent), 0 24px 48px rgba(0, 0, 0, .35);
}
.focus-panel::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 30%;
  height: 2px;
  background: var(--green);
}
.focus-panel::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 15%;
  width: 1px;
  height: 30%;
  background: var(--purple);
}
.paper-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.5rem;
  box-shadow: 4px 4px 0 0 rgba(138, 43, 226, .32), 8px 8px 0 0 var(--translucent);
}
.print-frame {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  outline: 1px solid var(--translucent);
  outline-offset: 3px;
  padding: 1.25rem;
}
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(10, 15, 30, .25) 65%);
  pointer-events: none;
}
.media-frame--wide {
  aspect-ratio: 21 / 9;
}
.media-frame--tall {
  aspect-ratio: 3 / 4;
}
.track-path {
  position: relative;
}
.track-path::before {
  content: "";
  position: absolute;
  top: .75rem;
  bottom: .75rem;
  left: .25rem;
  width: 2px;
  background: linear-gradient(180deg, var(--purple), var(--green));
}
.track-node {
  position: relative;
  margin: 0 0 1.75rem 1.5rem;
  padding-left: 1.25rem;
}
.track-node::before {
  content: "";
  position: absolute;
  left: -1.625rem;
  top: .35rem;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--purple);
}
.track-node.is-active::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 255, 20, .15);
}

/* ===== 5. Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  padding: .6em 1em;
  background: var(--green);
  color: var(--bg);
  font-weight: 700;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  left: 0;
  color: var(--bg);
}
.header-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: var(--topbar-h);
  padding: 0 1.25rem;
  background: #05070d;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.meta-icp {
  color: var(--muted);
}
.meta-divider {
  width: 1px;
  height: 10px;
  background: var(--purple);
  opacity: .6;
}
.meta-service {
  color: var(--green);
  font-family: var(--font-body);
}
.header-rail {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: var(--header-h);
  background: var(--panel);
  border-top: 2px solid #06070d;
  border-bottom: 2px solid #06070d;
  box-shadow: inset 0 0 0 1px var(--translucent);
}
.header-rail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green) 0%, var(--purple) 40%, transparent 70%);
  opacity: .55;
  pointer-events: none;
}
.rail-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: .5rem 1.15rem;
  background: linear-gradient(135deg, rgba(138, 43, 226, .28), rgba(138, 43, 226, 0) 70%);
  border-right: 1px solid var(--line);
}
.brand-link {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--text);
}
.brand-link:hover {
  color: var(--text);
}
.brand-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .02em;
  transform: skewX(-5deg);
}
.brand-domain {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}
.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 54px;
  min-width: 54px;
  margin-left: auto;
  padding: 0 12px;
  background: transparent;
  border-left: 1px solid var(--line);
}
.nav-toggle-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  transform: scaleX(0);
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.rail-nav {
  display: none;
  flex-basis: 100%;
  background: var(--panel2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rail-nav[data-open] {
  display: block;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .5rem;
}
.nav-item {
  margin: 0;
}
.nav-link {
  display: block;
  padding: .6rem 1rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  border-left: 3px solid transparent;
}
.nav-link:hover {
  color: var(--green);
  background: var(--translucent);
  border-left-color: var(--green);
}
.nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--purple);
  border-left-color: var(--green);
}
.rail-league {
  display: flex;
  align-items: center;
  flex-basis: 100%;
  gap: .35rem;
  padding: .5rem .75rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: rgba(10, 15, 30, .4);
}
.league-label {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.league-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 .7em;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  transform: skewX(-8deg);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
  white-space: nowrap;
}
.league-pill:hover {
  border-color: var(--purple);
  color: var(--purple);
}
.league-pill.is-active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(57, 255, 20, .1);
}
.league-pill[hidden] {
  display: none;
}

/* ===== Header Desktop ===== */
@media (min-width: 980px) {
  .header-rail {
    flex-wrap: nowrap;
  }
  .header-rail::after {
    opacity: .75;
  }
  .rail-brand {
    padding: .75rem 1.5rem;
  }
  .brand-name {
    font-size: 1.5rem;
  }
  .nav-toggle {
    display: none;
  }
  .rail-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    background: transparent;
    border-top: 0;
    border-bottom: 0;
  }
  .nav-list {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 .75rem;
    gap: .3rem;
  }
  .nav-item {
    display: flex;
    align-items: center;
  }
  .nav-link {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 .85rem;
    font-size: .9rem;
    border-left: 0;
    transform: skewX(-6deg);
  }
  .nav-link:hover {
    background: var(--translucent);
    border-left: 0;
    color: var(--green);
  }
  .nav-link[aria-current="page"] {
    background: var(--purple);
    border-left: 0;
    box-shadow: 0 0 14px rgba(138, 43, 226, .4), 0 0 0 1px var(--purple);
  }
  .rail-league {
    flex-basis: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
    background: rgba(10, 15, 30, .4);
  }
}

/* ===== 6. Footer ===== */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 6vw, 6rem);
  background: var(--bg);
  border-top: 2px solid var(--green);
  color: var(--text);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--width);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) 1.5rem;
}
.footer-brand {
  min-width: 0;
}
.footer-logo {
  display: inline-flex;
  flex-direction: column;
  margin-bottom: .5rem;
  color: var(--text);
}
.footer-logo:hover {
  color: var(--text);
}
.footer-logo-main {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.1;
  transform: skewX(-5deg);
}
.footer-logo-sub {
  margin-top: .15rem;
  font-family: var(--font-body);
  font-size: .72rem;
  letter-spacing: .16em;
  color: var(--green);
  text-transform: uppercase;
}
.footer-desc {
  margin: .5em 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.8;
  max-width: 46ch;
}
.footer-desc-sec {
  margin-top: .5rem;
  padding: .75rem 1rem;
  border-left: 3px solid var(--purple);
  background: var(--translucent);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
  max-width: 58ch;
}
.footer-desc-sec a {
  color: var(--green);
}
.footer-help {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-nav {
  min-width: 0;
}
.footer-nav ul {
  display: grid;
  gap: .5rem;
}
.footer-nav a {
  display: inline-block;
  padding: .1rem 0;
  color: var(--muted);
  font-size: .95rem;
}
.footer-nav a:hover {
  color: var(--green);
  padding-left: .2rem;
}
.footer-col-title {
  display: block;
  padding-bottom: .4rem;
  margin-bottom: .8rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--purple);
  letter-spacing: .04em;
}
.footer-contact {
  min-width: 0;
}
.footer-contact p {
  margin: .15rem 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.8;
}
.contact-line:first-child {
  color: var(--green);
}
.contact-icp {
  margin-top: .6rem;
  font-size: .75rem;
  color: var(--muted);
}
.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: .9rem 1.5rem;
  border-top: 2px solid var(--purple);
  background: #060913;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
}
.footer-links a {
  padding: .2rem 0;
  font-size: .8rem;
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--green);
}
.footer-copy {
  margin: 0;
  font-size: .75rem;
  color: var(--muted);
}
.footer-icp {
  margin-left: .25em;
  color: var(--muted);
}
@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1.2fr .8fr;
  }
}
@media (min-width: 980px) {
  .footer-grid {
    grid-template-columns: 1.4fr .8fr 1fr;
    gap: 3rem;
  }
}

/* ===== 7. Back to Top ===== */
.top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  min-width: 48px;
  min-height: 48px;
  padding: .4em .8em;
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  background: var(--purple);
  border: 1px solid var(--translucent);
  border-radius: 2px;
  transform: skewX(-8deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, background .2s ease, box-shadow .2s ease;
}
.top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.top-btn:hover {
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 16px rgba(57, 255, 20, .35);
}

/* ===== 8. Responsive Footer Adjustments ===== */
@media (max-width: 639px) {
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-btn {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ===== 9. Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
