/* Shared by every public page: tokens, type, the pixel frame, nav, footer
   and motion. The landing, Comunidad and Soporte keep their layout inline. */

@font-face {
  font-family: "VT323";
  src: url("fonts/VT323.ttf") format("truetype");
  font-display: swap;
}

/* Palette from docs/design.md. One theme per visit: day or night. */
:root {
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --tint: #e2efdc;
  --text: #312f2c;
  --muted: #605d56;
  --line: #2f2a27;
  --shade: #d6d2c2;
  --accent: #4f8a6d;
  --display: "VT323", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151d19;
    --surface: #1f2a24;
    --tint: #24362b;
    --text: #f1ede0;
    --muted: #b4b6a8;
    --line: #080c0a;
    --shade: #0c120f;
    --accent: #86c7a3;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
.brand,
figcaption {
  font-family: var(--display);
  font-weight: 400;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(4rem, 10vw, 8.5rem);
  line-height: 0.85;
}

h2 {
  font-size: clamp(2.5rem, 4.6vw, 3.5rem);
  line-height: 0.95;
}

h2 + p {
  margin-top: 12px;
  max-width: 44ch;
  color: var(--muted);
}

/* The game's pixel frame: a notched 4px outline with a hard shadow. */
.px,
.legal .policy-card,
.legal .notice {
  box-shadow:
    0 -4px var(--line), 0 4px var(--line), -4px 0 var(--line), 4px 0 var(--line),
    8px 4px var(--shade), 8px 12px var(--shade), 4px 8px var(--shade), 12px 8px var(--shade);
}

.pixel {
  image-rendering: pixelated;
}

.wrap {
  width: min(100% - 40px, 1160px);
  margin-inline: auto;
}

section {
  scroll-margin-top: 24px;
}

main > section + section {
  margin-top: clamp(80px, 11vw, 152px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 2rem;
  line-height: 1;
}

.brand img {
  width: 36px;
  height: 36px;
  outline: 2px solid var(--line);
}

.nav nav,
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav nav a,
.footer nav a {
  padding-block: 6px;
  transition: color 0.2s;
}

.nav nav a:hover,
.footer nav a:hover,
.nav nav [aria-current] {
  color: var(--text);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(80px, 11vw, 152px);
  padding-block: 24px 40px;
  border-top: 4px solid var(--line);
  color: var(--muted);
}

/* Long reads: Privacidad and Términos. Their copy is legal text, so these
   rules dress the existing markup and leave it as it is. */
.legal main {
  padding-top: 40px;
}

.legal .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
  gap: 48px;
}

.legal .eyebrow {
  display: block;
  margin-bottom: 12px;
  font: 400 1.45rem/1 var(--display);
  color: var(--muted);
}

.legal h1 {
  font-size: clamp(2.4rem, 4vw, 3.25rem);
  line-height: 0.95;
}

.legal .hero-copy p {
  max-width: 60ch;
  margin-top: 14px;
  color: var(--muted);
}

.legal .policy-card,
.legal .notice {
  padding: 24px;
  background: var(--surface);
}

.legal .policy-card img {
  width: 128px;
  margin: 0 auto 12px;
  image-rendering: pixelated;
}

.legal .policy-card strong,
.legal .notice > strong,
.legal .mini-box strong {
  display: block;
  margin-bottom: 6px;
  font: 400 1.9rem/1 var(--display);
}

.legal .notice {
  margin-top: 56px;
  background: var(--tint);
}

.legal .policy {
  max-width: 72ch;
  margin-top: 24px;
}

.legal .section {
  padding-block: 32px;
}

.legal .section + .section {
  border-top: 2px solid var(--shade);
}

.legal h2 {
  font-size: 2.2rem;
}

.legal .section p,
.legal .section li {
  max-width: none;
  color: inherit;
  line-height: 1.7;
}

.legal .section p + p,
.legal main ul,
.legal main ol {
  margin: 12px 0 0;
}

.legal main ul,
.legal main ol {
  padding-left: 20px;
}

.legal .mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  margin-block: 20px;
}

.legal .mini-box {
  padding-left: 16px;
  border-left: 4px solid var(--accent);
}

.legal main a {
  font-weight: 600;
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 4px;
}

@media (max-width: 819px) {
  .legal .hero,
  .legal .mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal .policy-card {
    max-width: 340px;
  }
}

@media (max-width: 639px) {
  .nav nav {
    display: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@keyframes hop {
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* Each block settles in as it enters the screen. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
