/* Aesthetic Ghost — active woodblock visual system.
   Grouped by component; theme tokens and responsive rules each have one home. */

:root {
  --paper: #082a45;
  --paper-2: #214255;
  --card: #193b50;
  --ink: #f6ddb2;
  --ink-soft: #e2c9a4;
  --line: #eacb96;
  --tomato: #ef694f;
  --teal: #e9be65;
  --mustard: #e8b649;
  --lilac: #cfb6de;
  --shadow: -7px 7px 0 -2px #dbbd89;
  --theme-transition-duration: 500ms;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --maxw: 1040px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f0ddb8;
  --paper-2: #e4cca2;
  --card: #f7e7c9;
  --ink: #17354a;
  --ink-soft: #3f5260;
  --line: #254458;
  --tomato: #b83e2e;
  --teal: #526c58;
  --mustard: #c68f25;
  color-scheme: light;
}


/* ────────── Foundation and paper grain ────────── */

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5;
  font-variation-settings: "SOFT" 70, "WONK" 1;
  overflow-x: clip;
  transition: background-color .5s ease, color .5s ease;
  position: relative;
  isolation: isolate;
}

/* Two fixed grain treatments crossfade instead of snapping filter/blend modes. */
body::before, body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../assets/woodblock-blue-paper-tile.webp") left top / 640px 640px repeat;
}

body::before {
  opacity: 1;
  filter: brightness(1.15) saturate(.9);
}

body::after {
  opacity: 0;
  filter: grayscale(1) invert(1);
  mix-blend-mode: multiply;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--mustard);
  color: #1f1b16;
}

:focus-visible {
  outline: 3px dashed var(--tomato);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem 1rem;
}

.skip:focus {
  top: 1rem;
}

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


:root[data-theme="light"] body::before {
  opacity: 0;
}

:root[data-theme="light"] body::after {
  opacity: .45;
}

/* ────────── Type ────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.05;
  margin: 0 0 .5em;
  letter-spacing: -.025em;
}

h1 {
  font-size: clamp(3.1rem,6vw,5.25rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(2.25rem,3.8vw,3.3rem);
  font-weight: 850;
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

em {
  font-style: italic;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: .045em;
  color: var(--tomato);
  margin: 0 0 .9rem;
  font-weight: 600;
}

.hand {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--teal);
  line-height: 1.1;
}


/* ────────── Header and lamp ────────── */

.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
  min-height: 78px;
  width: min(var(--maxw),calc(100% - 3rem));
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.brand img {
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
  width: 40px;
  height: 48px;
  object-fit: contain;
}

.brand:hover img {
  transform: none;
}

.brand-name {
  font-size: 1.65rem;
  font-weight: 800;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  white-space: nowrap;
}

.brand-name em {
  color: var(--tomato);
  font-style: normal;
}

.site-nav {
  display: flex;
  gap: .6rem;
  margin-left: auto;
  margin-right: 6.8rem;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-decoration: none;
  padding: .3rem .95rem;
  border: 2px solid transparent;
  border-radius: 0;
  transition: border-color .2s, transform .2s;
  font-weight: 650;
}

.site-nav a:hover {
  border-color: var(--line);
  transform: rotate(-2deg);
}

.site-nav a[aria-current="page"] {
  background: #edc478 url("../assets/woodblock-parchment.webp") left bottom / 800px auto;
  color: #17354a;
  border-color: #f5dbac;
  box-shadow: inset 0 0 0 2px #d5ac60;
}

