/* Azteca Games — "Pixel Pyramid" design system.
   Tokens live in :root; the rules for using them are in .claude/skills/azteca-design/SKILL.md. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --violet: #2B1468;
  --violet-2: #3A1E86;
  --violet-deep: #1F0E4D;
  --ink: #1B0B3A;
  --cream: #FFF6DA;
  --paper: #FFFFFF;
  --green: #3DDC84;
  --yellow: #FFD23F;
  --pink: #FF5DA2;
  --pink-soft: #FF8FC0;
  --cyan: #4CC9F0;
  --purple: #7B4DFF;
  --lilac: #B79BFF;
  --orange: #FF9F43;
  --text-soft: #E4DCFA;     /* secondary text on violet */
  --text-dim: #CBBEF2;      /* tertiary text on ink */
  --text-cream: #3C2A66;    /* secondary text on cream / white */
  --label-cream: #6B3FD9;   /* section labels on cream */

  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --px: clamp(3px, 0.9vw, 5px);   /* pixel bevel on pyramid blocks */
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--violet);
  color: #fff;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--yellow); }
a:hover { color: #FFE58A; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
p { margin: 0; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.on-light :focus-visible { outline-color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 100;
  padding: 10px 16px; background: var(--yellow); color: var(--ink);
  font: 800 14px/1 var(--mono); text-decoration: none; border: var(--line);
}
.skip-link:focus { top: 12px; }

/* ---------- Labels & headings ---------- */
.label {
  display: block;
  margin-bottom: 12px;
  font: 800 14px/1.4 var(--mono);
  letter-spacing: 0.02em;
  color: var(--yellow);
}
.on-light .label { color: var(--label-cream); }
.section-title { font-size: clamp(34px, 4vw, 58px); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px 56px; margin-bottom: 52px;
}
.section-head > div { flex: 1 1 520px; min-width: 0; }
.section-head > p { flex: 1 1 300px; max-width: 420px; font-size: 17px; color: var(--text-soft); }
.on-light .section-head > p { color: var(--text-cream); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px;
  border: var(--line); box-shadow: var(--shadow);
  font: 800 16px/1 var(--mono); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.btn--go { background: var(--green); color: var(--ink); }
.btn--go:hover { color: var(--ink); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }
.btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: none; transform: none; }
.btn--ghost:active { transform: translate(2px, 2px); }
.btn--outline { background: #fff; color: var(--ink); }
.btn--outline:hover { color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 13px; box-shadow: 4px 4px 0 #fff; }
.btn--sm:hover { box-shadow: 5px 5px 0 #fff; }
.btn--sm:active { transform: translate(4px, 4px); box-shadow: 0 0 0 #fff; }
.btn .px-arrow { width: 12px; height: 12px; fill: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--violet);
  border-bottom: var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font: 800 18px/1 var(--mono); letter-spacing: 0.02em; }
.brand-name span { color: var(--green); }
.site-nav { display: flex; align-items: center; gap: 8px 26px; }
.site-nav a {
  color: #fff; text-decoration: none;
  font: 700 14px/1 var(--mono);
  padding: 8px 0; border-bottom: 3px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--green); }
.site-nav .btn { padding: 0 18px; border-bottom: var(--line); }
.menu-toggle {
  display: none;
  width: 48px; height: 48px; padding: 0;
  background: var(--yellow); border: var(--line); box-shadow: 3px 3px 0 #fff;
  cursor: pointer; align-items: center; justify-content: center;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 22px; height: 3px; background: var(--ink); position: relative; content: "";
}
.menu-toggle span::before { position: absolute; top: -7px; }
.menu-toggle span::after { position: absolute; top: 7px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--violet); border-bottom: var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 16px 0; border-bottom: 1px solid var(--violet-2); font-size: 16px; }
  .site-nav .btn { margin-top: 16px; min-height: 52px; }
  .no-js .site-nav { position: static; display: flex; flex-direction: row; flex-wrap: wrap; padding: 0 0 12px; border: 0; }
  .no-js .menu-toggle { display: none; }
  .no-js .header-inner { flex-wrap: wrap; }
}

/* ---------- Hero ---------- */
.hero {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: var(--line);
}
.hero-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 56px;
  padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 96px);
}
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.tag {
  align-self: flex-start;
  padding: 6px 12px; background: var(--ink); color: var(--yellow);
  font: 700 13px/1.5 var(--mono); letter-spacing: 0.08em;
}
.hero h1 { font-size: clamp(42px, 6vw, 88px); line-height: 1.08; letter-spacing: -0.04em; }
.hl { padding: 0 0.12em; color: var(--ink); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl--green { background: var(--green); }
.hl--yellow { background: var(--yellow); }
.lead { max-width: 560px; font-size: clamp(17px, 1.6vw, 19px); color: var(--text-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none;
  font: 700 13px/1.5 var(--mono); color: var(--text-soft);
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 10px; height: 10px; background: var(--c, var(--green)); }
.hero-art { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }

/* ---------- Pixel pyramid ---------- */
.pyramid { width: min(100%, 520px); }
.pyramid__row { display: flex; justify-content: center; gap: 1.2%; margin-bottom: 1.2%; }
.b {
  width: 8.8%; aspect-ratio: 1 / 1; background: var(--c);
  box-shadow: inset calc(var(--px) * -1) calc(var(--px) * -1) 0 rgba(0, 0, 0, 0.28),
              inset var(--px) var(--px) 0 rgba(255, 255, 255, 0.3);
}
.b--y { --c: var(--yellow); }
.b--p { --c: var(--pink); }
.b--c { --c: var(--cyan); }
.b--g { --c: var(--green); }
.b--v { --c: var(--purple); }
.b--door { --c: var(--ink); box-shadow: none; }
.b--gone { background: transparent; box-shadow: none; outline: 3px dashed rgba(255, 255, 255, 0.55); outline-offset: -3px; }
.pyramid__ground { height: 14px; margin-top: 2%; background: var(--ink); }
/* 404: the floating block sits right above the gap (third of six blocks). */
.pyramid__row--float { justify-content: flex-start; padding-left: 40.6%; margin-bottom: 8%; }
.sun {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  width: 22%; margin: 0 6% 5% auto;
}
.sun i { aspect-ratio: 1 / 1; background: var(--yellow); }
.sun i.o { background: transparent; }

/* ---------- Sticker band ---------- */
.band-clip { overflow-x: clip; padding-block: 22px 10px; }
.band {
  margin: 0 -24px; padding: 14px var(--gutter);
  background: var(--yellow); color: var(--ink);
  border-block: var(--line); box-shadow: 0 6px 0 var(--ink);
  transform: rotate(-1.2deg);
}
.band ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px;
  margin: 0; padding: 0; list-style: none;
  font: 800 16px/1.4 var(--mono); letter-spacing: 0.06em;
}
.band li { display: flex; align-items: center; gap: 12px; }
.band li::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--ink); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(80px, 10vw, 120px); }
.section--cream { background: var(--cream); color: var(--ink); }
.section--deep { background: var(--violet-deep); border-top: var(--line); }
.section--line { border-top: var(--line); }

