/* Every rule for the site. Colours come from theme.css tokens only —
   no literals in this file. See DESIGN.md §3. */

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
}

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- page shell ---------- */

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Site header. Landing page omits it; every subpage carries it, where it
   doubles as the back link to /. */
.site-header {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header__home {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  gap: 0.5rem;
  color: var(--text-dim);
  font-weight: 600;
  text-decoration: none;
}

.site-header__home:hover,
.site-header__home:focus-visible { color: var(--accent); }

.site-footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
}

.site-footer p { margin: 0; }

/* ---------- headings ---------- */

.banner {
  margin: 1.5rem 0 2rem;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.page-title {
  margin: 0.5rem 0 1.5rem;
  font-size: 1.75rem;
  line-height: 1.2;
}

.lede {
  margin: -1rem 0 2rem;
  color: var(--text-dim);
}

/* ---------- card family ----------
   One component, used for the two landing cards and for project cards.
   The whole card is the <a>. If a third kind of card appears, something
   has gone wrong. */

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.card {
  display: block;
  min-height: var(--tap-min);
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.card:hover,
.card:focus-visible {
  background: var(--surface-raised);
  border-color: var(--accent);
}

.card__title {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  line-height: 1.25;
}

.card__body {
  margin: 0;
  color: var(--text-dim);
}

.card__cue {
  display: block;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- the only breakpoint ---------- */

@media (min-width: 640px) {
  .page { padding-top: 2.5rem; }

  .banner { font-size: 2.5rem; }

  .card-grid--two { grid-template-columns: 1fr 1fr; }
}

/* ---------- portrait ----------
   The About page's photo. Not a card and not trying to be — a figure, and the
   one-card-family rule is about pressable things. The <img> carries explicit
   width/height attributes, so the browser knows the aspect ratio before the
   file decodes and the page cannot reflow around it. That is why there is no
   aspect-ratio here: the intrinsic ratio does the job, and hardcoding one
   would crop a photo that isn't 3:2. See DESIGN.md §3. */

.portrait {
  margin: 0 0 2rem;
}

.portrait__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Photo credit. Full-size --text-dim, not small grey type — the house rule
   is that secondary text drops colour, never size. */
.portrait__credit {
  margin: 0.75rem 0 0;
  color: var(--text-dim);
}
