/*
  Gym Monster — styles.css
  ========================
  BEGINNER GUIDE
  - CSS selects HTML elements (by tag, class, or id) and sets visual properties.
  - A "selector" like .hero picks every element with class="hero".
  - Properties look like:  property-name: value;
  - Comments in CSS use slash-star ... star-slash (they cannot nest).

  Cascade tip: when two rules conflict, the more specific one wins; if equal,
  the one that appears LATER in this file usually wins.

  Units you'll see often:
  - rem  ≈ relative to root font size (scales if user zooms text)
  - %    = relative to parent
  - vw/vh = % of viewport width/height
  - svh  = "small viewport height" (better on mobile browsers with collapsing UI chrome)
*/

/* ---------------------------------------------------------------------------
   CUSTOM FONTS
   @font-face teaches the browser a new font-family name and where the file lives.
   font-display: swap → show fallback text immediately, then swap in our pixel font
   once it loads (avoids a long invisible-text flash).
--------------------------------------------------------------------------- */
@font-face {
  font-family: "Press Start 2P";
  src: url("assets/PressStart2P-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("assets/SpaceMono-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   DESIGN TOKENS (CSS variables)
   :root = the document root (<html>). Variables defined here are reusable
   everywhere via var(--name). Change a color once → updates the whole site.
   These hex values match the Gym Monster iOS app (mint surfaces + indigo CTAs).
--------------------------------------------------------------------------- */
:root {
  --mint: #f0fdf4;
  --mint-deep: #dcfce7;
  --mint-mid: #bbf7d0;
  --indigo: #6366f1;
  --indigo-dark: #3730a3;
  --indigo-mid: #4338ca;
  --indigo-light: #a5b4fc;
  --ink: #22223b;
  --body: #374151;
  --pixel-border: #333333;
  --cyan: #50d8e0;
  --cyan-bright: #78f8e0;
  --danger: #b91c1c;
  --white: #ffffff;
  --header-h: 72px; /* shared height so hero can subtract it from the viewport */
  /* App UI uses Press Start 2P for nearly all text (login, labels, buttons). */
  --font-pixel: "Press Start 2P", monospace;
  /* Space Mono kept as a rare fallback for very long dense copy if needed. */
  --font-mono: "Space Mono", ui-monospace, monospace;
}

/* ---------------------------------------------------------------------------
   RESET-ISH BASICS
   box-sizing: border-box → width includes padding + border (easier math for layouts).
   The * selector means "every element"; ::before/::after cover pseudo-elements too.
--------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* animated jump when clicking #hash links */
}

body {
  margin: 0; /* browsers add default margin — remove it for full-bleed layouts */
  min-height: 100vh;
  /* Match the iOS app: Press Start 2P everywhere, not a modern sans-serif. */
  font-family: var(--font-pixel);
  color: var(--body);
  background: var(--mint);
  /* Pixel fonts need extra line-height or lines crash into each other. */
  line-height: 1.7;
  letter-spacing: -0.04em;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1); /* same soft shadow idea as the app login UI */
  -webkit-font-smoothing: antialiased; /* slightly cleaner text on macOS/iOS Safari */
}

/* Make images responsive by default: never wider than their container. */
img {
  max-width: 100%;
  height: auto;
  display: block; /* removes the tiny gap under inline images */
}

/* Let <picture> wrappers pass layout through to the nested <img>. */
picture {
  display: contents;
}

/*
  Pixel art tip: when you scale up low-res sprites, browsers blur by default.
  image-rendering: pixelated keeps hard square pixels (retro look).
  We list crisp-edges too for broader browser support.
*/
.pixelated {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------------------------------------------------------------------------
   SKIP LINK (keyboard accessibility)
   Parked far off-screen with left: -9999px until focused, then jumps into view.
--------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--indigo);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* —— Header ——
   position: sticky keeps the bar stuck to the top while scrolling.
   z-index stacks it above page content. backdrop-filter blurs what's behind.
*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(240, 253, 244, 0.92); /* mint with alpha for translucency */
  border-bottom: 2px solid var(--pixel-border);
  backdrop-filter: blur(8px);
}

/*
  Flexbox layout: one row, space-between pushes brand left & CTA right.
  margin: 0 auto centers the fixed-width-ish container.
*/
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  min-width: 0; /* allow wordmark to shrink on tiny phones */
}