.lamp {
  position: absolute;
  right: 3.5rem;
  top: 0;
  width: 2.6rem;
  height: 5.5rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

.lamp-chain {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 3.3rem;
  border-left: 3px dotted var(--ink);
  transform-origin: top center;
  transition: height .25s cubic-bezier(.3, 1.8, .5, 1);
  border-color: #edc478;
}

.lamp-bead {
  position: absolute;
  left: 50%;
  top: 3.25rem;
  width: 1.8rem;
  height: 1.8rem;
  margin-left: -.8rem;
  border-radius: 50%;
  background: #e8b858;
  border: 2px solid #f4dbaf;
  transition: top .25s cubic-bezier(.3, 1.8, .5, 1);
}

.lamp:hover .lamp-bead {
  top: 3.5rem;
}

.lamp:hover .lamp-chain {
  height: 3.55rem;
}

.lamp.tug .lamp-bead {
  top: 4.2rem;
}

.lamp.tug .lamp-chain {
  height: 4.25rem;
}

.lamp-tip {
  position: absolute;
  right: 100%;
  top: 3.6rem;
  white-space: nowrap;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin-right: .3rem;
  opacity: 0;
  transition: opacity .3s;
}

.lamp:hover .lamp-tip, .lamp:focus-visible .lamp-tip {
  opacity: 1;
}

:root[data-theme="dark"] .lamp-bead {
  box-shadow: inset 0 0 0 3px #d9a94e;
}


/* ────────── Buttons ────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.28rem;
  color: var(--ink);
  text-decoration: none;
  padding: .55rem 1.35rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--line) 18%,transparent);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary {
  background: #dc5940;
  color: #fae2b8;
  border-color: #f7ddb2;
  position: relative;
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
}

.btn-ghost:hover {
  box-shadow: none;
  background: var(--paper-2);
}

.btn:active, :root[data-theme="dark"] .btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:hover, :root[data-theme="dark"] .btn:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--line) 30%,transparent);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/woodblock-parchment.webp") left bottom / 1000px auto;
  mix-blend-mode: multiply;
  opacity: .25;
  pointer-events: none;
}

.btn-primary:hover {
  background: #c94732;
}


/* ────────── Cards ────────── */

.card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 1px;
  box-shadow: var(--shadow);
}


/* ────────── Layout and sections ────────── */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 1;
  width: min(var(--maxw),calc(100% - 3rem));
}

.section {
  padding: 5rem 0 0;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 1.3rem;
}

.section-head p:not(.eyebrow) {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
}


.section-head .eyebrow {
  margin-bottom: .45rem;
}

.section-head h2 {
  margin-bottom: .15em;
}


/* ────────── Hero and landscape ────────── */

.hero {
  display: grid;
  grid-template-columns: 600px 1fr;
  gap: 0;
  align-items: start;
  min-height: 745px;
  padding-top: 24px;
  position: relative;
}

.hero h1 {
  line-height: .95;
  margin: 0 0 22px;
}

.lede {
  font-size: 1.42rem;
  max-width: 550px;
  color: var(--ink);
  line-height: 1.36;
  margin: 0;
}

.lede > p {
  margin-bottom: 0;
}

.lede-list {
  margin-top: 4px;
  font-size: 1.3rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.3rem;
}

.scribble-wrap {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  color: var(--tomato);
  font-style: italic;
  margin-bottom: .08em;
}

.scribble {
  position: absolute;
  left: -1%;
  bottom: -.15em;
  width: 102%;
  height: .3em;
  overflow: visible;
}

.scribble path {
  fill: none;
  stroke: var(--mustard);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 0;
}

.hero-art {
  display: block;
  place-items: center;
  position: relative;
  padding-top: 130px;
  margin-left: -15px;
}

.mascot {
  position: relative;
  width: 345px;
  padding-top: 0;
}

.landscape {
  --sky-size: 100% auto;
  --sky-position: center top;
  position: absolute;
  inset: 32px 0 auto;
  height: min(65vw,1105px);
  pointer-events: none;
}

/* The page-level sky serves the desktop columns; the artwork's copy serves stacked layouts. */
.hero-art > .landscape {
  display: none;
}

.landscape::before, .landscape::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: var(--sky-position);
  background-size: var(--sky-size);
  background-repeat: no-repeat;
  mask-position: var(--sky-position);
  mask-size: var(--sky-size);
  mask-repeat: no-repeat;
}

.landscape::before {
  background-image: url("../assets/sun.webp");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221556%22%20height%3D%221011%22%20viewBox%3D%220%200%201556%201011%22%3E%3Ccircle%20cx%3D%221165%22%20cy%3D%22300%22%20r%3D%22228%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E");
}

