/* ---------- Fonts ---------- */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fbfaf8;
  --surface: #f2f0ec;
  --text: #151414;
  --muted: #5f5c58;
  --line: #e3e0db;
  --accent: #e10600;       /* 4.8:1 on --bg, passes WCAG AA */
  --accent-strong: #b30500;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(5rem, 12vw, 9rem);
  --radius: 4px;
  --ease: 160ms ease;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Small text links get a red strike-through on hover */
.nav a:hover,
.back:hover,
.contact__links a:hover,
.work__links a:hover,
.about__elsewhere a:hover,
.jams__all:hover,
.timeline__cv:hover,
.site-footer a:hover {
  color: var(--accent);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0; }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.site-header__name { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: clamp(1rem, 3vw, 2rem); margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--muted); transition: color var(--ease); }
.nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(5rem, 16vw, 11rem); padding-bottom: clamp(3rem, 8vw, 5rem); }
.hero__name { font-size: clamp(2.75rem, 8vw, 6rem); font-weight: 600; letter-spacing: -0.045em; line-height: 0.98; }
.hero__lead { margin-top: 1.75rem; max-width: 34ch; font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.35; color: var(--muted); letter-spacing: -0.01em; }
.hero__meta { margin-top: 2.25rem; display: flex; align-items: flex-start; gap: 0.6rem; color: var(--muted); }
.dot { width: 0.5rem; height: 0.5rem; margin-top: 0.5em; background: var(--accent); flex: none; }

/* ---------- Sections ---------- */
.section { padding-top: var(--section); }
.section__title {
  display: flex; align-items: baseline; gap: 1rem;
  padding-bottom: 1rem; margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem; font-weight: 500; letter-spacing: 0;
}

