/* ==========================================================================
   Personal site styles
   Layout breakpoints: 34rem (cards, resume, cat) and 44rem (football gallery).
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --bg: #f6f1e7;
  --ink: #1b1a17;
  --muted: #6b665b;
  --line: #ddd5c4;
  --card: #efe8d8;
  --accent: #c2410c;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --ink: #efe9da;
    --muted: #9a947f;
    --line: #2e2c22;
    --card: #1f1d15;
    --accent: #f08a4b;
  }
}

/* ---- Base --------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font-serif);
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

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

img {
  max-width: 100%;
}

picture {
  display: block;
}

section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 1.5rem;
  font: 500 0.8rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Accessibility: visible only when focused. */
.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem;
  background: var(--bg);
}

/* Small monospace text. */
.kicker,
.tag,
.subtitle,
dt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* ---- Hero --------------------------------------------------------------- */
.hero {
  padding: 2rem 0 3rem;
}

.lang {
  margin: 0 0 3rem;
  text-align: right;
  font: 0.8rem var(--font-mono);
  color: var(--muted);
}

.lang a {
  text-decoration: none;
}

.lang a[aria-current] {
  color: var(--accent);
  font-weight: 700;
}

.avatar {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 0 1.5rem;
  border: 3px solid var(--card);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  object-fit: cover;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 34rem;
  margin: 0 0 0.75rem;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  line-height: 1.4;
}

.origin {
  margin: 0 0 2rem;
  color: var(--muted);
  font: 0.9rem var(--font-mono);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.links a {
  font: 0.9rem var(--font-mono);
}

/* ---- Projects ----------------------------------------------------------- */
.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.project-list li:last-child {
  border: 0;
}

.project-list p {
  margin: 0 0 0.5rem;
}

.tag {
  color: var(--muted);
}

/* ---- Home cards --------------------------------------------------------- */
.subtitle {
  margin: -0.75rem 0 1.5rem;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card b {
  font-size: 1.05rem;
}

.card span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ---- Football gallery --------------------------------------------------- */
/* Below 44rem the photos stack. From 44rem the tall photo spans the height of
   the two wide ones, so the tops, bottoms and captions line up. */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 0.6rem;
  object-fit: cover;
}

.gallery figcaption {
  margin-top: 0.5rem;
  font: 0.75rem var(--font-mono);
  color: var(--muted);
}

.gallery__tall img {
  aspect-ratio: 2 / 3;
}

@media (max-width: 43.99rem) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 44rem) {
  .gallery__kick {
    grid-column: 1;
    grid-row: 1;
  }

  .gallery__team {
    grid-column: 1;
    grid-row: 2;
  }

  .gallery__tall {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
  }

  /* Reserve two caption lines everywhere so image bottoms stay aligned. */
  .gallery figcaption {
    min-height: 3.2em;
  }

  /* The image fills the remaining height instead of imposing its own. */
  .gallery__tall picture {
    position: relative;
    flex: 1;
    min-height: 0;
  }

  .gallery__tall img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-position: 50% 45%;
  }
}

/* ---- Cat ---------------------------------------------------------------- */
.cat {
  margin: 0;
}

.cat img {
  display: block;
  width: 14rem;
  height: auto;
  border-radius: 0.6rem;
}

.cat figcaption {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  font-style: italic;
}

@media (min-width: 34rem) {
  .cat {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
  }

  .cat figcaption {
    margin: 0;
    padding-bottom: 0.25rem;
  }
}

/* ---- Experience --------------------------------------------------------- */
.resume > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
}

dt {
  padding-top: 0.3rem;
  color: var(--muted);
}

dd {
  margin: 0;
}

.note {
  margin: 1rem 0 0;
  color: var(--muted);
}

.note--spaced {
  margin: 0 0 1.5rem;
}

/* ---- Footer ------------------------------------------------------------- */
footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 34rem) {
  .cards {
    grid-template-columns: 1fr;
  }

  .resume > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
