/* Tiny Robot Missions — the website's one stylesheet.
 *
 * ⚠ THE COLOUR TOKENS BELOW ARE GENERATED, NOT CHOSEN. Every value in :root is measured from, or mixed from, the
 * owner's approved app-icon master by tools/site/generate_site_assets.py, and recorded in tools/site/manifest.json
 * with its patch, its mix and its contrast ratios. tools/site/check_site.py fails if this file and that manifest
 * disagree, so a token is changed by editing the generator and running it — never by editing the hex here.
 *
 * ⚠ The measured ratios are measurements. They are not a WCAG conformance claim, and nothing may report them as one.
 *
 * No web font is loaded: the type is the reader's own platform UI font, which already scales with their text-size
 * setting and already covers the scripts a future translation would need. Logical properties (inline/block) are used
 * throughout so a right-to-left translation needs dir="rtl" and no new layout.
 */

/* --- tokens ------------------------------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Measured from the master. */
  --identity-blue-deep: #0053FD;
  --identity-blue-bright: #008CFD;
  --identity-cyan: #69FDFD;
  --identity-cream: #FEF8E6;
  --identity-ink: #1D2A3F;
  --identity-amber: #FBA63E;
  --identity-yellow: #FDFDAD;

  /* The hero band, in both appearances. */
  --hero-base: #004BE4;
  --hero-text: #FEF8E7;
  --hero-glow-opacity: 0.46;

  /* The light appearance. */
  --surface: #FFFCF6;
  --card: #FFFEFD;
  --band: #FEFAEE;
  --text: #182234;
  --text-muted: #676C76;
  --line: #CCCCCB;
  --line-strong: #909399;
  --link: #004CE9;
  --link-hover: #0037A8;

  --measure: 36rem;
  --page: 64rem;
  --gutter: clamp(16px, 4vw, 24px);
  --radius: 0.875rem;
  --radius-small: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0A0E15;
    --card: #101722;
    --band: #0D121C;
    --text: #FEF8E7;
    --text-muted: #A6A49B;
    --line: #3B3D3F;
    --line-strong: #757571;
    --link: #78FDFD;
    --link-hover: #AEFEFE;
  }
}

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

html {
  /* No fixed root size: the reader's own text-size setting decides, and every length below is relative to it. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
  margin-block: 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: 0;
}

p,
ul,
ol,
dl {
  margin-block: 0 1em;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

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

/* --- layout ------------------------------------------------------------------------------------------------- */
.wrap {
  inline-size: 100%;
  max-inline-size: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-inline-size: var(--measure);
}

.skip {
  position: absolute;
  inset-inline-start: -100vw;
  inset-block-start: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--card);
  color: var(--link);
  border: 2px solid var(--link);
  border-radius: 0 0 var(--radius-small) 0;
}

.skip:focus {
  inset-inline-start: 0;
}

/* --- header ------------------------------------------------------------------------------------------------- */
.site-header {
  border-block-end: 1px solid var(--line);
  background: var(--surface);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
  margin-inline-end: auto;
}

.brand:hover {
  color: inherit;
  text-decoration: underline;
}

/* The identity images are sized in pixels, not in rem: they carry no text, so growing them with the reader's text
 * size only steals room from the words beside them. */
.brand img {
  inline-size: 32px;
  block-size: 32px;
  border-radius: 0.45rem;
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  padding-block: 0.25rem;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration-color: var(--line-strong);
}

/* --- hero --------------------------------------------------------------------------------------------------- */
/* The glow is the icon's own inner blue, at the opacity the generator measured as the strongest the hero's text
 * stays legible over. It is a background layer, not a positioned pseudo-element, so the hero never has to clip
 * itself — clipping would cut the hero's own words at large text sizes, not just the glow. */
.hero {
  background:
    radial-gradient(
      120% 90% at 50% 15%,
      rgb(0 140 253 / var(--hero-glow-opacity)) 0%,
      rgb(0 140 253 / 0) 70%
    ),
    var(--hero-base);
  color: var(--hero-text);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.hero__icon {
  inline-size: clamp(104px, 26vw, 160px);
  block-size: auto;
  border-radius: 22.5%;
  flex: none;
}

.hero h1 {
  margin: 0;
}

.hero__lead {
  margin: 0;
  max-inline-size: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--hero-text);
}

/* --- the availability slot ---------------------------------------------------------------------------------- */
/* The place store buttons will go. It carries the current state as words; it never shows a button that does not
 * lead anywhere, and it never implies the game can be downloaded. */
