:root {
  --bg: #12130f;
  --bg-panel: #191a15;
  --ink: #ece8de;
  --ink-dim: #92948a;
  --line: #33352b;
  --accent: #4fd1c5;
  --accent-dim: #2e5c56;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --maxw: 880px;
  --edge: clamp(20px, 6vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
}

h1, h2, h3 {
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* header */

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--edge);
  max-width: 1180px;
  margin: 0 auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.brand {
  font-weight: 600;
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--ink-dim);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  color: var(--ink);
}

/* hero */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--edge) clamp(60px, 10vw, 120px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0 0 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero-sub {
  color: var(--ink-dim);
  font-size: 1.02rem;
  max-width: 46ch;
}

.hero-links {
  display: flex;
  gap: 20px;
  margin-top: 32px;
}

.hero-links a {
  font-size: 0.92rem;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hero-links a:first-child {
  color: var(--bg);
  background: var(--accent);
  border: none;
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: 500;
}

.hero-links a:first-child:hover {
  background: #6adcd1;
}

.hero-links a:last-child:hover,
.hero-links a:last-child:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-diagram {
  min-width: 0;
}

.pipe-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 1.4s ease forwards;
}

.pipe-node {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  animation: appear 0.4s ease forwards;
  animation-delay: 1.1s;
}

.pipe-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-dim);
  opacity: 0;
  animation: appear 0.4s ease forwards;
  animation-delay: 1.3s;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes appear {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pipe-line, .pipe-node, .pipe-label {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* sections */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 72px) var(--edge);
  border-top: 1px solid var(--line);
}

.section-top {
  border-top: none;
  padding-top: clamp(56px, 9vw, 96px);
}

.text-link {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.92rem;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.text-link:hover,
.text-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.section-head h2 {
  font-size: 1.4rem;
  margin-bottom: 28px;
}

.section-body p {
  color: var(--ink-dim);
  max-width: 62ch;
  font-size: 1rem;
}

/* timeline */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  padding-top: 3px;
}

.timeline-body h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.timeline-body p {
  color: var(--ink-dim);
  font-size: 0.96rem;
  max-width: 56ch;
}

/* stack */

.stack-grid {
  display: flex;
  flex-direction: column;
}

.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stack-row:last-child { border-bottom: none; }

.stack-cat {
  font-size: 0.92rem;
  color: var(--ink);
}

.stack-items {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-dim);
}

/* about photo */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.about-photo figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-dim);
}

@media (max-width: 760px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-photo {
    order: -1;
    max-width: 360px;
  }
}

/* work */

.work-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.work-item {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.work-item h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.work-item p {
  color: var(--ink-dim);
  max-width: 60ch;
  font-size: 0.96rem;
}

.work-tags {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.work-tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 3px 9px;
}

/* contact */

.contact-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  font-size: 0.96rem;
}

.contact-list span:first-child {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding-top: 2px;
}

.contact-list a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* footer */

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px var(--edge) 48px;
  color: var(--ink-dim);
  font-size: 0.84rem;
}

/* responsive */

@media (max-width: 1024px) {
  .hero {
    gap: 32px;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px var(--edge) 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-diagram {
    order: -1;
    max-width: 320px;
  }

  .timeline-item,
  .stack-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contact-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .hero-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .hero-links a:first-child {
    width: 100%;
    text-align: center;
  }

  .work-tags span {
    font-size: 0.73rem;
  }
}
