/* Oblong Element -- pixel art indie studio */

/* Self-hosted so no third-party font request can be blocked. Licence: fonts/OFL.txt */
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PressStart2P-Regular.woff2") format("woff2");
}

:root {
  /* The sticky header's height. 64px is right when the nav fits on one row; on
     phones it wraps onto two, and js/main.js sets the real height here. */
  --header-height: 64px;
  --purple-deep: #1a0f2e;
  --purple-mid: #3d1f6b;
  --purple: #7b3fb0;
  --purple-bright: #b06dff;
  --teal: #2a9d8f;
  --green: #3ecf7a;
  --green-bright: #6dff9a;
  --green-deep: #1a5c3a;
  --ink: #e8e0f5;
  --ink-dim: #a898c4;
  --pixel: 4px;
  --text-body: 1.02rem; /* body text: 2pt (~2.7px) bigger than the old 0.85rem */
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Press Start 2P", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height); /* so "#games" links don't land under the header */
  image-rendering: pixelated;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 2;
  color: var(--ink);
  background: var(--purple-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Atmospheric background: three big soft blobs that drift and breathe very slowly */
@property --blob-a-x { syntax: "<percentage>"; inherits: false; initial-value: 20%; }
@property --blob-a-y { syntax: "<percentage>"; inherits: false; initial-value: 10%; }
@property --blob-a-s { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --blob-b-x { syntax: "<percentage>"; inherits: false; initial-value: 85%; }
@property --blob-b-y { syntax: "<percentage>"; inherits: false; initial-value: 80%; }
@property --blob-b-s { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --blob-c-x { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --blob-c-y { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --blob-c-s { syntax: "<number>"; inherits: false; initial-value: 1; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse calc(80% * var(--blob-a-s)) calc(50% * var(--blob-a-s)) at var(--blob-a-x) var(--blob-a-y), rgba(123, 63, 176, 0.45), transparent 55%),
    radial-gradient(ellipse calc(70% * var(--blob-b-s)) calc(60% * var(--blob-b-s)) at var(--blob-b-x) var(--blob-b-y), rgba(62, 207, 122, 0.28), transparent 50%),
    radial-gradient(ellipse calc(50% * var(--blob-c-s)) calc(40% * var(--blob-c-s)) at var(--blob-c-x) var(--blob-c-y), rgba(42, 157, 143, 0.15), transparent 60%),
    linear-gradient(165deg, var(--purple-deep) 0%, #241440 40%, #152a28 100%);
  /* Each blob has its own multi-minute cycle so they never line up.
     steps() means only ~1 repaint per second, with ~1-2px per step: smooth to the eye, cheap for the GPU. */
  animation:
    blob-a 60s steps(90) infinite alternate,
    blob-b 80s steps(90) infinite alternate,
    blob-c 100s steps(90) infinite alternate;
}

@keyframes blob-a {
  0%   { --blob-a-x: 20%; --blob-a-y: 10%; --blob-a-s: 1; }
  33%  { --blob-a-x: 34%; --blob-a-y: 24%; --blob-a-s: 1.25; }
  66%  { --blob-a-x: 10%; --blob-a-y: 32%; --blob-a-s: 0.85; }
  100% { --blob-a-x: 26%; --blob-a-y: 4%;  --blob-a-s: 1.15; }
}

@keyframes blob-b {
  0%   { --blob-b-x: 85%; --blob-b-y: 80%; --blob-b-s: 1; }
  33%  { --blob-b-x: 70%; --blob-b-y: 68%; --blob-b-s: 0.8; }
  66%  { --blob-b-x: 92%; --blob-b-y: 62%; --blob-b-s: 1.3; }
  100% { --blob-b-x: 76%; --blob-b-y: 90%; --blob-b-s: 1.05; }
}

@keyframes blob-c {
  0%   { --blob-c-x: 50%; --blob-c-y: 50%; --blob-c-s: 1; }
  33%  { --blob-c-x: 38%; --blob-c-y: 40%; --blob-c-s: 1.35; }
  66%  { --blob-c-x: 62%; --blob-c-y: 58%; --blob-c-s: 0.8; }
  100% { --blob-c-x: 46%; --blob-c-y: 68%; --blob-c-s: 1.2; }
}

/* Pixel grid overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 8px 8px;
}

img {
  max-width: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a {
  color: var(--green-bright);
  text-decoration: none;
  transition: color 0.15s steps(3);
}

a:hover {
  color: var(--purple-bright);
}

/* ----- Layout ----- */

.wrap {
  width: min(960px, 92vw);
  margin-inline: auto;
}

/* ----- Nav ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 15, 46, 0.92);
  border-bottom: 4px solid rgba(123, 63, 176, 0.4); /* --purple at 40% */
  backdrop-filter: blur(4px);
}

/* Gem-studded corner protectors, like the metal ones on old books. The artwork
   (img/corner.svg) is a 40x40-pixel grid drawn at 5px per pixel = 200px. Its top
   leg is 12 pixels thick = 60px, which is exactly the height of the header bar, so
   the leg and the bar read as one piece. The corners hang down over the page
   (they are not clipped to the header); the right one is the same artwork mirrored.
   Windows narrower than 1100px don't have room for them next to the nav, so they
   only appear on wider screens. */
@media (min-width: 1100px) {
  .site-header {
    --corner-cell: 5px;
    --corner-size: calc(40 * var(--corner-cell));
    --bar-height: calc(12 * var(--corner-cell));
    min-height: var(--bar-height);
    display: flex;
    align-items: stretch; /* the nav fills the bar, so its top is the bar's top */
  }

  /* Keep the nav between the two corners */
  .site-header .nav {
    --nav-pad-top: 0px;
    padding: 0;
    width: min(960px, calc(100vw - 2 * var(--corner-size)));
  }

  .site-header::before,
  .site-header::after {
    content: "";
    position: absolute;
    top: 0;
    width: var(--corner-size);
    height: var(--corner-size);
    background: url("../img/corner.svg") no-repeat 0 0 / 100% 100%;
    image-rendering: pixelated;
    pointer-events: none;
  }

  .site-header::before {
    left: 0;
  }

  .site-header::after {
    right: 0;
    transform: scaleX(-1);
  }
}

.nav {
  --nav-pad-top: 0.85rem; /* matches the padding below; the music toggle needs it */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

/* Header play/pause toggle (created by js/music.js once the music has started).
   .nav-music holds its place between the brand and the menu; the button itself
   hangs from 10px below the top of the bar and overhangs the bottom of it. It's
   styled like the corner protectors: embossed purple plate (bright bevel top-left,
   dark bevel bottom-right, engraved groove) with a green icon in the middle. */
.nav-music {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  align-self: stretch;
}

.nav-music-toggle {
  --toggle-top: 10px; /* space above the button, measured from the top of the bar */
  position: absolute;
  top: calc(var(--toggle-top) - var(--nav-pad-top));
  left: 0;
  width: 96px;
  height: 75px; /* the earlier 68px, plus ~10% */
  padding: 0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: var(--purple);
  image-rendering: pixelated;
  box-shadow:
    inset 5px 5px 0 var(--purple-bright),
    inset -5px -5px 0 var(--purple-mid),
    0 0 0 5px #0d0814,
    5px 12px 0 5px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.nav-music-toggle::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 5px solid var(--purple-mid);
  pointer-events: none;
}

.nav-music-toggle svg {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.nav-music-toggle:hover {
  filter: brightness(1.12);
}

/* On phones the nav wraps onto two rows, and a toggle between the brand and the
   links ends up on top of them. So there it leaves the row and hangs from the
   header's bottom border, centered, covering the border so it looks attached.
   Any higher and it would cover the links. (The sticky header is what it's
   positioned against.) */
@media (max-width: 699px) {
  .nav-music {
    position: absolute;
    left: 50%;
    bottom: 0; /* the top of the header's bottom border */
    height: 0;
    transform: translateX(-50%);
  }

  .nav-music-toggle {
    top: 0;
  }
}

.nav-music-toggle:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 8px;
}

.nav-brand {
  font-family: var(--font-pixel);
  font-size: clamp(1.06rem, 2.38vw, 1.36rem);
  line-height: 1.5;
  color: var(--green-bright);
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 var(--purple-mid);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-brand:hover {
  color: var(--purple-bright);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.nav-links {
  display: flex;
  gap: 0.5rem 1.75rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: clamp(0.94rem, 1.95vw, 1.1rem);
  line-height: 1.5;
  color: var(--ink-dim);
  padding: 0.5rem 0;
  border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--green);
}

/* ----- Site-wide pixel field ----- */

.pixel-field-background {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.pixel-field-background canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* (.site-header is NOT in this list: it is position: sticky, which keeps it pinned to
   the top of the window while scrolling, and a position: relative here would undo that.) */
main,
.site-footer {
  position: relative;
}

main,
.site-footer {
  z-index: 1;
}

/* The router moves focus here after swapping pages; it isn't an interactive control. */
main:focus {
  outline: none;
}

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

/* The hero fills exactly the screen below the header, which puts the "scroll" hint
   on the bottom edge. On phones, 100vh is the height with the browser's address bar
   hidden, so the hero came out taller than the screen when the page loads. 100svh is
   the height with the bar showing. Browsers that don't know svh use the vh line. */
.hero {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0 4rem;
  position: relative;
  width: 100%;
  overflow: hidden;
  --dome-size: 14rem; /* resting size of the backdrop behind the "scroll" hint: big enough to cover the text */
}

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

.hero-brand {
  font-family: var(--font-pixel);
  font-size: clamp(2.12rem, 5.95vw, 3.61rem);
  line-height: 1.35;
  color: var(--ink);
  text-shadow:
    4px 4px 0 var(--purple-mid),
    -1px -1px 0 var(--green-deep);
  margin-bottom: 1.25rem;
  animation: brand-in 0.6s steps(6) both;
}

/* Plain-text fallback, only visible if js/title.js doesn't run */
.hero-brand .title-fallback {
  display: block;
  background: linear-gradient(90deg, var(--purple-bright), var(--teal), var(--green-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(3px 3px 0 var(--purple-mid));
}

/* Pixel/ASCII-style title: one <svg> per letter, one <rect> per lit cell */
.hero-brand.is-rendered {
  /* One grid cell. 42 cells = the widest word ("Element") plus its gaps. */
  --cell: min(15.3px, 1.79vw);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--cell);
  line-height: 0;
  text-shadow: none;
}

.title-word {
  display: flex;
  gap: var(--cell);
}

/* "Oblong" hugs the left edge, "Element" sits flush against the right edge of the content column */
.title-word:last-child {
  align-self: flex-end;
}

.title-letter {
  width: calc(var(--cell) * 5);
  height: calc(var(--cell) * 9);
  flex-shrink: 0;
  overflow: visible;
  cursor: default;
  image-rendering: pixelated;
  /* Hard, un-blurred shadow like before; contrast tweaks can come later. */
  filter: drop-shadow(calc(var(--cell) * 0.3) calc(var(--cell) * 0.3) 0 var(--purple-mid));
}

.hero-tagline {
  font-size: clamp(0.85rem, 2.04vw, 1.27rem);
  line-height: 1.8;
  color: var(--ink-dim);
  /* Spans the full content width so the second line can sit against the right
     edge, in line with "Element" in the title above. */
  margin-bottom: 2rem;
  animation: fade-up 0.5s steps(5) 0.2s both;
}

.tagline-line {
  display: block;
}

.tagline-line-right {
  text-align: right;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: fade-up 0.5s steps(5) 0.35s both;
}

/* Pixel buttons */
.btn {
  font-family: var(--font-pixel);
  font-size: clamp(0.94rem, 1.78vw, 1.1rem);
  line-height: 1.5;
  padding: 1.1rem 1.5rem;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  image-rendering: pixelated;
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.35),
    inset 3px 3px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.1s steps(2), filter 0.1s steps(2);
}

.btn:hover {
  transform: translate(-1px, -1px);
  filter: brightness(1.1);
}

/* The buttons under the games stay put when hovered; they only get the brightness
   highlight (and the pressed look while being clicked). */
.game-links .btn:hover {
  transform: none;
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow:
    inset 3px 3px 0 rgba(0, 0, 0, 0.35),
    inset -2px -2px 0 rgba(255, 255, 255, 0.15);
}

/* :hover is listed so a link styled as a button keeps its color instead of
   picking up the purple from a:hover. */
.btn-primary,
.btn-primary:hover {
  background: var(--purple-deep);
  color: var(--green);
}

.btn-ghost {
  background: var(--purple-mid);
  color: var(--ink);
}

/* Scroll hint. It's a link to the games section, and it's as big as the semicircle
   behind it (.hero::after), so clicking anywhere on that bubble scrolls down, not
   just clicking the text. */
.scroll-hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--dome-size);
  height: calc(var(--dome-size) / 2);
  border-radius: calc(var(--dome-size) / 2) calc(var(--dome-size) / 2) 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.5rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  color: var(--green);
  animation: bob 1.4s steps(4) infinite;
  z-index: 1;
  white-space: nowrap;
}

/* A semicircle sits behind the "scroll" hint as its backdrop. It appears after the
   title's letter wave has finished (js/title.js adds .is-pinging to the hero then):
   it starts as big as the hero section, collapses in on the hint while fading from
   0% to 40% opacity, and stays there. Its flat edge sits flush on the line at the
   bottom of the hero section, so only the top half shows. Smooth, not stepped. */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0; /* the flat edge sits right on the horizontal line under the hero section */
  --ping-size: max(100vw, 2 * (100vh - var(--header-height)));
  --ping-size: max(100vw, 2 * (100svh - var(--header-height)));
  width: var(--dome-size);
  height: var(--dome-size);
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: var(--purple-bright);
  clip-path: inset(0 0 50% 0);
  opacity: 0;
  pointer-events: none;
  /* z-index auto + earlier in the stacking order than .hero-content and .scroll-hint,
     so it sits behind the title and the hint itself */
}

/* The size and the fade have separate timing curves: the shrinking speeds up as it
   closes in (ease-in), while the fade uses ease-out so the semicircle is visibly
   there from the very first moment instead of staying invisible for the first part
   of the 0.4s (which made it seem to start late). */
.hero.is-pinging::after {
  animation:
    scroll-ping-size 0.4s ease-in forwards,
    scroll-ping-fade 0.4s ease-out forwards;
}

/* ----- Sections ----- */

.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 2rem;
}

.section-label {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  line-height: 1.5;
  color: var(--teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.49rem, 3.23vw, 2rem);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.section-lead {
  font-size: var(--text-body);
  color: var(--ink-dim);
  max-width: 36ch;
}

/* Pixel divider */
.pixel-rule {
  height: 4px;
  border: none;
  background: repeating-linear-gradient(
    90deg,
    var(--purple) 0 8px,
    transparent 8px 12px,
    var(--green) 12px 20px,
    transparent 20px 24px
  );
  margin: 0;
  opacity: 0.4;
}

/* ----- Games ----- */

.games {
  background: rgba(0, 0, 0, 0.2);
  border-top: 4px solid var(--purple-mid);
  border-bottom: 4px solid var(--green-deep);
}

.game {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "head"
    "art"
    "body";
  gap: 1.5rem;
  padding: 2.5rem 0;
  align-items: center;
}

.game-head {
  grid-area: head;
  align-self: start;
  /* Lets the title size itself from this box's width (see .game-title) */
  container-type: inline-size;
}

.game-art {
  grid-area: art;
}

.game-body {
  grid-area: body;
}

.game + .game {
  border-top: 4px dashed rgba(123, 63, 176, 0.35);
}

/* Every game uses the same layout: pixel art on the left; the label, title and
   description all line up in a single column on the right */
@media (min-width: 700px) {
  .game {
    grid-template-columns: 200px 1fr;
    grid-template-areas:
      "art head"
      "art body";
    column-gap: 4rem;
    row-gap: 0.75rem;
  }

  .game-head {
    align-self: end;
  }

  .game-body {
    align-self: start;
  }
}

.game-art {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  margin-inline: auto;
  position: relative; /* anchors the "COMING SOON!" overlay */
}

/* Entries that aren't playable yet: clicking the art shows "COMING SOON!" (js/soon.js) */
.game-art-soon {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn[data-soon] {
  position: relative;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}

.soon-text {
  letter-spacing: normal;
  text-transform: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font-pixel);
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  color: #ffd24a; /* gold, with a bright top-left bevel and hard dark shadows */
  text-shadow:
    -0.06em -0.06em 0 #fff3b0,
    0.08em 0.08em 0 #b8741a,
    0.16em 0.16em 0 var(--purple-deep);
  animation: soon-pop 1.4s ease-in-out both;
}

.soon-text span {
  display: block;
}

.game-art svg,
.game-art canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.4));
  animation: float-pixel 3s steps(6) infinite;
}

.game:nth-child(even) .game-art svg,
.game:nth-child(even) .game-art canvas {
  animation-delay: -1.5s;
}

/* Playable Snake: clicking it stops the bobbing (js/snake.js adds .is-active) */
.game-art canvas {
  display: block;
  cursor: pointer;
  outline: none;
  /* Phones: tapping must never double-tap-zoom, and no text-select/callout/flash */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.game-art canvas:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 6px;
}

.game-art.is-active canvas {
  animation: none;
  /* Once a game is on, swipes on the canvas steer the snake instead of scrolling the page */
  touch-action: none;
}

.game-meta {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  line-height: 1.5;
  color: var(--teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.game-title {
  font-family: var(--font-pixel);
  /* Fallback for browsers without container units */
  font-size: clamp(0.85rem, 1.9vw, 1.53rem);
  line-height: 1.55;
  color: var(--green-bright);
  margin-bottom: 0.85rem;
  text-shadow: 2px 2px 0 var(--purple-mid);
}

/* Every title is the same size, scaled so the longest one ("Summer, Harvest,
   Winter, War" = 28 characters, each exactly 1em wide) just fits on one line
   in its column. The floor is the font's native 8px pixel size: it used to be
   body-text size (13.6px), but 28 characters at that size need 381px, so titles
   wrapped on phones, where the column is narrower than that.
   Browsers (Linux especially) can round every glyph's width to a whole pixel,
   which can add up to half a pixel per letter, so the title is sized to ~95% of
   the column (29.5 instead of 28 characters' worth) to leave room for that, and
   it is never allowed to wrap: if it's ever a hair too wide it spills into the
   empty space on the right instead of dropping a word to a second line. */
@supports (width: 1cqw) {
  .game-title {
    font-size: clamp(0.5rem, calc(100cqw / 29.5), 1.55rem);
    white-space: nowrap;
  }
}

.game-blurb {
  color: var(--ink-dim);
  font-size: var(--text-body);
  margin-bottom: 1rem;
}

/* Download / store links under each description */
.game-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  list-style: none;
}

/* li is a flex box so side-by-side buttons always end up the same height */
.game-links li {
  display: flex;
}

.game-links li[hidden] {
  display: none;
}

/* Square-ish button holding a pixel icon (the music play/pause toggle) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1.1rem;
}

.btn-icon svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
}

/* ----- Page hero (inner pages) ----- */

.page-hero {
  padding: 3rem 0 2rem;
}

.page-hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1.78rem, 4.25vw, 2.55rem);
  line-height: 1.45;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--purple-mid);
  margin-bottom: 1rem;
}

