:root {
  --bg: #f4f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --ink: #15181c;
  --ink-2: #3d434b;
  --muted: #646b75;
  --line: #d9dde3;
  --dot: #a3abb5;
  --accent: #2e5bff;
  --live: #1f9d55;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1080px;
  --gutter: clamp(16px, 5vw, 48px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

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

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 16px var(--gutter);
  background: linear-gradient(var(--bg) 60%, rgba(244, 245, 247, 0));
}

.nav-name { font-weight: 600; text-decoration: none; }
.nav nav { display: flex; gap: 22px; font-size: 0.94rem; }
.nav nav a { text-decoration: none; color: var(--ink-2); }
.nav nav a:hover { color: var(--accent); }

main, .footer {
  position: relative;
  z-index: 1;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  grid-template-areas: "name name" "lede activity" "links activity";
  column-gap: 56px;
  align-items: start;
  padding: clamp(48px, 10vh, 120px) 0 clamp(64px, 12vh, 140px);
}

.hero h1 {
  grid-area: name;
  margin: 0 0 28px;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.lede {
  grid-area: lede;
  margin: 0 0 28px;
  max-width: 34em;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.btn:hover { background: var(--accent); color: #fff; }

/* ---------- Currently working on ---------- */
.activity {
  grid-area: activity;
  align-self: end;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(6px);
}

.activity-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
}

.activity[data-state="live"] .pulse {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.5);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse { to { box-shadow: 0 0 0 8px rgba(31, 157, 85, 0); } }

.activity-repo { display: block; font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.activity-message { display: block; margin-top: 2px; color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.activity-message:hover { text-decoration: underline; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.activity-meta code { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-2); }
.activity[data-state="loading"] .activity-repo,
.activity[data-state="loading"] .activity-message { opacity: 0.55; }

/* ---------- Sections ---------- */
.section { padding: 0 0 clamp(72px, 12vh, 128px); }

.section-title {
  margin: 0 0 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Projects ---------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 72px;
}

.project:nth-of-type(even) .project-media { order: 2; }

.project-media {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000;
  aspect-ratio: 16 / 10;
}

.project-media video,
.project-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.project-media:hover video,
.project-media:hover img { transform: scale(1.015); }
.project-media img { object-position: top left; }

.project-body h3 { margin: 0; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; }
.project-kicker { margin: 4px 0 16px; color: var(--muted); }
.project-body p { max-width: 36em; }
.stack { margin: 16px 0; font-size: 0.92rem; color: var(--muted); }
.project-links { display: flex; gap: 22px; margin: 0; font-weight: 500; }

/* Paint has no screenshot yet, so its release history stands in for one. */
.sprints {
  margin: 0;
  padding: 24px 26px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  counter-reset: none;
}

.sprints li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.sprints li:last-child { border-bottom: 0; }
.sprints .v { font-family: var(--mono); font-size: 0.88rem; color: var(--accent); padding-top: 2px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.headshot { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.about-text p { margin: 0 0 16px; max-width: 38em; color: var(--ink-2); }
.about-text p:first-child { color: var(--ink); }

/* ---------- Contact ---------- */
.contact-email {
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-alt { display: flex; flex-wrap: wrap; gap: 22px; color: var(--ink-2); }

.footer { padding-bottom: 40px; font-size: 0.88rem; color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "lede" "links" "activity";
  }
  .activity { margin-top: 36px; }
  .project { grid-template-columns: 1fr; gap: 20px; }
  .project:nth-of-type(even) .project-media { order: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .headshot { max-width: 200px; }
  .nav nav { gap: 16px; }
}

@media (max-width: 420px) {
  .nav-name { display: none; }
  .nav { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .activity[data-state="live"] .pulse { animation: none; }
  .project-media video, .project-media img { transition: none; }
}