.landscape::after {
  background-image: url("../assets/clouds.webp");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221555%22%20height%3D%221011%22%20viewBox%3D%220%200%201555%201011%22%3E%3Cg%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M%20920%20156%20H%201080%20A%2012%2012%200%200%201%201080%20180%20H%201072%20Q%201066%20180%201066%20185.5%20Q%201066%20191%201072%20191%20H%201158%20A%2012%2012%200%200%201%201158%20215%20H%20978%20A%2012%2012%200%200%201%20978%20191%20H%201008%20Q%201014%20191%201014%20185.5%20Q%201014%20180%201008%20180%20H%20920%20A%2012%2012%200%200%201%20920%20156%20Z%22%2F%3E%3Cpath%20d%3D%22M%201350%2098%20H%201492%20A%2011%2011%200%200%201%201492%20120%20H%201421%20Q%201415%20120%201415%20125.5%20Q%201415%20131%201421%20131%20H%201436%20A%2012%2012%200%200%201%201436%20155%20H%201212%20A%2012%2012%200%200%201%201212%20131%20H%201369%20Q%201375%20131%201375%20125.5%20Q%201375%20120%201369%20120%20H%201350%20A%2011%2011%200%200%201%201350%2098%20Z%22%2F%3E%3Cpath%20d%3D%22M%20900%20366%20H%201025%20A%2012%2012%200%200%201%201025%20390%20H%201023%20Q%201017%20390%201017%20395%20Q%201017%20400%201023%20400%20H%201127%20A%2011%2011%200%200%201%201127%20422%20H%20965%20A%2011%2011%200%200%201%20965%20400%20H%20969%20Q%20975%20400%20975%20395%20Q%20975%20390%20969%20390%20H%20900%20A%2012%2012%200%200%201%20900%20366%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.headline-line {
  display: block;
  white-space: normal;
}

.mascot-image {
  width: 100%;
  height: auto;
}


/* Keep each landscape's blend mode fixed; fade the layers together. */
.landscape-light {
  opacity: 0;
  mix-blend-mode: multiply;
}

:root[data-theme="light"] .landscape-dark {
  opacity: 0;
}

:root[data-theme="light"] .landscape-light {
  opacity: .23;
}

/* ────────── Newsletter ────────── */

.newsletter {
  padding-top: 4.5rem;
  padding-bottom: 2rem;
}

.newsletter-copy {
  max-width: 46rem;
}

.newsletter-copy .eyebrow {
  margin-bottom: .45rem;
}

.newsletter-copy h2 {
  margin-bottom: .15em;
}

.newsletter-copy p:not(.eyebrow) {
  max-width: 42rem;
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.4;
  /* Fraunces' WONK axis distorts letterforms at body-text size. */
  font-variation-settings: "SOFT" 70, "WONK" 0;
}

.newsletter-signup {
  --paper-edge: polygon(
    0 .6%, 12% .2%, 25% .5%, 39% 0, 54% .4%, 68% .1%, 83% .5%, 99.7% 0,
    100% 17%, 99.6% 34%, 100% 51%, 99.7% 69%, 100% 86%, 99.5% 99.6%,
    85% 100%, 71% 99.5%, 57% 100%, 42% 99.6%, 28% 100%, 14% 99.5%, .3% 100%,
    0 83%, .4% 66%, 0 49%, .3% 32%, 0 15%
  );
  max-width: 46rem;
  margin-top: 2rem;
  padding: 2.15rem 2rem 1.65rem;
  position: relative;
  isolation: isolate;
  color: #f6ddb2;
  border: 0;
  background: none;
  box-shadow: none;
  transform: rotate(-1deg);
  filter: drop-shadow(1px 4px 3px rgb(4 20 30 / .28));
}

.newsletter-signup::before {
  content: "";
  position: absolute;
  inset: 4px 7px -9px -10px;
  z-index: -1;
  background: #e5c695 url("../assets/woodblock-parchment.webp") left bottom / 900px auto;
  clip-path: url("#newsletter-paper-edge");
  transform: rotate(.9deg);
  pointer-events: none;
}

.newsletter-paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 95% 100%, rgb(246 221 178 / .1), transparent 38%),
    url("../assets/woodblock-blue-paper-tile.webp");
  background-size: auto, 512px 512px;
  background-repeat: no-repeat, repeat;
  clip-path: url("#newsletter-paper-edge");
  box-shadow: inset -5px -7px 16px rgb(5 24 38 / .1);
}

