/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
html {
  scroll-behavior: smooth;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0d12;
  --bg-elev: #141821;
  --bg-elev-2: #1a1f2b;
  --text: #e6e8ee;
  --text-muted: #9aa3b2;
  --border: #1f2430;
  --border-strong: #2a3142;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);

  --container: 1100px;
  --radius: 14px;
  --radius-sm: 8px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: rgba(11, 13, 18, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(11, 13, 18, 0.85);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.nav__logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--grad);
  color: white;
  font-size: 0.9rem;
}
.nav__links {
  display: flex;
  gap: var(--space-3);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.nav__links a {
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-6);
}
.hero__inner {
  max-width: 820px;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}
.hero__title {
  font-size: clamp(3rem, 7.5vw, 5.25rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-3);
}
.hero__lede {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  color: var(--text);
  max-width: 56ch;
  margin-bottom: var(--space-3);
  line-height: 1.45;
}
.hero__now {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--space-4);
  line-height: 1.5;
}
.hero__now-mark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-right: 0.6rem;
  padding-right: 0.6rem;
  border-right: 1px solid var(--border-strong);
  position: relative;
  top: -1px;
}
.hero__cta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--grad);
  color: #0b0d12;
  box-shadow: 0 8px 24px -10px rgba(124, 92, 255, 0.6);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(124, 92, 255, 0.7);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}
.btn--lg {
  padding: 0.95rem 1.6rem;
  font-size: 1rem;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-6) 0;
}
.section--alt {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section__header {
  margin-bottom: var(--space-4);
}
.section__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.section__title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- About ---------- */
.about {
  max-width: 68ch;
}
.about__bio p + p {
  margin-top: var(--space-2);
}
.about__bio {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}
.about__bio p:first-child {
  color: var(--text);
}

/* ---------- Selected Work ---------- */
.work {
  display: grid;
  gap: var(--space-4);
}
.work__item {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.work__item:first-child {
  padding-top: var(--space-3);
  border-top: none;
}
.work__meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-2);
}
.work__headline {
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: var(--space-2);
  max-width: 64ch;
}
.work__body {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 70ch;
}
.work__tech {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  letter-spacing: 0.02em;
}
.work__item--brief {
  padding-top: var(--space-3);
}
.work__item--brief .work__body {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---------- Stack ---------- */
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  max-width: 100%;
}
.stack__row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.stack__row::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.stack__row:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -18px rgba(124, 92, 255, 0.45);
}
.stack__row:hover::before {
  opacity: 1;
}
.stack dt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stack dt::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--grad);
  flex-shrink: 0;
}
.stack dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}
.stack__chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  letter-spacing: -0.005em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.stack__chip:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.14);
}

/* ---------- Contact ---------- */
.contact {
  max-width: 640px;
}
.contact .section__header {
  margin-bottom: var(--space-3);
}
.contact__lede {
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-size: 1.05rem;
  line-height: 1.6;
}
.contact .btn {
  display: inline-flex;
}
.socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.socials a {
  transition: color 0.2s ease;
}
.socials a:hover {
  color: var(--text);
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer__inner {
  display: flex;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav__links {
    gap: var(--space-2);
    font-size: 0.88rem;
  }
  .nav__logo-text {
    display: none;
  }
  .hero {
    padding: var(--space-5) 0;
  }
  .hero__now-mark {
    display: inline-block;
    margin-bottom: 0.25rem;
  }
  .section {
    padding: var(--space-5) 0;
  }
  .work {
    gap: var(--space-3);
  }
  .work__item {
    padding-top: var(--space-3);
  }
}
