/* ============================================
   DESIGN TOKENS — Berlin Underground / Night Vision
   Ported from waveform-playlist's dark mode
   ============================================ */
:root {
  /* Backgrounds */
  --bg: #0a0a0f;
  --surface: #12121a;
  --navbar-bg: rgba(10, 10, 15, 0.95);

  /* Primary accent — Ampelmännchen green */
  --primary: #63c75f;
  --primary-dark: #52b84e;
  --primary-light: #78d074;

  /* Text — warm amber, night-vision preserving */
  --text: #d8c0a8;
  --text-secondary: #a89078;

  /* Headings — deep red with text-shadow glow */
  --heading-h1: #d08070;
  --heading-h2: #c87060;
  --heading-h4: #c8a888;
  --glow-strong: rgba(180, 60, 40, 0.5);
  --glow-medium: rgba(200, 80, 50, 0.3);
  --glow-subtle: rgba(180, 80, 60, 0.25);

  /* Borders */
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* Type */
  --font-base: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --container-width: 1100px;
  --gutter: 2rem;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-base);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  color: var(--heading-h1);
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: -0.03em;
  text-shadow: 0 0 60px var(--glow-strong), 0 0 30px var(--glow-medium);
}

h2 {
  color: var(--heading-h2);
  font-size: 1.5rem;
  text-shadow: 0 0 25px var(--glow-medium);
}

h3 {
  color: var(--heading-h2);
  font-size: 1.2rem;
  text-shadow: 0 0 20px var(--glow-subtle);
}

h4 {
  color: var(--heading-h4);
  font-size: 1rem;
  text-shadow: 0 0 15px var(--glow-subtle);
}

a {
  color: var(--primary);
  text-decoration: none;
}