/*
  iOS-style app icon "squircle":
  - ~22.5% corner radius approximates Apple's continuous corner on small icons
  - soft drop shadow matches the floating home-screen look in the reference
  - mint fill peeks out if the PNG has transparency
*/
.app-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 22.5%;
  overflow: hidden;
  background: #d5fcdf;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-header__wordmark {
  width: 120px;
  height: auto;
}

/*
  APP STORE BUTTON — "3D bevel" look matching the iOS app's pixelPrimaryButton.
  Tricks used:
  - Different border-top vs border-bottom colors → fake light from above
  - box-shadow as a solid "ledge" under the button
  - On hover/active, translateY + shorter shadow = "pressing into the screen"
  transition: smoothly animates those property changes over 120ms.
*/
.btn-app-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 10px;
  border: 2px solid var(--indigo-dark);
  border-top-color: var(--indigo-light);
  border-bottom-color: var(--indigo-dark);
  background: var(--indigo);
  padding: 0.35rem 0.45rem;
  box-shadow: 0 6px 0 var(--ink);
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn-app-store:hover {
  background: var(--indigo-mid);
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--ink);
}

/* :active = mouse/finger currently pressed. .is-pressed is toggled by JavaScript. */
.btn-app-store:active,
.btn-app-store.is-pressed {
  background: var(--indigo-dark);
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn-app-store img {
  width: 160px;
  height: auto;
}

/* Modifier class: smaller version for the sticky header. */
.btn-app-store--compact {
  padding: 0.2rem 0.3rem;
  box-shadow: 0 4px 0 var(--ink);
}

.btn-app-store--compact img {
  width: 110px;
}

/* —— Hero ——
   min-height: calc(100svh - header) ≈ fill the first screen minus the sticky bar.
   isolation: isolate creates a stacking context so z-index: -1 atmosphere
   stays behind hero content but doesn't sink behind the whole page.
*/
.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--pixel-border);
}

/* Full-bleed colored gradients behind the copy/art (not a flat single color). */
.hero__atmosphere {
  position: absolute;
  inset: 0; /* shorthand for top/right/bottom/left: 0 */
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(80, 216, 224, 0.16), transparent 55%),
    linear-gradient(165deg, var(--mint) 0%, var(--mint-deep) 45%, #e0f2fe 100%);
}

/*
  ::after is a CSS-generated empty box we style as a subtle pixel grid overlay.
  Two 1px gradients + background-size = graph-paper lines without an image file.
*/
.hero__atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(34, 34, 59, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 34, 59, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none; /* clicks pass through to content underneath */
}

/*
  min(1100px, 100%) = never wider than 1100px, but shrink on small screens.
  display: grid with one column by default → stacks copy then art on mobile.
*/
.hero__grid {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}

/*
  Mobile-first: center headline, support text, and CTA (matches app login).
  Brand mark now lives in the sticky header (app icon + wordmark).
*/
.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  /* Soft mint panel so floating GIFs don't fight the copy for attention. */
  padding: 1.25rem 1rem;
  background: rgba(240, 253, 244, 0.82);
  border: 2px solid rgba(51, 51, 51, 0.15);
  box-shadow: 4px 4px 0 rgba(34, 34, 59, 0.12);
}

.hero__logo {
  width: min(100%, 320px);
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(34, 34, 59, 0.22));
}

/*
  Floating monster field — checkerboard on an 8×4 grid.
  Monsters only occupy alternating cells (empty neighbors between them),
  so the field feels less like a neat roster while still never overlapping.
  Float animation can be bigger because each sprite has vacant cells around it.
*/
.hero__floaters {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.45rem;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  /* Stay in grid flow — NOT position:absolute (that caused pile-ups). */
  position: relative;
  width: auto;
  max-width: min(100%, 96px);
  max-height: 92%;
  height: auto;
  object-fit: contain;
  justify-self: center;
  align-self: center;
  opacity: 0.92;
  filter: drop-shadow(0 5px 0 rgba(34, 34, 59, 0.18));
  animation: floater-bob 5.5s ease-in-out infinite;
  will-change: transform;
}