/* Gradient words in a page heading: the same purple -> teal -> green as the title on
   the home page, one gradient per word. (A drop-shadow filter is used instead of
   text-shadow, which would paint over the gradient.) */
.grad-word {
  display: inline-block;
  background: linear-gradient(90deg, var(--purple-bright), var(--teal), var(--green-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(3px 3px 0 var(--purple-mid));
}

.page-hero p {
  font-size: var(--text-body);
  color: var(--ink-dim);
  max-width: 36ch;
}

/* Centred heading block (About page) */
.page-hero-centered {
  text-align: center;
}

.page-hero-centered p {
  margin-inline: auto;
}

/* ----- Prose ----- */

.prose {
  max-width: 46ch;
  padding-bottom: 4rem;
}

.prose p {
  margin-bottom: 1.25rem;
  color: var(--ink-dim);
  font-size: var(--text-body);
}

.prose strong {
  color: var(--ink);
  font-weight: 400;
}

.prose h2 {
  font-family: var(--font-pixel);
  font-size: clamp(1.27rem, 2.55vw, 1.61rem);
  line-height: 1.5;
  color: var(--green-bright);
  margin: 2rem 0 1rem;
}

/* ----- Contact ----- */

.contact-grid {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-note {
  color: var(--ink-dim);
  font-size: var(--text-body);
}

.contact-note a {
  border-bottom: 2px solid var(--green);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field label {
  display: block;
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  line-height: 1.5;
  color: var(--teal);
  margin-bottom: 0.5rem;
  letter-spacing: 0.06em;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--ink);
  background: rgba(26, 15, 46, 0.8);
  border: 3px solid var(--purple);
  padding: 0.65rem 0.75rem;
  border-radius: 0;
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 3px 3px 0 var(--purple-mid);
}

.field textarea {
  min-height: 140px;
}

.form-status {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  line-height: 1.6;
  min-height: 1.2em;
  color: var(--green-bright);
}

.form-status.error {
  color: #ff8a9a;
}

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

.site-footer {
  border-top: 4px solid rgba(123, 63, 176, 0.4); /* --purple at 40% */
  padding: 1.75rem 0;
  background: rgba(0, 0, 0, 0.35);
}

/* Not the centred .wrap column: the brand and copyright are pinned out near the
   left and right edges of the window (50px in, a bit less on small screens). */
.site-footer .footer-inner {
  width: auto;
  margin-inline: 0;
  padding-inline: clamp(1rem, 5vw, 50px);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-brand {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 1.61vw, 0.98rem);
  line-height: 1.5;
  color: var(--ink-dim);
}

.footer-copy {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* ----- Animations ----- */

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* Starts as big as the hero and collapses onto the hint... */
@keyframes scroll-ping-size {
  from {
    width: var(--ping-size);
    height: var(--ping-size);
  }
  to {
    width: var(--dome-size);
    height: var(--dome-size);
  }
}

/* ...while fading in from 0% to 40%, where it stays (animation-fill-mode: forwards) */
@keyframes scroll-ping-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.4;
  }
}

@keyframes float-pixel {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* "COMING SOON!": fades in, holds, fades out, and grows from small to large
   the whole time. (28px "COMING" is 168px wide, which fits the 200px art.) */
@keyframes soon-pop {
  0% {
    opacity: 0;
    font-size: 0.6rem;
  }
  20% {
    opacity: 0; /* nothing yet: the fade-in starts late */
  }
  45%,
  55% {
    opacity: 1; /* only a brief moment at full strength */
  }
  80% {
    opacity: 0; /* and it's gone before the end */
  }
  100% {
    opacity: 0;
    font-size: 1.75rem;
  }
}

/* Same fade, no growing, for people who asked for less motion */
@keyframes soon-fade {
  0%,
  20% {
    opacity: 0;
  }
  45%,
  55% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
  }
}

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

  /* ...but the teaser still has to be visible long enough to read */
  .soon-text {
    animation-name: soon-fade;
    animation-duration: 1.4s !important;
    font-size: 1.25rem;
  }

  body::before {
    animation: none !important;
  }
}
