:root {
  color-scheme: dark;
  --bg: #080a12;
  --card: rgba(18, 23, 38, 0.82);
  --card-strong: rgba(27, 34, 54, 0.94);
  --text: #eef2ff;
  --muted: #aab4d4;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(139, 92, 246, 0.28), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.2), transparent 24rem),
    linear-gradient(135deg, #070913 0%, #101424 52%, #060811 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.hero {
  max-width: 760px;
  margin-right: auto;
  margin-bottom: 32px;
  margin-left: auto;
  text-align: center;
}

.eyebrow,
.kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-right: auto;
  margin-bottom: 18px;
  margin-left: auto;
  font-size: clamp(2.1rem, 5.4vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero p {
  max-width: 650px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.author {
  margin-bottom: 22px;
  color: var(--text);
  font-size: 1.14rem;
  font-weight: 700;
}

code {
  padding: 0.14rem 0.34rem;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.demo-card {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card-header,
.control-panel,
.sample-stage {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
}

.card-header {
  justify-content: center;
  margin-bottom: 24px;
  text-align: center;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.pill {
  flex: 0 0 auto;
  padding: 0.56rem 0.82rem;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.concept-button {
  min-height: 76px;
  padding: 18px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 22px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.concept-button:hover,
.concept-button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(34, 211, 238, 0.55);
}

.concept-button.is-active {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(34, 211, 238, 0.14)),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 139, 250, 0.8);
}

.concept-button strong {
  display: block;
  font-size: 1.12rem;
}

.concept-button span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.control-panel {
  padding: 24px;
  margin-bottom: 18px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 26px;
}

.alpha-readout {
  min-width: 128px;
}

.alpha-readout span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.alpha-readout strong {
  display: block;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.slider-wrap {
  width: 100%;
}

.slider-labels,
.tick-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.slider-labels {
  margin-bottom: 10px;
}

.tick-row {
  margin-top: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.sample-stage {
  align-items: stretch;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 28px;
}

.sample-meta {
  flex: 1 1 36%;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
}

.sample-meta p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.visualizer {
  display: flex;
  flex: 0 1 220px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.visualizer span {
  width: 12px;
  height: calc(28px + var(--bar, 1) * 12px);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  opacity: 0.85;
}

.visualizer span:nth-child(1) {
  --bar: 2;
}

.visualizer span:nth-child(2) {
  --bar: 5;
}

.visualizer span:nth-child(3) {
  --bar: 3;
}

.visualizer span:nth-child(4) {
  --bar: 7;
}

.visualizer span:nth-child(5) {
  --bar: 4;
}

.visualizer span:nth-child(6) {
  --bar: 6;
}

.visualizer span:nth-child(7) {
  --bar: 3;
}

.visualizer span:nth-child(8) {
  --bar: 5;
}

audio {
  align-self: center;
  width: min(360px, 100%);
}

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.links a {
  min-width: 74px;
  padding: 0.72rem 0.9rem;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.links a:hover,
.links a:focus-visible {
  outline: none;
  border-color: rgba(34, 211, 238, 0.65);
}

@media (max-width: 900px) {
  .concept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sample-stage {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 28px 0;
  }

  .demo-card {
    padding: 16px;
    border-radius: 24px;
  }

  .card-header,
  .control-panel {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .sample-stage {
    padding: 18px;
  }

  .links {
    flex-direction: row;
  }
}
