/* Hitmania Games
   The active theme is chosen in site.js (THEME = "a" | "c").
   Theme A is the default below, so the site still renders it without JS.
   Themes only override the custom properties in the two blocks below. */

/* ---------- Font (Archivo, self-hosted from Google Fonts, OFL) ---------- */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  /* Brand blue and its shades (the only hues used on the site). */
  --brand: #13437e;
  --brand-deep: #0e3566;
  --brand-ink: #0b2747;
  --brand-tint: #dce6f2;
  --brand-mist: #cfe0f5;
  --off-white: #f4f7fb;
  --white: #ffffff;

  /* Theme A: brand-blue page, white logo. */
  --bg: var(--brand);
  --fg: var(--white);
  --focus: var(--white);
  --btn-bg: var(--white);
  --btn-fg: var(--brand);
  --btn-border: var(--white);
  --btn-hover-bg: var(--brand-tint);
  --btn-hover-border: var(--brand-tint);
  --footer-bg: var(--brand-deep);
  --footer-fg: var(--white);
  --footer-link: var(--brand-mist);
  --header-border: transparent;
  --logo-white: block;
  --logo-blue: none;

  /* Long-form pages (legal) use a light reading surface in both themes. */
  --paper: var(--off-white);
  --paper-fg: var(--brand-ink);
  --paper-link: var(--brand);
  --paper-rule: var(--brand-tint);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="c"] {
  /* Theme C: off-white page, original blue logo. */
  --bg: var(--off-white);
  --fg: var(--brand-ink);
  --focus: var(--brand);
  --btn-bg: var(--brand);
  --btn-fg: var(--white);
  --btn-border: var(--brand);
  --btn-hover-bg: var(--brand-deep);
  --btn-hover-border: var(--brand-deep);
  --footer-bg: var(--brand);
  --footer-fg: var(--white);
  --footer-link: var(--white);
  --header-border: var(--brand-tint);
  --logo-white: none;
  --logo-blue: block;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Theme-dependent logo files: exactly one of each pair is shown. */
.logo-white {
  display: var(--logo-white);
}

.logo-blue {
  display: var(--logo-blue);
}

/* ---------- Button ---------- */

.button {
  display: inline-block;
  padding: 0.85rem 2rem;
  border: 2px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

/* ---------- Home & 404 ---------- */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vh, 3.5rem);
  padding: clamp(3rem, 10vh, 6rem) 1.25rem clamp(3rem, 8vh, 5rem);
  text-align: center;
}

.hero-logo {
  margin: 0;
  width: min(560px, 82vw);
  transform-origin: 50% 100%;
}

.hero-logo img {
  width: 100%;
}

.home-message {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 600;
}

.home--404 .hero-logo {
  width: min(320px, 64vw);
}

/* The one "hit" moment: the logo drops in, squashes on impact, settles.
   Only transform is animated so the logo is painted immediately (LCP). */
@media (prefers-reduced-motion: no-preference) {
  .home:not(.home--404) .hero-logo {
    animation: hit-landing 0.72s both;
  }
}

@keyframes hit-landing {
  0% {
    transform: translateY(-14vh) scale(0.94, 1.08);
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  44% {
    transform: translateY(0) scale(0.97, 1.04);
    animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
  }
  58% {
    transform: translateY(0) scale(1.1, 0.86);
    animation-timing-function: cubic-bezier(0.3, 0, 0.5, 1);
  }
  76% {
    transform: translateY(-2.5%) scale(0.97, 1.04);
    animation-timing-function: cubic-bezier(0.5, 0, 0.7, 1);
  }
  90% {
    transform: translateY(0) scale(1.02, 0.98);
  }
  100% {
    transform: none;
  }
}

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

.site-footer {
  --focus: var(--white);
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 1.75rem 1.25rem;
  font-size: 0.9375rem;
}

.site-footer .inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--footer-link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration-thickness: 2px;
}

.site-footer a[aria-current="page"] {
  color: var(--white);
  text-decoration: none;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 560px) {
  .site-footer .inner {
    flex-direction: column;
    text-align: center;
  }

  .site-footer nav ul {
    justify-content: center;
  }
}

/* ---------- Legal pages ---------- */

.page-header {
  background: var(--bg);
  border-bottom: 1px solid var(--header-border);
  padding: 1rem 1.25rem;
}

.page-header .inner {
  /* Same measure as .prose so the logo lines up with the text column. */
  max-width: 70ch;
  margin: 0 auto;
  font-size: 1.0625rem;
}

.page-header a {
  display: inline-block;
  width: 108px;
}

.legal {
  --focus: var(--brand);
  flex: 1;
  background: var(--paper);
  color: var(--paper-fg);
  padding: clamp(2rem, 6vw, 4rem) 1.25rem clamp(3rem, 8vw, 5rem);
}

.prose {
  max-width: 70ch;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.625rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--brand);
}

.prose h2 {
  margin: 2.5rem 0 0.5rem;
  font-size: 1.3125rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--brand);
}

.prose h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose a {
  color: var(--paper-link);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose .updated {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 0.9375rem;
}

.prose address {
  font-style: normal;
}
