:root {
  --bg: #08090B;
  --bg-2: #0E1014;
  --surface: #14171C;
  --rule: rgba(255,255,255,0.07);
  --rule-2: rgba(255,255,255,0.14);
  --fg: #ECEDEF;
  --fg-2: #B8BBC2;
  --fg-dim: #6E7480;
  --accent: #5EE6E6;
  --accent-warm: #FF7A45;
  --grid: rgba(255,255,255,0.035);
  --grid-strong: rgba(94,230,230,0.10);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(94,230,230,0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,122,69,0.04), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0/32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0/32px 32px,
    var(--bg);
  color: var(--fg);
  font-family: 'Geist', sans-serif;
  font-weight: 380;
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}
.display {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.mono {
  font-family: 'Departure Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}
.accent { color: var(--accent); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.wrap--narrow { max-width: 920px; }
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

nav.bar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: rgba(8,9,11,0.7);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
.bar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 32px;
  gap: 24px;
}
.bar__brand { font-weight: 600; color: var(--fg); }
.bar__brand a { color: inherit; text-decoration: none; }
.bar__center .mono { color: var(--fg-dim); }
.bar__links { display: flex; gap: 18px; justify-content: flex-end; }
.bar__links a {
  color: var(--fg-2); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color 200ms, border-color 200ms;
}
.bar__links a:hover { color: var(--fg); border-bottom-color: var(--accent); }
@media (max-width: 720px) {
  .bar__inner { grid-template-columns: 1fr 1fr; padding: 12px 20px; }
  .bar__center { display: none; }
  .bar__links { gap: 14px; }
  .bar__links a { font-size: 14px; }
}

.hero { padding: 128px 0 96px; position: relative; }
.hero__crosshair {
  position: absolute;
  top: 80px; right: 32px;
  width: 240px; height: 240px;
  pointer-events: none;
  opacity: 0.45;
}
@media (max-width: 900px) { .hero__crosshair { display: none; } }
.hero__tag {
  color: var(--fg-dim); margin-bottom: 28px;
  display: flex; gap: 12px; align-items: center;
}
.hero__tag::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 0 4px rgba(255,122,69,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,122,69,0.20); }
  50%      { box-shadow: 0 0 0 10px rgba(255,122,69,0.04); }
}
.hero__name { font-size: clamp(56px, 11vw, 168px); max-width: 14ch; }
.hero__name .swash {
  font-variation-settings: 'opsz' 144, 'SOFT' 80, 'WONK' 1;
  font-style: italic;
  color: var(--accent);
}
.hero__role {
  margin-top: 36px;
  max-width: 56ch;
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--fg-2);
  line-height: 1.5;
}
.hero__role strong { color: var(--fg); font-weight: 600; }
.hero__meta {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 24px;
  max-width: 800px;
}
@media (max-width: 720px) { .hero__meta { grid-template-columns: repeat(2, 1fr); } }
.hero__meta .label { display: block; margin-bottom: 6px; color: var(--fg-dim); }
.hero__meta .val { color: var(--fg); font-weight: 500; font-size: 16px; }

section {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.section__head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-bottom: 56px;
}
@media (max-width: 720px) {
  .section__head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
}
.section__num { color: var(--fg-dim); }
.section__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 350;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.section__lede {
  max-width: 60ch;
  color: var(--fg-2);
  margin-top: 16px;
}

