:root {
  --bg: #12121a;
  --fg: #f4f0e6;
  --muted: #9a9588;
  --accent: #d4a017;
  --on-accent: #1a1408;
  --line: rgb(244 240 230 / 0.16);
  --pad: clamp(0.9rem, 2.6vw, 1.8rem);
  --hud: "Special Gothic Condensed One", "Arial Narrow", sans-serif;
  --body: Cabin, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 200ms;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img {
  display: block;
  max-width: 100%;
}

a,
button {
  cursor: pointer;
}

a {
  color: var(--fg);
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -4rem;
  z-index: 40;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.55rem 0.8rem;
  min-height: 44px;
}

.skip:focus {
  top: var(--pad);
}

.stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: #0e1016 url("/media/hero-town.png") center / cover no-repeat;
}

.stage canvas,
.still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage canvas {
  display: block;
  touch-action: none;
  opacity: 0;
}

.still[hidden] {
  display: none;
}

.brackets i {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgb(244 240 230 / 0.55);
  pointer-events: none;
  z-index: 4;
}

.brackets i:nth-child(1) {
  top: 4.6rem;
  left: var(--pad);
  border-right: 0;
  border-bottom: 0;
}

.brackets i:nth-child(2) {
  top: 4.6rem;
  right: var(--pad);
  border-left: 0;
  border-bottom: 0;
}

.brackets i:nth-child(3) {
  bottom: 6.4rem;
  left: var(--pad);
  border-right: 0;
  border-top: 0;
}

.brackets i:nth-child(4) {
  bottom: 6.4rem;
  right: var(--pad);
  border-left: 0;
  border-top: 0;
}

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem var(--pad);
  background: linear-gradient(to bottom, rgb(18 18 26 / 0.72), transparent);
}

.mark {
  font-family: var(--hud);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1;
}

.telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-top nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.hud-top nav a {
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  font-weight: 600;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 1.05rem;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  border: 0;
  font-family: var(--body);
  font-size: 0.95rem;
  transition: filter var(--t) var(--ease), transform var(--t) var(--ease);
}

.cta:hover {
  color: var(--on-accent);
  filter: brightness(1.08);
}

.cta:active {
  transform: scale(0.97);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.05rem;
  border: 1px solid var(--line);
  background: rgb(18 18 26 / 0.45);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hud-copy {
  position: absolute;
  left: var(--pad);
  bottom: 7.2rem;
  z-index: 5;
  max-width: 30rem;
  padding: 1rem 1.25rem 1.1rem 0.2rem;
  background: linear-gradient(90deg, rgb(18 18 26 / 0.62) 0%, rgb(18 18 26 / 0.28) 70%, transparent);
  text-shadow: 0 2px 18px rgb(8 8 12 / 0.55);
}

.hud-copy h1 {
  margin: 0;
  font-family: var(--hud);
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  line-height: 0.85;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hud-copy p {
  margin: 0.65rem 0 1rem;
  max-width: 34ch;
  font-size: 1.08rem;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hotbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0.55rem var(--pad) 0.75rem;
  list-style: none;
  overflow-x: auto;
  background: linear-gradient(to top, rgb(18 18 26 / 0.88), transparent);
}

.hotbar button {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  background: #1a1a24;
  color: var(--fg);
  overflow: hidden;
  flex: none;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease);
}

.hotbar button[data-live] {
  background:
    linear-gradient(160deg, #2a2a38, #12121a);
}

.hotbar button[data-live]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--accent);
  transform: translateX(2px);
}

.hotbar button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.hotbar button span,
.hotbar button b {
  position: absolute;
  left: 4px;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px #000;
}

.hotbar button span {
  top: 3px;
  color: var(--accent);
}

.hotbar button b {
  bottom: 3px;
}

.hotbar button.on,
.hotbar button[aria-pressed="true"] {
  border-color: var(--accent);
}

.hotbar button:hover {
  transform: translateY(-2px);
}

.why,
.facts,
.run,
footer {
  padding: clamp(2.4rem, 7vh, 4.5rem) var(--pad);
}

.why,
.facts {
  border-top: 1px solid var(--line);
}

.why h2,
.facts h2,
.run h2 {
  margin: 0 0 0.8rem;
  font-family: var(--hud);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.9;
  font-weight: 400;
}

.why p,
.run > p {
  max-width: 42rem;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 2rem;
}

.facts li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.facts b {
  font-family: var(--hud);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--accent);
  margin-right: 0.35rem;
}

.run pre {
  margin: 1.1rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: #0c0c12;
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 0.92rem;
  line-height: 1.6;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

footer p {
  margin: 0 0 0.4rem;
  max-width: 42rem;
}

@media (max-width: 720px) {
  .telemetry {
    display: none;
  }

  .hud-copy {
    bottom: 5.5rem;
    max-width: calc(100% - 1.2rem);
    padding-right: 0.4rem;
  }

  .hud-copy .actions {
    display: none;
  }

  .hud-copy h1 {
    font-size: 3rem;
  }

  .hotbar button {
    width: 64px;
    height: 64px;
  }

  .brackets {
    display: none;
  }
}

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