:root {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --line: #262626;
  --line-strong: #3a3a3a;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --dim: #5a5a5a;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--text); color: var(--bg); }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); }

#grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: rgba(10, 10, 10, .7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }

.brand {
  font-weight: 700;
  letter-spacing: .18em;
  font-size: 14px;
}

.nav nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.nav nav a {
  position: relative;
  font-size: 14px;
  color: var(--muted);
  transition: color .2s;
}
.nav nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.nav nav a:hover { color: var(--text); }
.nav nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Layout */
main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 80px !important;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 20px;
}

h1 {
  font-size: clamp(56px, 12vw, 148px);
  line-height: .95;
  letter-spacing: -.045em;
  font-weight: 700;
  margin: 0;
}

.cursor {
  display: inline-block;
  width: .08em;
  height: .8em;
  margin-left: .06em;
  background: var(--text);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lede {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  margin: 28px 0 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.scroll-hint {
  position: absolute;
  left: var(--gutter);
  bottom: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.scroll-hint i {
  position: relative;
  display: block;
  width: 64px; height: 1px;
  background: var(--line);
  overflow: hidden;
}
.scroll-hint i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--muted);
  animation: slide 2.2s var(--ease) infinite;
}
@keyframes slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(260%); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--text);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { border-color: var(--text); }
.btn-solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-solid:hover { background: transparent; color: var(--text); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:focus-visible, a:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

/* Section heads */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.03em;
  font-weight: 600;
}
.idx { color: var(--dim); font-size: 13px; }

/* Projects */
.work { padding-top: 120px !important; }

.project {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.project-meta { display: flex; flex-direction: column; gap: 20px; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}

.project h3 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -.04em;
  margin: 0 0 20px;
  font-weight: 700;
}

.project p { color: var(--muted); max-width: 640px; margin: 0 0 16px; }
.project p.summary { color: var(--text); font-size: 19px; }

.pipeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 36px 0;
  padding: 0;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.pipeline::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 1px; width: 25%;
  background: linear-gradient(90deg, transparent, var(--text), transparent);
  animation: scan 4s linear infinite;
}
@keyframes scan {
  from { transform: translateX(-100%); }
  to   { transform: translateX(400%); }
}
.pipeline li {
  padding: 16px;
  font-size: 13px;
  color: var(--text);
  border-left: 1px solid var(--line);
  transition: background .3s var(--ease);
}
.pipeline li:first-child { border-left: 0; }
.pipeline li:hover { background: var(--bg-raised); }
.pipeline span { display: block; color: var(--dim); font-size: 11px; margin-bottom: 6px; }

.features {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.features li {
  background: var(--bg);
  padding: 20px;
  font-size: 14px;
  color: var(--muted);
  transition: background .3s var(--ease);
}
.features li:hover { background: var(--bg-raised); }
.features strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

/* About */
.about { padding-top: 120px !important; padding-bottom: 120px !important; }
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  padding-top: 40px;
}
.about-grid > p { font-size: clamp(20px, 2.6vw, 26px); line-height: 1.45; margin: 0; letter-spacing: -.01em; }
.stats { margin: 0; display: grid; gap: 0; }
.stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.stats dt { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.stats dd { margin: 0; font-weight: 500; }

/* Footer */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}
.footer a { transition: color .2s; }
.footer a:hover { color: var(--text); }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 800px) {
  .project { grid-template-columns: 1fr; gap: 24px; padding: 48px 0; }
  .project-meta { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; }
  .tags { justify-content: flex-end; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li:nth-child(3) { border-left: 0; }
  .pipeline li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .nav nav a:not(:last-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
