@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@700;900&display=swap');

:root {
  --neon: #87ff71;
  --cyan: #01cdfe;
  --ink: #192617;
  --bg: #0b1410;
  --panel: #101a14;
  --panel-2: #0d1712;
  --pink: #ff71ce;
  --violet: #b967ff;
  --txt: #dff3e4;
  --muted: #9dbba6;
  --line: rgba(135, 255, 113, 0.22);
  --line-cyan: rgba(1, 205, 254, 0.3);
  --rail: 262px;
  --r: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--txt);
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  font-size: 16.5px;
  line-height: 1.78;
  background:
    linear-gradient(180deg, rgba(255, 113, 206, 0.18) 0, rgba(185, 103, 255, 0.11) 14%, rgba(1, 205, 254, 0.09) 34%, rgba(11, 20, 16, 0) 58%),
    repeating-linear-gradient(0deg, rgba(135, 255, 113, 0.055) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(1, 205, 254, 0.05) 0 1px, transparent 1px 46px),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0 1px, transparent 1px 3px);
  opacity: 0.35;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover,
a:focus-visible {
  color: var(--neon);
}

h1,
h2,
h3,
h4 {
  font-family: 'Orbitron', 'JetBrains Mono', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.01em;
  margin: 0 0 0.55em;
  color: #eafff0;
  overflow-wrap: break-word;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 90;
  padding: 12px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--neon);
  color: var(--ink);
  border-radius: var(--r);
  font-weight: 700;
  transition: top 0.18s ease;
}

.skip:focus {
  top: 12px;
  color: var(--ink);
}

/* ---------- left rail ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px 26px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 113, 206, 0.1), rgba(1, 205, 254, 0.06) 40%, rgba(11, 20, 16, 0.9) 78%),
    linear-gradient(180deg, #122019, #0c1712);
  box-shadow: inset -14px 0 26px -22px var(--cyan);
}

.brand {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-height: 44px;
  border: 1px solid var(--neon);
  border-radius: var(--r);
  background: linear-gradient(135deg, rgba(135, 255, 113, 0.16), rgba(1, 205, 254, 0.16));
  box-shadow: 0 0 16px rgba(135, 255, 113, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% 76%, 76% 100%, 0 100%);
}

.mark-glyph {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--neon);
  text-shadow: 0 0 10px rgba(135, 255, 113, 0.9);
}

.mark-img {
  border-radius: 2px;
}

.rail-tag {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: none;
}

.rail-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--txt);
  background: rgba(9, 18, 13, 0.85);
  border: 1px solid var(--line-cyan);
  border-radius: var(--r);
  outline: none;
}

.rail-search input::placeholder {
  color: #6f8a79;
}

.rail-search input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(135, 255, 113, 0.22);
}

.rail-menu {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.rail-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 6px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--neon);
  border-left: 2px solid var(--neon);
  padding-left: 10px;
}

.rail-menu summary::-webkit-details-marker {
  display: none;
}

.rail-menu summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.rail-menu[open] summary::after {
  transform: rotate(180deg);
}

.rail-menu menu {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-menu menu li {
  animation: slidein 0.42s ease both;
}

.rail-menu menu li:nth-child(1) { animation-delay: 0.03s; }
.rail-menu menu li:nth-child(2) { animation-delay: 0.07s; }
.rail-menu menu li:nth-child(3) { animation-delay: 0.11s; }
.rail-menu menu li:nth-child(4) { animation-delay: 0.15s; }
.rail-menu menu li:nth-child(5) { animation-delay: 0.19s; }
.rail-menu menu li:nth-child(6) { animation-delay: 0.23s; }
.rail-menu menu li:nth-child(7) { animation-delay: 0.27s; }

.rail-menu menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--txt);
  border-left: 2px solid transparent;
  border-radius: 0 var(--r) var(--r) 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.rail-menu menu a:hover,
.rail-menu menu a:focus-visible,
.rail-menu menu a.is-active {
  color: var(--neon);
  background: rgba(135, 255, 113, 0.09);
  border-left-color: var(--neon);
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.55);
}

.rail-foot {
  margin: auto 0 0;
  padding-top: 12px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #6f8a79;
  border-top: 1px dashed var(--line);
}

/* ---------- shell / main grid ---------- */

