:root {
  --paper: #f1f3ee;
  --ink: #18211d;
  --muted: #55615b;
  --rule: #cfd5cc;
  --link: #2a43c9;
  --lcd-bg: #c6d2b6;
  --lcd-ink: #232d1d;
  --bezel: #2b3330;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Literata", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121614;
    --ink: #e7ebe5;
    --muted: #9aa69f;
    --rule: #2c3530;
    --link: #8fa3ff;
    --bezel: #0a0d0c;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 700px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }

/* Header */
.site-header { padding: 20px 0; }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
nav { display: flex; gap: 20px; font-family: var(--display); font-weight: 500; font-size: 0.98rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero {
  display: grid;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 72px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.25fr 1fr; gap: 64px; padding-top: 72px; padding-bottom: 104px; }
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.lede { max-width: 58ch; margin: 24px 0 0; color: var(--muted); }
.hero-links { display: flex; gap: 24px; flex-wrap: wrap; margin: 28px 0 0; font-family: var(--display); font-weight: 500; }

.lcd-wrap { margin: 0; }
.lcd {
  background: var(--bezel);
  padding: 14px;
  border-radius: 18px;
}
.lcd canvas {
  display: block;
  width: 100%;
  aspect-ratio: 160 / 100;
  image-rendering: pixelated;
  background: var(--lcd-bg);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.lcd-wrap figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--muted); max-width: 44ch; line-height: 1.5; }

/* Sections */
.section { padding-top: 24px; padding-bottom: 64px; }
.section > h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

/* Projects */
.project {
  display: grid;
  gap: 8px 40px;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 800px) {
  .project { grid-template-columns: 210px 1fr; }
}
.meta p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.meta .when { font-family: var(--display); font-weight: 500; color: var(--ink); }
.body { max-width: 66ch; }
.body h3 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 12px; }
.project.featured .body h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.body p { margin: 0 0 14px; }
.links { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; padding: 0; margin: 18px 0 0; font-family: var(--display); font-weight: 500; }

/* Screenshots */
.shot { margin: 22px 0 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.shot figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* Video */
.shot.video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

/* About */
.about-grid { display: grid; gap: 36px; padding-top: 16px; border-top: 1px solid var(--rule); margin-top: 20px; }
@media (min-width: 800px) { .about-grid { grid-template-columns: 1.1fr 1fr; gap: 64px; } }
.about-grid .prose { max-width: 62ch; }
.about-grid .prose p { margin: 16px 0 0; }
.skills { margin: 0; padding-top: 16px; }
.skills dt { font-family: var(--display); font-weight: 700; margin-top: 16px; }
.skills dt:first-child { margin-top: 0; }
.skills dd { margin: 4px 0 0; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }

/* Contact */
.contact { border-top: 1px solid var(--rule); padding-top: 40px; margin-top: 8px; }
.contact p { margin: 8px 0 0; }
.contact-links { display: flex; gap: 24px; flex-wrap: wrap; font-family: var(--display); font-weight: 500; font-size: 1.1rem; }

.site-footer { padding-top: 24px; padding-bottom: 48px; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; }
