:root {
  --bg: #05050a;
  --bg-elevated: #0b0b14;
  --text-primary: #f4f4f8;
  --text-muted: #a4a4b8;
  --text-dim: #6b6b85;

  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #22d3ee;

  --gradient-primary: linear-gradient(135deg, var(--accent-purple), var(--accent-blue), var(--accent-cyan));
  --border-subtle: rgba(255, 255, 255, 0.08);

  --font-heading: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;

  --header-height: 4.5rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

section[id] {
  scroll-margin-top: var(--header-height);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--text-muted); }

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

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.gradient-text {
  color: var(--accent-blue);
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

/* background glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
}

.bg-glow::before {
  top: -20vmax;
  left: -15vmax;
  background: radial-gradient(circle, var(--accent-purple), transparent 70%);
}

.bg-glow::after {
  bottom: -25vmax;
  right: -15vmax;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
}

@media (max-width: 640px) {
  .bg-glow::before, .bg-glow::after {
    width: 90vmax;
    height: 90vmax;
    filter: blur(60px);
  }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #05050a;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(139, 92, 246, 0.55);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-small { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-large { padding: 1rem 2rem; font-size: 1.05rem; margin-bottom: 2rem; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

/* backdrop-filter lives on a pseudo-element, not .site-header itself —
   backdrop-filter on the header would make it the containing block for
   its position:fixed mobile nav-menu descendant, collapsing its height */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 5, 10, 0.75);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.2rem;
  height: 2.2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 60;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu a {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: var(--text-primary);
}

.nav-cta { display: none; }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-menu { position: static; flex-direction: row; background: none; padding: 0; height: auto; }
  .nav-cta { display: inline-flex; }
}

@media (max-width: 1023px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav-menu a {
    font-size: 1.5rem;
  }
}

/* hero */
.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  padding-block: 4rem;
}

.hero-inner { max-width: 760px; }

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin-bottom: 0.3em;
}

.hero-subhead {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  color: var(--text-primary);
  margin-bottom: 0.75em;
}

.hero-body {
  font-size: 1.05rem;
  max-width: 560px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* sections */
.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--border-subtle);
}

.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  max-width: 620px;
}

.section-subhead {
  max-width: 620px;
  font-size: 1.05rem;
}

/* about */
.about-bio {
  max-width: 760px;
  margin-bottom: 3rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.timeline-item {
  border-left: 2px solid var(--border-subtle);
  padding-left: 1.25rem;
}

.timeline-date {
  font-family: var(--font-heading);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4em;
}

.timeline-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.timeline-item p {
  font-size: 0.92rem;
  margin-bottom: 0;
}

.stack-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.stack-strip li {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
              var(--gradient-primary) border-box;
  border: 1px solid transparent;
  color: var(--text-muted);
}

/* services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.15);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.18));
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.card-icon svg { width: 24px; height: 24px; }

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6em;
}

.card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* projects */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
  overflow-x: hidden;
}

.project-item {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-item:nth-child(odd)  { --slide-x: -40px; }
.project-item:nth-child(even) { --slide-x: 40px; }

.project-item:hover, .project-item:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.15);
}

.project-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-body {
  padding: 1.75rem;
}

.project-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5em;
}

.project-body > p {
  font-size: 0.95rem;
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
}

.project-tags li {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-private {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (min-width: 768px) {
  .project-item {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .project-item:nth-child(even) .project-media { order: 2; }
  .project-item:nth-child(even) .project-body  { order: 1; }

  .project-media {
    aspect-ratio: auto;
    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
  }

  .project-item:nth-child(even) .project-media {
    border-right: none;
    border-left: 1px solid var(--border-subtle);
  }

  .project-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* contact */
.contact-inner {
  text-align: center;
  max-width: 640px;
}

.contact-inner .eyebrow,
.contact-inner h2,
.contact-inner .section-subhead {
  margin-inline: auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  color: var(--text-muted);
}

.footer-links a { transition: color 0.2s ease; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent-cyan); }

/* scroll-reveal: only hides content once JS has confirmed it can reveal it again */
.js .reveal {
  opacity: 0;
  transform: translate(var(--slide-x, 0), 16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