.shell {
  margin-left: var(--rail);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  width: 100%;
  max-width: 1180px;
  padding: 28px 26px 46px;
  margin: 0 auto;
}

.doc {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.jump {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 24px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(1, 205, 254, 0.09), rgba(16, 26, 20, 0.94));
  box-shadow: 0 14px 30px -26px #000;
}

.jump h2 {
  font-size: 15px;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.jump .subtitle {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.jump ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: none;
}

.jump a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 8px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--txt);
  border-radius: var(--r);
  transition: background 0.18s ease, color 0.18s ease;
}

.jump a:hover,
.jump a:focus-visible {
  color: var(--neon);
  background: rgba(135, 255, 113, 0.1);
}

.jump .num {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: 24px;
  min-height: 45vh;
  padding: 18px;
  border: 1px solid var(--line-cyan);
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(1, 205, 254, 0.12), rgba(255, 113, 206, 0.13) 52%, rgba(135, 255, 113, 0.11)),
    rgba(12, 22, 17, 0.72);
  box-shadow: 0 26px 50px -34px rgba(1, 205, 254, 0.7);
}

.hero-visual {
  position: relative;
  min-width: 0;
}

.hero-img {
  display: block;
  width: 100%;
  border-radius: var(--r);
  border: 1px solid rgba(255, 113, 206, 0.4);
  filter: hue-rotate(-6deg) saturate(1.08) contrast(1.04);
}

.hero-ph {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid rgba(255, 113, 206, 0.4);
  background: linear-gradient(180deg, #ff71ce 0%, #b967ff 40%, #01cdfe 70%, #0b1410 100%);
  display: grid;
  place-items: center;
}

.hero-ph::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background:
    repeating-linear-gradient(90deg, rgba(135, 255, 113, 0.75) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(0deg, rgba(135, 255, 113, 0.6) 0 1px, transparent 1px 22px);
  transform: perspective(140px) rotateX(62deg);
  transform-origin: bottom center;
  opacity: 0.85;
}

.hero-ph span {
  position: relative;
  z-index: 2;
  padding: 6px 12px;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: #0b1410;
  background: rgba(135, 255, 113, 0.92);
  border-radius: var(--r);
}

.badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  padding: 7px 11px;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  color: #0b1410;
  background: var(--neon);
  border-radius: var(--r);
  box-shadow: 0 0 22px rgba(135, 255, 113, 0.75);
  animation: floaty 5.5s ease-in-out infinite;
}

.hero-copy {
  text-align: right;
  min-width: 0;
}

.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(1, 205, 254, 0.6);
}

.hero h1 {
  font-size: clamp(25px, 3.2vw, 43px);
  margin: 0 0 12px;
  animation: flicker 7s ease-in-out infinite;
}

.lede {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.72;
  color: #c6e2ce;
}

.hero-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #0b1410;
  background: linear-gradient(120deg, var(--neon), var(--cyan));
  border: 1px solid var(--neon);
  border-radius: var(--r);
  box-shadow: 0 0 20px -4px rgba(135, 255, 113, 0.7);
}

.btn:hover,
.btn:focus-visible {
  color: #0b1410;
  filter: hue-rotate(-18deg) brightness(1.06);
}

.btn-ghost {
  color: var(--neon);
  background: rgba(11, 20, 16, 0.7);
  border-color: var(--line-cyan);
  box-shadow: none;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--neon);
  border-color: var(--neon);
}

/* ---------- content sections (from page.content) ---------- */

.doc > article {
  position: relative;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--neon);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(135, 255, 113, 0.045), rgba(16, 26, 20, 0.96));
  box-shadow: 0 16px 34px -30px #000;
  scroll-margin-top: 26px;
}

.doc > article:nth-of-type(even) {
  border-left-color: var(--cyan);
}

.doc > .hero {
  margin-top: 0;
  padding: 18px;
  border-left: 1px solid var(--line-cyan);
  border-color: var(--line-cyan);
  background:
    linear-gradient(135deg, rgba(1, 205, 254, 0.12), rgba(255, 113, 206, 0.13) 52%, rgba(135, 255, 113, 0.11)),
    rgba(12, 22, 17, 0.72);
}