/* Services */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: var(--line); box-shadow: var(--shadow-lg);
}
.card__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--c, var(--green)); border-bottom: var(--line);
  font: 800 13px/1 var(--mono);
}
.card__top svg { width: 22px; height: 22px; }
.card__body { padding: 24px 22px 26px; }
.card h3 { font-size: 23px; letter-spacing: -0.02em; margin-bottom: 10px; }
.card p { color: var(--text-cream); font-size: 15.5px; }

/* Levels */
.meter { display: flex; gap: 6px; height: 22px; padding: 4px; border: 3px solid #fff; margin-bottom: 36px; }
.meter i { flex: 1; background: var(--c); }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.level { background: var(--violet-2); border: var(--line); box-shadow: var(--shadow); padding: 22px 20px; }
.level__n { display: block; margin-bottom: 10px; font: 800 13px/1 var(--mono); color: var(--c, var(--lilac)); }
.level h3 { font-size: 22px; margin-bottom: 8px; letter-spacing: -0.02em; }
.level p { font-size: 15px; color: var(--text-soft); }
.level--boss { background: var(--yellow); color: var(--ink); }
.level--boss .level__n { color: var(--ink); }
.level--boss p { color: var(--ink); font-weight: 500; }

/* Rules + FAQ */
.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split > * { flex: 1 1 420px; min-width: 0; }
.split > .split__wide { flex-basis: 520px; }
.rules { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; color: var(--text-soft); }
.rules li::before { content: ""; flex: 0 0 14px; height: 14px; margin-top: 6px; background: var(--c); }
.rules strong { color: #fff; }
.faq { display: flex; flex-direction: column; gap: 14px; }
.faq details { border: 3px solid #fff; background: rgba(255, 255, 255, 0.02); }
.faq details[open] { background: var(--violet-2); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 700; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--yellow), var(--yellow)) center / 14px 4px no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) center / 4px 14px no-repeat;
}
.faq details[open] summary::after { background: linear-gradient(var(--yellow), var(--yellow)) center / 14px 4px no-repeat; }
.faq details p { padding: 0 20px 18px; color: var(--text-soft); font-size: 15.5px; }