.current {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 720px) { .current { grid-template-columns: 1fr; } }
.current__what {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.current__detail { margin-top: 22px; color: var(--fg-2); max-width: 62ch; }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .stack-grid { grid-template-columns: 1fr; } }
.stack-card {
  padding: 24px;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.stack-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 36px; height: 1px;
  background: var(--accent);
}
.stack-card__title {
  font-family: 'Fraunces', serif;
  font-weight: 350;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.stack-card__sub { color: var(--fg-dim); margin-bottom: 14px; }
.stack-card__list { list-style: none; padding: 0; margin: 0; }
.stack-card__list li {
  padding: 6px 0;
  color: var(--fg-2);
  border-top: 1px dashed var(--rule);
  display: flex; justify-content: space-between; align-items: baseline;
}
.stack-card__list li:first-child { border-top: 0; }
.stack-card__list .meta { color: var(--fg-dim); }

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 24px;
}
@media (max-width: 900px) { .projects { grid-template-columns: 1fr; } }
.proj {
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--fg);
  transition: transform 250ms ease;
}
.proj:hover { transform: translateY(-3px); }
.proj__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.proj__media::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--grid-strong) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px) 0 0/24px 24px;
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
}
.proj__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms ease, filter 700ms ease;
  filter: contrast(1.05) saturate(0.85) brightness(0.92);
}
.proj:hover .proj__media img { transform: scale(1.04); filter: contrast(1.1) saturate(1) brightness(1); }
.proj__corner {
  position: absolute; top: 12px; left: 12px;
  color: var(--accent);
  background: rgba(8,9,11,0.7);
  padding: 4px 8px;
  backdrop-filter: blur(4px);
  z-index: 1;
}
.proj__year {
  position: absolute; top: 12px; right: 12px;
  color: var(--fg-dim);
  background: rgba(8,9,11,0.7);
  padding: 4px 8px;
  z-index: 1;
}
.proj__title {
  margin: 18px 0 4px;
  font-family: 'Fraunces', serif;
  font-weight: 350;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.proj__role { color: var(--fg-dim); margin-bottom: 8px; }
.proj__lede { color: var(--fg-2); max-width: 52ch; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.proj__tag { color: var(--fg-dim); border: 1px solid var(--rule-2); padding: 3px 8px; }

.reading {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
.reading__item {
  padding: 22px 24px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 18px;
  align-items: baseline;
  color: var(--fg);
}
.reading__item:nth-child(odd) { border-right: 1px solid var(--rule); }
.reading__date { color: var(--accent); }
.reading__topic { color: var(--fg-dim); white-space: nowrap; }
.reading__item em { color: var(--fg); font-style: italic; }
@media (max-width: 720px) {
  .reading { grid-template-columns: 1fr; }
  .reading__item:nth-child(odd) { border-right: 0; }
  .reading__item { grid-template-columns: 80px 1fr; }
  .reading__topic { grid-column: 2; margin-top: 4px; }
}

.contact { padding-bottom: 120px; }
.contact__big {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 1;
  font-weight: 300;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
}
.contact__big a {
  color: var(--accent); text-decoration: none;
  border-bottom: 2px solid var(--accent);
  transition: color 200ms;
}
.contact__big a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.contact__rest {
  display: flex; gap: 28px; flex-wrap: wrap;
  color: var(--fg-dim);
}
.contact__rest a {
  color: var(--fg); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: border-color 200ms;
}
.contact__rest a:hover { border-bottom-color: var(--accent); }

footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  color: var(--fg-dim);
}
.footer__inner {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px;
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Project detail page ===== */
.proj-hero { padding: 96px 0 48px; }
.proj-hero__back {
  color: var(--fg-dim);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 36px;
  border-bottom: 1px solid transparent;
  transition: color 200ms, border-color 200ms;
}
.proj-hero__back:hover { color: var(--fg); border-bottom-color: var(--accent); }
.proj-hero__crumb { color: var(--fg-dim); margin-bottom: 14px; }
.proj-hero__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 40, 'WONK' 1;
  font-weight: 300;
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.proj-hero__meta {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 24px;
  max-width: 900px;
}
@media (max-width: 720px) { .proj-hero__meta { grid-template-columns: repeat(2, 1fr); } }
.proj-hero__meta .label { display: block; margin-bottom: 6px; color: var(--fg-dim); }
.proj-hero__meta .val { color: var(--fg); font-weight: 500; font-size: 16px; }

.proj-section {
  padding: 64px 0;
  border-top: 1px solid var(--rule);
}
.proj-section__head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 720px) { .proj-section__head { grid-template-columns: 1fr; gap: 8px; } }
.proj-section__num { color: var(--accent); }
.proj-section__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 350;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.proj-prose {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}
@media (max-width: 720px) { .proj-prose { grid-template-columns: 1fr; } }
.proj-prose__body {
  max-width: 64ch;
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1.65;
}
.proj-prose__body p { margin: 0 0 18px; }
.proj-prose__body p:last-child { margin-bottom: 0; }
.proj-prose__body strong { color: var(--fg); font-weight: 600; }
.proj-prose__body ul { padding-left: 20px; margin: 0; }
.proj-prose__body li { margin: 6px 0; }

.proj-figure {
  position: relative;
  margin: 12px 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
}
.proj-figure img,
.proj-figure video {
  display: block;
  width: 100%; height: auto;
  filter: contrast(1.05) saturate(0.9) brightness(0.95);
}
.proj-figure::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--grid-strong) 1px, transparent 1px) 0 0/32px 32px,
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px) 0 0/32px 32px;
  mix-blend-mode: screen;
  opacity: 0.18;
  pointer-events: none;
}
.proj-figure__caption {
  position: absolute; left: 12px; bottom: 12px;
  color: var(--fg-dim);
  background: rgba(8,9,11,0.78);
  padding: 4px 8px;
  backdrop-filter: blur(4px);
  max-width: calc(100% - 24px);
}

/* Video figures: caption moves below so it doesn't block playback controls,
   and the grid-overlay is removed so the controls aren't visually obscured. */
.proj-figure:has(video) { overflow: visible; }
.proj-figure:has(video)::after { display: none; }
.proj-figure:has(video) video { filter: none; }
.proj-figure:has(video) .proj-figure__caption {
  position: static;
  display: block;
  margin-top: 8px;
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  max-width: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
/* When a gallery has a single figure, give it full width. */
.gallery:has(> .proj-figure:only-child) { grid-template-columns: 1fr; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

.proj-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.proj-tags .mono {
  border: 1px solid var(--rule-2);
  padding: 4px 8px;
  color: var(--fg-dim);
}

/* ===== Downloads ===== */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .dl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-card {
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  display: flex; flex-direction: column;
  overflow: hidden;
}
.dl-card__media {
  aspect-ratio: 4 / 3;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.dl-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) saturate(0.85) brightness(0.95);
}
.dl-card__media::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--grid-strong) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px) 0 0/24px 24px;
  mix-blend-mode: screen;
  opacity: 0.32;
  pointer-events: none;
}
.dl-card__body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.dl-card__title {
  font-family: 'Fraunces', serif;
  font-weight: 350;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.dl-card__lede { color: var(--fg-2); margin: 0; flex: 1; }
.dl-card__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-family: 'Departure Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 180ms, color 180ms;
}
.dl-card__cta:hover { background: var(--accent); color: var(--bg); }

