@font-face {
  font-family: "Rubik";
  src: url("assets/fonts/rubik.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Monocraft";
  src: url("assets/fonts/monocraft.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #15171b;
  --surface: #1e2127;
  --surface-2: #272b32;
  --line: #343841;
  --text: #e8e9ec;
  --muted: #a6abb5;
  --red: #c8382f;
  --red-hover: #d9473d;
  --red-press: #a92c24;
  --gold: #f2c94c;
  --link: #f0b64a;

  /* Minecraft chat colors, only for in-game examples */
  --mc-gold: #ffaa00;
  --mc-blue: #5555ff;
  --mc-blue-readable: #8f8fff;
  --mc-green: #55ff55;
  --mc-gray: #aaaaaa;

  --radius: 10px;
  --wrap: 1180px;
  --font: "Rubik", system-ui, sans-serif;
  --pixel: "Monocraft", ui-monospace, monospace;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; scrollbar-color: #3c414b var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img { display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd27a; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.38em;
  white-space: nowrap;
}
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--gold); color: #1b1b1b; padding: 8px 12px; border-radius: 6px; z-index: 20; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- pixel icons ---------- */
.ico { width: 16px; height: 16px; fill: currentColor; flex: none; shape-rendering: crispEdges; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--red); color: #fff; text-decoration: none; font-weight: 600;
  border-radius: 8px; padding: 10px 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 6px 16px -6px rgba(200, 56, 47, 0.7);
  transition: background-color 0.15s, transform 0.15s var(--ease-out);
}
.btn:hover { background: var(--red-hover); color: #fff; }
.btn:active { background: var(--red-press); transform: translateY(1px); }
.btn-small { padding: 7px 14px; font-size: 0.9rem; }
.btn-big { padding: 14px 26px; font-size: 1.1rem; border-radius: 10px; }
.btn-big .ico { width: 20px; height: 20px; }
.btn-block { display: flex; width: 100%; font-size: 0.92rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { image-rendering: pixelated; }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.topnav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(620px, 82vh);
  display: grid; align-items: start;
  border-bottom: 1px solid var(--line);
}
.hero-scene {
  position: absolute; inset: 0;
  background: #18183a url("assets/scene.png") center bottom / cover no-repeat;
  image-rendering: pixelated;
}
/* keeps text readable over the sky without hiding the scene */
.hero-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 14, 34, 0.55) 0%, rgba(14, 14, 34, 0.15) 55%, rgba(14, 14, 34, 0) 75%);
}
.hero-inner { position: relative; text-align: center; padding-top: 64px; padding-bottom: 140px; }
.hero-icon {
  margin: 0 auto 18px; width: 96px; height: 96px; image-rendering: pixelated;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 3px 14px rgba(10, 10, 30, 0.6); }
