/* arca.games — one stylesheet, no build step.
   Palette and type follow the app (DesignSystem/Theme.swift, tools/branding):
   pixel display face for headings, the system face for reading. */

@font-face {
  font-family: "Bytesized Arca";
  src: url("assets/fonts/BytesizedArca-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #FAF7F5;          /* cream */
  --surface: #EFEAE6;     /* warm grey — the blocks */
  --text: #291334;        /* plum */
  --muted: rgb(41 19 52 / 0.68);
  --rule: rgb(41 19 52 / 0.14);
  --mark: #291334;        /* the AR/CA letters */
  --accent: #44EBD3;      /* teal, as a fill */
  --on-accent: #291334;
  --accent-text: #00745F; /* teal darkened to read on cream */
  --badge: #291334;       /* the App Store badge's plate */
  --badge-rule: transparent;

  --gutter: 20px;
  --measure: 38rem;
  --display: "Bytesized Arca", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #291334;
    --surface: #3A2145;
    --text: #F1EAF6;
    --muted: rgb(241 234 246 / 0.68);
    --rule: rgb(241 234 246 / 0.16);
    --mark: #44EBD3;
    --accent-text: #44EBD3;
    --badge: #130818;     /* darker than the plum it sits on */
    --badge-rule: rgb(241 234 246 / 0.28);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
}

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

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

.wrap {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Type ------------------------------------------------------------- */

h1,
h2,
.wordmark {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  /* The pixel face carries a tall line box; headings set their own space. */
  line-height: 1;
}

/* Bytesized draws on an 8-to-the-em grid: sizes in multiples of 8px
   (0.5rem) keep every pixel of it whole. */
h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.2; /* for the ones that wrap on a phone */
  margin: 3rem 0 0.75rem;
}

@media (min-width: 40rem) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 1.75rem 0 0.25rem;
}

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

ul {
  padding-left: 1.2em;
}

li {
  margin-bottom: 0.35rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.5;
}

.muted,
.small {
  color: var(--muted);
}

.small {
  font-size: 0.9375rem;
}

/* ---- Header (inner pages) and footer ----------------------------------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  font-size: 2rem;
  color: var(--mark);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.9375rem;
}

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

main {
  padding-bottom: 3rem;
}

.site-footer {
  position: relative;
  padding-block: 1.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* The rule keeps to the text column, inside the gutters. */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 var(--gutter) auto;
  border-top: 1px solid var(--rule);
}

/* ---- Home: the splash, as in the app ----------------------------------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  /* Whole rows of the field: its pitch is 600px / 12 = 50px. */
  height: 300px;
  overflow: hidden;
}

@media (min-width: 40rem) {
  .hero {
    height: 400px;
  }
}

/* The logo's block field tiles seamlessly (its edge margin is half a gap),
   so one mask repeats across any width and takes the theme's block colour. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--surface);
  -webkit-mask: url("assets/field.svg") center top / 600px repeat;
  mask: url("assets/field.svg") center top / 600px repeat;
}

.hero h1 {
  position: relative;
  margin: 0;
  line-height: 0;
}

/* The mark is 7 pixels wide: widths in multiples of 7 keep its edges sharp. */
.hero svg {
  display: block;
  width: 154px;
  height: auto;
  fill: var(--mark);
}

@media (min-width: 40rem) {
  .hero svg {
    width: 210px;
  }
}

.intro {
  text-align: center;
  padding-block: 2.5rem 0.5rem;
}

.intro .lede {
  max-width: 28rem;
  margin-inline: auto;
}

/* The App Store badge (after Routine Rocket's): a dark plate, the logo, two
   lines. A <span> with .is-soon before launch; an <a> once the app is live. */
.badge-store {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 12.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--badge-rule);
  border-radius: 0.75rem;
  background: var(--badge);
  color: #fff;
  text-align: left;
  text-decoration: none;
}

.badge-store svg {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  fill: currentColor;
}

.badge-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.badge-top {
  font-size: 0.6875rem;
  opacity: 0.85;
}

.badge-bottom {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badge-store.is-soon {
  cursor: default;
}

.badge-store.is-soon > * {
  opacity: 0.7;
}

/* ---- The games --------------------------------------------------------- */

.games {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.games li {
  margin: 0;
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule);
}

.games li:last-child {
  border-bottom: 1px solid var(--rule);
}

.game-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.tag {
  font: 600 0.75rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.name-note {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent-text);
}

.games p:last-child {
  margin: 0;
  color: var(--muted);
}

/* ---- Documents (support, privacy, licences) ---------------------------- */

.doc h1 {
  margin-top: 1.5rem;
}

.doc h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.notice {
  padding: 1rem 1.1rem;
  background: var(--surface);
  font-size: 0.9375rem;
  white-space: pre-line;
}

@media (prefers-reduced-motion: no-preference) {
  a.badge-store {
    transition: transform 0.15s ease;
  }

  a.badge-store:hover {
    transform: translateY(-2px);
  }
}