.signup-paper-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.newsletter-paper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 178px;
  height: 145px;
  z-index: 1;
  background: url("../assets/woodblock-waves.svg") right top / contain no-repeat;
  mask-image: radial-gradient(ellipse 100% 120% at 100% 0%, #000 50%, transparent 85%);
  mask-composite: intersect;
  pointer-events: none;
}

.newsletter-form,
.newsletter-note {
  position: relative;
  z-index: 4;
}

.newsletter-form {
  max-width: none;
  margin: 0;
  padding-top: .15rem;
}

.newsletter-form .formkit-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: end;
}

.newsletter-form .formkit-field {
  min-width: 0;
}

.newsletter-form label {
  display: block;
  margin-bottom: .4rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #ecd1a2;
}

.newsletter-form .formkit-input {
  width: 100%;
  min-height: 3.25rem;
  margin: 0;
  padding: .7rem .85rem;
  border: 2px solid #ecd1a2;
  border-radius: 0;
  background: #f4dbaf url("../assets/woodblock-parchment.webp") left bottom / 900px auto;
  color: #17354a;
  font: inherit;
  line-height: 1.3;
  box-shadow: inset 0 0 12px rgb(151 102 40 / .1);
}

.newsletter-form .formkit-input::placeholder {
  color: #40545d;
  opacity: .78;
}

.newsletter-form .formkit-input:focus-visible,
.newsletter-form .formkit-submit:focus-visible,
.newsletter-note a:focus-visible,
.formkit-powered-by-convertkit:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

.newsletter-form .formkit-submit {
  position: relative;
  min-height: 3.25rem;
  min-width: 8.5rem;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.newsletter-form .formkit-submit:hover {
  background: #c94732;
}

.newsletter-form .formkit-submit[data-active] {
  cursor: progress;
  pointer-events: none;
  opacity: .82;
}

.newsletter-form .formkit-spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: .28rem;
}

.newsletter-form .formkit-spinner > span {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .78;
}

.newsletter-form .formkit-submit[data-active] .formkit-spinner {
  display: flex;
}

.newsletter-form .formkit-submit[data-active] .formkit-spinner + span {
  opacity: 0;
}

.newsletter-form .formkit-alert {
  margin: 0 0 .9rem;
  padding: .65rem .8rem;
  border: 1.5px solid var(--line);
  list-style: none;
  font-size: 1rem;
}

.newsletter-form .formkit-alert:empty {
  display: none;
}

.newsletter-form .formkit-alert-error {
  border-color: #ef694f;
  color: #f6ddb2;
}

.newsletter-form .formkit-alert-success {
  border-color: #e9be65;
  color: #f6ddb2;
}

.newsletter-status {
  margin: 0;
}

.formkit-powered-by-convertkit-container {
  margin-top: .7rem;
}

.formkit-powered-by-convertkit {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: #e2c9a4;
  text-underline-offset: .2em;
}

.newsletter-note {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: #e2c9a4;
  font-size: .88rem;
  line-height: 1.45;
}

.newsletter-note a {
  text-underline-offset: .18em;
}


/* ────────── Game identities ────────── */
/* Original abstract stamps, not game screenshots or interface mockups.
   All three share a frame; visible inline SVG strokes use currentColor. */
.game--snake {
  --game-accent: var(--tomato);
}

.game--lobby {
  --game-accent: var(--teal);
}

.game--driftwood {
  --game-accent: var(--lilac);
}

:root[data-theme="light"] .game--driftwood {
  --game-accent: #76506a;
}