/* Contact */
.contact { background: var(--green); color: var(--ink); border-top: var(--line); }
.contact .label { color: var(--ink); }
.contact-grid { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: flex-start; }
.contact-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.contact h2 { font-size: clamp(38px, 4.6vw, 66px); line-height: 1; letter-spacing: -0.04em; }
.email-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.email-big {
  display: inline-flex; align-items: center; padding: 10px 16px;
  background: var(--ink); color: #fff; text-decoration: none;
  font: 800 clamp(16px, 2vw, 24px)/1.3 var(--mono); overflow-wrap: anywhere;
}
.email-big:hover { color: var(--yellow); }
.copy-btn {
  min-height: 48px; padding: 0 16px; background: #fff; color: var(--ink);
  border: var(--line); font: 800 13px/1 var(--mono); cursor: pointer;
}
.copy-btn:active { transform: translate(2px, 2px); }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px 32px;
  margin: 8px 0 0; padding-top: 22px; border-top: 3px solid var(--ink);
}
.facts dt { font: 800 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-cream); }
.facts dd { margin: 4px 0 0; font-weight: 600; font-style: normal; }
.facts address { font-style: normal; }
.facts a { color: var(--ink); }
.form {
  flex: 1 1 420px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: var(--line); box-shadow: 10px 10px 0 var(--ink);
  padding: 28px 26px;
}
.form label { margin-top: 6px; font: 800 13px/1.4 var(--mono); }
.form input, .form textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: var(--line); border-radius: 0; background: #fff; color: var(--ink);
}
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus-visible, .form textarea:focus-visible { outline: 4px solid var(--purple); outline-offset: 0; }
.form .btn { margin-top: 12px; width: 100%; }
.form-note { font-size: 13px; color: var(--text-cream); }
.form-status { min-height: 1.5em; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); padding-block: 48px 36px; border-top: var(--line); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; align-items: flex-start; }
.footer-brand { flex: 1 1 320px; min-width: 0; }
.footer-brand p { margin-top: 8px; max-width: 420px; color: var(--text-dim); font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 26px; font: 700 13px/1.6 var(--mono); }
.footer-nav a, .link-btn { color: #fff; text-decoration: none; }
.footer-nav a:hover, .link-btn:hover { color: var(--yellow); text-decoration: underline; }
.link-btn { padding: 0; background: none; border: 0; font: inherit; cursor: pointer; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--violet-2);
  font: 500 12px/1.6 var(--mono); color: #A493D6;
}

/* ---------- Consent banner ---------- */
.consent {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  width: min(440px, calc(100% - 32px));
  background: #fff; color: var(--ink);
  border: var(--line); box-shadow: var(--shadow-lg);
  padding: 20px 20px 18px;
}
.consent[hidden] { display: none; }
.consent h2 { font: 800 14px/1.3 var(--mono); letter-spacing: 0; margin-bottom: 8px; }
.consent p { font-size: 14px; color: var(--text-cream); }
.consent a { color: var(--label-cream); }
.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.consent .btn { min-height: 44px; padding: 0 18px; font-size: 13px; box-shadow: 4px 4px 0 var(--ink); }
.consent .btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(40px, 6vw, 72px) clamp(72px, 9vw, 112px); }
.crumbs { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 10px; font: 700 13px/1.5 var(--mono); color: var(--text-soft); }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--lilac); }
.crumbs a { color: #fff; }
.paper {
  max-width: 860px; margin: 0 auto;
  background: var(--cream); color: var(--ink);
  border: var(--line); box-shadow: 10px 10px 0 var(--ink);
  padding: clamp(24px, 5vw, 56px);
}
.paper h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 12px; }
.paper .updated { font: 700 13px/1.5 var(--mono); color: var(--text-cream); }
.paper .intro { margin-top: 24px; font-size: 18px; }
.toc { margin: 32px 0 8px; padding: 20px 22px; background: #fff; border: var(--line); }
.toc h2 { font: 800 13px/1 var(--mono); letter-spacing: 0.04em; margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 0; list-style: none; columns: 2 240px; column-gap: 32px; }
.toc li { break-inside: avoid; padding: 3px 0; font-size: 15px; }
.toc a { color: var(--ink); }
.prose { font-size: 17px; line-height: 1.7; }
.prose section { padding-top: 32px; }
.prose h2 { display: flex; gap: 12px; align-items: baseline; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; margin-bottom: 12px; }
.prose h2 .n { flex: none; font: 800 0.6em/1 var(--mono); padding: 5px 7px; background: var(--ink); color: var(--yellow); }
.prose h3 { font-size: 19px; letter-spacing: -0.01em; margin: 20px 0 8px; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul { margin: 12px 0 0; padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 22px; margin-top: 6px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; background: var(--purple); }
.prose a { color: var(--label-cream); }
.prose code { font: 600 0.88em/1 var(--mono); padding: 2px 5px; background: #fff; border: 1px solid #D9CCF5; }
.prose strong { font-weight: 700; }
.prose .caps { text-transform: none; font-weight: 600; }
.contact-card { margin-top: 12px; padding: 16px 18px; background: #fff; border: var(--line); font-style: normal; }

/* ---------- 404 ---------- */
.error { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; padding-block: 56px 72px; }
.error-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 48px 64px; }
.error-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.error-code { font: 800 clamp(72px, 12vw, 150px)/0.9 var(--mono); letter-spacing: -0.06em; color: var(--yellow); text-shadow: 6px 6px 0 var(--ink); }
.error h1 { font-size: clamp(30px, 4vw, 48px); }
.error .pyramid { flex: 1 1 360px; max-width: 440px; }

/* ---------- Motion (opt-in) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sun { animation: bob 3.2s steps(4) infinite; }
  .pyramid__row { animation: drop 520ms steps(6) both; animation-delay: calc(var(--r, 0) * 140ms + 120ms); }
  .b--float { animation: bob 2.4s steps(4) infinite; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-36px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .consent, .band-clip, .hero-art { display: none !important; }
  body, .paper, .section--cream { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .paper { border: 0; padding: 0; }
}