/*
  Checkerboard cell map (X = monster, . = empty):
  X . X . X . X .
  . X . X . X . X
  X . X . X . X .
  . X . X . X . X
*/
.floater--1  { grid-column: 1; grid-row: 1; max-width: min(100%, 110px); animation-duration: 5.8s; animation-delay: -0.4s; }
.floater--2  { grid-column: 3; grid-row: 1; max-width: min(100%, 82px);  animation-duration: 4.6s; animation-delay: -1.2s; }
.floater--3  { grid-column: 5; grid-row: 1; max-width: min(100%, 98px);  animation-duration: 6.2s; animation-delay: -2.1s; }
.floater--4  { grid-column: 7; grid-row: 1; max-width: min(100%, 88px);  animation-duration: 5.1s; animation-delay: -0.8s; }
.floater--5  { grid-column: 2; grid-row: 2; max-width: min(100%, 76px);  animation-duration: 4.9s; animation-delay: -3.0s; }
.floater--6  { grid-column: 4; grid-row: 2; max-width: min(100%, 104px); animation-duration: 6.4s; animation-delay: -1.6s; }
.floater--7  { grid-column: 6; grid-row: 2; max-width: min(100%, 84px);  animation-duration: 5.4s; animation-delay: -2.5s; }
.floater--8  { grid-column: 8; grid-row: 2; max-width: min(100%, 92px);  animation-duration: 4.7s; animation-delay: -0.2s; }
.floater--9  { grid-column: 1; grid-row: 3; max-width: min(100%, 80px);  animation-duration: 5.9s; animation-delay: -4.0s; }
.floater--10 { grid-column: 3; grid-row: 3; max-width: min(100%, 108px); animation-duration: 6.6s; animation-delay: -1.9s; }
.floater--11 { grid-column: 5; grid-row: 3; max-width: min(100%, 74px);  animation-duration: 4.4s; animation-delay: -3.4s; }
.floater--12 { grid-column: 7; grid-row: 3; max-width: min(100%, 90px);  animation-duration: 5.7s; animation-delay: -2.8s; }
.floater--13 { grid-column: 2; grid-row: 4; max-width: min(100%, 86px);  animation-duration: 5.2s; animation-delay: -1.1s; }
.floater--14 { grid-column: 4; grid-row: 4; max-width: min(100%, 100px); animation-duration: 6.0s; animation-delay: -3.7s; }
.floater--15 { grid-column: 6; grid-row: 4; max-width: min(100%, 78px);  animation-duration: 4.8s; animation-delay: -0.6s; }
.floater--16 { grid-column: 8; grid-row: 4; max-width: min(100%, 94px);  animation-duration: 5.5s; animation-delay: -2.2s; }

/*
  clamp(min, preferred, max) = fluid type that scales with the viewport
  but never goes smaller than min or larger than max.
*/
h1 {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(1.05rem, 2.8vw, 1.55rem);
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: -0.04em;
  text-shadow: 2px 2px 0 rgba(99, 102, 241, 0.18);
}

/* Same pixel type as the app tagline (~11–14px on login). */
.hero__support {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(0.65rem, 2.2vw, 0.85rem);
  line-height: 1.75;
  color: var(--body);
  max-width: 32rem;
}

/* —— Shared section chrome —— */
.section-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 4rem 1.25rem;
}

h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.section-lead {
  margin: 0 0 2.25rem;
  max-width: 36rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.6rem, 1.8vw, 0.75rem);
  line-height: 1.75;
}

/* —— Transformation (dark arcade strip) ——
   Nested selectors like ".transform h2" only style headings INSIDE .transform,
   so we can flip text to light colors without affecting other sections.
*/
.transform {
  background:
    linear-gradient(180deg, #0b1220 0%, #151b2e 55%, #1a1030 100%);
  color: #e5e7eb;
  border-bottom: 2px solid var(--pixel-border);
}

.transform h2,
.transform .section-lead {
  color: #f8fafc;
}

/* Larger body copy in this section — pixel type reads tiny at the global lead size. */
.transform .section-lead {
  color: #cbd5e1;
  font-size: clamp(0.75rem, 2.2vw, 0.95rem);
  line-height: 1.8;
  max-width: 40rem;
}

/* Skull + title sit on one row next to each other. */
.transform__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.transform__heading h2 {
  margin: 0;
}

.transform__skull {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 8px rgba(80, 216, 224, 0.55));
}

