:root {
  --bg: #0a0a0c;
  --bg-strong: #141418;
  --surface: rgba(20, 20, 24, 0.68);
  --surface-strong: #1a1a20;
  --ink: #e8e8e8;
  --muted: #888888;
  --line: rgba(0, 255, 65, 0.15);
  --accent: #00ff41;
  --accent-dark: #00cc33;
  --accent-light: #4dff8c;
  --forest: #0d3d1f;
  --cyan: #00d4ff;
  --shadow: 0 30px 80px rgba(0, 255, 65, 0.08);
  --glow-sm: 0 0 10px rgba(0, 255, 65, 0.3);
  --glow-md: 0 0 20px rgba(0, 255, 65, 0.2);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 255, 65, 0.06), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(0, 212, 255, 0.04), transparent 26%),
    linear-gradient(180deg, #0f0f12 0%, #0a0a0c 52%, #050507 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 80%);
}

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

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

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  margin-bottom: 2.5rem;
  padding: 1rem 1.25rem;
  background: rgba(20, 20, 24, 0.76);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--glow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  tracking: 0.1em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
  transition: color 200ms ease;
}

.hero,
.section-grid,
.contrast-band,
.cta-section,
.quote-block,
.featured-strip,
.terminal-section,
.infrastructure-section {
  margin-bottom: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.featured-strip,
.quote-block,
.cta-section,
.terminal-section {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--glow-sm);
}

.hero-copy {
  padding: 4.25rem;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.hero h1 span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-text {
  max-width: 62ch;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--bg);
  box-shadow: 0 16px 30px rgba(0, 255, 65, 0.24);
}

.button-primary:hover {
  box-shadow: 0 20px 40px rgba(0, 255, 65, 0.36);
}

.button-secondary {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--line);
  color: var(--accent);
}

.button-secondary:hover {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: var(--glow-md);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 1.4rem;
  background: radial-gradient(circle at 60% 30%, rgba(0, 255, 65, 0.1), transparent 40%),
              linear-gradient(135deg, #0d3d1f 0%, #0a0a0c 100%);
  color: var(--accent);
}

.pulsing-heart {
  width: 100%;
  height: 100%;
  max-width: 250px;
  max-height: 250px;
  filter: drop-shadow(0 0 15px rgba(0, 255, 65, 0.3));
}

.heart-glass {
  animation: heartPulse 1.2s ease-in-out infinite;
}

.heart-glow {
  animation: heartGlow 1.2s ease-in-out infinite;
}

.chamber-aortic {
  animation: chamberPulseAortic 1.2s ease-in-out infinite;
}

.chamber-mitral {
  animation: chamberPulseMitral 1.2s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes heartGlow {
  0%, 100% {
    opacity: 0.15;
    filter: blur(1px);
  }
  50% {
    opacity: 0.25;
    filter: blur(2px);
  }
}

@keyframes chamberPulseAortic {
  0%, 100% {
    r: 12px;
    opacity: 0.4;
  }
  50% {
    r: 16px;
    opacity: 0.8;
  }
}

@keyframes chamberPulseMitral {
  0%, 100% {
    r: 14px;
    opacity: 0.4;
  }
  50% {
    r: 18px;
    opacity: 0.8;
  }
}

.featured-strip {
  padding: 1.35rem 1.5rem;
}

.featured-strip p {
  text-align: center;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.4;
}

.section-grid,
.terminal-section,
.infrastructure-section,
.cta-section {
  padding: 2rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  max-width: 16ch;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

/* ALIGNMENT SECTION */
.alignment-container {
  display: grid;
  gap: 2rem;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.mixing-channel {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 24, 0.8);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.channel-label {
  color: var(--accent);
  font-weight: 700;
}

.channel-freq {
  color: var(--muted);
  font-size: 0.75rem;
}

.vu-meter {
  width: 100%;
  height: 200px;
}

.meter-background {
  opacity: 0.6;
}

.meter-fill {
  animation: meterFlicker 0.5s ease-in-out infinite;
}

.aortic-fill {
  animation-delay: 0s;
}

.pulmonic-fill {
  animation-delay: 0.1s;
}

.tricuspid-fill {
  animation-delay: 0.2s;
}

.mitral-fill {
  animation-delay: 0.15s;
}

@keyframes meterFlicker {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.9;
  }
}

.cross-attention-module {
  padding: 2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 212, 255, 0.05));
  border: 2px solid var(--line);
  text-align: center;
  position: relative;
}

.cross-attention-module::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-md);
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.cross-attention-module:hover::before {
  opacity: 0.5;
}

.module-header {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.module-core {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.2);
  margin-bottom: 1rem;
}

.attention-node {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--accent-light);
}

.module-footer {
  font-size: 0.85rem;
  color: var(--muted);
}

/* VALIDATION SECTION */
.spec-table {
  display: grid;
  gap: 1rem;
}

.spec-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  padding: 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 24, 0.9);
  border: 1px solid rgba(0, 255, 65, 0.2);
  position: relative;
  overflow: hidden;
}

.spec-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 255, 65, 0.03) 50%, transparent 100%);
  pointer-events: none;
}

.spec-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(0, 212, 255, 0.1));
  border: 1px solid var(--line);
  min-width: 140px;
}

