@font-face { font-family: "Silkscreen"; src: url("../fonts/silkscreen-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #1d1416;
  --bg-2: #2a1d1f;
  --bg-3: #34252a;
  --line: #4a3236;
  --slot: #2b2224;
  --slot-hover: #3a2c2f;
  --slot-light: #4a3a3c;
  --slot-shadow: #110b0c;
  --text: #eadbd2;
  --text-dim: #b9a49a;
  --gold: #f3c98b;
  --ember: #e0a23a;
  --lava: #ff8a3c;
  --netherite: #5a3e36;
  --netherite-hover: #6a4a40;
  --netherite-light: #8a6455;
  --netherite-dark: #3a2620;
  --tooltip-bg: #100010;
  --tooltip-border: #3c0a8a;
  --splash: #ffff3c;
  --px: "Silkscreen", "Courier New", monospace;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 80% 420px at 30% 0%, #4a1a14 0%, transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
img { max-width: 100%; height: auto; }
a { color: var(--gold); }
a:hover { color: #fff1d6; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; }

.px { font-family: var(--px); font-weight: 400; letter-spacing: .02em; }
.dim { color: var(--text-dim); }
.icon { image-rendering: pixelated; flex: none; }

/* Containers: 16px gutter on phones, centred max width on desktop. */
.hero, .section, .crumbs, .project-head, .credit, .footer-inner, .topbar-inner {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--bg-2); padding: 8px 12px; }

/* Top bar */
.topbar { background: var(--slot-shadow); border-bottom: 2px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; font-size: 18px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.topbar nav a { color: var(--text); text-decoration: none; }
.topbar nav a:hover { color: var(--gold); }

/* Hero */
.hero { position: relative; padding: 64px 0 40px; }
.eyebrow { margin: 0 0 8px; color: var(--ember); font-size: 14px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 6vw, 52px); color: var(--gold); text-shadow: 3px 3px 0 var(--slot-shadow); }
.lede { margin: 0 0 20px; max-width: 60ch; font-size: 18px; }
.splash {
  position: absolute; right: 0; top: 48px; margin: 0; max-width: 16ch;
  color: var(--splash); text-shadow: 2px 2px 0 #3f3f00; text-align: center; font-size: 16px;
  transform: rotate(-12deg);
  animation: splash .6s ease-in-out infinite alternate;
}
@keyframes splash { to { transform: rotate(-12deg) scale(1.08); } }
.hero-lava h1 { color: var(--lava); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-block; padding: 10px 16px; font-size: 14px;
  background: var(--netherite); color: #fff2e6; text-decoration: none; cursor: pointer;
  border: 2px solid var(--slot-shadow);
  box-shadow: inset 2px 2px 0 var(--netherite-light), inset -2px -2px 0 var(--netherite-dark);
}
.btn:hover { background: var(--netherite-hover); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: inset -2px -2px 0 var(--netherite-light), inset 2px 2px 0 var(--netherite-dark); }
.btn-alt { background: var(--bg-3); box-shadow: inset 2px 2px 0 var(--slot-light), inset -2px -2px 0 var(--slot-shadow); }
.btn-alt:hover { background: var(--slot-hover); }

/* Netherrack band divider */
.band {
  height: 24px;
  background: repeating-linear-gradient(90deg, #6b2a2a 0 8px, #5a2222 8px 16px, #742f2c 16px 24px, #4d1d1f 24px 32px);
  border-top: 4px solid #3d1a1c;
  border-bottom: 4px solid var(--slot-shadow);
}

/* Sections */
.section { padding: 40px 0; }
.label { margin: 0 0 16px; color: var(--ember); font-size: 14px; }
.chip, .badge { display: inline-block; background: var(--bg-3); border: 1px solid var(--line); }
.chip { padding: 2px 8px; font-size: 13px; }
.badge { padding: 0 6px; font: 12px/1.7 var(--mono); }
.badge-warn { border-color: var(--ember); color: var(--ember); }

/* Featured */
.featured {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 20px;
  background: var(--bg-2); border: 2px solid var(--line); box-shadow: 0 0 0 2px var(--slot-shadow);
}
.featured-shot img { display: block; border: 2px solid var(--slot-shadow); }
.featured h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 24px; color: var(--gold); }
.family { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }

/* Inventory slots */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.slot {
  position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px;
  background: var(--slot); color: var(--text); text-decoration: none;
  border: 2px solid var(--slot-shadow);
  box-shadow: inset 3px 3px 0 var(--slot-light), inset -3px -3px 0 #1a1113;
}
.slot:hover, .slot:focus-visible { background: var(--slot-hover); color: var(--text); }
.slot-name { font-size: 18px; color: var(--gold); }
.slot-tagline { font-size: 15px; }
.slot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; font-size: 13px; }
.tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 5;
  display: none; flex-direction: column; gap: 2px;
  width: max-content; max-width: 280px; padding: 8px 10px;
  background: var(--tooltip-bg); color: var(--text); font-size: 14px;
  border: 2px solid var(--tooltip-border); outline: 2px solid var(--tooltip-bg);
  transform: translateX(-50%); pointer-events: none;
}
.tooltip-title { color: #fff; }
.slot:hover .tooltip, .slot:focus-visible .tooltip { display: flex; }
@media (hover: none) { .slot .tooltip { display: none; } }

/* Contributions */
.contribs { margin: 0; padding: 0; list-style: none; border-top: 1px dashed var(--line); }
.contrib {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px;
  padding: 14px 4px; color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--line);
}
.contrib:hover { background: var(--bg-2); color: var(--text); }
.contrib .icon { grid-row: span 2; }
.contrib-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.contrib-name { color: var(--gold); }
.contrib-changes { color: var(--text-dim); font-size: 14px; }

