/*
 * The website's look: the game's sky gradient, ink and pink, with Nunito.
 * Text keeps WCAG AA contrast: the game's light pink (--accent) is only
 * for buttons and decoration; pink text uses --accent-ink.
 */

@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url('/site/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('/site/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 900; font-display: swap; src: url('/site/fonts/nunito-latin-900-normal.woff2') format('woff2'); }

:root {
  --bg-top: #e6f1ff;
  --bg-bottom: #fde9f1;
  --panel: rgba(255, 255, 255, 0.72);
  --ink: #5b5f7a;          /* 5.4:1 on the background */
  --ink-strong: #3f4260;   /* on the pink button, 5:1 */
  --accent: #ff9fb2;       /* the game's pink: buttons, never text */
  --accent-hover: #ff8ca3;
  --accent-ink: #c2456b;   /* pink text: large 4.2:1 */
  --link: #a8385a;         /* body links, 5.6:1 */
  --radius: 18px;
  --shadow: 0 8px 28px rgba(120, 120, 170, 0.18);
  --gutter: 16px;
  --measure: 42rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed;
  background-color: var(--bg-bottom);
  color: var(--ink);
  font-family: 'Nunito', ui-rounded, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

/* Skip link: off screen until it gets keyboard focus. */
.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-strong);
  font-weight: 700;
}
.skip:focus { top: 12px; }

/* Header: brand on the left; Play, the pages and the languages on the right; wraps on phones. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-ink);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
}

.site-menus,
.site-nav,
.languages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}
.site-menus { gap: 8px 28px; }
.site-nav a:not(.button),
.languages a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:not(.button):hover,
.site-nav a[aria-current='page'] { color: var(--ink-strong); text-decoration: underline; text-decoration-thickness: 2px; }

/* Languages: EN ES CA, the current one on a pink pill. */
.languages { gap: 4px; }
.languages a { padding: 2px 10px; border-radius: 999px; font-size: 0.95rem; }
.languages a:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink-strong); }
.languages a[aria-current] { background: var(--accent); color: var(--ink-strong); }

.button {
  display: inline-block;
  padding: 0.7em 2.4em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-strong);
  font-size: 1.3rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button-small { padding: 0.3em 1.2em; font-size: 1rem; box-shadow: none; }

main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 16px var(--gutter) 48px;
}
main:focus { outline: none; }

/* Home: the name, the tagline and Play, then the page's text. */
.hero {
  padding: clamp(24px, 6vw, 72px) 0 32px;
  text-align: center;
}
.hero h1 {
  margin: 0;
  color: var(--accent-ink);
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
}
.hero .tagline {
  margin: 0.4em 0 1.4em;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
}
.hero-image {
  margin: 32px auto 0;
  max-width: 60rem;
}
.hero-image img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Text pages: one readable column on a frosted panel. */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { color: var(--ink-strong); font-weight: 900; line-height: 1.2; }
.prose h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--accent-ink); }
.prose h2 { margin-top: 1.8em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.5em; font-size: 1.15rem; }
.prose img, .prose video { display: block; margin: 1.5em auto; border-radius: 12px; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-size: 0.9rem; text-align: center; }
.prose kbd {
  padding: 0.05em 0.45em;
  border: 1px solid #c9cbe0;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9em;
  font-weight: 700;
}
.prose code { font-size: 0.92em; }

/* Posts: the list on the blog page and the home, and a post's date. */
.posts { margin: 1.5em 0 0; padding: 0; list-style: none; }
.posts li { padding: 1.1em 0; border-top: 1px solid rgba(91, 95, 122, 0.15); }
.posts li:first-child { border-top: 0; padding-top: 0; }
.posts h2, .posts h3 { margin: 0; font-size: 1.25rem; }
.posts h2 a, .posts h3 a { color: var(--link); text-decoration: none; }
.posts h2 a:hover, .posts h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.posts p { margin: 0.3em 0 0; }
.post-meta { margin-top: 0.2em; font-size: 0.92rem; font-weight: 700; }
.latest { margin-top: 24px; }
.latest h2 { margin-top: 0; }
.page-back { max-width: var(--measure); margin: 24px auto 0; font-weight: 700; }

/* Play below a page's text, centred. */
.page-play { margin: 32px 0 0; text-align: center; }

/* Footer: the site's small print and the year. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  font-size: 0.9rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer nav:empty { display: none; } /* no landmark without links */
.site-footer a { color: var(--ink); }
.copyright { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .button:hover { transform: none; }
}
