/* ---------- Tokens ---------- */
:root {
  --bg: #0a0e13;
  --bg-2: #0f141b;
  --card: #121921;
  --card-hi: #17202a;
  --line: #222c38;
  --line-hi: #2f3d4d;
  --fg: #e8edf2;
  --fg-2: #b4bfcb;
  --muted: #8592a1;
  --accent: #2dd4bf;
  --accent-ink: #04201c;
  --accent-soft: rgba(45, 212, 191, 0.12);

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0 0 1em; }
code { font: 500 0.88em var(--mono); color: var(--accent); }
ul { margin: 0; padding: 0; list-style: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 0.9375rem var(--font); cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 0.875rem; }
.btn--sm .ic { width: 16px; height: 16px; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #5eead4; }
.btn--ghost { border-color: var(--line-hi); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 19, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font: 600 0.875rem var(--mono);
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--fg-2); font-size: 0.9375rem; border-radius: 8px;
  transition: color .2s var(--ease);
}
.nav__links a:not(.btn):hover, .nav__links a.is-current { color: var(--fg); }
.nav__links .btn { margin-left: 8px; }

@media (max-width: 560px) {
  .brand__name { display: none; }
  .nav__links a:not(.btn) { padding: 0 9px; }
  .nav__links .btn span { display: none; }
  .nav__links .btn { padding: 0 11px; margin-left: 2px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero__grid {
  position: absolute; inset: -64px 0 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 20%, transparent 75%);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; left: -120px; top: -160px;
  background: radial-gradient(circle, rgba(45, 212, 191, .16), transparent 65%);
}
.hero__meta { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.hero__meta p { margin: 0; line-height: 1.4; }
.avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line-hi); }
.hero__loc { display: flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 0.9375rem; }
.hero__loc .ic { width: 15px; height: 15px; color: var(--accent); }
.hero__title {
  font-size: clamp(2.25rem, 6.2vw, 4.25rem);
  font-weight: 600; letter-spacing: -0.035em; max-width: 15ch;
  text-wrap: balance;
}
.hl { color: var(--accent); }
.hero__lead { margin-top: 24px; max-width: 58ch; font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); color: var(--fg-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin: 56px 0 0; max-width: 640px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.stats div { background: var(--bg); padding: 18px 20px; }
.stats dt { color: var(--muted); font-size: 0.8125rem; }
.stats dd { margin: 4px 0 0; font: 600 1.75rem/1.1 var(--font); letter-spacing: -0.02em; }
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .stats div { display: flex; justify-content: space-between; align-items: baseline; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section__head { margin-bottom: 40px; }
.section__head p:last-child { margin: 0; }
.eyebrow { color: var(--accent); margin-bottom: 12px; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); margin-bottom: 12px; text-wrap: balance; }

/* ---------- Featured projects ---------- */
.project {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.project--flip .shot { order: 2; }
.project__title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.project__title img, .glyph { width: 36px; height: 36px; border-radius: 9px; }
.glyph { display: grid; place-items: center; background: var(--card-hi); border: 1px solid var(--line-hi); color: var(--accent); font-size: 1rem; font-weight: 600; }
.project__title h3 { font-size: 1.5rem; }
.project__title p { margin: 2px 0 0; }
.project__body > p { color: var(--fg-2); }
.project__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.shot {
  position: relative; display: block; width: 100%; padding: 0; margin: 0;
  background: var(--card); border: 1px solid var(--line-hi); border-radius: var(--r);
  overflow: hidden; cursor: zoom-in;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255,255,255,.02) inset;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.shot img { width: 100%; }
.shot:hover { transform: translateY(-4px); border-color: rgba(45, 212, 191, .5); box-shadow: 0 40px 70px -30px rgba(0,0,0,.9), 0 0 40px -12px rgba(45,212,191,.35); }
.shot__zoom {
  position: absolute; right: 12px; bottom: 12px;
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; background: rgba(10, 14, 19, .8); color: var(--fg);
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.shot:hover .shot__zoom, .shot:focus-visible .shot__zoom { opacity: 1; transform: none; }
.shot--phone {
  width: min(300px, 70%); justify-self: center;
  border-radius: 32px; border-width: 6px; border-color: #1c252f;
}
@media (hover: none) { .shot__zoom { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project--flip .shot { order: 0; }
}

/* ---------- More builds ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: transparent; color: var(--fg-2);
  border: 1px solid var(--line-hi); font: 500 0.875rem var(--font); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip .ic { width: 16px; height: 16px; }
.chip:hover { color: var(--fg); border-color: var(--muted); }
.chip.is-active { background: var(--accent-soft); color: var(--accent); border-color: rgba(45, 212, 191, .45); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column;
  padding: 22px; border-radius: var(--r);
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.card:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.card[hidden] { display: none; }
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kind { display: inline-flex; align-items: center; gap: 6px; font: 500 0.75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kind .ic { width: 14px; height: 14px; }
.lock { color: var(--muted); display: inline-flex; }
.lock .ic { width: 15px; height: 15px; }
.card h3 { font-size: 1.1875rem; margin-bottom: 8px; }
.card p { color: var(--fg-2); font-size: 0.9375rem; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tags li {
  font: 500 0.75rem var(--mono); color: var(--fg-2);
  padding: 4px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about > div:first-child > p:not(.eyebrow) { color: var(--fg-2); max-width: 60ch; }
.about strong { color: var(--fg); font-weight: 600; }
.stack { padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); }
.stack h3 { color: var(--accent); font-weight: 500; margin-bottom: 14px; }
.stack dl { margin: 0; }
.stack dl div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.stack dt { color: var(--muted); font-size: 0.875rem; }
.stack dd { margin: 0; font-size: 0.9375rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.about .stack { position: sticky; top: 88px; }
@media (max-width: 860px) { .about .stack { position: static; } }

.timeline__h { color: var(--accent); font-weight: 500; margin: 36px 0 18px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line-hi); }
.timeline li { position: relative; padding-bottom: 24px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline p { margin: 0; }
.timeline h4 { margin: 4px 0 2px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.timeline__org { color: var(--fg-2); font-size: 0.9375rem; }
.about .timeline__desc { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Contact / footer ---------- */
.contact {
  text-align: center; margin-block: 24px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(45, 212, 191, .12), transparent 70%),
    var(--bg-2);
  max-width: calc(var(--wrap) - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter));
}
.contact .hero__cta { justify-content: center; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding-block: 32px 40px; }
.footer p { margin: 0; }
.footer a:hover { color: var(--fg); }

/* ---------- Lightbox ---------- */
.lightbox {
  padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(4, 7, 10, .88); backdrop-filter: blur(6px); }
.lightbox img { max-width: 94vw; max-height: 88vh; width: auto; border-radius: var(--r); border: 1px solid var(--line-hi); }
.lightbox__close {
  position: absolute; top: -52px; right: 0;
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line-hi); background: var(--card); color: var(--fg); cursor: pointer;
}
.lightbox[open] { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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