/* ---------- Work cards ---------- */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); margin: 0; padding: 0; list-style: none; }
.card__link { display: block; text-decoration: none; }
.card__link:hover { color: inherit; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border-radius: var(--radius); margin-bottom: 1.1rem; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--ease); }
.card__title { margin-top: 0.4rem; font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
.card__title::after { content: " →"; color: var(--accent); opacity: 0; transition: opacity var(--ease); }
.card__summary { margin-top: 0.5rem; color: var(--muted); max-width: 46ch; }
.card__link:hover .card__media img { opacity: 0.88; }
.card__link:hover .card__title::after,
.card__link:focus-visible .card__title::after { opacity: 1; }

/* ---------- Game jams ---------- */
.jams { margin-top: clamp(4.5rem, 9vw, 6.5rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 2rem clamp(1.5rem, 3vw, 2.5rem); }
.jams__title { font-size: 1.125rem; }
.jams__intro { margin-top: 0.5rem; color: var(--muted); font-size: 0.9375rem; max-width: 28ch; }
.jams__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem 1rem; margin: 0; padding: 0; list-style: none; }
.jams__grid--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.jams__all { display: inline-block; margin-top: 1rem; font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.jams-page { padding-bottom: var(--section); }
.jams__grid--all { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
.jams__grid--all .jam__title { font-size: 1.0625rem; }
.jams__grid--all .jam__summary { font-size: 0.875rem; }
.jam a { display: block; text-decoration: none; }
.jam img { aspect-ratio: 315 / 250; object-fit: cover; border-radius: var(--radius); background: var(--surface); margin-bottom: 0.6rem; transition: opacity var(--ease); }
.jam a:hover img { opacity: 0.85; }
.jam__title { display: block; font-size: 0.9375rem; font-weight: 500; line-height: 1.3; }
.jam__summary { display: block; margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.jam a:hover .jam__title { color: var(--accent); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about__photo { margin: 0; position: sticky; top: 6rem; }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius); }
.about__text > p + p { margin-top: 1.1rem; }
.about__text > p { max-width: 62ch; }
.about__lead { font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.4; letter-spacing: -0.01em; margin-bottom: 1.5rem; }
.about__text > p:not(.about__lead):not(.about__elsewhere) { color: #3b3936; }

.timeline { margin-top: 3rem; }
.timeline__title { font-size: 0.9375rem; font-weight: 500; color: var(--muted); padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.timeline__title + ol { margin: 0 0 2.25rem; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.timeline li .mono { color: var(--muted); padding-top: 0.15rem; }
.timeline li span:last-child { color: var(--muted); }

.about__elsewhere { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; font-size: 0.9375rem; color: var(--muted); }
.about__elsewhere .mono { margin-right: 0.6rem; }

/* ---------- Contact ---------- */
.contact { padding-bottom: var(--section); }
.contact__lead { font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.35; max-width: 30ch; color: var(--muted); letter-spacing: -0.01em; }
.contact__email {
  display: inline-block; margin-top: 1.5rem;
  font-size: clamp(1.375rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.2;
  text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 0.2em;
  word-break: break-word; transition: color var(--ease), text-decoration-color var(--ease);
}
.contact__email:hover { text-decoration-color: currentColor; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.contact__links a { text-decoration: none; }
.timeline ol:last-of-type { margin-bottom: 1.25rem; }
.timeline__cv:hover .mono { color: inherit; }
.timeline__cv { display: inline-block; margin-bottom: 2.25rem; font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.timeline__cv .mono { color: var(--muted); font-size: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.75rem; font-size: 0.875rem; color: var(--muted); }

/* ---------- Work page ---------- */
.work { padding-bottom: var(--section); }
.back { display: inline-flex; gap: 0.5rem; margin-top: 2.5rem; font-size: 0.9375rem; color: var(--muted); text-decoration: none; }
.work__header { padding-top: clamp(3rem, 8vw, 5.5rem); padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.work__title { margin-top: 0.85rem; font-size: clamp(2.5rem, 7vw, 5rem); letter-spacing: -0.045em; line-height: 1; }
.lead { margin-top: 1.5rem; max-width: 38ch; font-size: clamp(1.2rem, 2.4vw, 1.625rem); line-height: 1.35; color: var(--muted); letter-spacing: -0.01em; }

.work__hero { margin: 0 auto; }
.work__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.work__hero figcaption { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--muted); }

.work__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: clamp(2rem, 6vw, 5rem); margin-top: clamp(3rem, 7vw, 5rem); align-items: start; }
.work__facts { position: sticky; top: 6rem; }
.work__facts dl { margin: 0; }
.work__facts dl > div { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.work__facts dl > div:last-child { border-bottom: 1px solid var(--line); }
.work__facts dt { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.work__facts dd { margin: 0.2rem 0 0; font-size: 0.9375rem; }
.work__links { margin: 1.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.work__links a { font-weight: 500; text-decoration: none; }

.prose { max-width: 66ch; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { margin-top: 2.75rem; font-size: 1.375rem; }
.prose h2 + * { margin-top: 0.75rem; }
.prose > p:first-child { font-size: 1.1875rem; line-height: 1.55; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); }

.work__next { margin-top: clamp(4rem, 9vw, 7rem); }
.work__next a { display: block; padding-top: 1.5rem; border-top: 1px solid var(--line); text-decoration: none; }
.work__next-title { display: block; margin-top: 0.5rem; font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -0.03em; }
.work__next a:hover .work__next-title { color: var(--accent); }

/* ---------- 404 ---------- */
.not-found { padding-block: clamp(6rem, 18vw, 12rem); }
.not-found h1 { font-size: clamp(2.5rem, 7vw, 5rem); letter-spacing: -0.045em; }
.not-found p { margin-top: 1rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .jams { grid-template-columns: 1fr; }
  .jams__intro { max-width: 50ch; }
  .jams__grid, .jams__grid--all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .works { grid-template-columns: 1fr; }
  .about, .work__body { grid-template-columns: 1fr; }
  .about__photo, .work__facts { position: static; }
  .about__photo { max-width: 22rem; }
  .jams__grid, .jams__grid--all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jams__grid--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media (max-width: 420px) {
  .jams__grid--featured .jam__summary { display: none; }
  .site-header__name { font-size: 0.9375rem; }
  .nav { gap: 0.9rem; font-size: 0.875rem; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
