/* mastering — style.css */

:root {
  --bg:     #080408;
  --bg-2:   #0d0610;
  --bg-3:   #120918;
  --accent:  #7b2fff;
  --accent-2:#b060ff;
  --cyan:    #00d4ff;
  --text:    #8a7a9a;
  --hi:      #e0d0f0;
  --muted:   rgba(224,208,240,0.4);
  --mono:    'JetBrains Mono', 'Courier New', monospace;
  --serif:   'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.8;
}

/* ── KEYFRAMES ────────── */

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

@keyframes pulse-bar {
  0%, 100% { transform: scaleY(0.3); opacity: 0.5; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

@keyframes waveform-drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes vu-glow {
  0%, 100% { box-shadow: 0 0 4px var(--accent); }
  50%       { box-shadow: 0 0 18px var(--accent-2), 0 0 40px rgba(123,47,255,0.3); }
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes level-sweep {
  0%   { width: 12%; }
  30%  { width: 78%; }
  50%  { width: 92%; }
  65%  { width: 55%; }
  80%  { width: 84%; }
  100% { width: 12%; }
}

@keyframes level-sweep-2 {
  0%   { width: 60%; }
  25%  { width: 88%; }
  50%  { width: 35%; }
  75%  { width: 95%; }
  100% { width: 60%; }
}

@keyframes clip-flash {
  0%, 90%, 100% { opacity: 0; }
  91%, 95%      { opacity: 1; }
}

/* ── HERO ────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* Frequency visualizer background */
.freq-viz {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 1rem;
  pointer-events: none;
  opacity: 0.22;
}

.freq-bar {
  width: 6px;
  border-radius: 2px 2px 0 0;
  transform-origin: bottom center;
  background: var(--accent);
}
.freq-bar:nth-child(3n)   { background: var(--accent-2); }
.freq-bar:nth-child(5n)   { background: var(--cyan); }
.freq-bar:nth-child(1)  { height: 45px;  animation: pulse-bar 3.2s ease-in-out infinite; animation-delay: 0s; }
.freq-bar:nth-child(2)  { height: 80px;  animation: pulse-bar 2.9s ease-in-out infinite; animation-delay: 0.2s; }
.freq-bar:nth-child(3)  { height: 120px; animation: pulse-bar 3.5s ease-in-out infinite; animation-delay: 0.1s; }
.freq-bar:nth-child(4)  { height: 60px;  animation: pulse-bar 2.8s ease-in-out infinite; animation-delay: 0.4s; }
.freq-bar:nth-child(5)  { height: 180px; animation: pulse-bar 3.8s ease-in-out infinite; animation-delay: 0.05s; }
.freq-bar:nth-child(6)  { height: 140px; animation: pulse-bar 3.1s ease-in-out infinite; animation-delay: 0.3s; }
.freq-bar:nth-child(7)  { height: 95px;  animation: pulse-bar 4.0s ease-in-out infinite; animation-delay: 0.15s; }
.freq-bar:nth-child(8)  { height: 220px; animation: pulse-bar 3.3s ease-in-out infinite; animation-delay: 0.6s; }
.freq-bar:nth-child(9)  { height: 160px; animation: pulse-bar 2.9s ease-in-out infinite; animation-delay: 0.25s; }
.freq-bar:nth-child(10) { height: 75px;  animation: pulse-bar 3.6s ease-in-out infinite; animation-delay: 0.45s; }
.freq-bar:nth-child(11) { height: 200px; animation: pulse-bar 3.0s ease-in-out infinite; animation-delay: 0.1s; }
.freq-bar:nth-child(12) { height: 130px; animation: pulse-bar 3.9s ease-in-out infinite; animation-delay: 0.35s; }
.freq-bar:nth-child(13) { height: 50px;  animation: pulse-bar 2.8s ease-in-out infinite; animation-delay: 0.55s; }
.freq-bar:nth-child(14) { height: 170px; animation: pulse-bar 3.4s ease-in-out infinite; animation-delay: 0.2s; }
.freq-bar:nth-child(15) { height: 110px; animation: pulse-bar 3.7s ease-in-out infinite; animation-delay: 0.4s; }
.freq-bar:nth-child(16) { height: 85px;  animation: pulse-bar 3.2s ease-in-out infinite; animation-delay: 0.0s; }
.freq-bar:nth-child(17) { height: 145px; animation: pulse-bar 4.1s ease-in-out infinite; animation-delay: 0.3s; }
.freq-bar:nth-child(18) { height: 195px; animation: pulse-bar 3.0s ease-in-out infinite; animation-delay: 0.15s; }
.freq-bar:nth-child(19) { height: 70px;  animation: pulse-bar 3.8s ease-in-out infinite; animation-delay: 0.5s; }
.freq-bar:nth-child(20) { height: 120px; animation: pulse-bar 2.9s ease-in-out infinite; animation-delay: 0.25s; }
.freq-bar:nth-child(21) { height: 160px; animation: pulse-bar 3.5s ease-in-out infinite; animation-delay: 0.1s; }
.freq-bar:nth-child(22) { height: 90px;  animation: pulse-bar 3.3s ease-in-out infinite; animation-delay: 0.4s; }
.freq-bar:nth-child(23) { height: 210px; animation: pulse-bar 3.6s ease-in-out infinite; animation-delay: 0.2s; }
.freq-bar:nth-child(24) { height: 55px;  animation: pulse-bar 4.2s ease-in-out infinite; animation-delay: 0.35s; }
.freq-bar:nth-child(25) { height: 175px; animation: pulse-bar 3.1s ease-in-out infinite; animation-delay: 0.05s; }
.freq-bar:nth-child(26) { height: 100px; animation: pulse-bar 3.4s ease-in-out infinite; animation-delay: 0.45s; }
.freq-bar:nth-child(27) { height: 135px; animation: pulse-bar 2.9s ease-in-out infinite; animation-delay: 0.6s; }
.freq-bar:nth-child(28) { height: 185px; animation: pulse-bar 3.7s ease-in-out infinite; animation-delay: 0.1s; }
.freq-bar:nth-child(29) { height: 65px;  animation: pulse-bar 3.2s ease-in-out infinite; animation-delay: 0.3s; }
.freq-bar:nth-child(30) { height: 150px; animation: pulse-bar 3.9s ease-in-out infinite; animation-delay: 0.2s; }
.freq-bar:nth-child(31) { height: 105px; animation: pulse-bar 3.1s ease-in-out infinite; animation-delay: 0.55s; }
.freq-bar:nth-child(32) { height: 190px; animation: pulse-bar 3.5s ease-in-out infinite; animation-delay: 0.0s; }
.freq-bar:nth-child(33) { height: 80px;  animation: pulse-bar 4.0s ease-in-out infinite; animation-delay: 0.4s; }
.freq-bar:nth-child(34) { height: 165px; animation: pulse-bar 3.3s ease-in-out infinite; animation-delay: 0.15s; }
.freq-bar:nth-child(35) { height: 115px; animation: pulse-bar 2.8s ease-in-out infinite; animation-delay: 0.35s; }
.freq-bar:nth-child(36) { height: 200px; animation: pulse-bar 3.6s ease-in-out infinite; animation-delay: 0.25s; }
.freq-bar:nth-child(37) { height: 50px;  animation: pulse-bar 3.0s ease-in-out infinite; animation-delay: 0.5s; }
.freq-bar:nth-child(38) { height: 140px; animation: pulse-bar 3.8s ease-in-out infinite; animation-delay: 0.1s; }
.freq-bar:nth-child(39) { height: 95px;  animation: pulse-bar 3.4s ease-in-out infinite; animation-delay: 0.3s; }
.freq-bar:nth-child(40) { height: 170px; animation: pulse-bar 3.2s ease-in-out infinite; animation-delay: 0.2s; }

.hero-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--hi);
  text-align: center;
  text-shadow: 0 0 80px rgba(123,47,255,0.25);
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.hero-title em {
  font-style: italic;
  color: var(--accent-2);
}

.hero-sub {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 520px;
  text-align: center;
  line-height: 1.75;
  position: relative;
  z-index: 2;
  margin-bottom: 3rem;
}

.hero-meter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 2;
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.68rem;
}
.meter-label {
  width: 40px;
  text-align: right;
  color: var(--muted);
  flex-shrink: 0;
}
.meter-track {
  flex: 1;
  height: 6px;
  background: rgba(123,47,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.meter-fill {
  height: 100%;
  border-radius: 2px;
  position: relative;
}
.meter-fill-l {
  background: linear-gradient(to right, #7b2fff, #b060ff, #00d4ff);
  animation: level-sweep 5s ease-in-out infinite;
}
.meter-fill-r {
  background: linear-gradient(to right, #7b2fff, #b060ff, #00d4ff);
  animation: level-sweep-2 5s ease-in-out infinite;
}
.meter-clip {
  width: 6px;
  height: 6px;
  background: #ff4040;
  border-radius: 1px;
  margin-left: 4px;
  flex-shrink: 0;
  animation: clip-flash 5s ease-in-out infinite;
}
.meter-db {
  width: 38px;
  color: var(--accent);
  text-align: right;
  flex-shrink: 0;
  font-size: 0.62rem;
}

/* ── WAVEFORM DIVIDER ────────── */

.wave-divider {
  width: 100%;
  overflow: hidden;
  height: 28px;
  position: relative;
  opacity: 0.2;
}
.wave-divider svg {
  position: absolute;
  left: 0;
  animation: waveform-drift 20s linear infinite;
  width: 200%;
}

/* ── SECTIONS ────────── */

.s {
  padding: 5rem 2rem;
  border-top: 1px solid rgba(123,47,255,0.06);
}
.s-2 { background: var(--bg-2); }
.s-3 { background: var(--bg-3); }

.s-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.s-full { max-width: 980px; margin: 0 auto; }

.sec-label {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 1.2rem;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--hi);
  margin-bottom: 1.2rem;
}

h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--hi);
  margin-bottom: 0.8rem;
}

p { margin-bottom: 1rem; font-size: 0.9rem; }

.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent-2);
  border-left: 1px solid rgba(176,96,255,0.2);
  padding-left: 1.2rem;
  margin-top: 1.5rem;
  line-height: 1.55;
  opacity: 0.9;
}

