:root {
  --bg: #05070a;
  --text: #e7f0ea;
  --muted: #b4c2ba;
  --faint: #8b9c94;
  --accent: #00ff9d;
  --accent-ink: #042117;
  --line: rgba(0, 255, 157, 0.22);
  --line-dim: rgba(231, 240, 234, 0.12);
  --panel: rgba(8, 12, 16, 0.84);
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --nav-h: 4.25rem;
  --wrap: 1120px;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100%;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.nav-lock {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

::selection {
  background: rgba(0, 255, 157, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 0.9rem;
  z-index: 20;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

#particles-js canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Layout shells stay click-through so the canvas keeps grab/click.
   Links, controls, and the small text panels opt back in. */
.site,
.site main,
.hero,
.hero-inner,
.hero-main,
.section,
.wrap,
.about-grid,
.contact-grid,
.projects,
.footer {
  pointer-events: none;
}

.site :is(a, button, input, textarea, label),
.skip-link,
.scope,
.copy-panel,
.spec,
.filters,
.project-card,
.contact-form,
.footer-inner,
.nav.is-open .nav-links,
.lightbox {
  pointer-events: auto;
}

.site {
  position: relative;
  z-index: 1;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.nav.is-scrolled {
  background: rgba(5, 7, 10, 0.55);
  border-bottom-color: var(--line-dim);
}

.nav.is-open {
  background: #05070a;
  border-bottom-color: var(--line-dim);
}

.nav-inner {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.logo-mark {
  width: 1.35rem;
  height: 0.85rem;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 40% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 100% / 2px 80% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 100% / 2px 55% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 12px 100% / 2px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 16px 100% / 2px 45% no-repeat;
  filter: drop-shadow(0 0 4px rgba(0, 255, 157, 0.65));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.75rem;
  border-radius: 2px;
}

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

.nav-links a.is-active {
  color: var(--accent);
}

.nav-index {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin-right: 0.4rem;
  color: var(--faint);
}

.nav-links a.is-active .nav-index {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span:nth-child(2) { top: 15px; }
.nav-toggle span:nth-child(3) { top: 21px; }
.nav-toggle span:nth-child(4) { top: 27px; }

.nav.is-open .nav-toggle span:nth-child(2) {
  transform: translateY(6px) rotate(45deg);
}

.nav.is-open .nav-toggle span:nth-child(3) {
  opacity: 0;
}

.nav.is-open .nav-toggle span:nth-child(4) {
  transform: translateY(-6px) rotate(-45deg);
}

.hero {
  min-height: 100svh;
  display: flex;
}

.hero-inner {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-h) + 1.5rem);
  padding-bottom: 1.75rem;
}

.hero-main {
  margin: auto 0;
  display: grid;
  gap: 1.75rem;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.led {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.7);
  animation: pulse 2.4s ease-out infinite;
}

.eyebrow-sep {
  color: var(--faint);
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3.1rem, 9.2vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.hero-role {
  max-width: 36rem;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--text);
  letter-spacing: 0.01em;
}

.hero-role span {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-primary:hover {
  background: #b8ffdf;
}

.btn-ghost {
  background: rgba(5, 7, 10, 0.35);
  border-color: var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.92rem;
}

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

.scope {
  border: 1px solid var(--line);
  background: rgba(4, 8, 10, 0.62);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.scope-bar,
.meters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.scope-screen {
  position: relative;
  height: 96px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.4);
  background-image:
    linear-gradient(rgba(0, 255, 157, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 157, 0.08) 1px, transparent 1px);
  background-size: 100% 24px, 48px 100%;
  border-block: 1px solid rgba(0, 255, 157, 0.12);
}

.scope-screen svg {
  width: 100%;
  height: 100%;
}

.scope-trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.scope-trace-ghost {
  opacity: 0.28;
  transform: translate(8px, 4px);
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 255, 157, 0.9);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.8);
  animation: scan 5.5s linear infinite;
}

.meters {
  justify-content: stretch;
  height: 42px;
  gap: 3px;
  align-items: flex-end;
  padding-bottom: 0.55rem;
}

.meters span {
  flex: 1;
  height: 100%;
  transform-origin: bottom;
  background: linear-gradient(to top, rgba(0, 255, 157, 0.95), rgba(0, 255, 157, 0.25));
  transform: scaleY(var(--h));
  animation: meter 1.8s ease-in-out infinite;
  animation-delay: var(--d);
  opacity: 0.85;
}

.scroll-cue {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.scroll-cue-line {
  width: 3.25rem;
  height: 1px;
  background: currentColor;
}

.section {
  scroll-margin-top: var(--nav-h);
  padding: clamp(4.5rem, 9vw, 7rem) 0;
  background: transparent;
  border-top: 1px solid rgba(231, 240, 234, 0.08);
}

.section-index {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.8rem;
}

.section-lead {
  max-width: 38rem;
  color: var(--muted);
  margin-bottom: 2rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75);
}

.section h2,
.contact-lead,
.contact-list {
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.65);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid var(--line-dim);
  color: var(--muted);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.project-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-dim);
  border-left: 2px solid rgba(0, 255, 157, 0.45);
  min-width: 0;
}

.project-card:hover,
.project-card:focus-within {
  border-left-color: var(--accent);
}

.project-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.project-card:hover img,
.project-card:focus-within img {
  transform: scale(1.045);
  filter: saturate(1) contrast(1.05);
}

.project-body {
  padding: 0.95rem 1rem 1rem;
  display: grid;
  gap: 0.55rem;
}

.project-kicker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.project-category {
  color: var(--accent);
}

.project-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.waveform {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
}

.waveform i {
  display: block;
  flex: 1;
  height: 100%;
  background: var(--accent);
  opacity: 0.8;
  transform-origin: bottom;
  transform: scaleY(var(--h));
  animation: meter 1.7s ease-in-out infinite;
  animation-delay: var(--d);
}

.project-open {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.project-open:focus-visible {
  outline-offset: -3px;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.about-copy {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.35rem;
}

.copy-panel {
  background: rgba(5, 7, 10, 0.42);
  border: 1px solid rgba(231, 240, 234, 0.08);
  padding: 1rem 1.15rem;
}

.about-copy p,
.contact-lead {
  color: var(--text);
  font-size: 1.08rem;
}

.about-copy p {
  color: #d5e2db;
  max-width: 40rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75);
}

.spec {
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(4, 8, 10, 0.55);
}

.spec div {
  padding: 1rem 1.05rem 1.05rem;
  border-top: 1px solid var(--line-dim);
}

.spec div:first-child {
  border-top: 0;
}

.spec dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.spec dd {
  margin: 0;
  color: var(--text);
}

.spec a {
  color: var(--text);
  text-decoration-thickness: 1px;
}

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

.contact-lead {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.contact-list a,
.contact-list span {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

.contact-list a:hover {
  color: var(--accent);
}

.contact-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.15rem;
}

/* TODO: profiles have no real URLs yet. Remove [hidden] and set each href
   before showing them. */
.social-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.social-links[hidden] {
  display: none !important;
}

.social-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dim);
  color: var(--text);
  text-decoration: none;
}

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

.social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.contact-form {
  background: var(--panel);
  border: 1px solid var(--line-dim);
  padding: clamp(1.15rem, 2.5vw, 1.75rem);
  display: grid;
  gap: 0.95rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(231, 240, 234, 0.16);
  border-radius: 2px;
  padding: 0.8rem 0.85rem;
  font-size: 1rem;
}

.form-field textarea {
  min-height: 150px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.16);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
}

.form-note,
.form-status {
  color: var(--faint);
  font-size: 0.88rem;
  margin: 0;
}

.form-status:empty {
  display: none;
}

.btn-submit {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  font-weight: 600;
  min-width: 11rem;
}

.btn-submit:hover {
  background: #b8ffdf;
}

.footer {
  background: transparent;
  border-top: 1px solid rgba(231, 240, 234, 0.08);
  padding: 1.4rem 0 1.6rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.back-top {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.lightbox {
  width: min(720px, calc(100% - 2rem));
  max-height: min(90svh, 860px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: #0b1014;
  color: var(--text);
  overflow: auto;
}

.lightbox-frame {
  position: relative;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background: #000;
}

.lightbox-body {
  padding: 1.25rem 1.3rem 1.5rem;
  display: grid;
  gap: 0.7rem;
}

.lightbox-category {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.lightbox-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lightbox-desc {
  color: var(--muted);
  max-width: 40rem;
}

.lightbox-desc:empty,
.lightbox-desc[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 255, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 157, 0); }
}

@keyframes scan {
  from { left: 0; }
  to { left: 100%; }
}

@keyframes meter {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(var(--h)); }
}

@media (max-width: 980px) {
  .projects {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-block;
    z-index: 2;
  }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    z-index: 9;
    background: #05070a;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.25rem 1.25rem 2rem;
    gap: 0.25rem;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav.is-open .nav-links {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
  }

  .nav-links a {
    font-size: 1.35rem;
    padding: 0.85rem 0.2rem;
    width: 100%;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(2.35rem, 11.2vw, 4.5rem);
  }
}

@media (max-width: 380px) {
  .wrap,
  .nav-inner {
    width: min(var(--wrap), calc(100% - 1.5rem));
  }

  .hero-actions,
  .form-actions {
    align-items: stretch;
  }

  .hero-actions .btn,
  .btn-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .meters span,
  .waveform i {
    transform: scaleY(var(--h));
  }

  .project-card:hover img,
  .project-card:focus-within img {
    transform: none;
  }
}