p {
  margin-bottom: 1rem;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

::selection {
  background: var(--primary);
  color: var(--bg);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Full-width content with side gutters. Everything anchors at the
   gutter so the whole page reads as one left-aligned column. */
.container {
  width: 100%;
  padding: 0 var(--gutter);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 var(--gutter);
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
  font-size: 0.95rem;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-links a {
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar-links a:hover {
  color: var(--primary);
}

/* Mobile menu toggle — hidden on desktop, shown on mobile via media query */
.navbar-toggle {
  display: none;
  align-items: center;
  background: transparent;
  border: 2px solid var(--text-secondary);
  color: var(--text);
  font-family: var(--font-base);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.navbar-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: 6rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 var(--gutter);
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.footer-support {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.footer-support:hover {
  color: var(--primary);
}

.footer-support-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 0 4rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 80%, rgba(99, 199, 95, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(208, 128, 112, 0.04) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0f 0%, #0f0f18 50%, #0a0a0f 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
}

.hero-eq {
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 25%;
  height: 30%;
  opacity: 0.35;
}

.eq-bar {
  fill: var(--primary);
  opacity: 0.4;
  transform-origin: center bottom;
  animation: eq-pulse 1.4s ease-in-out infinite;
}
.eq-bar:nth-child(1) { animation-delay: 0.0s; }
.eq-bar:nth-child(2) { animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.3s; }
.eq-bar:nth-child(5) { animation-delay: 0.4s; }
.eq-bar:nth-child(6) { animation-delay: 0.5s; }
.eq-bar:nth-child(7) { animation-delay: 0.6s; }
.eq-bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes eq-pulse {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

.hero-circle {
  position: absolute;
  top: 10%;
  right: 5%;
  width: 18%;
  height: auto;
  opacity: 0.5;
}

.pulse-ring {
  transform-origin: center;
  animation: pulse-ring 4s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%      { transform: scale(1.15); opacity: 0.1; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-staff {
  margin: 0 auto 1.5rem;
  max-width: 520px;
  min-height: 140px;
}

.hero-name {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15em;
  font-size: clamp(3rem, 9vw, 5.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.name-group {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: inherit;
}

.name-space {
  width: 0.6em;
}

.name-letter {
  background: none;
  border: none;
  padding: 0.05em 0.1em;
  color: var(--heading-h1);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-shadow: 0 0 60px var(--glow-strong), 0 0 30px var(--glow-medium);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease, text-shadow 0.2s ease;
  border-radius: 0;
}

.name-letter:hover {
  color: var(--primary);
  outline: none;
}

.name-letter:focus-visible {
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.name-letter.active {
  color: var(--primary-light);
  transform: translateY(-4px);
  text-shadow: 0 0 40px var(--primary), 0 0 16px var(--primary);
}

.hero-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0;
  margin-bottom: 2rem;
}

/* PLAY BUTTON — brutalist primary */
.play-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: var(--font-base);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.play-button:hover {
  background: var(--primary);
  color: var(--bg);
  transform: translateY(-2px);
}

.play-button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--bg);
}

.play-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* ============================================
   NUMBERED SECTION HEADERS
   ============================================ */
.numbered-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-number {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.section-number::after {
  content: ' /';
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.section-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-subtitle {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-left: auto;
}

/* ============================================
   ABOUT
   ============================================ */
.about-bio {
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 720px;
  color: var(--text);
}

.about-bio em {
  font-style: italic;
  color: var(--text);
}

/* ============================================
   PROJECTS
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 500px));
  gap: 2rem;
}

.project-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

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

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

.project-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-body p {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
}

.project-links {
  display: flex;
  gap: 1.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-links a {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ============================================
   LINK UNDERLINE GROW (in body content only)
   ============================================ */
.numbered-section p a {
  background-image: linear-gradient(var(--primary), var(--primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease;
  padding-bottom: 2px;
}

.numbered-section p a:hover {
  background-size: 100% 2px;
}

/* ============================================
   VEXFLOW STAFF
   ============================================ */
.hero-staff svg {
  display: block;
  margin: 0 auto;
}

/* Default note color: warm amber on dark */
.hero-staff path,
.hero-staff text {
  fill: var(--text-secondary);
  stroke: var(--text-secondary);
}

/* Stave lines a touch dimmer */
.hero-staff .vf-stave path {
  stroke: var(--border-strong);
}

/* Active notehead: glow green for 400ms */
.hero-staff g.active path,
.hero-staff g.active {
  fill: var(--primary);
  stroke: var(--primary);
  filter: drop-shadow(0 0 10px var(--primary));
  transition: fill 0.1s ease, stroke 0.1s ease, filter 0.1s ease;
}

/* ============================================
   NAVBAR — collapse to MENU dropdown only on small phones
   ============================================ */
@media (max-width: 540px) {
  .navbar-toggle {
    display: inline-flex;
  }

  /* Menu collapses into a dropdown below the navbar */
  .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem var(--gutter);
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .navbar.is-open .navbar-links {
    display: flex;
  }

  .navbar.is-open .navbar-links li {
    border-top: 1px solid var(--border);
  }

  .navbar.is-open .navbar-links li:first-child {
    border-top: none;
  }

  .navbar.is-open .navbar-links a {
    display: block;
    padding: 0.85rem 0;
    font-size: 0.95rem;
  }
}

/* ============================================
   MOBILE — sections + hero scale down at the tablet breakpoint
   ============================================ */
@media (max-width: 768px) {
  :root {
    --gutter: 1.25rem;
  }

  /* Tighter navbar gap so the inline links pack closer when narrow */
  .navbar-links {
    gap: 1rem;
  }

  .hero {
    min-height: 70vh;
    padding: 4rem 0 3rem;
  }

  .hero-name {
    font-size: clamp(2.5rem, 12vw, 4rem);
    gap: 0.05em;
  }

  .hero-staff {
    max-width: 100%;
  }

  .hero-eq { width: 40%; }
  .hero-circle { width: 30%; }

  .section-header {
    flex-wrap: wrap;
  }

  .section-subtitle {
    margin-left: 0;
    width: 100%;
  }

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

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

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .eq-bar,
  .pulse-ring,
  .name-letter,
  .play-button,
  .project-card,
  .hero-staff g.active path,
  .hero-staff g.active {
    animation: none !important;
    transition: none !important;
  }

  .name-letter.active {
    color: var(--primary-light);
    transform: none;
    text-shadow: none;
  }

  .hero-staff g.active {
    filter: none;
  }
}
