/* arcgames.ca — page styles. Every colour, size, radius and duration is a
   token from tokens.css (generated from the design system artifact).
   Components follow the artifact's Button, TextInput and Checkbox READMEs. */

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

:root {
  /* Page gutters: space-5 on phones, space-8 from 640px, space-9 from 1024px
     (tokens.json names space-8 "page gutters, mobile" and space-9 "desktop";
     64px gutters leave too little room at 390px, so phones use space-5). */
  --gutter: var(--space-5);
  --content-max: 1088px; /* 1280 − 2 × space-9 */
  --measure: 640px;      /* hero column */
}
@media (min-width: 640px)  { :root { --gutter: var(--space-8); } }
@media (min-width: 1024px) { :root { --gutter: var(--space-9); } }

html {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-weight: var(--type-body-weight);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
p { margin: 0; }
img, svg { display: block; }

.content {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---- Links and focus ---- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color var(--duration-fast) var(--ease-enter);
}
a:hover { color: var(--accent-hover); }
a:active { color: var(--accent-pressed); }

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--focus);
  border-radius: var(--radius-sm);
}

/* ---- Header ---- */
.site-header { padding: var(--space-5) 0; }
.lockup { display: inline-block; border-radius: var(--radius-sm); }
.lockup img { width: 150px; height: auto; }

/* ---- Type styles ---- */
.display, h1 {
  font-size: var(--type-display-size);
  line-height: var(--type-display-line);
  font-weight: var(--type-display-weight);
  letter-spacing: var(--type-display-tracking);
  margin: 0 0 var(--space-5);
  text-wrap: balance;
}
.lead {
  font-size: var(--type-lead-size);
  line-height: var(--type-lead-line);
  font-weight: var(--type-lead-weight);
  color: var(--text-secondary);
}
.caption, .under, .site-footer {
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-line);
  font-weight: var(--type-caption-weight);
  letter-spacing: var(--type-caption-tracking);
  color: var(--text-secondary);
}
.phrase {
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-line);
  font-weight: var(--type-h2-weight);
  letter-spacing: var(--type-h2-tracking);
  color: var(--accent);
}

/* ---- Hero ---- */
.hero {
  max-width: var(--measure);
  padding: var(--space-7) 0 var(--space-7);
}
@media (min-width: 640px) { .hero { padding-top: var(--space-10); } }
.hero .lead { margin-bottom: var(--space-6); }
.hero .phrase { margin-bottom: var(--space-6); }
.hero .caption { margin-top: var(--space-5); }

/* ---- Form: TextInput ---- */
.signup { max-width: 480px; }
.field { margin-bottom: var(--space-5); }
.field > label:not(.checkbox) {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--ground-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: var(--type-body-weight) var(--type-body-size) var(--font-sans);
  transition: border-color var(--duration-fast) var(--ease-enter);
}
.input::placeholder { color: var(--text-secondary); opacity: 1; }
.input:focus, .input:focus-visible { border-color: var(--focus); box-shadow: none; }
.input[aria-invalid="true"] { border-color: var(--error); }
.input[disabled] { background: var(--ground); border-color: var(--line-subtle); color: var(--text-tertiary); }

.msg {
  font-size: 14px;
  line-height: 1.4;
  margin-top: var(--space-2);
  color: var(--error);
}
.msg:empty { display: none; }
.msg-form { margin-top: var(--space-3); }

/* ---- Form: Checkbox ---- */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
}
.checkbox input {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0; padding: 0;
  opacity: 0;
  pointer-events: none;
}
.checkbox .box {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) var(--ease-enter), border-color var(--duration-fast) var(--ease-enter);
}
.checkbox .box svg { visibility: hidden; }
.checkbox input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + .box svg { visibility: visible; }
.checkbox input:focus-visible + .box { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--focus); }
.checkbox input[aria-invalid="true"] + .box { border-color: var(--error); }
.checkbox input[disabled] + .box { border-color: var(--line-subtle); }
.checkbox input[disabled] ~ .checkbox-text { color: var(--text-tertiary); }

/* ---- Button (primary) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 var(--space-6);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-enter);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { background: var(--accent-pressed); color: var(--on-accent); }
.btn:focus-visible { border-radius: var(--radius-md); }
.btn[disabled] {
  background: var(--ground-raised);
  color: var(--text-tertiary);
  border-color: var(--line-subtle);
  cursor: default;
}
.under { margin-top: var(--space-3); }

/* ---- Step cards ---- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding-bottom: var(--space-10);
}
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--ground-raised);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
.card-title { font-weight: 600; margin-bottom: var(--space-2); }
.card .step { color: var(--accent); }
.card p:not(.card-title) { color: var(--text-secondary); }

/* ---- Message pages (/thanks, /confirmed) ---- */
.page-message .hero { padding-bottom: var(--space-10); }

/* ---- Plain page (/privacy) ---- */
.plain {
  max-width: var(--measure);
  padding: var(--space-7) 0 var(--space-10);
}
.plain h1 {
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: var(--space-4);
}
.plain p { margin-bottom: var(--space-4); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line-subtle);
  padding: var(--space-6) 0;
}
.site-footer p + p { margin-top: var(--space-2); }

/* ---- Mobile type: one step down the scale under 640px ---- */
@media (max-width: 639px) {
  .display, h1 {
    font-size: var(--type-h1-size);
    line-height: var(--type-h1-line);
    letter-spacing: var(--type-h1-tracking);
  }
  .plain h1 { font-size: var(--type-body-size); line-height: var(--type-body-line); letter-spacing: 0; }
  .phrase {
    font-size: var(--type-h3-size);
    line-height: var(--type-h3-line);
  }
  .btn { width: 100%; }
}

/* ---- Motion: instant when the reader asks ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
