/* ==========================================================================
   Lanternfox — site styles
   Colours and fonts live in :root, so a re-theme starts there.
   ========================================================================== */

@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Night palette */
  --sky: #0b0c26;         /* top of the hero sky, footer */
  --night: #15163b;       /* page background */
  --dusk: #24235c;        /* raised surfaces, secondary buttons */
  --dusk-line: #3a3881;   /* dividers */
  --moon: #f4ecdc;        /* headings and main text */
  --moon-soft: #c9c2dd;   /* body copy */
  --lantern: #ffb547;     /* primary actions, highlights */
  --lantern-edge: #c27713;
  --ember: #e8743b;       /* the fox */
  --moss: #5fae86;        /* "out now" */
  --glow: #6fe3d2;        /* "free" */

  --font-display: "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 72px;
  --max: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(88px, 12vw, 152px);

  /* Pixel corners: one 4px step for small things, two steps for pictures */
  --notch: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
  --notch-lg: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--moon-soft);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

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

h1, h2, h3 {
  margin: 0;
  color: var(--moon);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
}

p, ul, ol { margin: 0; }

a { color: var(--moon); text-underline-offset: 0.22em; text-decoration-thickness: 2px; }
a:hover { color: var(--lantern); }

::selection { background: var(--lantern); color: var(--sky); }

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 100;
  left: 12px;
  top: -80px;
  padding: 12px 16px;
  background: var(--lantern);
  color: var(--sky);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--lantern);
  --btn-fg: var(--sky);
  --btn-edge: var(--lantern-edge);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 13px 22px 17px;
  border: 0;
  background: none;
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-bg);
  box-shadow: inset 0 -4px 0 var(--btn-edge), inset 0 3px 0 rgb(255 255 255 / 0.28);
  clip-path: var(--notch);
}
.btn:hover { color: var(--btn-fg); }
.btn:hover::before { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); }
.btn:active::before { box-shadow: inset 0 -2px 0 var(--btn-edge), inset 0 2px 0 rgb(255 255 255 / 0.2); }
.btn:focus-visible { outline-color: var(--moon); }

.btn--quiet {
  --btn-bg: var(--dusk);
  --btn-fg: var(--moon);
  --btn-edge: #121139;
}
.btn--quiet::before { box-shadow: inset 0 -4px 0 var(--btn-edge), inset 0 2px 0 rgb(255 255 255 / 0.08); }

.btn--small { min-height: 44px; padding: 10px 16px 14px; font-size: 17px; }

.btn__icon { width: 18px; height: 18px; flex: none; }
.btn--play .btn__icon--stop,
.btn--play[aria-pressed="true"] .btn__icon--play { display: none; }
.btn--play[aria-pressed="true"] .btn__icon--stop { display: block; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-top: 28px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.is-solid,
.nav.is-open {
  background: rgb(11 12 38 / 0.94);
  box-shadow: 0 2px 0 var(--dusk);
}
@supports (backdrop-filter: blur(8px)) {
  .nav.is-solid { background: rgb(11 12 38 / 0.82); backdrop-filter: blur(8px); }
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
}
.brand:hover { color: var(--moon); }
.brand__mark { width: 32px; height: 32px; image-rendering: pixelated; }

.nav__menu ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
  padding: 0;
}
.nav__menu a {
  display: block;
  padding: 10px 2px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  text-decoration: none;
}
.nav__menu a:hover { color: var(--lantern); }

.nav__toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
}
.nav__toggle-icon { width: 20px; height: 14px; display: grid; gap: 4px; }
.nav__toggle-icon i { display: block; height: 2px; background: currentColor; }
.nav.is-open .nav__toggle-icon i:nth-child(2) { opacity: 0; }

@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .brand { font-size: 22px; }
  .brand__mark { width: 28px; height: 28px; }
  .js .nav__toggle { display: inline-flex; }
  .js .nav__menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 28px;
    background: rgb(11 12 38 / 0.98);
    box-shadow: 0 2px 0 var(--dusk);
  }
  .js .nav.is-open .nav__menu { display: block; }
  .nav__menu ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__menu a { padding: 14px 0; font-size: 28px; }
  .no-js .nav__menu a { font-size: 17px; padding: 8px 0; }
  .no-js .nav__menu ul { flex-direction: row; gap: 14px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--sky);
  color: var(--moon);
}

.hero__scene {
  position: absolute;
  z-index: -1;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  max-width: none;
}

.hero__content {
  padding-top: calc(var(--nav-h) + clamp(20px, 6vh, 80px));
}

.hero__title {
  font-size: clamp(56px, min(13vw, 17vh), 184px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-shadow: 0 0.055em 0 #2a1f52;
}

.hero__lead {
  max-width: 31ch;
  margin-top: clamp(14px, 2.6vh, 28px);
  color: var(--moon);
  font-size: clamp(19px, min(2.4vw, 3vh), 25px);
  line-height: 1.45;
}

.hero .actions { margin-top: clamp(20px, 3.4vh, 36px); }
@media (max-width: 480px) {
  .hero .actions .btn { flex: 1 1 100%; }
}

.hero__stage { flex: 1 0 var(--stage, 200px); }

.hero__hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--ground, 120px);
  padding-block: 10px;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.hero__hud[hidden] { display: none; }