/* Homepage parchment stays light in either site theme. */
.mini.game--snake { --game-accent: #b94330; }
.mini.game--lobby { --game-accent: #455d49; }
.mini.game--driftwood { --game-accent: #76506a; }

.game-motif {
  display: grid;
  place-items: center;
  flex: none;
  width: 74px;
  height: 74px;
  color: var(--game-accent);
  border: 2px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: -7px;
  transform: rotate(-4deg);
  pointer-events: none;
}

.game-motif svg {
  display: block;
  width: 75%;
  height: 75%;
}


/* ────────── Workbench cards ────────── */

.mini-games {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.7rem;
  margin-top: 2rem;
}

.mini {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.8rem 1.5rem;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
  min-height: 305px;
  color: #17354a;
  background: #f4dbaf url("../assets/woodblock-parchment.webp") left bottom / 1200px auto;
  border-color: #ecd1a2;
  border-top: 4px solid var(--game-accent);
  box-shadow: none;
  height: 100%;
}

/* Each stationary slot owns the backing; only its card face animates. */
.mini-slot {
  position: relative;
}

.mini-slot .mini {
  position: relative;
  z-index: 1;
}

.mini-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #b79564;
  transform: translate(-6px, 7px);
  pointer-events: none;
}

.tilt-l {
  transform: rotate(-1.5deg);
}

.tilt-r {
  transform: rotate(1.2deg);
}

.tilt-l2 {
  transform: rotate(-.6deg);
}

.mini:hover {
  transform: rotate(0) translateY(-8px) scale(1.02);
}

.mini .game-motif {
  margin-bottom: .6rem;
}

.mini-kind {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: #40545d;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .6rem;
}

.mini-title {
  font-size: 1.9rem;
  font-weight: 750;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  margin-top: .35rem;
}

.stamp {
  align-self: flex-start;
  margin-top: .8rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .25rem .6rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  transform: rotate(-3deg);
}

.stamp-beta {
  color: var(--teal);
}

.stamp-dev {
  color: var(--tomato);
}

.stamp-art {
  color: #8a6fd1;
}

:root[data-theme="dark"] .stamp-art {
  color: var(--lilac);
}

.codename-note {
  text-align: right;
  margin-top: 1.5rem;
  font-size: 1.4rem;
  color: var(--ink-soft);
}

.haunting .section-head {
  max-width: 100%;
}

.mini-games > .mini-slot:nth-child(2) .mini {
  background-position: 52% 44%;
}

.mini-games > .mini-slot:nth-child(3) .mini {
  background-position: 30% 10%;
}

.mini::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #9c8061;
  opacity: .45;
  pointer-events: none;
}

.mini .stamp {
  font-size: .68rem;
}

.mini .stamp-beta {
  color: #455d49;
}

.mini .stamp-dev {
  color: #b94330;
}

.mini .stamp-art, :root[data-theme="dark"] .mini .stamp-art {
  color: #76506a;
}

.haunting {
  position: relative;
  padding-bottom: 6rem;
}


/* ────────── Games and stages ────────── */

.page-head {
  padding: 2rem 0 3rem;
  max-width: 46rem;
}

.page-head h1 {
  font-size: clamp(3.5rem, 10vw, 7rem);
  margin-bottom: 0;
}

.wip-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.wip-head h2 {
  margin: 0;
}

.wip-light {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tomato) 25%, transparent);
  animation: pulse 1.6s ease-in-out infinite;
}

.game {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem;
  margin-bottom: 4rem;
  isolation: isolate;
  background: var(--card);
  border-left: 4px solid var(--game-accent);
}

.game:nth-of-type(odd) {
  transform: rotate(-.4deg);
}

.game:nth-of-type(even) {
  transform: rotate(.4deg);
}

.game-side {
  padding-top: .4rem;
}

.game-side .game-motif {
  width: 90px;
  height: 90px;
  margin-top: 1.7rem;
  transform: rotate(3deg);
}

.game-num {
  display: block;
  font-size: clamp(4rem, 9vw, 6.5rem);
  font-weight: 800;
  line-height: .9;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--tomato);
}

.game-kind {
  font-family: var(--font-mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin: .8rem 0 0;
}

.game-info {
  max-width: 40rem;
  min-width: 0;
}

.game-info p {
  margin-top: 0;
}

.game h3 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.codename {
  display: block;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--ink-soft);
  transform: rotate(-2deg);
  transform-origin: left;
}

.game-feel {
  font-style: italic;
  color: var(--ink-soft);
}

.track {
  margin-top: 1rem;
}

.track ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  position: relative;
}

.track ol::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 2.15rem;
  border-top: 3px dotted var(--ink-soft);
}

.track li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .7rem;
  line-height: 1.2;
  color: var(--ink-soft);
  padding-top: 1.7rem;
}

.track li::before {
  content: "";
  width: .95rem;
  height: .95rem;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2.5px solid var(--ink-soft);
  margin-bottom: .45rem;
  position: relative;
  z-index: 1;
}

