:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #0d1b2e;
  --panel: #10243a;
  --panel-2: #142c45;
  --line: #29435e;
  --text: #eef8ff;
  --muted: #a9c0d2;
  --gold: #f0bf5d;
  --green: #45e58f;
  --violet: #b889ff;
  --red: #ff6f7a;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(69, 229, 143, .14), transparent 28rem),
    radial-gradient(circle at 86% 2%, rgba(240, 191, 93, .11), transparent 22rem),
    linear-gradient(180deg, #081320 0%, #07111f 50%, #0b1624 100%);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: #7ef0b5;
  text-decoration: none;
}

a:hover { color: #fff0bd; }

img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(7, 17, 31, .88);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

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

.nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 650;
  font-size: .93rem;
}

.nav a[aria-current="page"],
.nav a:hover {
  background: rgba(69, 229, 143, .12);
  color: var(--text);
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 34px;
  align-items: center;
  padding: 54px 0 44px;
}

.hero-art {
  min-height: 520px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(12, 31, 52, .3), rgba(4, 11, 20, .82)),
    url("logo.png") center / min(82%, 500px) no-repeat;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(7,17,31,.95));
}

.eyebrow {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: clamp(2.55rem, 6vw, 5.7rem);
  max-width: 780px;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  margin: 0 0 18px;
}

h3 { font-size: 1.15rem; }

p { margin: 0 0 16px; color: var(--muted); }

.lead {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  max-width: 720px;
  margin-top: 20px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: #173049;
  color: var(--text);
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: none;
}

.btn.primary,
button.primary {
  background: linear-gradient(135deg, #34d885, #f0bf5d);
  color: #07111f;
  border-color: transparent;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.btn.primary:hover,
button.primary:hover { color: #07111f; }

.section,
.content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
}

.article {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 94px;
  align-self: start;
  border-left: 2px solid rgba(69,229,143,.28);
  padding-left: 16px;
}

.toc a {
  display: block;
  color: var(--muted);
  margin: 8px 0;
  font-size: .92rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(20, 44, 69, .92), rgba(13, 27, 46, .92));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.card h3 { margin-bottom: 10px; }

.stat {
  display: grid;
  gap: 4px;
}

.stat strong {
  color: var(--gold);
  font-size: 1.6rem;
  line-height: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(69, 229, 143, .12);
  color: #b7ffd5;
  font-weight: 800;
  font-size: .78rem;
}

.pill.gold { background: rgba(240,191,93,.13); color: #ffe0a2; }
.pill.violet { background: rgba(184,137,255,.13); color: #dcc6ff; }
.pill.red { background: rgba(255,111,122,.13); color: #ffc6cc; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius);
  margin: 18px 0 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: #d9ffe8;
  background: rgba(69,229,143,.08);
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tr:last-child td { border-bottom: 0; }

.notice {
  border-left: 3px solid var(--gold);
  background: rgba(240,191,93,.1);
  padding: 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #fff1c8;
  margin: 22px 0;
}

.search-panel {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 680px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  background: #091827;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: #dcecff;
  font-weight: 750;
  font-size: .92rem;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result {
  min-height: 142px;
  border: 1px solid rgba(69,229,143,.18);
  background: rgba(69,229,143,.07);
  border-radius: var(--radius);
  padding: 16px;
}

.meter {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 14px;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.code-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.code-text {
  font-family: "Cascadia Code", Consolas, monospace;
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 900;
}

.mini-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mini-list li {
  padding: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 28px;
}

.media-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-card {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 44, 69, .92), rgba(13, 27, 46, .92));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.media-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-card figcaption,
.media-card .caption {
  padding: 12px 14px 14px;
  color: var(--muted);
  font-size: .92rem;
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #030810;
}

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

.video-trigger {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #030810;
  cursor: pointer;
}

.video-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(.82);
  transition: transform .2s ease, filter .2s ease;
}

.video-trigger:hover img,
.video-trigger:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.14) brightness(1);
}

.play-badge {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(69, 229, 143, .94);
  color: #07111f;
  box-shadow: 0 14px 42px rgba(0,0,0,.38);
}

.play-badge::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid currentColor;
  margin-left: 5px;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 24px;
  background: rgba(2, 8, 16, .82);
  backdrop-filter: blur(12px);
}

.video-modal.open {
  display: grid;
  place-items: center;
}

.video-modal-panel {
  width: min(1120px, 100%);
  background: #06101d;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(20, 44, 69, .96);
}

.video-modal-title {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.video-modal-close {
  min-width: 42px;
  padding: 8px 12px;
}

.video-modal-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.parry-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: #091827;
}

.parry-orb {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.16);
  color: var(--muted);
  font-weight: 900;
}

.parry-orb.flash {
  background: radial-gradient(circle, #ff3344, #6f1018);
  box-shadow: 0 0 42px rgba(255, 51, 68, .56);
  color: white;
}

.footer {
  border-top: 1px solid rgba(255,255,255,.08);
  background: #06101d;
  padding: 34px 0;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  color: var(--muted);
  font-size: .92rem;
}

.footer a { color: #c9f7dd; }

@media (max-width: 920px) {
  .hero,
  .content,
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero-art { min-height: 360px; }
  .toc { position: static; }
  .grid,
  .grid.two,
  .grid.four,
  .media-grid,
  .media-grid.three,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-wrap {
    width: min(100% - 20px, 1180px);
    min-height: 64px;
    align-items: flex-start;
    padding: 10px 0;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .nav a { white-space: nowrap; }
  .section, .content, .hero, .footer-inner { width: min(100% - 20px, 1180px); }
  .search-panel { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