.transform__stage {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.transform__panel {
  margin: 0; /* <figure> has browser default margins — zero them */
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  /* Allow grid tracks to shrink below intrinsic GIF width (530px). */
  min-width: 0;
  width: 100%;
}

.transform__frame {
  position: relative;
  box-sizing: border-box;
  /* Always shrink with the panel/viewport; cap desktop size at 320px. */
  width: 100%;
  max-width: 320px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
  border: 3px solid var(--pixel-border);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45); /* chunky pixel "offset" shadow */
  /* Shared knight-003 viewport so both panels stay matched while scaling. */
  aspect-ratio: 530 / 640;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Modifier-driven accents: dead = muted, alive = cyan glow. */
.transform__panel--dead .transform__frame {
  border-color: #4b5563;
  box-shadow: 6px 6px 0 rgba(80, 216, 224, 0.18);
}

.transform__panel--alive .transform__frame {
  border-color: var(--cyan);
  box-shadow: 6px 6px 0 rgba(99, 102, 241, 0.35);
}

/* Full-res GIFs/PNGs must shrink inside the frame (never overflow on narrow viewports). */
.transform__frame > img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

/*
  In-app death sequence (MonsterCard):
  alive hold → 3 staggered explosion2.gif overlays → hard-swap to dead PNG.
*/
.death-seq__monster {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.death-seq__boom {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

/*
  Global `img { display: block }` overrides the UA [hidden] rule, which left
  empty explosion <img>s visible as broken icons + horizontal seams.
*/
.death-seq__boom[hidden] {
  display: none !important;
}

/* Approximate MonsterCard explosionOffsetBelow / Above (top: ±100). */
.death-seq__boom--2 {
  transform: translateY(28%);
}

.death-seq__boom--3 {
  transform: translateY(-28%);
}

.transform__panel figcaption {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.transform__panel figcaption strong {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--white);
}

.transform__panel figcaption span:last-child {
  font-family: var(--font-pixel);
  font-size: clamp(0.65rem, 1.8vw, 0.75rem);
  line-height: 1.75;
  color: #94a3b8;
  max-width: 18rem;
}

.transform__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Shared footprint with SHOW UP so Quit / SHOW UP / Train read as equal boxes. */
  min-width: 8.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid currentColor;
}

.transform__label--dead {
  color: var(--cyan);
}

.transform__label--alive {
  color: var(--mint-mid);
}

.transform__arrow {
  display: flex;
  justify-content: center;
  align-items: center;
}

.transform__arrow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 8.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-light);
  border: 2px dashed var(--indigo-light);
}

/* —— How it works —— */
.how {
  background:
    linear-gradient(180deg, var(--mint-deep), var(--mint));
  border-bottom: 2px solid var(--pixel-border);
}

/* Remove default numbered list bullets/indent; we style our own step numbers. */
.how__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.how__steps li {
  display: grid;
  gap: 0.4rem;
  padding-left: 0;
  border-left: 4px solid var(--indigo); /* accent rule on mobile (top border on desktop) */
  padding-left: 1rem;
}

.how__num {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--indigo);
  letter-spacing: 0.08em;
}

.how__steps strong {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--ink);
}

.how__steps li > span:last-child {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  line-height: 1.7;
  color: var(--body);
}

/* —— Closing CTA —— */
.closing {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99, 102, 241, 0.2), transparent 60%),
    var(--mint);
  border-bottom: 2px solid var(--pixel-border);
  text-align: center;
}

.closing__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.closing__logo {
  width: min(100%, 260px);
}

.closing .section-lead {
  margin-bottom: 0.5rem;
}

/* —— Legal / support pages (terms, privacy, support) ——
   Same mint + indigo system as the landing page, with Space Mono for dense
   body copy so long policies stay readable under Press Start 2P headings.
*/
.page-shell {
  position: relative;
  isolation: isolate;
  border-bottom: 2px solid var(--pixel-border);
  min-height: calc(100svh - var(--header-h));
}

.page-shell__atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 80% 10%, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(ellipse 45% 35% at 10% 70%, rgba(80, 216, 224, 0.12), transparent 50%),
    linear-gradient(165deg, var(--mint) 0%, var(--mint-deep) 50%, #e0f2fe 100%);
}

.page-shell__atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(34, 34, 59, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 34, 59, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.legal {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.legal__panel {
  background: rgba(240, 253, 244, 0.88);
  border: 2px solid rgba(51, 51, 51, 0.15);
  box-shadow: 4px 4px 0 rgba(34, 34, 59, 0.12);
  padding: 1.75rem 1.25rem;
}

.legal__kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
}

.legal h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
}

.legal__updated {
  margin: 0 0 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--body);
}

.legal__intro,
.legal p {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  letter-spacing: 0;
  text-shadow: none;
  color: var(--body);
}

.legal h2 {
  margin: 2rem 0 0.85rem;
  padding-top: 0.35rem;
  border-top: 2px solid rgba(51, 51, 51, 0.12);
  font-size: clamp(0.75rem, 1.8vw, 0.95rem);
}