.track li.done::before {
  background: var(--teal);
  border-color: var(--line);
}

.track li.now {
  color: var(--ink);
  font-weight: 600;
}

.track li.now::before {
  background: var(--tomato);
  border-color: var(--line);
  transform: scale(1.3);
}

.track-here {
  display: block;
  margin-top: .25rem;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tomato);
}

.shelf-section {
  padding: 2rem 0;
}

.shelf {
  position: relative;
  max-width: 40rem;
}

.shelf-empty {
  display: flex;
  align-items: flex-end;
  gap: 1.2rem;
  padding: 0 1.5rem 0 0;
}

.shelf-empty p {
  margin: 0 0 .4rem;
  color: var(--ink-soft);
}

.shelf-board {
  height: 10px;
  margin-top: .2rem;
  background: var(--mustard);
  border: 2.5px solid var(--line);
  border-radius: 0;
  box-shadow: 0 10px 0 -4px rgba(0,0,0,.18);
}







/* As with the page grain, keep each card texture's filter/blend mode fixed. */
.game::before, .game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: url("../assets/woodblock-blue-paper-tile.webp") left top / 512px 512px repeat;
}

.game::before {
  filter: brightness(1.15) saturate(.9);
  opacity: .85;
}

.game::after {
  filter: grayscale(1) brightness(1.5) invert(1);
  mix-blend-mode: multiply;
  opacity: 0;
}

:root[data-theme="light"] .game::before {
  opacity: 0;
}

:root[data-theme="light"] .game::after {
  opacity: .6;
}


/* ────────── Footer ────────── */

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 0 5rem;
  border-top: 1px dashed var(--line);
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
  position: relative;
  isolation: isolate;
  width: min(var(--maxw),calc(100% - 3rem));
}

.footer-ghost {
  margin: 0 auto 1rem;
  width: 62px;
  height: 75px;
  object-fit: contain;
}

.site-footer p {
  max-width: 580px;
  margin: auto;
}


/* Only the in-progress indicator still animates. */

@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--tomato) 0%, transparent); } }


/* Theme-only color transitions: one clock across the whole page.
   Enabled by the lamp toggle only, so normal hover/tug animations stay fast. */
:root.theme-changing,
:root.theme-changing *,
:root.theme-changing *::before,
:root.theme-changing *::after {
  transition-property: color, background-color, border-color, outline-color,
    text-decoration-color, caret-color, fill, stroke, box-shadow, opacity, filter;
  transition-duration: var(--theme-transition-duration);
  transition-timing-function: ease;
  transition-delay: 0s;
}

/* Preserve interactive motion while theme colors are crossfading. */
:root.theme-changing .site-nav a {
  transition: color var(--theme-transition-duration) ease,
    background-color var(--theme-transition-duration) ease,
    border-color var(--theme-transition-duration) ease,
    transform .2s;
}

:root.theme-changing .btn {
  transition: color var(--theme-transition-duration) ease,
    background-color var(--theme-transition-duration) ease,
    border-color var(--theme-transition-duration) ease,
    box-shadow var(--theme-transition-duration) ease,
    transform .15s ease;
}

:root.theme-changing .mini {
  transition: color var(--theme-transition-duration) ease,
    background-color var(--theme-transition-duration) ease,
    border-color var(--theme-transition-duration) ease,
    box-shadow var(--theme-transition-duration) ease,
    transform .3s cubic-bezier(.3, 1.6, .5, 1);
}

:root.theme-changing .lamp-chain {
  transition: border-color var(--theme-transition-duration) ease,
    height .25s cubic-bezier(.3, 1.8, .5, 1);
}

:root.theme-changing .lamp-bead {
  transition: background-color var(--theme-transition-duration) ease,
    border-color var(--theme-transition-duration) ease,
    box-shadow var(--theme-transition-duration) ease,
    top .25s cubic-bezier(.3, 1.8, .5, 1);
}

:root.theme-changing .lamp-tip {
  transition: color var(--theme-transition-duration) ease, opacity .3s;
}

/* ────────── Responsive adjustments ────────── */

@media (min-width: 1250px) {
  .site-header, main, .site-footer { margin-left: calc((100% - 960px) / 2); }
}