.hero__hud-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--moon);
}
.hero__hud-msg { max-width: 46ch; }
.hero__hud-score { display: flex; gap: 20px; font-variant-numeric: tabular-nums; }
.hero__hud-score b { color: var(--lantern); font-weight: 600; }

.hero[data-mode="play"],
.hero[data-mode="over"],
.hero[data-mode="paused"] { cursor: pointer; touch-action: manipulation; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.hero + .section { padding-top: clamp(72px, 9vw, 120px); }

.section__title {
  font-size: clamp(42px, 6vw, 72px);
  margin-bottom: clamp(36px, 5vw, 64px);
}

.lead {
  color: var(--moon);
  font-size: clamp(21px, 2.2vw, 25px);
  line-height: 1.5;
}

/* Pixel-dash rule, used between list rows */
.rule {
  background-image: linear-gradient(90deg, var(--dusk-line) 50%, transparent 0);
  background-size: 8px 2px;
  background-repeat: repeat-x;
}

/* ---------- Games ---------- */
.game__art {
  display: block;
  position: relative;
}
.game__art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--dusk);
  clip-path: var(--notch-lg);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--dot, var(--lantern));
  box-shadow: 0 0 0 4px rgb(255 181 71 / 0.18);
}
.status--out { --dot: var(--moss); }
.status--out::before { box-shadow: 0 0 0 4px rgb(95 174 134 / 0.2); }
.status--free { --dot: var(--glow); }
.status--free::before { box-shadow: 0 0 0 4px rgb(111 227 210 / 0.18); }

.game__title {
  margin-top: 14px;
  font-size: clamp(34px, 3.6vw, 44px);
}
.game__pitch {
  max-width: 48ch;
  margin-top: 14px;
}
.game__where {
  margin-top: 14px;
  color: var(--moon);
  font-size: 16px;
}

.game--featured {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 4.5vw, 64px);
}
.game--featured .game__title { font-size: clamp(44px, 5.4vw, 68px); }
.game--featured .game__pitch { color: var(--moon); font-size: clamp(19px, 1.7vw, 21px); }

.game__facts {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}
.game__facts li { position: relative; padding-left: 24px; }
.game__facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--lantern);
}

.games__more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 5vw, 64px) clamp(28px, 4vw, 56px);
  margin-top: clamp(72px, 9vw, 120px);
}
.games__more .game__art { margin-bottom: 22px; }
.games__more .actions { margin-top: 22px; }

@media (max-width: 880px) {
  .game--featured,
  .games__more { grid-template-columns: minmax(0, 1fr); }
  .game--featured { gap: 28px; }
}

/* ---------- Devlog ---------- */
.log {
  padding: 0;
  list-style: none;
}
.log__item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 6px clamp(24px, 4vw, 56px);
  padding: 30px 0 34px;
  background-position: 0 100%;
}
.log__item:first-child { padding-top: 0; }
.log__date {
  padding-top: 5px;
  color: var(--moon-soft);
  font-family: var(--font-display);
  font-size: 17px;
}
.log__title {
  color: var(--moon);
  font-family: var(--font-body);
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.3;
}
.log__title a { text-decoration: none; }
.log__title a:hover { text-decoration: underline; color: var(--lantern); }
.log__excerpt { max-width: 62ch; margin-top: 8px; }
.log__more { margin-top: 36px; }

@media (max-width: 640px) {
  .log__item { grid-template-columns: minmax(0, 1fr); }
  .log__date { padding-top: 0; }
}

/* ---------- Studio ---------- */
.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: start;
}
.studio__story p { max-width: 58ch; }
.studio__story p + p { margin-top: 20px; }

.team {
  display: grid;
  gap: 22px;
  padding: 0;
  list-style: none;
}
.team__member {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.team__avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  background: var(--ember);
  color: var(--sky);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  clip-path: var(--notch);
  object-fit: cover;
}
.team__avatar--moss { background: var(--moss); }
.team__name {
  display: block;
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.team__role { display: block; }

.presskit {
  margin-top: 40px;
  padding-top: 36px;
  background-position: 0 0;
}
.presskit h3 { font-size: 28px; }
.presskit p { margin-top: 10px; max-width: 44ch; }
.presskit .actions { margin-top: 22px; }

@media (max-width: 880px) {
  .studio__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Contact ---------- */
.contact__intro { max-width: 52ch; }
.contact__email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 32px;
}
.contact__address {
  color: var(--lantern);
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__address:hover { color: var(--moon); }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 48px;
  padding: 0;
  list-style: none;
}
.socials a {
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 36px;
  background: var(--sky);
  font-size: 15px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer .brand { font-size: 20px; }
.footer .brand__mark { width: 28px; height: 28px; }
.footer a:not(.brand) { color: var(--moon-soft); }
.footer a:not(.brand):hover { color: var(--lantern); }

/* ---------- Trailer dialog ---------- */
.trailer {
  width: min(100% - 32px, 1080px);
  max-width: none;
  padding: 0;
  border: 0;
  background: var(--sky);
  color: var(--moon);
}
.trailer::backdrop { background: rgb(7 8 28 / 0.86); }
.trailer__frame { aspect-ratio: 16 / 9; background: #000; }
.trailer__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.trailer__bar { display: flex; justify-content: flex-end; padding: 10px; }

/* ---------- 404 ---------- */
.lost .hero__lead { max-width: 30ch; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav { transition: none; }
  .btn:active { transform: none; }
}