/* Project page */
.crumbs { padding-top: 24px; font-size: 14px; color: var(--text-dim); }
.project-head { display: flex; align-items: center; gap: 20px; padding: 24px 0 8px; }
.project-head h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); color: var(--gold); }
.project-head .lede { margin: 6px 0 10px; }
.credit { margin-top: 16px; padding: 16px 20px; background: var(--bg-2); border: 2px solid var(--ember); }
.credit .label { margin-bottom: 8px; }
.credit p { margin: 0 0 8px; }
.family-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.family-list li { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font: 400 13px var(--px); color: var(--ember); }
.stats { display: block; font: 13px var(--mono); color: var(--text-dim); }
.highlights { margin: 0; padding-left: 1.2em; }
.highlights li { margin-bottom: 6px; }
.highlights li::marker { color: var(--ember); }
.tech { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
main { flex: 1; }
.prose > * { max-width: 72ch; }
.prose h2 { margin: 28px 0 8px; font: 400 20px var(--px); color: var(--gold); }
.prose code { padding: 1px 5px; background: var(--bg-3); font: .9em var(--mono); }
.prose pre { padding: 12px; overflow-x: auto; background: var(--slot-shadow); }
.prose pre code { padding: 0; background: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.gallery img { display: block; border: 2px solid var(--slot-shadow); }
.lightbox { max-width: min(96vw, 1400px); padding: 0; background: var(--bg); border: 2px solid var(--line); }
.lightbox::backdrop { background: rgb(0 0 0 / .8); }
.lightbox img { display: block; width: auto; max-height: 85vh; }
.lightbox .btn { margin: 10px; }

/* Footer */
.footer { margin-top: 48px; background: var(--slot-shadow); }
.footer-inner { padding: 24px 0 32px; font-size: 14px; color: var(--text-dim); }
.footer-inner .px { margin: 0 0 6px; color: var(--gold); }
.fine { font-size: 12px; }

/* Responsive */
@media (max-width: 860px) { .slots { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .splash { position: static; display: inline-block; margin-bottom: 16px; }
  .hero { padding-top: 32px; }
  .project-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 540px) { .slots { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active { transform: none; }
}