@media (min-width: 1700px) {
  .site-header, main, .site-footer { margin-left: auto; }
  .landscape { --sky-size: 1700px auto; height: 1105px; }
}

@media (min-width: 1001px) and (max-width: 1249px) {
  .hero { grid-template-columns: 58% 42%; min-height: 690px; }
  .hero h1 { font-size: 6.1vw; }
  .hero-art { margin-left: 12px; padding-top: 135px; }
  .mascot { width: 27vw; }
  .lede { max-width: 510px; font-size: 1.3rem; }
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 2rem; }
  .hero h1 { font-size: clamp(3rem,8.7vw,5.25rem); }
  .hero-copy { max-width: 650px; }
  .hero-art { order: initial; padding-top: 2rem; margin: 0; display: grid; place-items: center; min-height: 420px; }
  .mascot { width: 265px; }
  body > .landscape { display: none; }
  .hero-art > .landscape {
    display: block;
    --sky-size: auto 600px;
    --sky-position: 70% top;
    /* The sun now starts below the CTA row, regardless of text wrapping. */
    inset: -24px auto auto 50%;
    width: 100vw;
    height: 600px;
    transform: translateX(-50%);
    mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  }
  .site-nav { margin-right: 4rem; }
  .lamp { right: .5rem; }
  .game { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem; }
  .game-num { font-size: 4rem; }
  .game-side { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; }
  .game-side .game-motif { width: 72px; height: 72px; margin-top: 0; }
  .game-kind { margin: 0; }
  .mini-games { grid-template-columns: repeat(3,1fr); gap: 1rem; }
  .mini { padding: 1.3rem 1rem; }
  .newsletter-signup { max-width: 42rem; }
}


@media (max-width: 650px) {
  .site-header, main, .site-footer { width: calc(100% - 2.5rem); }
  .site-header { gap: .5rem; min-height: 75px; }
  .brand { gap: .4rem; }
  .brand img { width: 28px; height: 36px; }
  .brand-name { font-size: 1.1rem; }
  .site-nav { gap: .15rem; margin-right: 2.25rem; }
  .site-nav a { font-size: .9rem; padding: .2rem .4rem; }
  .lamp { right: -.5rem; width: 1.8rem; }
  .lamp-bead { width: 1.25rem; height: 1.25rem; margin-left: -.5rem; }
  .lamp-tip { display: none; }
  .hero { padding-top: 1.65rem; }
  .hero .eyebrow { font-size: .68rem; letter-spacing: .02em; }
  .hero h1 { font-size: clamp(2.2rem,9.25vw,3.65rem); line-height: 1.04; margin-bottom: 1.6rem; }
  .lede { font-size: 1.13rem; line-height: 1.45; }
  .cta-row { gap: .75rem; }
  .btn { font-size: 1.02rem; padding: .65rem .85rem; }
  .hero-art { min-height: 380px; padding-top: 1.5rem; }
  .mascot { width: 245px; }
  .hero-art > .landscape { --sky-position: 74% top; }
  .mini-games { grid-template-columns: 1fr; gap: 2rem; }
  .section { padding-top: 3.5rem; }
  .section-head p:not(.eyebrow) { font-size: 1.1rem; line-height: 1.45; }
  .newsletter-copy p:not(.eyebrow) { font-size: 1.1rem; line-height: 1.45; }
  .newsletter-signup { padding: 1.8rem 1.35rem 1.35rem; transform: rotate(-.55deg); }
  .newsletter-paper::after { width: 105px; height: 86px; }
  .newsletter-form .formkit-fields { grid-template-columns: 1fr; }
  .newsletter-form .formkit-submit { width: 100%; }
  .eyebrow { font-size: .8rem; }
  .mini { padding: 1.75rem; min-height: 270px; }
  .game { padding: 1.5rem 1rem; }
  .game-side { gap: .65rem; }
  .game-side .game-motif { width: 58px; height: 58px; outline-offset: -5px; }
  .game-kind { font-size: .7rem; }
  .track-here { font-size: 1rem; }
  .shelf-empty { padding: 0; }
}

@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .track li { font-size: .56rem; }
}

@media (max-width: 360px) {
  .brand-name { font-size: .93rem; }
  .brand img { width: 23px; }
  .site-nav a { font-size: .8rem; }
  .hero .eyebrow { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