/* ── TECH BOX ────────── */

.tech-box {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(123,47,255,0.05);
  border: 1px solid rgba(123,47,255,0.15);
  border-radius: 3px;
  padding: 1.4rem;
  line-height: 2;
}
.tech-box-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 0.8rem;
}
.tech-key   { color: var(--accent-2); }
.tech-val   { color: var(--hi); }
.tech-dim   { color: rgba(224,208,240,0.3); }
.tech-hi    { color: var(--cyan); }

/* ── TIMELINE ────────── */

.timeline {
  position: relative;
  max-width: 980px;
  margin: 2rem auto 0;
}
.timeline-track {
  position: relative;
  padding-left: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-track::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(123,47,255,0.4), rgba(0,212,255,0.4), transparent);
}
.tl-item {
  position: relative;
  padding: 1.2rem 0 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(123,47,255,0.05);
}
.tl-item:last-child { border: none; }
.tl-dot {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid rgba(123,47,255,0.4);
  box-shadow: 0 0 8px rgba(123,47,255,0.4);
}
.tl-dot.peak { background: #ff4040; box-shadow: 0 0 10px rgba(255,64,64,0.5); }
.tl-dot.good { background: var(--cyan); box-shadow: 0 0 8px rgba(0,212,255,0.4); }
.tl-year {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 0.2rem;
}
.tl-title { font-size: 0.9rem; color: var(--hi); margin-bottom: 0.2rem; }
.tl-desc  { font-size: 0.82rem; color: var(--text); line-height: 1.7; }
.tl-lufs  {
  display: inline-block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  background: rgba(123,47,255,0.1);
  color: var(--accent-2);
  border: 1px solid rgba(123,47,255,0.2);
}
.tl-lufs.red { background: rgba(255,64,64,0.08); color: #ff7070; border-color: rgba(255,64,64,0.2); }
.tl-lufs.grn { background: rgba(0,212,255,0.08); color: var(--cyan); border-color: rgba(0,212,255,0.2); }

/* ── PLATFORM TABLE ────────── */

.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-top: 1.5rem;
}
.platform-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  border-bottom: 1px solid rgba(123,47,255,0.15);
}
.platform-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(123,47,255,0.06);
  color: var(--text);
  vertical-align: top;
}
.platform-table tr:hover td { background: rgba(123,47,255,0.03); }
.platform-table td:first-child { color: var(--hi); }
.platform-table .lufs-val {
  color: var(--cyan);
  font-size: 0.88rem;
}
.platform-table .lufs-note { font-size: 0.72rem; opacity: 0.65; margin-top: 0.2rem; }