.doc > article h2 {
  font-size: clamp(19px, 2.1vw, 25px);
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line-cyan);
  text-shadow: 0 0 16px rgba(1, 205, 254, 0.32);
}

.doc > article h2::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  vertical-align: 2px;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(135, 255, 113, 0.9);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
}

.subtitle,
p.subtitle {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.doc h3 {
  font-size: 17px;
  margin-top: 1.4em;
  color: var(--cyan);
}

.doc ul,
.doc ol {
  padding-left: 1.35em;
}

.doc li {
  margin-bottom: 0.45em;
}

.doc li::marker {
  color: var(--neon);
}

.doc blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 3px solid var(--pink);
  background: rgba(255, 113, 206, 0.07);
  border-radius: 0 var(--r) var(--r) 0;
  color: #e3f6e8;
}

.doc strong {
  color: var(--neon);
  font-weight: 500;
}

.doc a {
  border-bottom: 1px solid rgba(1, 205, 254, 0.5);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
}

.doc th {
  background: rgba(1, 205, 254, 0.1);
  color: var(--cyan);
}

.doc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: rgba(1, 205, 254, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line-cyan);
  background: linear-gradient(180deg, rgba(255, 113, 206, 0.08), rgba(11, 20, 16, 0.9));
  padding: 20px 26px 26px;
  display: grid;
  gap: 8px;
}

.foot-mega p {
  margin: 0;
  font-family: 'Orbitron', 'JetBrains Mono', sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 6.4vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(135, 255, 113, 0.8);
  text-shadow: 0 0 34px rgba(255, 113, 206, 0.35);
  overflow-wrap: break-word;
}

.foot-meta {
  text-align: center;
}

.foot-desc {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.foot-meta .copy {
  margin: 0;
  font-size: 12.5px;
  color: #6f8a79;
}

/* ---------- motion ---------- */

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes slidein {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes flicker {
  0%, 100% { text-shadow: 0 0 20px rgba(135, 255, 113, 0.45), 0 0 46px rgba(1, 205, 254, 0.28); }
  46% { text-shadow: 0 0 9px rgba(255, 113, 206, 0.55), 0 0 26px rgba(135, 255, 113, 0.36); }
  70% { text-shadow: 0 0 24px rgba(1, 205, 254, 0.5), 0 0 40px rgba(135, 255, 113, 0.24); }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  main {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 20px;
    padding: 22px 18px 40px;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 16px;
  }

  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    overflow: visible;
  }

  .rail-tag,
  .rail-foot {
    display: none;
  }

  .rail-search {
    flex: 1 1 150px;
    min-width: 130px;
  }

  .rail-search input {
    min-height: 44px;
  }

  .rail-menu {
    flex: 1 1 100%;
    border-top: 1px dashed var(--line);
    padding-top: 8px;
  }

  .rail-menu summary {
    padding-left: 10px;
  }

  .rail-menu menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-bottom: 4px;
  }

  .rail-menu menu a {
    font-size: 14px;
    padding: 10px;
    background: rgba(135, 255, 113, 0.05);
    border-left-color: rgba(135, 255, 113, 0.35);
  }

  .shell {
    margin-left: 0;
  }

  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px 14px 34px;
  }

  .doc,
  .jump {
    grid-column: 1;
    grid-row: auto;
  }

  .jump {
    position: static;
  }

  .jump ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .jump li {
    flex: 1 1 44%;
  }

  .jump a {
    min-height: 42px;
    border: 1px solid var(--line);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 16px;
    padding: 14px;
  }

  .hero-visual {
    order: 2;
  }

  .hero-copy {
    order: 1;
    text-align: left;
  }

  .hero-jump {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: clamp(23px, 6.4vw, 32px);
  }

  .doc > article {
    padding: 18px 16px;
    scroll-margin-top: 12px;
  }

  .foot {
    padding: 18px 14px 24px;
  }
}

@media (max-width: 420px) {
  .rail-menu menu {
    grid-template-columns: minmax(0, 1fr);
  }

  .jump li {
    flex: 1 1 100%;
  }

  .hero-jump .btn {
    flex: 1 1 100%;
  }
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
