/*
 * hockey.nann.in — spec §19.
 *
 * Two layouts in one sheet: the front page (a pitch, a slab, two store buttons) and the quiet
 * documents behind it. No framework, no build step, nothing fetched from anyone else's server
 * (§19.4) — which is why the one webfont is served from this origin and why there is no analytics
 * script to describe in the privacy policy.
 *
 * The palette is the game's own (shared/data/design.json) and the two greens are **sampled from a
 * real captured frame** rather than chosen by eye: #68c848 and #58b840 are the mown bands of the
 * pitch the game actually draws. The cheapest way to look like this game is to be made of it.
 */

/* The display face is the game's own (shared/assets/fonts), copied in by push.toml's build. Served
   from this origin: a Google Fonts link would tell Google about every visitor, and §19.4's claim
   that visiting tells no third party anything has to be true of the stylesheet too. */
@font-face {
  font-family: "Lilita One";
  src: url("/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --pitch: #58b840;          /* the mown band, sampled */
  --pitch-lit: #68c848;      /* its lighter neighbour, sampled */
  --straw: #fff3b0;          /* design.json: the pale surround */
  --ink: #1e1b4b;
  --paper: #ffffff;
  --paper-shade: #d8dcec;
  --sun: #ffc83d;
  --sun-shade: #c98a12;
  --pink: #f472b6;
  --green: #4ade80;
  --card: #2a2660;

  --slab-lift: 10px;         /* the extrusion under every panel — the 3D UI, seen head-on */
  --radius: 20px;
  --gutter: 16px;
  --measure: 64ch;

  color-scheme: light;
}

/* The lesson from the sister project, stated once for everything: an author rule carrying a
   `display` beats the UA stylesheet's `[hidden] { display: none }`, and an invisible panel that
   still eats taps is the kind of bug that ships. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--straw);
  color: var(--ink);
  font: 400 1.0625rem/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: #3f3a9e; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

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

/* ─────────────────────────────────────────────────────────────────────────────
   The pitch — the ground of the front page.

   Mown bands plus the shooting circle's D, which is the one marking nobody could
   mistake for another sport. It is drawn rather than photographed so it scales to
   any screen and costs no request.
   ───────────────────────────────────────────────────────────────────────────── */

.pitch {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      180deg,
      var(--pitch-lit) 0 64px,
      var(--pitch) 64px 128px
    );
  padding: clamp(2.5rem, 9vw, 5.5rem) var(--gutter) clamp(3rem, 10vw, 6rem);
}

/* The D: a circle far wider than the screen, so only its arc crosses the hero.
   Sized in vw rather than in percentages of the hero, so the apex lands a predictable 40vw above
   the bottom edge whatever the hero's height turns out to be — percentages of a box whose height
   is set by its own content put the whole circle off-screen on a tall viewport. */
.pitch::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -120vw;
  width: 160vw;
  height: 160vw;
  transform: translateX(-50%);
  border: 5px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
}

/* The app icon, stood on the pitch like one of the game's own panels. */
.badge {
  width: clamp(120px, 28vw, 168px);
  height: clamp(120px, 28vw, 168px);
  display: block;
  margin: 0 auto clamp(1.25rem, 4vw, 2rem);
  border-radius: 26%;
  border: 5px solid var(--ink);
  box-shadow: 0 var(--slab-lift) 0 var(--ink);
  background: var(--paper);
}

.wordmark {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--paper);
  /* The game letters things this way: a white face over a hard navy extrusion. */
  text-shadow: 0 6px 0 var(--ink);
}

.lede {
  font-size: clamp(1.0625rem, 2.6vw, 1.3125rem);
  line-height: 1.5;
  max-width: 30ch;
  margin: clamp(1.25rem, 4vw, 1.75rem) auto 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 0.7rem 1.1rem;
}

/* ── the two store buttons ─────────────────────────────────────────────────── */

/* Equal, and loud. The page wants an install and does not care which of the two
   stores delivers it, so it never guesses at a platform and never hides one. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
  margin: clamp(1.5rem, 5vw, 2.25rem) 0 0;
  padding: 0;
  list-style: none;
}

.store {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 14.5rem;
  padding: 0.8rem 1.25rem;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  box-shadow: 0 var(--slab-lift) 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}

.store b {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.3125rem;
  line-height: 1.1;
}

.store span { font-size: 0.8125rem; }

a.store:hover { background: #ffd868; color: var(--ink); }

a.store:active {
  transform: translateY(var(--slab-lift));
  box-shadow: 0 0 0 var(--ink);
}

/* Not on the stores yet. A button that led nowhere would be worse than one that
   says so, and inventing a URL is exactly the fabrication this repo forbids. */
.store[aria-disabled="true"] {
  background: var(--paper);
  color: #4a4f6b;
  cursor: default;
}

.store[aria-disabled="true"] b { color: var(--ink); }

/* ── the band of plain facts ───────────────────────────────────────────────── */

.facts {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(2.25rem, 7vw, 3.5rem) var(--gutter);
}

.facts ul {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.facts h2 {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.15;
  margin: 0 0 0.3rem;
  color: var(--sun);
}

.facts li:nth-child(2) h2 { color: var(--green); }
.facts li:nth-child(3) h2 { color: var(--pink); }

.facts p {
  margin: 0;
  color: #d9dcf0;
  font-size: 1rem;
}

/* ── footers and the quiet documents ───────────────────────────────────────── */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  padding: 1.75rem var(--gutter);
  background: var(--straw);
  font-size: 0.9375rem;
}

.pitch + .facts + footer,
footer { justify-content: center; }

footer span { color: #5b5f77; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) var(--gutter) 1rem;
}

.wrap footer {
  margin-top: 3rem;
  padding-left: 0;
  padding-right: 0;
  background: none;
  border-top: 2px solid var(--paper-shade);
  justify-content: flex-start;
}

.mark {
  display: inline-block;
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 2rem;
}

.mark:hover { color: #3f3a9e; }

.legal h1 {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 0.5rem;
}

.legal h2 {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.3125rem;
  line-height: 1.2;
  margin: 2.25rem 0 0.5rem;
}

.legal .lede {
  background: none;
  padding: 0;
  margin: 0;
  max-width: none;
  font-size: 1.1875rem;
  color: #3d4160;
}

.legal .updated {
  font-size: 0.9375rem;
  color: #5b5f77;
  margin: 0.75rem 0 0;
}

.legal p, .legal li { max-width: var(--measure); }

.legal ul { padding-left: 1.15rem; }

.legal li { margin-bottom: 0.5rem; }

.callout {
  margin: 2rem 0 0;
  padding: 1.1rem 1.25rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
}

.callout p { margin: 0; }

/* ── the one orchestrated moment ───────────────────────────────────────────── */

/* The game's panels land rather than appear. One sequence, on load, and nothing
   else on the page moves by itself. */
@media (prefers-reduced-motion: no-preference) {
  .badge, .wordmark, .lede, .stores {
    animation: land 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  }
  .wordmark { animation-delay: 0.07s; }
  .lede     { animation-delay: 0.14s; }
  .stores   { animation-delay: 0.21s; }
}

@keyframes land {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  a.store:active { transform: none; }
}