/* ── VU METER DISPLAY ────────── */

.vu-display {
  background: var(--bg);
  border: 1px solid rgba(123,47,255,0.15);
  border-radius: 4px;
  padding: 1.5rem;
  animation: vu-glow 4s ease-in-out infinite;
}
.vu-header {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 1rem;
}
.vu-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
}
.vu-bar {
  flex: 1;
  border-radius: 1px 1px 0 0;
  transform-origin: bottom center;
}
.vu-bar:nth-child(1)  { height: 35%; background: #7b2fff; animation: pulse-bar 3.1s ease-in-out infinite; animation-delay: 0s; }
.vu-bar:nth-child(2)  { height: 68%; background: #7b2fff; animation: pulse-bar 2.8s ease-in-out infinite; animation-delay: 0.1s; }
.vu-bar:nth-child(3)  { height: 90%; background: #b060ff; animation: pulse-bar 3.4s ease-in-out infinite; animation-delay: 0.2s; }
.vu-bar:nth-child(4)  { height: 75%; background: #b060ff; animation: pulse-bar 3.0s ease-in-out infinite; animation-delay: 0.05s; }
.vu-bar:nth-child(5)  { height: 100%; background: #00d4ff; animation: pulse-bar 2.9s ease-in-out infinite; animation-delay: 0.3s; }
.vu-bar:nth-child(6)  { height: 82%; background: #b060ff; animation: pulse-bar 3.6s ease-in-out infinite; animation-delay: 0.15s; }
.vu-bar:nth-child(7)  { height: 60%; background: #7b2fff; animation: pulse-bar 3.2s ease-in-out infinite; animation-delay: 0.25s; }
.vu-bar:nth-child(8)  { height: 95%; background: #00d4ff; animation: pulse-bar 2.8s ease-in-out infinite; animation-delay: 0.4s; }
.vu-bar:nth-child(9)  { height: 72%; background: #b060ff; animation: pulse-bar 3.8s ease-in-out infinite; animation-delay: 0.1s; }
.vu-bar:nth-child(10) { height: 45%; background: #7b2fff; animation: pulse-bar 3.3s ease-in-out infinite; animation-delay: 0.35s; }
.vu-bar:nth-child(11) { height: 88%; background: #b060ff; animation: pulse-bar 3.1s ease-in-out infinite; animation-delay: 0.5s; }
.vu-bar:nth-child(12) { height: 55%; background: #7b2fff; animation: pulse-bar 4.0s ease-in-out infinite; animation-delay: 0.2s; }

.vu-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
}

/* ── AI TOOLS ────────── */

.ai-cards {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid rgba(123,47,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1.5rem;
}
.ai-card {
  background: var(--bg-2);
  padding: 1.2rem 1.5rem;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: start;
  border-bottom: 1px solid rgba(123,47,255,0.06);
  transition: background 0.2s;
}
.ai-card:last-child { border: none; }
.ai-card:hover { background: rgba(123,47,255,0.03); }

.ai-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--hi);
  margin-bottom: 0.2rem;
}
.ai-year {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--accent);
  opacity: 0.6;
}
.ai-desc { font-size: 0.85rem; line-height: 1.7; margin-bottom: 0.5rem; }
.ai-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(123,47,255,0.25);
  color: var(--accent-2);
  border-radius: 2px;
  margin-right: 0.3rem;
}

/* ── SPATIAL AUDIO ────────── */

.spatial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.spatial-card {
  padding: 1.2rem;
  background: rgba(123,47,255,0.04);
  border: 1px solid rgba(123,47,255,0.12);
  border-radius: 3px;
  transition: border-color 0.2s;
}
.spatial-card:hover { border-color: rgba(123,47,255,0.3); }
.spatial-name {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
.spatial-desc { font-size: 0.8rem; line-height: 1.65; }

/* ── CLOSE ────────── */

.s-close {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.close-inner { max-width: 600px; position: relative; z-index: 1; }
.close-bg-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.06;
  pointer-events: none;
}
.close-text {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--hi);
  margin-bottom: 1.5rem;
}
.close-sub  { font-size: 0.88rem; opacity: 0.55; margin-bottom: 2rem; line-height: 1.7; }
.close-meta { font-size: 0.62rem; letter-spacing: 0.2em; opacity: 0.18; }

/* ── CROSS-LINKS ────────── */

.crosslink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  text-decoration: none;
  border: 1px solid rgba(123,47,255,0.2);
  padding: 0.35rem 0.8rem;
  border-radius: 2px;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}
.crosslink:hover {
  border-color: rgba(123,47,255,0.5);
  color: var(--hi);
}
.crosslink::before { content: '→'; color: var(--accent); }

/* ── FOOTER ────────── */

.site-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.7rem;
  border-top: 1px solid rgba(123,47,255,0.06);
}
.site-footer a { color: var(--accent-2); text-decoration: none; opacity: 0.35; }
.site-footer a:hover { opacity: 0.8; }

/* ── SPEC ROW ────────── */

.spec-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(123,47,255,0.05);
  font-size: 0.85rem;
}
.spec-row:last-child { border: none; }
.spec-key   { color: var(--muted); font-size: 0.78rem; min-width: 140px; }
.spec-val   { color: var(--hi); }
.spec-note  { color: var(--text); font-size: 0.75rem; opacity: 0.7; }

/* ── RESPONSIVE ────────── */

@media (max-width: 780px) {
  .s-inner     { grid-template-columns: 1fr; gap: 2rem; }
  .spatial-grid { grid-template-columns: 1fr; }
  .ai-card { grid-template-columns: 1fr; gap: 0.5rem; }
}
