@font-face {
  font-family: "CandleBorne";
  src: url("fonts/CandleBorne.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #09080c;
  --charcoal-2: #111017;
  --panel: #17131d;
  --gold: #d8b36a;
  --ember: #6b5886;
  --cream: #eee8dc;
  --cream-dim: #aaa4ae;
  --border: #312a3b;
  --purple: #473861;
  --font-display: "CandleBorne", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Silkscreen", "Courier New", monospace;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--charcoal);
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
}

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

.hero-logo,
.cta-logo {
  image-rendering: auto;
}

.hero-monk {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--cream); }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--gold);
  color: var(--charcoal);
  font-family: var(--font-ui);
  font-size: 13px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

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

/* ---------- Buttons: dark, gold trim ---------- */
.btn {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 22px;
  max-width: 100%;
  background: var(--panel);
  color: var(--gold);
  border: 2px solid var(--gold);
  box-shadow: 4px 4px 0 0 #00000088;
  cursor: pointer;
}

.btn:hover {
  background: var(--purple);
  color: var(--cream);
  border-color: var(--cream);
}

/* ---------- Nav: game menu ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  background: var(--charcoal);
  border-bottom: 1px solid var(--purple);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0 2.75rem;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream-dim);
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-left: 1.15em;
}

.nav-links a::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--gold);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before,
.nav-links a.is-active::before {
  opacity: 1;
}

.nav-toggle {
  display: none;
  height: 32px;
  padding: 0 10px;
  border: 2px solid var(--border);
  background: var(--panel);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- Hero: title screen ---------- */
.hero {
  background: var(--charcoal);
}

.hero-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(36rem, calc(100vh - 11rem));
  padding: 2.5rem 24px 2rem;
  overflow: visible;
  background:
    radial-gradient(ellipse 38% 52% at 28% 58%, rgba(71, 56, 97, 0.22), transparent 68%),
    radial-gradient(ellipse 90% 80% at 50% 40%, #100d14, var(--charcoal) 74%);
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(11rem, 17.6rem) minmax(26rem, 52rem);
  gap: 1.25rem 2rem;
  align-items: center;
  justify-content: center;
  width: min(100%, 78rem);
}

.monk-wrap {
  position: relative;
  width: min(17.6rem, 100%);
  aspect-ratio: 1 / 1;
  justify-self: end;
}

.monk-wrap::before {
  content: "";
  position: absolute;
  left: 70.3%;
  top: 23.3%;
  z-index: 0;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255, 190, 80, 0.35) 0%,
      rgba(255, 130, 40, 0.18) 28%,
      rgba(110, 62, 28, 0.08) 52%,
      transparent 72%
    );
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  animation: candle-pulse 2.8s ease-in-out infinite;
}

.hero-monk {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.hero-title {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  text-align: center;
}

.hero-logo {
  width: 112%;
  max-width: none;
  height: auto;
  margin: -12% -6% -22%;
  object-fit: contain;
  object-position: center;
}

.hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hero-lines {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream);
  margin: 0;
  text-shadow: 0 0 18px rgba(216, 179, 106, 0.18);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 1.5rem;
}

@keyframes candle-pulse {
  0%,
  100% {
    opacity: 0.68;
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.07);
  }
}

.title-rule {
  display: flex;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.35rem 24px 0.15rem;
}

.title-rule::before,
.title-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--purple);
}

.title-rule-ornament {
  width: 7px;
  height: 7px;
  margin: 0 14px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(216, 179, 106, 0.4);
}

.btn-secondary {
  color: var(--cream-dim);
  border-color: var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--panel);
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- Section labels ---------- */
.section-label h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.35;
  font-weight: 400;
  font-synthesis: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin-bottom: 1rem;
}

.about,
.mech,
.trailer,
.media,
.replay,
.wishlist {
  padding: 4.5rem 0;
}

.trailer { padding-bottom: 0; }

.about p,
.mech-copy p,
.mech-dark p,
.replay p:not(.manifesto) {
  color: var(--cream-dim);
  max-width: 40rem;
}

.about p + p,
.mech-copy p + p,
.mech-dark p + p {
  margin-top: 0.9rem;
}

.lead {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--cream) !important;
  margin-bottom: 1.5rem;
}

.pixel-rule {
  height: 2px;
  background: var(--border);
  max-width: 1120px;
  margin: 0 auto;
}

/* ---------- Alternating mechanics ---------- */
.mech-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.mech-row.reverse { grid-template-columns: 0.85fr 1.15fr; }

.shot-frame {
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 0 #00000066;
  background: #000;
  overflow: hidden;
}

.shot-frame img {
  width: 100%;
  height: auto;
}

