/* ==========================================================================
   Odd Forest — main stylesheet
   ========================================================================== */

/* Fonts ------------------------------------------------------------------- */

/* Served from this site, so no visitor's browser has to contact a font host.
   Latin and Latin Extended subsets; the licences sit next to the files. */
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-400-latin.woff2") format("woff2");
  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: "Alegreya Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-500-latin.woff2") format("woff2");
  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: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-700-latin.woff2") format("woff2");
  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: "Alegreya Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/alegreya-sans-800-latin.woff2") format("woff2");
  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: "Fraunces";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  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;
}

/* Tokens ------------------------------------------------------------------ */

:root {
  /* A moonlit wood: deep green night, sage mist, firefly gold and will-o'-the-wisp mint. */
  --ink-950: #060f0e;
  --ink-900: #0a1615;
  --ink-800: #11221f;
  --line: rgba(205, 235, 220, 0.1);
  --line-strong: rgba(205, 235, 220, 0.22);

  --text: #f4efdb;
  --text-soft: rgba(244, 239, 219, 0.86);
  --text-muted: #a2b9ad;

  --gold: #e8cb6e; /* firefly light */
  --wisp: #9fe8c6; /* will-o'-the-wisp glow */
  --moss: #3a5f50;
  --on-gold: #15201b;

  /* Moonlit gilding for the big titles */
  --gilt: linear-gradient(180deg, #fffbea 18%, #f3e9c2 58%, #d6c47e 100%);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;

  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 76px;
  --radius: 4px;
  --radius-lg: clamp(6px, 0.7vw, 10px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 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(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Fraunces, the display face, set soft and a little wonky. The other fonts ignore these axes. */
  font-variation-settings: "SOFT" 50, "WONK" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Film grain: keeps the big gradients from banding. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg,
canvas {
  display: block;
}

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

a {
  color: inherit;
}

p {
  margin: 0;
}

::selection {
  background: var(--gold);
  color: var(--on-gold);
}

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

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

.nowrap {
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

/* The tilted ticker is wider than the viewport; clip it here so the page never scrolls sideways. */
main {
  overflow-x: hidden;
  overflow-x: clip;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}

.site-header.is-scrolled {
  background: rgba(10, 22, 21, 0.72);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  border-radius: var(--radius);
}

.brand__mark {
  flex: none;
  width: 42px;
  height: 42px;
  transition: transform 0.7s var(--ease-spring);
}

.brand:hover .brand__mark {
  transform: rotate(-16deg) scale(1.08);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand__sub {
  margin-top: 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Moss green, with a firefly-gold edge on hover. */
.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.15rem;
  border: 1px solid rgba(170, 215, 190, 0.32);
  border-radius: var(--radius);
  background: rgba(58, 95, 80, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s var(--ease-spring);
}

.site-nav__link:hover {
  background: rgba(58, 95, 80, 0.75);
  border-color: rgba(232, 203, 110, 0.6);
  transform: translateY(-1px);
}

.site-nav__link[aria-current="page"] {
  border-color: rgba(232, 203, 110, 0.6);
}

/* Smallest phones: brand and nav button share 280px, so both tighten up. */
@media (max-width: 400px) {
  .brand {
    gap: 0.6rem;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .brand__name {
    font-size: 1rem;
  }

  .brand__sub {
    letter-spacing: 0.24em;
  }

  .site-nav__link {
    padding: 0 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 54px;
  padding: 0 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out);
}

.btn--primary {
  background: linear-gradient(180deg, #f3dc8a, #dcbc58);
  color: var(--on-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(21, 32, 27, 0.2), 0 12px 32px -12px rgba(232, 203, 110, 0.55);
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(21, 32, 27, 0.2), 0 20px 44px -14px rgba(232, 203, 110, 0.7);
}

.btn--primary:active {
  transform: translateY(0) scale(0.97);
}

/* The quiet companion to the primary button: an outline that warms to gold on hover. */
.btn--ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform 0.4s var(--ease-spring), border-color 0.3s, color 0.3s;
}

.btn--ghost:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 203, 110, 0.6);
  color: var(--gold);
}

.btn--ghost:active {
  transform: translateY(0) scale(0.97);
}

.btn__icon {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease-spring);
}

.btn:hover .btn__icon {
  transform: translateY(3px);
}

.btn:hover .btn__icon--back {
  transform: translateX(-3px);
}

.btn:hover .btn__icon--next {
  transform: translateX(3px);
}

@media (max-width: 400px) {
  .btn {
    padding: 0 1.2rem;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
  }
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) 0 clamp(9rem, 24vh, 15rem);
  overflow: hidden;
}

.hero__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(34% 30% at 78% 26%, rgba(250, 244, 205, 0.09), transparent 70%),
    radial-gradient(60% 40% at 74% 62%, rgba(120, 200, 165, 0.16), transparent 70%),
    radial-gradient(55% 40% at 10% 14%, rgba(3, 8, 10, 0.6), transparent 70%),
    linear-gradient(180deg, #060c12 0%, #0a161b 22%, #0f2226 42%, #16302f 58%, #1e3c38 72%, #284a43 86%, #30554c 100%);
}

.hero__stars,
.hero__motes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The crescent moon and the cloud bank beneath it. Every moving layer is its own element,
   so the browser can move it without repainting the others. */
.hero__moon {
  position: absolute;
  top: 11%;
  right: max(-4vw, calc(50% - 860px));
  width: clamp(300px, 44vw, 640px);
  aspect-ratio: 1;
}

.moon {
  position: relative;
  width: 100%;
  height: 100%;
}

.moon > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.moon__clouds {
  animation: clouds-drift 30s ease-in-out infinite alternate;
}

/* Overflow stays visible so tall things (the giant toadstool) keep their tops on wide screens,
   where the slice crops the top of each layer. The scene itself still clips. */
.ridge {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  overflow: visible;
}

.ridge--far {
  height: 46%;
}

.ridge--mid {
  height: 34%;
}

.ridge--near {
  bottom: -2px;
  height: 25%;
}

/* Little scene details */
.lake__shimmer,
.shroom__glow,
.shroom__spots {
  animation: glow 3.2s ease-in-out infinite alternate;
}

.lake__shimmer {
  animation-duration: 4.2s;
}

/* Eyes in the dark. Open is the resting pose, so with reduced motion they simply stay open. */
.eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: blink var(--blink, 6s) var(--wait, 0s) infinite;
}

/* Hidden eyes stay still (and cost nothing) until the secret path is found. */
.eyes--hidden {
  opacity: 0;
  animation-name: none;
  transition: opacity 0.6s ease var(--late, 0s);
}

/* The secret path (Konami code): more eyes open one by one and the mushrooms pulse. */
.is-ritual .eyes--hidden {
  opacity: 1;
  animation-name: blink;
}

.is-ritual .shroom__glow,
.is-ritual .shroom__spots {
  animation-duration: 0.45s;
}

/* Hero copy */
.hero__content {
  position: relative;
}

/* A small inscription above the title, set between a firefly and a fading rule. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 1px 12px rgba(3, 10, 10, 0.7);
}

.pill::after {
  content: "";
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  opacity: 0.7;
}

.pill__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 2.6s ease-in-out infinite;
}

@media (max-width: 479px) {
  .pill {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .pill::after {
    display: none;
  }
}

.wordmark {
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: 1.4rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
}

.wordmark__main {
  display: flex;
  font-size: clamp(2.6rem, 14vw, 7.5rem);
  letter-spacing: -0.005em;
}

.wordmark__space {
  width: 0.24em;
}

/* Every letter stands a little crooked, like the trees. */
.ch {
  display: inline-block;
  rotate: var(--r, 0deg);
  translate: 0 var(--y, 0);
  background: var(--gilt);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Title for the 404 page */
.page-title {
  margin: 1.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.01em;
  background: var(--gilt);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 404: two short lines keep the title clear of the moon. */
.hero--lost .page-title {
  max-width: 6em;
}

.hero__lede {
  max-width: 34ch;
  margin-top: 1.6rem;
  font-size: clamp(1.12rem, 1.5vw, 1.32rem);
  color: var(--text-soft);
}

@media (min-width: 600px) {
  .hero__lede {
    max-width: none;
  }

  .hero__lede-line {
    display: block;
  }
}

.hero__lede a {
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(232, 203, 110, 0.6);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  transition: color 0.3s, text-decoration-color 0.3s;
}

.hero__lede a:hover {
  color: var(--gold);
  text-decoration-color: currentColor;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

@media (min-width: 960px) {
  .wordmark__main {
    font-size: min(9vw, 9rem);
  }
}

@media (max-width: 959px) {
  .hero {
    align-items: flex-end;
    padding-bottom: clamp(5rem, 14vh, 8rem);
  }

  /* Copy sits lower on narrow screens, so the sky stays darker where it lands. */
  .hero__sky {
    background:
      radial-gradient(45% 30% at 86% 16%, rgba(250, 244, 205, 0.09), transparent 70%),
      radial-gradient(70% 30% at 80% 34%, rgba(120, 200, 165, 0.14), transparent 70%),
      linear-gradient(180deg, #060c12 0%, #0a161b 24%, #0f2226 46%, #13292b 62%, #183230 76%, #1e3a36 90%, #23413c 100%);
  }

  .ridge--far {
    height: 34%;
  }

  .ridge--mid {
    height: 26%;
  }

  .ridge--near {
    height: 20%;
  }

  .hero__moon {
    top: calc(var(--header-h) - 4px);
    right: -18vw;
    width: min(76vw, 460px);
  }
}

/* Intro choreography. Gated on .js so the page reads complete without JavaScript,
   and paused until .is-ready so the wordmark never swaps fonts mid-animation. */
.js [data-intro] {
  animation: fade-up 1s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}

.js .ch {
  animation: letter-in 1.1s var(--ease-spring) both;
  animation-delay: calc(240ms + var(--i) * 70ms);
}

.js .hero__moon .moon {
  animation: orb-rise 2.6s var(--ease-out) both, orb-float 11s ease-in-out 2.6s infinite alternate;
}

.js:not(.is-ready) [data-intro],
.js:not(.is-ready) .ch,
.js:not(.is-ready) .hero__moon .moon {
  animation-play-state: paused;
}

/* Ticker ------------------------------------------------------------------ */

.ticker {
  position: relative;
  z-index: 2;
  width: 110%;
  margin: -2.4rem 0 0 -5%;
  padding: 1rem 0;
  overflow: hidden;
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  transform: rotate(-2deg);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.ticker__group {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding-right: 1.75rem;
}

.ticker__group span {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__mark {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--moss);
}

/* Game -------------------------------------------------------------------- */

.games {
  position: relative;
  isolation: isolate;
  padding: clamp(6rem, 12vw, 9.5rem) 0 clamp(5rem, 10vw, 8rem);
}

.games::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 12% 24%, rgba(120, 200, 165, 0.09), transparent 70%),
    radial-gradient(36% 30% at 88% 72%, rgba(232, 203, 110, 0.06), transparent 70%);
}

.section-head {
  max-width: 44rem;
  margin: 0 auto clamp(2.75rem, 5vw, 4rem);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-title {
  margin: 0.9rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.8vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.game-card {
  --lift: 0px;
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line);
  transform: perspective(1600px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(var(--lift));
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

.game-card:hover {
  --lift: -8px;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line-strong);
}

/* The frame takes the key art's own shape (920 × 430), so the art is never cropped. */
.game-card__frame {
  position: relative;
  isolation: isolate;
  aspect-ratio: 920 / 430;
  overflow: hidden;
  border-radius: inherit;
  background: var(--ink-800);
  /* Safari: keep the rounded clip while the card is transformed. */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* A thin gilt rule inside the edge, like the frame round the game's menu. */
.game-card__frame::before {
  content: "";
  position: absolute;
  inset: clamp(8px, 1.1vw, 14px);
  z-index: 2;
  border: 1px solid rgba(233, 200, 140, 0.32);
  border-radius: 2px;
  pointer-events: none;
}

.game-card__art {
  position: absolute;
  inset: 0;
}

.game-card__art > img,
.game-card__art > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game-card__art > img {
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}

/* The art is pixel art. Wherever it shows at native size or larger, keep its pixels hard-edged;
   below that (phones at 2x) smooth scaling keeps thin sparks from dropping out. */
@media (min-width: 960px), (min-width: 600px) and (min-resolution: 2dppx), (min-resolution: 3dppx) {
  .game-card__art > img {
    image-rendering: pixelated;
  }
}

.game-card:hover .game-card__art > img {
  transform: scale(1.045);
}

.game-card__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 0%), rgba(255, 255, 255, 0.16), transparent 45%);
  transition: opacity 0.5s;
}

.game-card:hover .game-card__glare {
  opacity: 1;
}

.game-card__fx {
  pointer-events: none;
}

/* Covers the whole card, so a click anywhere on the art opens the game's page. */
.game-card__link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.games__more {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-900), var(--ink-950));
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}

.site-footer__note {
  font-weight: 500;
  color: var(--text-muted);
}

.site-footer__up {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-soft);
  transition: color 0.3s;
}

.site-footer__up svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease-spring);
}

.site-footer__up:hover {
  color: var(--gold);
}

.site-footer__up:hover svg {
  transform: translateY(-3px);
}

.site-footer__mega {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-family: var(--font-display);
  font-size: clamp(3rem, 15vw, 15rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(205, 235, 220, 0.15), rgba(205, 235, 220, 0.02) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 1.25rem 0 1.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Cinderborn page --------------------------------------------------------- */

/* The game's own colours, taken from its key art: night stone, candlelight and hearth embers.
   The studio's header, footer and fonts stay as they are. */
.theme-cinderborn {
  --ink-950: #0b0b0e;
  --ink-900: #121318;
  --ink-800: #1c1d23;
  --line: rgba(255, 225, 170, 0.1);
  --line-strong: rgba(255, 225, 170, 0.22);

  --text: #fff1d3;
  --text-soft: rgba(255, 241, 211, 0.86);
  --text-muted: #b4aa94;

  --gold: #ffc468; /* candlelight, the gold in the logo */
  --on-gold: #2b1a0e;
  --gilt: linear-gradient(180deg, #fff6e3 18%, #ffe1aa 60%, #ffc468 100%);
}

.theme-cinderborn .site-header.is-scrolled {
  background: rgba(18, 19, 24, 0.74);
}

.theme-cinderborn .site-footer__mega {
  background-image: linear-gradient(180deg, rgba(255, 225, 170, 0.14), rgba(255, 225, 170, 0.02) 85%);
}

/* The page is this one screen, so it always fills the view and the footer waits below. */
.cb-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(1rem, 3vh, 2.5rem)) 0 clamp(3rem, 8vh, 6rem);
  overflow: hidden;
  text-align: center;
}

/* The key art again, blurred into the warm glow of the hall it shows. */
.cb-hero__glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.cb-hero__glow img {
  position: absolute;
  inset: -10%;
  width: 120%;
  max-width: none;
  height: 120%;
  object-fit: cover;
  filter: blur(42px) saturate(1.25) brightness(0.62);
  opacity: 0.75;
}

.cb-hero__glow::after {
  content: "";
  position: absolute;
  inset: 0;
  /* The bottom fade comes first, so the hero always ends in exactly the page colour. */
  background:
    linear-gradient(180deg, transparent 65%, var(--ink-900)),
    radial-gradient(60% 45% at 50% 100%, rgba(255, 150, 70, 0.14), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, transparent 35%, var(--ink-950) 100%);
}

/* Embers rise behind the art, out of the glow. */
.cb-hero__fx {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cb-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* As big as the screen allows, up to exactly four screen pixels per art pixel (the art is drawn at 3×). */
.cb-hero__art {
  width: min(100%, max(18rem, calc((100vh - var(--header-h) - 8.5rem) * 920 / 430)), 920px * 4 / 3);
  width: min(100%, max(18rem, calc((100svh - var(--header-h) - 8.5rem) * 920 / 430)), 920px * 4 / 3);
}

.cb-hero__art .game-card,
.cb-hero__art .game-card:hover {
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--line), 0 0 140px -40px rgba(255, 170, 80, 0.35);
}

/* Here the art is the title, so it always shows whole: no zoom on hover. */
.cb-hero__art .game-card:hover .game-card__art > img {
  transform: none;
}

.cb-hero__by {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.cb-hero__mark {
  flex: none;
  width: 30px;
  height: 30px;
}

.cb-hero__by a {
  color: var(--gold);
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.cb-hero__by a:hover {
  text-decoration: underline;
}

/* Achievement toast (easter egg) ------------------------------------------ */

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.25rem 0.85rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, #1d3a35, #0d1c1b);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transform: translateY(calc(100% + 2rem));
  transition: transform 0.6s var(--ease-spring), opacity 0.4s;
}

.toast.is-shown {
  opacity: 1;
  transform: none;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold), var(--wisp));
  color: var(--on-gold);
}

.toast__icon svg {
  width: 26px;
  height: 26px;
}

.toast__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.toast__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toast__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

/* Scroll reveals ---------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Keyframes --------------------------------------------------------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translateY(0.5em) rotate(8deg) scale(0.6);
  }
}

@keyframes orb-rise {
  from {
    opacity: 0;
    transform: translateY(12%) scale(0.94);
  }
}

@keyframes orb-float {
  to {
    transform: translateY(-14px);
  }
}

@keyframes clouds-drift {
  from {
    transform: translateX(-2%);
  }
  to {
    transform: translateX(2%);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@keyframes glow {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: none;
  }
  95% {
    transform: scaleY(0.1);
  }
}

/* Reduced motion: everything lands in its final state, nothing loops. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}