.hero-pitch {
  max-width: 34em; margin: 14px auto 0; font-size: clamp(1.05rem, 2vw, 1.25rem); color: #f1eef6;
  text-shadow: 0 1px 12px rgba(10, 10, 30, 0.8);
}
.tag { font-family: var(--pixel); font-size: 0.92em; }
.tag-gold { color: var(--mc-gold); }
.hero-actions { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-file { font-size: 0.85rem; color: #ded9e8; text-shadow: 0 1px 8px rgba(10, 10, 30, 0.9); }
.hero-meta {
  list-style: none; padding: 0; margin: 22px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.hero-meta li {
  background: rgba(18, 18, 40, 0.62); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; color: #ecebf3;
}

/* ---------- tabs ---------- */
.tabs { border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  padding: 14px 14px 12px; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); border-bottom-color: var(--line); }
.tabs a.on { color: var(--text); border-bottom-color: var(--red); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-top: 36px; padding-bottom: 72px; }
main { min-width: 0; }
.block { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; margin-bottom: 0; }
.block p { max-width: 68ch; }
.block h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 14px; }
.block h3 { font-size: 1.1rem; font-weight: 600; margin: 32px 0 6px; }
.block p { margin: 0 0 14px; }

/* ---------- in-game example ---------- */
.ingame { margin: 28px 0 8px; }
.ingame-view {
  display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #2b2b52 url("assets/scene-plain.png") 50% 72% / cover no-repeat; image-rendering: pixelated;
  font-family: var(--pixel); font-size: 0.9rem; line-height: 1.55;
}
.ingame-view > * { image-rendering: auto; }
.tablist { background: rgba(0, 0, 0, 0.62); padding: 8px 10px 10px; }
.tablist-title { color: var(--mc-gray); text-align: center; margin-bottom: 6px; }
.tablist ul { list-style: none; margin: 0; padding: 0; }
.tablist li { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.1); padding: 1px 6px 1px 2px; margin-bottom: 2px; color: #fff; }
.face {
  width: 16px; height: 16px; flex: none;
  background: url("assets/faces.png") calc(var(--f) * -16px) 0 / 80px 16px no-repeat;
  image-rendering: pixelated;
}
.chatbox { background: rgba(0, 0, 0, 0.62); padding: 8px 10px; align-self: end; }
.chatbox p { margin: 0 0 4px; color: #fff; }
.chatbox p:last-child { margin: 0; }
.ingame figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.mc-gold { color: var(--mc-gold); }
.mc-blue { color: var(--mc-blue-readable); }
.mc-green { color: var(--mc-green); }
.mc-gray { color: var(--mc-gray); }

/* ---------- locator bar demo ---------- */
.locator {
  margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  font: 500 0.95rem var(--font); color: var(--muted); background: transparent; border: 0;
  padding: 7px 16px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--red); color: #fff; }

.bar-stage {
  margin: 22px 0 18px; padding: 34px 16px 18px;
  display: grid; justify-items: center; gap: 10px;
  border-radius: 8px; overflow: hidden;
  background: #2b2b52 url("assets/scene.png") 40% 100% / cover no-repeat; image-rendering: pixelated;
}
.bar-stage > * { image-rendering: auto; }
.bar { max-width: 400px; }
.bar {
  position: relative; width: 100%; height: 14px;
  background: #1a1a1a; border: 2px solid #000;
  box-shadow: inset 0 2px 0 #3a3a3a, inset 0 -2px 0 #0d0d0d;
}
.dot {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border: 2px solid #000;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), filter 0.35s;
}
.dot-alex { left: 34%; background: #ffd34d; }
.dot-mira { left: 63%; background: #6f8bff; }
.dot-kai { left: 84%; background: #e9e9e9; }
.hotbar { display: flex; padding: 2px; background: rgba(16, 16, 16, 0.55); border: 2px solid #a0a0a0; }
.hotbar i { width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.25); }
.hotbar i.sel { outline: 3px solid #f4f4f4; outline-offset: -1px; position: relative; z-index: 1; }

.legend { list-style: none; padding: 0; margin: 0 auto; width: fit-content; display: grid; gap: 4px; }
.legend li { display: flex; align-items: center; gap: 8px; transition: opacity 0.35s var(--ease-out); }
.legend em { color: var(--muted); font-style: normal; font-size: 0.88rem; }
.legend .mc-gold, .legend .mc-blue, .locator-note .mc-gold { font-family: var(--pixel); }
.swatch { width: 12px; height: 12px; border: 2px solid #000; flex: none; }
.sw-alex { background: #ffd34d; } .sw-mira { background: #6f8bff; } .sw-kai { background: #e9e9e9; }
.locator-note { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 14px auto 0 !important; }

/* hidden in the current mode */
.locator .off { opacity: 0; transform: scale(0.4); filter: blur(2px); }
.locator .legend .off { opacity: 0.38; transform: none; filter: none; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }

.code {
  margin: 0 0 8px; background: #0f1114; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; max-width: 68ch;
}
.code code { background: none; border: 0; padding: 0; font-size: 0.92rem; white-space: pre; color: #e3e3e3; }

/* ---------- commands table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; vertical-align: top; }
thead th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 0.85rem; }
tbody tr + tr td { border-top: 1px solid var(--line); }
tr.group th { background: var(--surface); color: var(--gold); font-weight: 600; font-size: 0.9rem; border-top: 1px solid var(--line); }
td:first-child { width: 46%; }
td code { white-space: normal; }

/* ---------- install ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 68ch; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: baseline; }
.steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%;
  font-weight: 700; color: var(--gold); font-size: 0.9rem; transform: translateY(-1px);
}
.files { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 18px; }
.files dt { font-weight: 500; }
.files dd { margin: 0; color: var(--muted); }
.note { color: var(--muted); font-size: 0.95rem; }

/* ---------- changelog ---------- */
.release + .release { margin-top: 22px; }
.release h3 { margin: 0 0 6px; display: flex; gap: 12px; align-items: baseline; }
.release time { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.release ul { margin: 0; padding-left: 20px; }

/* ---------- sidebar ---------- */
.side { display: grid; gap: 16px; align-content: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.panel h3 { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.panel h3:first-of-type { margin-top: 0; }
.panel p { margin: 0; font-size: 0.95rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.hash-label { margin-top: 14px !important; font-size: 0.8rem !important; color: var(--muted); font-weight: 600; }
.hash code { display: block; white-space: normal; word-break: break-all; font-size: 0.78rem; line-height: 1.5; margin-top: 4px; }
.copy {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 8px;
  font: 500 0.88rem var(--font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; cursor: pointer;
}
.copy:hover { border-color: #4a4f59; }
.copy.done { color: var(--mc-green); border-color: rgba(85, 255, 85, 0.4); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 0.95rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { padding-top: 22px; padding-bottom: 28px; color: var(--muted); font-size: 0.88rem; }
.foot p { margin: 0 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topnav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .hero-inner { padding-top: 44px; padding-bottom: 120px; }
  .hero-scene { background-position: 58% bottom; }
  .ingame-view { grid-template-columns: 1fr; padding: 14px; }
  .tablist { max-width: 260px; }
  .tabs-inner { mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 32px; }
  /* commands table: command on its own line, description under it */
  thead { display: none; }
  tbody tr, tbody td { display: block; }
  tr.group th { display: block; }
  td:first-child { width: auto; padding-bottom: 2px; }
  td + td { padding-top: 0; color: var(--muted); }
  tbody tr + tr td { border-top: 0; }
  tbody tr + tr { border-top: 1px solid var(--line); }
  .files { grid-template-columns: 1fr; gap: 2px; }
  .files dd { margin-bottom: 10px; }
  .locator { padding: 16px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 8px 6px; }
  .hotbar i { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