.availability {
  display: grid;
  gap: 0.25rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid rgb(254 248 231 / 0.45);
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.14);
  max-inline-size: 30rem;
}

.availability p {
  margin: 0;
}

.availability__state {
  font-weight: 650;
}

.availability__note {
  font-size: 0.9375rem;
  color: var(--hero-text);
  opacity: 0.85;
}

/* --- sections ----------------------------------------------------------------------------------------------- */
main {
  display: block;
}

.section {
  padding-block: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
}

.section--band {
  background: var(--band);
  border-block: 1px solid var(--line);
}

.section > .wrap > :last-child {
  margin-block-end: 0;
}

.section__lead {
  color: var(--text-muted);
  max-inline-size: var(--measure);
}

/* --- the steps ---------------------------------------------------------------------------------------------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

@media (min-width: 46em) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem 1.25rem;
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  margin-block-end: 0.5rem;
  border-radius: 50%;
  background: var(--identity-ink);
  color: var(--identity-cyan);
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin-block-end: 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

/* --- the feature grid --------------------------------------------------------------------------------------- */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 40em) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem;
  }
}

@media (min-width: 62em) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.facts li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  border-inline-start: 4px solid var(--identity-amber);
}

.facts h3 {
  margin-block-end: 0.25rem;
}

.facts p {
  margin: 0;
  color: var(--text-muted);
}

/* --- the quoted level text ---------------------------------------------------------------------------------- */
.mission {
  background: var(--identity-ink);
  color: var(--identity-cream);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  max-inline-size: var(--measure);
  margin: 0;
}

.mission p {
  margin-block: 0 1rem;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.45;
}

.mission__label {
  display: block;
  margin-block-end: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--identity-cyan);
}

.mission__hint {
  margin: 0;
  font-size: 1rem !important;
  color: var(--identity-cream);
  opacity: 0.88;
}

.mission + .source {
  margin-block-start: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* --- notes -------------------------------------------------------------------------------------------------- */
/* A standing note about the state of a page's content. It is part of the content, not decoration. */
.note {
  border: 1px solid var(--line-strong);
  border-inline-start: 4px solid var(--identity-amber);
  border-radius: var(--radius);
  background: var(--band);
  padding: 1.125rem 1.25rem;
  margin-block-end: 2rem;
}

.note > :last-child {
  margin-block-end: 0;
}

.note h2 {
  font-size: 1.0625rem;
  margin-block-end: 0.35rem;
}

/* --- prose -------------------------------------------------------------------------------------------------- */
.prose {
  max-inline-size: var(--measure);
}

.prose h2 {
  margin-block-start: 2rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

.prose h2:first-of-type {
  margin-block-start: 0;
  padding-block-start: 0;
  border-block-start: 0;
}

.prose h3 {
  margin-block-start: 1.5rem;
}

.prose ul {
  padding-inline-start: 1.25rem;
}

.prose li {
  margin-block-end: 0.4em;
}

.prose li::marker {
  color: var(--line-strong);
}

.prose dt {
  font-weight: 650;
  margin-block-start: 1rem;
}

.prose dd {
  margin-inline-start: 0;
  color: var(--text-muted);
}

.contact {
  display: inline-block;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
  font-weight: 650;
  padding: 0.75rem 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--card);
}

.updated {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* --- footer ------------------------------------------------------------------------------------------------- */
.site-footer {
  border-block-start: 1px solid var(--line);
  background: var(--band);
  padding-block: 2rem 2.5rem;
  margin-block-start: 0;
}

.site-footer__inner {
  display: grid;
  gap: 1rem;
}

@media (min-width: 46em) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 2rem;
  }
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  max-inline-size: var(--measure);
}

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

/* --- motion ------------------------------------------------------------------------------------------------- */
/* The only movement on the site is the colour change on a link. It is removed when the reader asks for less. */
@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 120ms ease-out;
  }
}

/* --- more contrast ------------------------------------------------------------------------------------------ */
/* When the reader's system asks for more contrast, the muted text becomes the body colour and every edge becomes
 * the strong one. Nothing is lost: the muting carries no meaning. */
@media (prefers-contrast: more) {
  :root {
    --text-muted: var(--text);
    --line: var(--line-strong);
  }

  .availability {
    border-color: var(--hero-text);
  }
}

/* --- print -------------------------------------------------------------------------------------------------- */
@media print {
  .skip,
  .site-nav,
  .hero__icon {
    display: none;
  }

  .hero {
    background: none;
    color: #000;
  }

  body {
    background: #fff;
    color: #000;
  }
}