.shot-frame-danger { border-color: #6a3a42; }

.shot-wide { margin: 1.25rem 0 1.5rem; }

.mech-danger {
  background: #10080c;
  border-block: 2px solid #3a2428;
}

.mech-dark {
  background: #050308;
  border-block: 2px solid var(--purple);
}

.stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 1.5rem;
  background: var(--border);
  border: 2px solid var(--border);
}

.stat-strip div {
  background: var(--panel);
  padding: 0.85rem 1rem;
}

.stat-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 0.45rem;
}

.stat-up {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gold);
}

.stat-up.curse { color: #c48a86; }

.tower {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 22rem;
}

.tower li {
  display: grid;
  grid-template-columns: 1.1rem 2.4rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream-dim);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}

.tower-sel {
  color: var(--gold);
  line-height: 1;
}

.tower-num {
  color: var(--gold);
}

.tower-name {
  min-width: 0;
}

.tower-state {
  font-size: 11px;
  color: var(--ember);
  justify-self: end;
}

.tower .locked {
  opacity: 0.5;
}

.tower .start {
  color: var(--cream);
  border-bottom-color: var(--gold);
}

.tower .start .tower-num,
.tower .start .tower-name {
  color: var(--cream);
}

/* ---------- Trailer ---------- */
.trailer-frame {
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 0 #00000066;
  background: #000;
  overflow: hidden;
}

.trailer-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: var(--panel);
  pointer-events: none;
  user-select: none;
}

.trailer-placeholder p {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream-dim);
  text-align: center;
  max-width: none;
  padding: 1.5rem;
}

.trailer-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* ---------- Gallery ---------- */
.shot-featured {
  display: block;
  width: 100%;
  margin: 0;
  background: #000;
}

#shot-stage:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.shot-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.85rem 0 1.1rem;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.shot-nav button {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--cream-dim);
  background: none;
  border: 0;
  cursor: pointer;
}

.shot-nav button:hover,
.shot-nav button:focus-visible { color: var(--gold); }

#shot-counter { color: var(--gold); }

.shot-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  list-style: none;
}

.shot-thumbs button {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid var(--border);
  background: #000;
  opacity: 0.5;
  cursor: pointer;
}

.shot-thumbs button.is-active,
.shot-thumbs button[aria-current="true"] {
  border-color: var(--gold);
  opacity: 1;
}

.shot-thumbs img {
  width: 100%;
  height: auto;
}

/* ---------- Replay + CTA ---------- */
.replay {
  background: var(--charcoal-2);
  border-block: 2px solid var(--border);
  text-align: left;
}

.manifesto {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--cream);
  margin: 0 0 0.75rem;
}

.manifesto.accent {
  color: var(--gold);
  margin-bottom: 1.75rem;
}

.wishlist {
  text-align: center;
  padding: 5.5rem 0;
  background: var(--charcoal);
}

.cta-logo {
  width: min(100%, 28rem);
  aspect-ratio: 1156 / 220;
  height: auto;
  margin: 0 auto 1.5rem;
  object-fit: cover;
  object-position: center;
}

.wishlist h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */
footer {
  border-top: 2px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--cream-dim);
}

.footer-brand {
  display: inline-block;
  margin-bottom: 12px;
  line-height: 0;
}

.footer-brand img {
  width: min(15.25rem, 70vw);
  height: auto;
  margin-inline: auto;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--cream-dim);
}

.social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-btn:hover,
.social-btn:focus-visible { color: var(--gold); }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 4px 0 8px;
}

.footer-meta a {
  color: var(--cream-dim);
  font-size: 0.95rem;
}

.footer-meta a:hover { color: var(--gold); }

.fine { font-size: 0.95rem; margin-top: 8px; }

.footer-steam-legal {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body { font-size: 1.125rem; }

  .mech-row,
  .mech-row.reverse {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    justify-content: flex-end;
  }

  .nav-toggle { display: inline-flex; align-items: center; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--charcoal);
    border-bottom: 1px solid var(--purple);
    padding: 8px 24px 16px;
  }

  .nav-links.is-open { display: flex; }

  .nav-links a {
    padding: 14px 0 14px 1.15em;
    min-height: 48px;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }

  .hero-screen { min-height: 0; padding: 1.75rem 20px 1.5rem; }
  .hero-title { margin-bottom: 0; }

  .shot-thumbs { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 799px) {
  .hero-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .hero-title {
    display: contents;
  }

  .hero-logo {
    order: 1;
    width: min(100%, 30rem);
    margin: -8% auto -16%;
  }

  .monk-wrap {
    order: 2;
    width: min(34vw, 8.8rem);
    justify-self: center;
  }

  .monk-wrap::before {
    width: 5.25rem;
    height: 5.25rem;
  }

  .hero-copy {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .hero h1 { order: 0; }
}

@media (max-width: 430px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 22rem);
    margin-inline: auto;
  }

  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .monk-wrap::before {
    animation: none;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }
}