.legal h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal ul {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  letter-spacing: 0;
  text-shadow: none;
  color: var(--body);
}

.legal li {
  margin-bottom: 0.45rem;
}

.legal li:last-child {
  margin-bottom: 0;
}

.legal a {
  color: var(--indigo-mid);
  font-weight: 700;
}

.legal a:hover,
.legal a:focus-visible {
  color: var(--indigo-dark);
}

.legal__note {
  margin: 1.5rem 0 0;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 2px solid rgba(99, 102, 241, 0.25);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  letter-spacing: 0;
  text-shadow: none;
  color: var(--ink);
}

@media (min-width: 860px) {
  .legal {
    padding-block: 3.25rem 4.5rem;
  }

  .legal__panel {
    padding: 2.25rem 2rem;
  }
}

/* —— Footer —— */
.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 2rem 1.25rem;
}

.site-footer__inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.site-footer__brand {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--white);
}

/*
  flex-wrap: wrap → links move to the next line on narrow screens instead of overflowing.
  gap: row-gap column-gap when two values are given.
*/
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.site-footer__nav a {
  color: var(--cyan-bright);
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  line-height: 1.6;
}

/* :focus-visible styles keyboard focus without painting a ring on every mouse click. */
.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  text-decoration: underline;
}

.site-footer__copy {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  line-height: 1.6;
  color: #94a3b8;
}

/* —— Keyframe animations ——
   @keyframes define the "from → to" (or % steps) of a named animation.
   You attach them with the animation: property on a selector.
*/
/* Pronounced float: bigger vertical travel + a little sway (empty checker cells absorb it). */
@keyframes floater-bob {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(6px, -16px) rotate(1.5deg);
  }
  50% {
    transform: translate(-4px, -28px) rotate(-1deg);
  }
  75% {
    transform: translate(5px, -12px) rotate(0.8deg);
  }
}

/* Same idea on mobile — still obvious, slightly shorter path. */
@keyframes floater-bob-mobile {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(4px, -12px) rotate(1deg);
  }
  50% {
    transform: translate(-3px, -20px) rotate(-0.8deg);
  }
  75% {
    transform: translate(3px, -9px) rotate(0.6deg);
  }
}

@keyframes copy-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__copy.is-ready {
  animation: copy-rise 520ms ease-out both;
}

/*
  Accessibility: some people get motion sickness from animation.
  OS setting "reduce motion" makes this media query match → we turn animations off.
  !important here intentionally overrides the animation rules above.
*/
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__copy.is-ready,
  .floater,
  .btn-app-store {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Responsive breakpoints ——
   Mobile-first approach: base styles above are for small screens.
   This block ADDS/OVERRIDES rules only when the viewport is at least 860px wide.
*/
@media (min-width: 860px) {
  /* Single composition: centered promise over the floating monster field. */
  .hero__grid {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-block: 3rem 3.5rem;
  }

  .hero__copy {
    align-items: center;
    text-align: center;
    margin-inline: auto;
    padding: 1.75rem 1.5rem;
  }

  .hero__floaters {
    gap: 0.5rem;
    padding: 0.85rem;
  }

  .floater {
    max-width: min(100%, 132px);
  }

  .floater--1,
  .floater--6,
  .floater--10,
  .floater--14 {
    max-width: min(100%, 148px);
  }

  /* Three columns: dead | arrow | alive */
  .transform__stage {
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
  }

  .transform__arrow span {
    writing-mode: horizontal-tb;
  }

  /* Three equal step columns on desktop */
  .how__steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .how__steps li {
    border-left: none;
    border-top: 4px solid var(--indigo);
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* Phones + narrow tablets: same non-overlapping grid, slightly tighter. */
@media (max-width: 859px) {
  .hero {
    min-height: calc(100svh - var(--header-h));
  }

  .hero__grid {
    padding-block: 1.25rem;
  }

  .hero__floaters {
    gap: 0.3rem;
    padding: 0.35rem;
  }

  .floater {
    opacity: 0.9;
    /* Still punchy on phones, but a bit less travel so sprites don't clip hard. */
    animation-name: floater-bob-mobile;
  }
}

/* Extra-tight phones: slightly smaller chrome. */
@media (max-width: 480px) {
  .app-icon {
    width: 36px;
    height: 36px;
  }

  .site-header__wordmark {
    width: 96px;
  }

  .btn-app-store--compact img {
    width: 96px;
  }

  h1 {
    font-size: 0.95rem;
  }
}
