@font-face { font-family: "Monocraft"; src: url("fonts/monocraft-subset.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Fancy Vanilla site. Palette comes from the brand artwork (charcoal + glacier blue), no decoration for its own sake. */
:root {
  --bg: #0e1013;
  --bg-2: #13161b;
  --line: #262b33;
  --line-2: #323844;
  --text: #e9edf2;
  --muted: #98a2b3;
  --accent: #8fb4e8;
  --accent-ink: #0b1220;
  --ok: #7bd88f;
  --warn: #f2c14e;
  --radius: 4px;
  --wrap: 1180px;
  --font-display: "Monocraft", "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: .08em .35em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 50; border-radius: var(--radius); }
.skip:focus { top: 8px; }

/* ---------- top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(14, 16, 19, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand img { height: 22px; width: auto; }
.nav { display: flex; gap: 22px; margin-left: 12px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); font-size: .92rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--text); border-bottom-color: var(--line-2); }
.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 34px; padding: 5px 11px; font: 500 .78rem var(--font-mono); letter-spacing: .04em; color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] { background: var(--text); color: var(--bg); }

.top-tools { display: flex; align-items: center; gap: 14px; }
.ext { display: flex; align-items: center; gap: 4px; }
.ext a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: .86rem; }
.ext a:hover { color: var(--text); background: var(--bg-2); }
.ico { width: 18px; height: 18px; flex: none; }
.ext-link { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- preloader (same idea as the in-game loader: wordmark and a thin progress line) */
#preloader { display: none; }
.js-preload #preloader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 26px; background: var(--bg); opacity: 1; transition: opacity .45s ease; }
.js-preload #preloader.done { opacity: 0; pointer-events: none; }
#preloader img { width: min(420px, 72vw); height: auto; }
.pre-bar { width: min(260px, 52vw); height: 2px; background: var(--line); overflow: hidden; }
.pre-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .js-preload #preloader { transition: none; } .pre-bar i { transition: none; } }

/* ---------- hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-art { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,16,19,.96) 0%, rgba(14,16,19,.62) 46%, rgba(14,16,19,.94) 100%), url("img/hero.jpg") center bottom / cover no-repeat; filter: saturate(.85); }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 56px; align-items: end; padding: clamp(64px, 12vh, 140px) 0 clamp(48px, 9vh, 96px); }
.eyebrow { margin: 0 0 22px; font: 500 .8rem/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0 0 22px; font: 700 clamp(1.9rem, 5.4vw, 3.9rem)/1.12 var(--font-display); letter-spacing: 0; overflow-wrap: anywhere; text-wrap: balance; }
.lead { margin: 0; max-width: 34rem; color: #c3cad6; font-size: clamp(1.02rem, 1.4vw, 1.18rem); }

.dl { background: rgba(14, 16, 19, .86); border: 1px solid var(--line-2); border-radius: 6px; padding: 24px; }
.label { margin: 0 0 14px; font: 500 .76rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.seg { --n: 4; --i: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.seg::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% / var(--n)); background: var(--accent); transform: translateX(calc(var(--i) * 100%)); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.seg button { position: relative; z-index: 1; background: none; border: 0; padding: 10px 8px; font: 500 .9rem var(--font-mono); color: var(--muted); cursor: pointer; border-right: 1px solid var(--line-2); transition: color .3s ease; }
.seg button:hover { color: var(--text); }
.seg button:last-child { border-right: 0; }
.seg button[aria-selected="true"], .seg button[aria-selected="true"]:hover { color: var(--accent-ink); }
/* download box: panels are stacked, the box height follows the active one, everything fades */
.panels { display: grid; position: relative; transition: height .45s cubic-bezier(.2, .8, .2, 1); }
.panel { grid-area: 1 / 1; align-self: start; transition: opacity .4s ease .08s, transform .45s cubic-bezier(.2, .8, .2, 1) .08s; }
.panel[hidden] { display: block; visibility: hidden; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s; }
.panel .ver { font: 700 1.5rem/1 var(--font-display); }
.panel .ver small { font: 500 .8rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); margin-left: 8px; }
.panel .meta { margin: 8px 0 18px; color: var(--muted); font-size: .88rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: var(--radius); text-decoration: none; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.ghost { border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted); }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; }
.hash { margin-top: 16px; display: flex; align-items: center; gap: 10px; font: 400 .74rem var(--font-mono); color: var(--muted); }
.hash code { background: none; border: 0; padding: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 17ch; }
.hash button { background: none; border: 1px solid var(--line-2); color: var(--muted); border-radius: 3px; padding: 2px 8px; font: 500 .72rem var(--font-mono); cursor: pointer; }
.hash button:hover { color: var(--text); border-color: var(--muted); }
.fine { color: var(--muted); font-size: .84rem; line-height: 1.55; margin: 14px 0 0; }

/* ---------- sections */
.band { padding: clamp(56px, 9vw, 108px) 0; border-bottom: 1px solid var(--line); }
.band.alt { background: var(--bg-2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
h2 { margin: 0 0 22px; font: 700 clamp(1.3rem, 2.8vw, 2rem)/1.25 var(--font-display); letter-spacing: 0; overflow-wrap: anywhere; text-wrap: balance; }
.statement { margin: 0; font: 400 clamp(1.05rem, 2vw, 1.5rem)/1.5 var(--font-display); letter-spacing: 0; }
.body { color: #c3cad6; margin: 0 0 16px; max-width: 38rem; }
.plain, .steps { padding-left: 1.2rem; margin: 0; color: #c3cad6; }
.plain li, .steps li { margin: 0 0 12px; padding-left: 4px; max-width: 38rem; }
.plain li::marker { color: var(--accent); }
.steps li::marker { color: var(--accent); font-family: var(--font-mono); }

.facts { margin: 0; border-top: 1px solid var(--line-2); }
.facts div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font: 500 .98rem var(--font-mono); text-align: right; }

.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px 48px; margin-top: clamp(40px, 6vw, 72px); padding-top: 36px; border-top: 1px solid var(--line-2); }
.lists h3 { margin: 0 0 12px; font: 500 .76rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.lists p { margin: 0; color: #c3cad6; font-size: .93rem; }

.shot { margin: 0; }
.shot img { border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); }
.shot figcaption { margin-top: 12px; color: var(--muted); font-size: .84rem; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }

/* ---------- tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tbl th { text-align: left; font: 500 .72rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0 12px 12px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .num { text-align: right; font-family: var(--font-mono); }
.tbl th.num { text-align: right; }
.tbl-scroll { overflow-x: auto; margin-top: 8px; }
.versions { min-width: 760px; }
.versions .latest td { background: rgba(143, 180, 232, .06); }
.versions .legacy td { color: var(--muted); }
.versions a { color: var(--accent); text-underline-offset: 3px; }
.versions code { font-size: .75rem; }
.tag { display: inline-block; font: 500 .72rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.alpha { color: var(--warn); border-color: rgba(242, 193, 78, .4); }
.tag.release { color: var(--ok); border-color: rgba(123, 216, 143, .4); }
.tbl .hashcell { font: 400 .74rem var(--font-mono); color: var(--muted); }
.tbl .hashcell button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 6px; text-decoration: underline; text-underline-offset: 3px; font: inherit; }

.code { border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: #0a0c0f; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); font: 500 .74rem var(--font-mono); color: var(--muted); }
.code-bar button { background: none; border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 9px; font: 500 .72rem var(--font-mono); color: var(--muted); cursor: pointer; }
.code-bar button:hover { color: var(--text); border-color: var(--muted); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 400 .82rem/1.7 var(--font-mono); color: #d3dae5; }
.code code { background: none; border: 0; padding: 0; font-size: inherit; }
.code .c { color: #6b7686; }
.download-row { margin: 18px 0 0; }

.zoomable { cursor: zoom-in; }
.lb { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
.lb::backdrop { background: rgba(6, 8, 10, .88); }
.lb img { display: block; max-width: 96vw; max-height: 92vh; width: auto; height: auto; border: 1px solid var(--line-2); border-radius: 6px; cursor: zoom-out; margin: 0 auto; }
.lb-x { position: fixed; top: 14px; right: 18px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(14, 16, 19, .9); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.lb-x:hover { border-color: var(--muted); }

/* ---------- footer */
.foot { padding: 48px 0 56px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 32px 64px; align-items: start; }
.foot-links { display: grid; gap: 8px; justify-items: start; }
.foot-links a { color: var(--muted); text-underline-offset: 3px; }
.foot-links a:hover { color: var(--text); }
.legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); margin: 0; }
.foot img { margin-bottom: 14px; opacity: .9; }

/* grid children may shrink below their content (long code, URLs) */
.hero-grid > *, .split > *, .foot-grid > *, .pair > * { min-width: 0; }
.steps code, .plain code, .body code, .fine code { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .ext a { min-height: 40px; }
  .lang a { min-height: 40px; }
  .seg button { min-height: 44px; }
}

/* ---------- motion */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.btn, .nav a, .ext a, .lang a, .hash button, .code-bar button, .foot-links a, .versions a { transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
html:not(.js-preload) .hero-grid > div > * { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
html:not(.js-preload) .hero-grid > div > :nth-child(2) { animation-delay: .1s; }
html:not(.js-preload) .hero-grid > div > :nth-child(3) { animation-delay: .22s; }
html:not(.js-preload) .hero-grid > div > :nth-child(n+4) { animation-delay: .34s; }
html:not(.js-preload) .hero-grid > .dl { animation: rise 1s cubic-bezier(.2, .8, .2, 1) .3s both; }
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }
.tbl tbody tr { transition: background-color .25s ease; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .025); }
@keyframes lbin { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lbout { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.98); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
.lb[open] { animation: lbin .3s cubic-bezier(.2, .8, .2, 1) both; }
.lb[open]::backdrop { animation: fadein .3s ease both; }
.lb.closing { animation: lbout .22s ease both; }
.lb.closing::backdrop { animation: fadeout .22s ease both; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  html:not(.js-preload) .hero-grid > div > *, html:not(.js-preload) .hero-grid > .dl { animation: none; }
  .panels, .panel, .panel[hidden], .seg::before, .lb[open], .lb.closing { transition: none; animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* ---------- spacing scale (fluid) and rhythm */
:root {
  --space-2xs: clamp(.25rem, .2rem + .25vw, .375rem);
  --space-xs: clamp(.5rem, .4rem + .4vw, .75rem);
  --space-sm: clamp(.75rem, .65rem + .5vw, 1rem);
  --space-md: clamp(1rem, .85rem + .75vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --space-xl: clamp(2rem, 1.6rem + 2vw, 3.25rem);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}
/* download box: one vertical rhythm for every panel, whatever it contains */
.dl { padding: var(--space-lg); }
.dl .label { margin-bottom: var(--space-sm); }
.dl .seg { margin-bottom: var(--space-md); }
.dl .panel > * + * { margin-top: var(--space-md); }
.dl .panel > .meta { margin-top: var(--space-2xs); }
.dl .panel > .note { margin-top: var(--space-sm); }
.dl .panel > .row { margin-top: var(--space-md); }
.dl .panel > .hash { margin-top: var(--space-sm); }
.dl .panel > .fine:not(.note) { margin-top: var(--space-sm); }
.panel .fine { line-height: 1.6; }
/* section rhythm */
.band .label + h2 { margin-top: var(--space-xs); }
.band h2 + .body, .band h2 + .plain, .band h2 + .tbl-scroll, .band h2 + .pair, .band h2 + .statement { margin-top: var(--space-md); }
.band .body + .body { margin-top: var(--space-sm); }
.band .fine { margin-top: var(--space-sm); }
.download-row { margin-top: var(--space-lg); }
.download-row .label { margin-bottom: var(--space-sm); }
.download-row .fine { margin-top: var(--space-sm); }
.pair { margin-top: var(--space-lg); gap: var(--space-md); }
.shot figcaption { margin-top: var(--space-xs); }
.facts div { padding-block: var(--space-sm); }
.lists { gap: var(--space-lg) var(--space-xl); }
.foot-grid { row-gap: var(--space-lg); }
@media (max-width: 960px) {
  .hero-grid { gap: var(--space-xl); }
  .split { gap: var(--space-xl); }
}

/* ---------- smooth scrolling (Lenis, light) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- reduced motion: global switch-off (accessibility) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- responsive */
@media (max-width: 960px) {
  .hero-grid, .split, .foot-grid, .pair { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 40px; }
  .top-inner { flex-wrap: wrap; height: auto; padding: 8px 0 0; gap: 6px 14px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-top: 1px solid var(--line); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: 12px 12px; border-bottom: 0; }
  .top-tools { margin-left: auto; }
  html { scroll-padding-top: 112px; }
}
@media (max-width: 720px) { .ext a span { display: none; } .ext a { padding: 6px; } }
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .btn { width: 100%; }
  .panel .row, .download-row .row { flex-direction: column; }
  .tbl-scroll { margin-inline: -16px; padding-inline: 16px; }
  .lb-x { top: 8px; right: 8px; }
  .brand img { height: 20px; }
  .nav a { padding: 12px 10px; font-size: .88rem; }
  .dl { padding: 18px; }
  .facts div { flex-direction: column; gap: 2px; }
  .facts dd { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
