:root {
  --bg: #FAFAF7;
  --ink: #18181B;
  --accent: #F04E23;
  --muted: #55555D;
  --line: #E4E4E0;
  --card: #FFFFFF;
  --radius: 28px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* SVG paint classes shared by the critters */
.ink { fill: var(--ink); }
.accent { fill: var(--accent); }
.eye { fill: var(--bg); stroke: var(--ink); stroke-width: 5; }

.brace { color: var(--accent); font-weight: 500; }

/* ---------- Hero: logo centred in the first screen ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 16px 112px;
  text-align: center;
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.5vw, 28px);
  font-weight: 800;
}

.critter { display: block; width: clamp(108px, 16vw, 168px); height: auto; overflow: visible; }

.wordmark {
  display: block;
  font-size: clamp(44px, 10vw, 104px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark em { font-style: italic; }

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  border-radius: 12px;
}
.scroll-cue:hover { color: var(--ink); }
.scroll-cue svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  animation: nudge 2.2s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- Projects ---------- */

.projects {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}
@media (min-width: 720px) { .projects { padding: 48px 40px 128px; } }

.section-title {
  margin: 0 0 32px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: clamp(24px, 3vw, 40px);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
a.card:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--ink); }
a.card:active { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--ink); }
a.card:focus-visible { outline: 4px solid var(--accent); outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } a.card:hover, a.card:active { transform: none; } }

.card-art {
  position: relative;
  height: clamp(220px, 28vw, 320px);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: clamp(24px, 3vw, 36px);
}

.card-host { margin: 0; color: var(--muted); font-size: 14px; }

.card-title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.card-text { margin: 0; color: var(--muted); font-size: 16px; max-width: 52ch; }

.card-cta {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 800;
  font-size: 18px;
}
a.card .card-cta span { display: inline-block; transition: transform 160ms ease; }
a.card:hover .card-cta span { transform: translateX(4px); }

/* Late Backseat Chess art: a tilted board with a grade badge */
.art-chess {
  background-color: var(--ink);
}
.art-chess::before {
  content: '';
  position: absolute;
  inset: -40%;
  background:
    conic-gradient(var(--bg) 25%, #2B2B30 0 50%, var(--bg) 0 75%, #2B2B30 0) 0 0 / 120px 120px;
  transform: rotate(-12deg);
}
.piece {
  position: absolute;
  font-family: 'Segoe UI Symbol', 'DejaVu Sans', 'Noto Sans Symbols 2', serif;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 0 0 var(--ink);
  -webkit-text-stroke: 3px var(--bg);
  paint-order: stroke fill;
}
.piece-knight { font-size: clamp(110px, 13vw, 160px); left: 14%; bottom: 8%; transform: rotate(-12deg); }
.piece-queen { font-size: clamp(80px, 9vw, 112px); right: 16%; top: 10%; transform: rotate(-12deg); opacity: .9; }
.grade {
  position: absolute;
  right: 10%;
  bottom: 14%;
  padding: 10px 18px 12px;
  background: var(--accent);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.02em;
  transform: rotate(6deg);
}

/* Stardate Scroll art: one timeline entry, in that site's own colours */
.art-stardate {
  --sd-bg: #1D2744;
  --sd-fg: #EEF1F7;
  --sd-trek: #F3B44C;
  --sd-real: #6EC1FF;
  display: grid;
  place-items: center;
  height: auto;
  min-height: clamp(220px, 28vw, 320px);
  padding: 56px 20px 20px;
  background-color: var(--sd-bg);
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 14%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 82%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 30%, rgba(255,255,255,.65) 50%, transparent 51%),
    radial-gradient(1px 1px at 89% 62%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 86%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 54% 48%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 12%, rgba(255,255,255,.5) 50%, transparent 51%);
  color: var(--sd-fg);
  text-align: center;
}
.sd-hud {
  position: absolute;
  inset: 0 0 auto;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: rgba(0, 0, 0, .35);
}
.sd-hud-year {
  font-family: 'Antonio', 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.01em;
}
.sd-entry { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sd-kicker,
.sd-match {
  margin: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.sd-kicker { color: var(--sd-trek); }
.sd-title {
  margin: 0;
  font-family: 'Antonio', 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.sd-gap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.sd-years { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 18px; }
.sd-line {
  display: block;
  width: clamp(140px, 18vw, 200px);
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sd-trek), var(--sd-real));
}
.sd-match { color: var(--sd-real); }

/* ---------- Footer ---------- */

.footer {
  padding: 32px 16px 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.footer p { margin: 0; }
