:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1d1b18;
  --muted: #5f5a52;
  --line: #e6e1d8;
  --accent: #b5452b;
  --accent-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 8px 24px rgba(29, 27, 24, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #201e1b;
    --ink: #f1ede6;
    --muted: #b1aa9f;
    --line: #34302b;
    --accent: #e0775c;
    --accent-ink: #161513;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .04em;
  text-decoration: none;
}
.nav nav { display: flex; gap: 1.5rem; }
.nav nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem); }
.eyebrow {
  margin: 0 0 .5rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .85rem;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -.01em;
}
.roles { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0 0 1.5rem; color: var(--muted); font-weight: 500; }
.roles span + span::before { content: "·"; margin-right: .75rem; color: var(--line); }
.lede { max-width: 38rem; font-size: 1.2rem; color: var(--muted); margin: 0 0 2rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease;
}
.button:hover { transform: translateY(-1px); }

/* Sections */
section { scroll-margin-top: 80px; }
h2 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  margin: 0 0 1.75rem;
}

/* Project cards */
.projects { display: grid; gap: 1.75rem; }

.card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
@media (min-width: 760px) {
  .card { grid-template-columns: 300px 1fr; }
}

.card-media {
  display: grid;
  place-items: center;
  padding: 2rem;
  min-height: 240px;
}
.card-media img {
  max-height: 340px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  transition: transform .25s ease;
}
.card:hover .card-media img { transform: translateY(-3px) rotate(-1deg); }
@media (prefers-reduced-motion: reduce) { .card:hover .card-media img { transform: none; } }

.card--puzzle .card-media { background: linear-gradient(160deg, #1f6f8b, #2a9bb5); }
.card--wine   .card-media { background: linear-gradient(160deg, #5b1a2a, #8a2e44); }
.card--fish   .card-media {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 24px),
    linear-gradient(160deg, #0f3b52, #1d6a7a);
}
.tape {
  display: block;
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
  transform: rotate(-4deg);
}
.card--fish .card-media img { box-shadow: none; border-radius: 0; }

.card-body { padding: 1.75rem 1.75rem 2rem; }
.card-kicker {
  margin: 0 0 .25rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h3 { font-family: var(--serif); font-size: 1.75rem; margin: 0; line-height: 1.2; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-tagline { font-style: italic; color: var(--muted); margin: .25rem 0 1rem; }
.card-body > p:not([class]) { margin: 0 0 1rem; max-width: 40rem; }

.tags { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  font-size: .8rem;
  font-weight: 500;
  padding: .2rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.card-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-link span { display: inline-block; transition: transform .15s ease; }
.card-link:hover span { transform: translateX(3px); }

/* About */
.about { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.about p { max-width: 40rem; color: var(--muted); font-size: 1.15rem; margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }

/* 404 */
.notfound { min-height: 70vh; display: grid; align-content: center; }