.spec-label-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.spec-metric {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.spec-desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.spec-name {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.spec-detail {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* TERMINAL SECTION */
.terminal-section {
  background: var(--bg-strong);
}

.terminal-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.terminal-screen {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: #000000;
  border: 2px solid var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1), 0 0 20px rgba(0, 255, 65, 0.2);
  min-height: 280px;
}

.terminal-line {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  opacity: 0;
  animation: terminalFadeIn 0.6s ease-out forwards;
}

.terminal-prompt {
  color: var(--accent);
  min-width: 1.5ch;
  user-select: none;
}

.terminal-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-ready {
  animation-delay: 0s;
}

.terminal-stage-1 {
  animation-delay: 0.8s;
}

.terminal-stage-2 {
  animation-delay: 1.6s;
}

.terminal-stage-3 {
  animation-delay: 2.4s;
}

.terminal-result {
  animation-delay: 3.2s;
}

.terminal-confidence {
  animation-delay: 3.8s;
}

.highlight {
  color: #ffff00;
  font-weight: 700;
}

@keyframes terminalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.terminal-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.knob-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.knob {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: relative;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.knob::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 15px;
  background: var(--accent);
  border-radius: 2px;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.knob:hover {
  box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1), 0 0 15px rgba(0, 255, 65, 0.3);
}

/* INFRASTRUCTURE SECTION */
.infrastructure-section {
  background: var(--bg-strong);
}

.infra-content {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 2rem;
  align-items: center;
}

.infra-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.infra-text p:last-child {
  margin-bottom: 0;
}

.infra-text strong {
  color: var(--accent);
  font-weight: 700;
}

.infra-badge {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.infra-badge svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(0, 255, 65, 0.2));
}

.badge-circle {
  animation: rotateBadge 8s linear infinite;
}

@keyframes rotateBadge {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* QUOTE & CTA SECTIONS */
.quote-block {
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, #1a1a20, #0f0f12);
}

.quote-block p {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-style: italic;
  color: var(--accent-light);
  line-height: 1.4;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 212, 255, 0.05));
}

.cta-copy h2 {
  max-width: 13ch;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.cta-copy p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 50ch;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: min(100%, 18rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}

.footer-links a {
  text-decoration: underline;
  text-underline-offset: 0.16rem;
  color: var(--accent);
  transition: color 200ms ease;
}

.footer-links a:hover {
  color: var(--accent-light);
}

.legal-shell {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-page {
  padding: 2rem 0;
}

.legal-hero {
  margin-bottom: 2rem;
}

.legal-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.legal-card h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: var(--accent);
}

.legal-card p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 1rem;
}

.legal-note {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.listen-button-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.listen-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.15), rgba(0, 212, 255, 0.15));
  border: 2px solid var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.listen-button:hover {
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.4);
  transform: scale(1.05);
}

.listen-button:active {
  transform: scale(0.98);
}

.listen-button svg {
  width: 45px;
  height: 45px;
}

.button-ring {
  transition: all 300ms ease;
}

.listen-button.playing .button-ring {
  animation: ringPulse 0.8s ease-in-out infinite;
}

.play-icon {
  transition: opacity 200ms ease;
}

.listen-button.playing .play-icon {
  opacity: 0;
}

.frequency-bars {
  transition: opacity 200ms ease;
}

.listen-button.playing .frequency-bars {
  opacity: 1;
  animation: barAnimation 0.6s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% {
    r: 30px;
    opacity: 1;
  }
  50% {
    r: 35px;
    opacity: 0.5;
  }
}

@keyframes barAnimation {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.lissajous-scope {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.2));
  opacity: 0;
  transition: opacity 200ms ease;
}

.listen-button-container.listening .lissajous-scope {
  opacity: 1;
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE DESIGN */
@media (max-width: 980px) {
  .hero,
  .timeline,
  .card-grid,
  .cta-section,
  .channels-grid,
  .infra-content,
  .terminal-container {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
  }

  .hero-copy {
    padding: 2rem;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .spec-label {
    min-width: auto;
  }

  .cta-section {
    display: block;
  }

  .footer-meta {
    align-items: flex-start;
    margin-top: 0.8rem;
  }

  .cta-actions {
    margin-top: 1.5rem;
  }

  .terminal-controls {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
  }

  .infra-badge {
    max-width: 150px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .site-header {
    padding: 1rem;
    border-radius: 1.5rem;
  }

  .site-nav {
    display: none;
  }

  .hero-copy,
  .section-grid,
  .quote-block,
  .cta-section,
  .terminal-section,
  .infrastructure-section {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .hero-copy {
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
  }

  .hero-card {
    padding: 1rem;
  }

  .channels-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .spec-row {
    padding: 1rem;
  }

  .listen-button-container {
    bottom: 1rem;
    right: 1rem;
  }

  .listen-button {
    width: 70px;
    height: 70px;
  }

  .listen-button svg {
    width: 40px;
    height: 40px;
  }

  .lissajous-scope {
    width: 150px;
    height: 150px;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-end;
  }
}

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

  .reveal,
  .reveal.is-visible,
  .button,
  .heart-glass,
  .heart-glow,
  .chamber-aortic,
  .chamber-mitral,
  .meter-fill,
  .terminal-line,
  .ringPulse,
  .barAnimation {
    transition: none;
    transform: none;
    opacity: 1;
    animation: none;
  }
}
