:root {
  --bg: #0a0a0f;
  --bg-alt: #0e0e14;
  --surface: #12121a;
  --text: #e8e9ec;
  --text-muted: #7a7f8a;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.12);
  --accent-glow: rgba(0, 212, 170, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7);
  --radius: 4px;
  --radius-sm: 2px;
  --container: 1100px;
  --container-narrow: 760px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f1f4;
    --bg-alt: #e6e8ec;
    --surface: #ffffff;
    --text: #0a0a0f;
    --text-muted: #5a5f6a;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --accent: #008f72;
    --accent-dim: rgba(0, 143, 114, 0.08);
    --accent-glow: rgba(0, 143, 114, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.12);
  }
  .hero__eyebrow,
  .hero__name,
  .hero__tagline {
    text-shadow: 0 1px 20px rgba(240, 241, 244, 0.95), 0 0 40px rgba(240, 241, 244, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease, opacity 120ms ease;
}

a:hover,
a:focus-visible {
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0 0 var(--space-3);
}

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

.container--narrow {
  max-width: var(--container-narrow);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ───── Header / Nav ───── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(120%) blur(16px);
  -webkit-backdrop-filter: saturate(120%) blur(16px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border-strong);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--space-3);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: -0.01em;
  flex: 0 0 auto;
  font-family: var(--font-mono);
}

.nav__brand img {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
}

.nav__brand:hover {
  color: var(--accent);
}

.nav__links {
  list-style: none;
  display: flex;
  gap: clamp(0.25rem, 1.5vw, 1rem);
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav__toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 860px) {
  .nav__toggle {
    display: inline-flex;
  }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border-strong);
    padding: var(--space-3);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
  }
  .nav__links a {
    padding: 0.6rem 0.75rem;
  }
  .nav[data-open="true"] .nav__links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ───── Hero ───── */
.hero {
  position: relative;
  min-height: min(88svh, 760px);
  display: flex;
  align-items: center;
  padding: var(--space-7) 0 var(--space-6);
  overflow: hidden;
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 70% 20%, var(--accent-glow), transparent 60%),
    radial-gradient(ellipse 30% 30% at 10% 80%, var(--accent-dim), transparent 50%);
  z-index: -2;
  opacity: 0.5;
}

.hero__inner {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: var(--space-3);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.hero__name {
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 0.95;
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7);
}

.hero__tagline {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--text-muted);
  max-width: 48ch;
  margin-bottom: var(--space-5);
  line-height: 1.6;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.7);
}

.socials {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  width: 20px;
  height: 32px;
  border: 1.5px solid var(--text-muted);
  border-radius: 10px;
  opacity: 0.4;
}

.hero__scroll span {
  display: block;
  width: 2px;
  height: 6px;
  margin: 5px auto 0;
  background: var(--text-muted);
  border-radius: 1px;
  animation: scrollHint 1.6s ease-in-out infinite;
}

@keyframes scrollHint {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scroll span { animation: none; }
}

/* ───── Sections ───── */
.section {
  padding: var(--space-7) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: var(--space-2);
  position: relative;
  padding-bottom: var(--space-3);
  letter-spacing: -0.03em;
}

.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.section__lede {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  max-width: 60ch;
  font-size: 0.95rem;
}

.prose {
  font-size: 1rem;
  max-width: 65ch;
  color: var(--text);
}

.prose p {
  margin-bottom: var(--space-3);
}

/* ───── Work grid ───── */
.work-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-grid > .work-item--feature {
    grid-column: 1 / -1;
  }
}

.work-item {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-3);
  transition: border-color 150ms ease, background 150ms ease;
}

.work-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-dim) 40%, var(--surface));
}

.work-item__logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px;
}

.work-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.work-item__role {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.work-item__role a {
  color: inherit;
  border-bottom: 1px solid var(--accent);
}

.work-item__role a:hover {
  color: var(--accent);
}

.work-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.6;
}

/* ───── Awards ───── */
.awards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.award {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-3);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  transition: border-color 150ms ease;
}

.award:hover {
  border-color: var(--accent);
}

.award img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 4px;
}

.award h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.award__org {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 0.2rem;
}

.award__date {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.award p:last-child {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

/* ───── Featured ───── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms ease, background 150ms ease;
}

.feature:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-dim) 30%, var(--surface));
}

.feature__logo {
  height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 0.2rem;
}

.feature__logo img {
  max-height: 40px;
  max-width: 56%;
  object-fit: contain;
}

.feature__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
}

.feature__time {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.feature p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ───── Footer ───── */
.site-footer {
  border-top: 1px solid var(--border-strong);
  padding: var(--space-5) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.site-footer p {
  margin: 0;
}

/* ───── Scroll progress bar ───── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  pointer-events: none;
  transition: width 60ms linear;
}

/* ───── Scroll reveal animations ───── */
.work-item,
.award,
.feature,
.section__title,
.section__lede,
.prose {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.work-item.in-view,
.award.in-view,
.feature.in-view,
.section__title.in-view,
.section__lede.in-view,
.prose.in-view {
  opacity: 1;
  transform: translateY(0);
}

.work-grid .work-item:nth-child(2) { transition-delay: 0.05s; }
.work-grid .work-item:nth-child(3) { transition-delay: 0.1s; }
.work-grid .work-item:nth-child(4) { transition-delay: 0.12s; }
.work-grid .work-item:nth-child(5) { transition-delay: 0.14s; }
.work-grid .work-item:nth-child(6) { transition-delay: 0.16s; }
.work-grid .work-item:nth-child(7) { transition-delay: 0.18s; }
.work-grid .work-item:nth-child(8) { transition-delay: 0.2s; }
.work-grid .work-item:nth-child(9) { transition-delay: 0.22s; }

.feature-grid .feature:nth-child(2) { transition-delay: 0.04s; }
.feature-grid .feature:nth-child(3) { transition-delay: 0.08s; }
.feature-grid .feature:nth-child(4) { transition-delay: 0.12s; }
.feature-grid .feature:nth-child(5) { transition-delay: 0.16s; }
.feature-grid .feature:nth-child(6) { transition-delay: 0.2s; }

.awards .award:nth-child(2) { transition-delay: 0.06s; }
.awards .award:nth-child(3) { transition-delay: 0.12s; }
.awards .award:nth-child(4) { transition-delay: 0.18s; }

/* ───── Hero canvas parallax handled in JS ───── */

/* ───── Card hover glow ───── */
.work-item::before,
.feature::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.work-item,
.feature {
  position: relative;
  overflow: hidden;
}

.work-item:hover::before,
.feature:hover::before {
  opacity: 1;
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  .work-item,
  .award,
  .feature,
  .section__title,
  .section__lede,
  .prose {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-progress { display: none; }
  .hero::after { transform: none; }
}

@media (max-width: 540px) {
  body {
    font-size: 15px;
  }
  .nav__brand span {
    display: none;
  }
  .section {
    padding: var(--space-6) 0;
  }
  .hero {
    padding: var(--space-6) 0 var(--space-5);
    min-height: 78svh;
  }
  .work-item {
    grid-template-columns: 48px 1fr;
  }
  .work-item__logo {
    width: 48px;
    height: 48px;
  }
  .award {
    grid-template-columns: 56px 1fr;
    padding: var(--space-3);
  }
  .award img {
    width: 56px;
    height: 56px;
  }
}
