@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #111925;
  --ground-raised: #172433;
  --stage: #223244;
  --line: #435367;
  --text: #f4f5ed;
  --muted: #bfcbcf;
  --blue: #586ef4;
  --blue-deep: #3549bd;
  --amber: #ffc247;
  --light: #e8edf0;
  --light-ink: #182332;
  --font-body: "Barlow", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 16px/1.5 var(--font-body); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--amber); color: var(--ground); }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: #66788c; border: 2px solid var(--ground); }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
[hidden] { display: none !important; }

.app { min-height: 100vh; }
.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: clamp(24px, 4vw, 62px); min-height: 78px; padding: 0 max(24px, calc((100vw - 1380px) / 2)); background: var(--ground); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 39px; height: 39px; background: var(--amber); color: var(--ground); font: 700 22px/1 var(--font-display); letter-spacing: -.02em; }
.brand__word { font-weight: 600; font-size: 18px; letter-spacing: -.025em; }
.site-nav { display: flex; align-self: stretch; align-items: stretch; gap: clamp(16px, 2.1vw, 34px); min-width: 0; }
.site-nav a { display: inline-flex; align-items: center; position: relative; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 4px; background: var(--amber); }
.site-header__external { margin-left: auto; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.site-header__external:hover { color: var(--amber); }
.site-header__external span { margin-left: 4px; }

main { width: min(100%, 1428px); margin: 0 auto; padding: 0 24px 110px; }
.opening { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 40px 0 24px; }
.opening h1, .section-opening h1, .about-copy h1 { margin: 0; font: 700 clamp(68px, 7vw, 96px)/.82 var(--font-display); letter-spacing: -.018em; text-transform: uppercase; }
.opening h1 { max-width: 840px; }
.opening__period { color: var(--amber); }
.opening p { max-width: 310px; margin: 0 0 6px; color: var(--muted); font-size: 18px; line-height: 1.4; }

.stage-shell { display: grid; grid-template-columns: minmax(230px, 282px) minmax(0, 1fr); background: var(--stage); border: 1px solid var(--line); }
.game-route { min-width: 0; display: flex; flex-direction: column; background: var(--ground-raised); border-right: 1px solid var(--line); }
.route-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 22px 18px 18px; border-bottom: 1px solid var(--line); }
.route-heading h2 { margin: 0; font: 700 25px/.95 var(--font-display); text-transform: uppercase; }
.route-heading span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.game-selector { display: flex; flex-direction: column; overflow: auto; max-height: 730px; scrollbar-color: #66788c var(--ground-raised); }
.game-choice { position: relative; display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 10px; width: 100%; min-height: 65px; padding: 13px 16px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.game-choice::before { content: ""; position: absolute; top: 0; bottom: -1px; left: 29px; width: 1px; background: #66788c; }
.game-choice:first-child::before { top: 27px; }
.game-choice:last-child::before { bottom: calc(100% - 27px); }
.game-choice:hover { background: #2c4055; }
.game-choice[aria-pressed="true"] { background: var(--blue); color: white; }
.game-choice__number { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--amber); background: var(--ground-raised); color: var(--amber); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.game-choice[aria-pressed="true"] .game-choice__number { background: var(--amber); color: var(--ground); }
.game-choice__name { display: block; font-size: 14px; font-weight: 600; line-height: 1.18; }
.game-choice__tool { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.game-choice[aria-pressed="true"] .game-choice__tool { color: #e4e8ff; }

.stage-main { min-width: 0; }
.stage-screen { position: relative; aspect-ratio: 16 / 6.8; overflow: hidden; background: #070c15; }
.stage-screen video { width: 100%; height: 100%; object-fit: cover; }
.stage-screen__play { position: absolute; left: 20px; bottom: 20px; z-index: 2; }
.stage-screen__bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: start; justify-content: space-between; padding: 16px; pointer-events: none; }
.preview-label, .preview-toggle { background: var(--ground); color: var(--text); font-size: 11px; line-height: 1.2; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.preview-label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; }
.preview-label__dot { width: 7px; height: 7px; background: var(--amber); }
.preview-toggle { padding: 9px 11px; border: 0; pointer-events: auto; }
.preview-toggle:hover { background: var(--amber); color: var(--ground); }
.stage-details { padding: 25px clamp(22px, 3vw, 40px) 27px; background: var(--light); color: var(--light-ink); }
.stage-details__head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.stage-details__meta { margin: 0 0 7px; color: #405063; font-size: 12px; font-weight: 600; }
.stage-details h2 { margin: 0; font: 700 clamp(36px, 4vw, 56px)/.95 var(--font-display); text-transform: uppercase; letter-spacing: -.01em; }
.stage-details__index { color: #718092; font: 700 36px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.stage-details__description { max-width: 58ch; margin: 12px 0 20px; color: #374859; font-size: 15px; line-height: 1.45; }
.stage-details__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.action-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 43px; padding: 10px 14px; border: 1px solid var(--light-ink); background: none; color: var(--light-ink); text-decoration: none; font-size: 13px; font-weight: 600; line-height: 1.2; }
.action-link:hover { background: #d1dae0; }
.action-link--primary { min-width: 150px; border-color: var(--amber); background: var(--amber); }
.action-link--primary:hover { background: #f4b526; }
.action-link--quiet { border-color: transparent; padding-left: 0; }
.action-link--quiet:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.stage-details__story { max-width: 65ch; margin-top: 22px; padding-top: 16px; border-top: 1px solid #a9b5be; color: #344455; font-size: 14px; line-height: 1.55; }
.stage-stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 47px; padding: 0 clamp(22px, 3vw, 40px); background: var(--ground-raised); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.stage-stepper button { padding: 4px 0; border: 0; background: transparent; color: var(--text); font-size: 12px; }
.stage-stepper button:hover { color: var(--amber); }

.icon { position: relative; display: inline-block; flex: 0 0 14px; width: 14px; height: 14px; vertical-align: middle; }
.icon::before { content: ""; position: absolute; top: 7px; left: 1px; width: 12px; height: 1.5px; background: currentColor; transform: rotate(-45deg); }
.icon::after { content: ""; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
.icon--right { transform: rotate(45deg); }
.icon--left { transform: rotate(-135deg); }
.icon--down { transform: rotate(135deg); }

.game-elsewhere { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 24px; background: var(--line); border: 1px solid var(--line); }
.game-elsewhere a { display: grid; grid-template-columns: 1fr auto; align-content: center; min-height: 120px; padding: 20px 28px; background: var(--ground-raised); text-decoration: none; }
.game-elsewhere a:hover { background: #273b50; }
.game-elsewhere a strong { font: 700 31px/.98 var(--font-display); text-transform: uppercase; }
.game-elsewhere a .icon { align-self: center; color: var(--amber); }
.archive-link { display: inline-block; margin-top: 23px; padding-bottom: 4px; border-bottom: 1px solid var(--amber); color: var(--amber); font-size: 13px; font-weight: 600; text-decoration: none; }
.archive-link:hover { color: var(--text); border-color: var(--text); }

.section-opening { display: flex; align-items: end; justify-content: space-between; gap: 24px; min-height: 240px; padding: 65px 0 36px; }
.section-opening h1 { max-width: 890px; }
.section-opening p { max-width: 260px; margin: 0 0 4px; color: var(--muted); font-size: 17px; line-height: 1.45; }
.section-opening--art h1 { color: var(--text); }
.section-opening--art h1 { font-size: clamp(62px, 6vw, 82px); }
.section-opening--software h1 { color: #b5d6ff; }
.section-opening--mods h1 { color: #ffcf75; }
.art-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 12px; }
.art-piece { position: relative; min-width: 0; margin: 0; overflow: hidden; background: var(--stage); }
.art-piece:first-child { grid-column: span 2; grid-row: span 2; }
.art-piece:nth-child(5n + 3) { grid-column: span 2; }
.art-piece img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.art-piece:first-child img { min-height: 470px; }
.art-piece:hover img { transform: scale(1.035); }
.art-piece figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; background: linear-gradient(transparent, rgba(8,12,20,.88)); color: white; font-size: 12px; font-weight: 600; }
.art-piece__motion { position: absolute; top: 12px; right: 12px; padding: 5px 7px; background: var(--amber); color: var(--ground); font-size: 10px; font-weight: 600; }
.section-end { display: flex; gap: 24px; margin-top: 26px; }
.section-end a { color: var(--amber); font-size: 14px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.section-end a:hover { color: var(--text); }

.software-showcase { border-top: 1px solid var(--line); }
.software-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: clamp(24px, 5vw, 78px); align-items: center; padding: 38px 0; border-bottom: 1px solid var(--line); }
.software-item:nth-child(even):not(.software-item--text) .software-item__image { order: 2; }
.software-item__image { background: #263342; min-width: 0; overflow: hidden; }
.software-item__image img { width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.software-item__copy { max-width: 480px; }
.software-item h2 { margin: 0 0 13px; font: 700 clamp(40px, 5vw, 68px)/.9 var(--font-display); text-transform: uppercase; }
.software-item p { max-width: 58ch; margin: 0; color: var(--muted); font-size: 15px; }
.software-item__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.software-item__tags span { padding: 4px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.software-item__link { display: inline-block; margin-top: 22px; color: var(--amber); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.software-item--text { grid-template-columns: 1fr; }
.software-item--text .software-item__copy { max-width: 820px; }

.mods-cat-selector { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.mods-cat-btn { position: relative; min-height: 47px; margin-right: 24px; padding: 8px 0 14px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; }
.mods-cat-btn:hover, .mods-cat-btn[aria-pressed="true"] { color: var(--text); }
.mods-cat-btn[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 4px; background: var(--amber); }
.mod-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.mod-item { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 18px; min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--line); }
.mod-item__image { display: block; align-self: start; aspect-ratio: 1.25; overflow: hidden; background: var(--stage); }
.mod-item__image img { width: 100%; height: 100%; object-fit: cover; }
.mod-item__copy { min-width: 0; }
.mod-item h2 { margin: 0 0 8px; font: 700 25px/1 var(--font-display); text-transform: uppercase; }
.mod-item h2 a { text-decoration: none; }
.mod-item h2 a:hover { color: var(--amber); }
.mod-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.mod-item:first-child { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-bottom: 20px; padding: 0; border: 0; background: var(--stage); }
.mod-item:first-child .mod-item__image { aspect-ratio: 16 / 9; }
.mod-item:first-child .mod-item__copy { align-self: center; padding: clamp(24px, 4vw, 56px); }
.mod-item:first-child h2 { font-size: clamp(42px, 4.5vw, 64px); }
.mod-item:first-child p { max-width: 55ch; font-size: 15px; }

.about-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(40px, 7vw, 110px); min-height: min(750px, calc(100vh - 78px)); padding: 50px 0; }
.about-visual { background: #660e1d; overflow: hidden; }
.about-visual img { width: 100%; max-height: 650px; object-fit: cover; }
.about-copy h1 { max-width: 650px; margin-bottom: 26px; }
.about-copy p { max-width: 56ch; margin: 0 0 17px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.about-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; max-width: 550px; margin-top: 34px; }
.about-links a { display: flex; justify-content: space-between; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.about-links a:hover { color: var(--amber); }
.about-links a span { color: var(--amber); }

.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 25px max(24px, calc((100vw - 1380px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer span:first-child { color: var(--text); font-weight: 600; }

@media (max-width: 1050px) {
  .site-header { gap: 25px; }
  .site-header__external { display: none; }
  .opening h1, .section-opening h1 { font-size: clamp(64px, 8vw, 84px); }
  .stage-shell { grid-template-columns: 230px minmax(0,1fr); }
  .game-selector { max-height: 650px; }
  .mod-item { grid-template-columns: 100px minmax(0,1fr); }
}

@media (max-width: 760px) {
  .site-header { display: block; min-height: 0; padding: 12px 18px 0; }
  .brand { margin-bottom: 10px; }
  .brand__mark { width: 30px; height: 30px; font-size: 18px; }
  .brand__word { font-size: 17px; }
  .site-nav { gap: 25px; overflow-x: auto; min-height: 43px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; font-size: 13px; }
  main { padding: 0 16px 70px; }
  .opening { display: block; padding: 34px 0 27px; }
  .opening h1, .section-opening h1, .about-copy h1 { font-size: clamp(59px, 12.5vw, 82px); }
  .opening p { margin: 20px 0 0; max-width: 400px; font-size: 15px; }
  .stage-shell { display: flex; flex-direction: column; }
  .stage-main { order: 1; }
  .game-route { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .route-heading { padding: 14px 15px 10px; border-bottom: 0; }
  .route-heading h2 { font-size: 22px; }
  .game-selector { flex-direction: row; gap: 7px; overflow-x: auto; max-height: none; padding: 0 14px 15px; scroll-snap-type: x proximity; }
  .game-choice { flex: 0 0 174px; display: block; min-height: 96px; padding: 9px 11px; border: 0; scroll-snap-align: start; }
  .game-choice::before { top: 22px; bottom: auto; left: -7px; right: -7px; width: auto; height: 1px; }
  .game-choice:first-child::before { top: 22px; left: 24px; }
  .game-choice:last-child::before { top: 22px; bottom: auto; right: calc(100% - 24px); }
  .game-choice__number { margin-bottom: 7px; }
  .game-choice__name { font-size: 13px; }
  .game-choice__tool { font-size: 10px; }
  .stage-screen { aspect-ratio: 16 / 9; }
  .stage-screen { scroll-margin-top: 145px; }
  .stage-screen__play { left: 10px; bottom: 10px; min-height: 36px; padding: 8px 10px; font-size: 11px; }
  .stage-screen__bar { padding: 9px; }
  .preview-label, .preview-toggle { font-size: 11px; padding: 7px 8px; }
  .stage-details { padding: 20px 18px 19px; }
  .stage-details h2 { font-size: clamp(35px, 9vw, 52px); }
  .stage-details__description { margin-bottom: 16px; font-size: 14px; }
  .stage-details__index { font-size: 27px; }
  .stage-stepper { padding: 0 18px; }
  .game-elsewhere { grid-template-columns: 1fr; margin-top: 15px; }
  .game-elsewhere a { min-height: 94px; padding: 17px 19px; }
  .game-elsewhere a strong { font-size: 26px; }
  .section-opening { display: block; min-height: 0; padding: 42px 0 28px; }
  .section-opening p { margin-top: 16px; font-size: 15px; }
  .art-wall { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .art-piece:first-child { grid-column: span 2; grid-row: auto; }
  .art-piece:nth-child(5n + 3) { grid-column: span 1; }
  .art-piece img { min-height: 200px; }
  .art-piece:first-child img { min-height: 350px; }
  .software-item, .software-item:nth-child(even):not(.software-item--text) { grid-template-columns: 1fr; gap: 18px; padding: 28px 0; }
  .software-item:nth-child(even):not(.software-item--text) .software-item__image { order: 0; }
  .software-item__copy { max-width: none; }
  .software-item h2 { font-size: clamp(40px, 10vw, 60px); }
  .mod-list { grid-template-columns: 1fr; }
  .mod-item:first-child { grid-column: 1; grid-template-columns: 1fr; }
  .mod-item:first-child .mod-item__image { aspect-ratio: 16 / 9; }
  .mod-item:first-child .mod-item__copy { padding: 20px; }
  .mod-item:first-child h2 { font-size: 40px; }
  .mod-item { grid-template-columns: 112px minmax(0,1fr); }
  .about-layout { grid-template-columns: 1fr; gap: 25px; min-height: 0; padding: 28px 0 45px; }
  .about-visual { max-width: 520px; }
  .about-visual img { max-height: 350px; object-position: center 32%; }
  .about-copy p { font-size: 16px; }
  .site-footer { flex-wrap: wrap; padding: 20px 16px; }
  .site-footer span:nth-child(2) { display: none; }
}

@media (max-width: 420px) {
  .opening h1 { font-size: 57px; }
  .stage-details h2 { font-size: 38px; }
  .stage-details__index { display: none; }
  .action-link { font-size: 12px; }
  .art-piece img { min-height: 160px; }
  .art-piece:first-child img { min-height: 285px; }
  .mod-item { grid-template-columns: 90px minmax(0,1fr); gap: 12px; }
  .mod-item h2 { font-size: 22px; }
  .mod-item p { font-size: 12px; }
  .about-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .art-piece img { transition: none; }
}
