:root {
  --bg: #0b0a0d;
  --card: #131218;
  --line: #28262f;
  --ink: #efe9dc;
  --mut: #a49c8c;
  --faint: #5f5748;
  --rune: #e6b757;
  --rune-dim: #a5813c;
  --steel: #6fc3e0;
  --blood: #d1654f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.65;
  padding: 0 18px;
}

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

.wrap {
  max-width: 720px;
  margin: 8vh auto 70px;
}

a {
  color: var(--steel);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: currentColor;
}

header {
  margin-bottom: 34px;
}

.brand {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rune);
}

.futhark {
  display: block;
  font-family: "Noto Sans Runic", monospace;
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  color: var(--rune-dim);
  margin-top: 4px;
}

h1 {
  font-size: 2.1rem;
  margin: 10px 0 8px;
  letter-spacing: -0.02em;
}

h1.glow {
  animation: flicker 6s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { text-shadow: 0 0 18px rgba(230, 183, 87, 0.18); }
  50% { text-shadow: 0 0 26px rgba(230, 183, 87, 0.32); }
  52% { text-shadow: 0 0 14px rgba(230, 183, 87, 0.14); }
}

.hero {
  position: relative;
  min-height: 46vh;
  padding: 48px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #171419 0%, var(--bg) 68%);
}

.hero + .wrap {
  margin-top: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 0 auto;
}

.hero .sub {
  margin: 0 auto;
}

.hero .badges {
  justify-content: center;
}

.embers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.embers span {
  position: absolute;
  left: var(--x);
  bottom: -10px;
  width: calc(3px * var(--s));
  height: calc(3px * var(--s));
  border-radius: 50%;
  background: var(--rune);
  opacity: 0;
  animation: rise var(--d) linear var(--sd) infinite;
  box-shadow: 0 0 6px rgba(230, 183, 87, 0.6);
}

@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.8; }
  50% { transform: translateY(-45vh) translateX(12px); }
  92% { opacity: 0.3; }
  100% { transform: translateY(-88vh) translateX(-8px); opacity: 0; }
}

.spear {
  position: relative;
  z-index: 1;
  display: block;
  width: min(360px, 60vw);
  height: auto;
  margin: 0 auto 18px;
  opacity: 0.85;
  filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.5));
  transform: translateX(-120vw) rotate(-18deg);
  animation: throw 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) 0.2s forwards;
}

@keyframes throw {
  0% { transform: translateX(-120vw) rotate(-18deg); }
  78% { transform: translateX(6px) rotate(1deg); }
  88% { transform: translateX(-3px) rotate(-0.5deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

.scroll-cue {
  position: relative;
  z-index: 2;
  margin-top: 16px;
  font-family: "Noto Sans Runic", monospace;
  font-size: 1.1rem;
  color: var(--rune-dim);
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

.yggdrasil {
  position: relative;
  height: 1px;
  margin: 0 0 30px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}

.valknut {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 10px;
}

@media (prefers-reduced-motion: reduce) {
  h1.glow { animation: none; }
  .embers span { animation: none; opacity: 0; }
  .spear { animation: none; transform: none; }
  .scroll-cue { animation: none; }
}

.sub {
  color: var(--mut);
  font-size: 1.02rem;
  max-width: 56ch;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.badge:hover {
  border-color: var(--rune-dim);
  color: var(--rune);
  transform: translateY(-1px);
}

.term {
  background: #0d0f13;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #0a0b0e;
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-bar .term-dot:nth-child(1) {
  background: #ff5f57;
}

.term-bar .term-dot:nth-child(2) {
  background: #febc2e;
}

.term-bar .term-dot:nth-child(3) {
  background: #28c840;
}

.term-title {
  margin-left: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--faint);
}

.term-body {
  padding: 16px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  white-space: pre-wrap;
  min-height: 168px;
}

.term-body .p {
  color: var(--rune);
}

.term-body .o {
  color: var(--mut);
}

.term-body .k {
  color: var(--steel);
}

.term-body .v {
  color: var(--blood);
}

.term-body .c {
  color: var(--ink);
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--rune);
  vertical-align: middle;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}

section {
  margin: 34px 0;
}

h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2::before {
  content: "\16CF";
  font-family: "Noto Sans Runic", monospace;
  color: var(--rune-dim);
  font-size: 0.95rem;
}

p {
  margin: 0 0 14px;
}

.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 20px;
}

.row {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 6px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: background-color 0.15s ease;
}

.row:hover {
  background: rgba(230, 183, 87, 0.05);
}

.row:hover .k2 {
  color: var(--rune);
}

.row:last-child {
  border-bottom: none;
}

.k2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--mut);
  min-width: 130px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.v2 {
  font-size: 0.92rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  border-color: var(--rune-dim);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card:hover b {
  color: var(--rune);
}

.card b {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.card span {
  color: var(--mut);
  font-size: 0.82rem;
}

pre.code {
  background: #0d0f13;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--ink);
}

pre.code .c1 {
  color: var(--faint);
}

.runes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rune {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.rune:hover {
  background: rgba(230, 183, 87, 0.06);
}

.rune code {
  font-family: "JetBrains Mono", monospace;
  color: var(--rune);
  font-size: 0.85rem;
  flex: none;
  min-width: 150px;
  transition: text-shadow 0.15s ease;
}

.rune:hover code {
  text-shadow: 0 0 10px rgba(230, 183, 87, 0.5);
}

.rune span {
  color: var(--mut);
  font-size: 0.88rem;
}

footer {
  color: var(--faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.9;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 40px;
}

footer a {
  color: var(--mut);
}
