:root {
  --bg: #070809;
  --panel: #101214;
  --panel-2: #16191c;
  --panel-3: #1d2125;
  --text: #f4f1e8;
  --muted: #a8a197;
  --soft: #706a61;
  --line: rgba(244, 241, 232, 0.12);
  --line-strong: rgba(244, 241, 232, 0.22);
  --accent: #f2b84b;
  --accent-soft: rgba(242, 184, 75, 0.14);
  --accent-line: rgba(242, 184, 75, 0.42);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --cursor-x: 50vw;
  --cursor-y: 24vh;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(244, 241, 232, 0.12), transparent 28rem),
    radial-gradient(circle at 84% 22%, rgba(242, 184, 75, 0.2), transparent 34rem),
    radial-gradient(circle at 50% 92%, rgba(242, 184, 75, 0.1), transparent 30rem),
    linear-gradient(180deg, rgba(242, 184, 75, 0.12), transparent 460px),
    var(--bg);
  color: var(--text);
  font-family: "Rubik", Arial, "Noto Sans Hebrew", sans-serif;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(
      circle at var(--cursor-x) var(--cursor-y),
      rgba(242, 184, 75, 0.28),
      rgba(242, 184, 75, 0.095) 13rem,
      transparent 34rem
    ),
    radial-gradient(circle at 46% 86%, rgba(244, 241, 232, 0.075), transparent 26rem);
  opacity: 0.95;
  transition: opacity 180ms ease;
}

body::after {
  background-image:
    linear-gradient(rgba(244, 241, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.032) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(242, 184, 75, 0.09), transparent 1px);
  background-size: 72px 72px, 72px 72px, 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 72%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 72%, transparent);
  opacity: 0.72;
}

body::selection {
  background: var(--accent);
  color: #090909;
}

a {
  color: inherit;
}

button,
input,
select,
audio {
  font: inherit;
}

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

.studio-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.site-header,
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(22px, calc((100vw - 1220px) / 2 + 22px));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 9, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

nav a:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.hero-copy {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 88px max(28px, calc((100vw - 1220px) / 2 + 28px));
  border-bottom: 1px solid var(--line);
  background: #0a0b0c;
}

.hero-video,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-video {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
  filter: saturate(1.02) contrast(1.04) brightness(1.22);
}

.hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 8, 9, 0.88), rgba(7, 8, 9, 0.58) 56%, rgba(7, 8, 9, 0.2)),
    linear-gradient(180deg, rgba(242, 184, 75, 0.08), transparent 42%);
  pointer-events: none;
}

.hero-copy > :not(.hero-video):not(.hero-shade) {
  position: relative;
  z-index: 2;
}

.hero-video-controls {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  display: flex;
  gap: 10px;
  direction: ltr;
}

.hero-video-controls button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(242, 184, 75, 0.58);
  border-radius: 8px;
  background: rgba(7, 8, 9, 0.54);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(244, 241, 232, 0.12);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.hero-video-controls button:hover {
  transform: translateY(-1px);
  background: rgba(242, 184, 75, 0.92);
  color: #090909;
  box-shadow: 0 0 36px rgba(242, 184, 75, 0.34), inset 0 1px 0 rgba(244, 241, 232, 0.22);
}

.hero-video-play-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.hero-video-play-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.play-shape,
.pause-shape {
  fill: currentColor;
}

.play-shape {
  opacity: 0;
}

.pause-shape {
  opacity: 1;
}

.hero-video-play-icon.is-paused .play-shape {
  opacity: 1;
}

.hero-video-play-icon.is-paused .pause-shape {
  opacity: 0;
}

.hero-video-sound-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.hero-video-sound-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sound-speaker {
  fill: currentColor;
}

.sound-wave,
.sound-slash {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.sound-slash {
  opacity: 0;
}

.hero-video-sound-icon.is-muted .sound-wave {
  opacity: 0;
}

.hero-video-sound-icon.is-muted .sound-slash {
  opacity: 1;
}

.eyebrow,
.section-kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 3.6rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.hero-text {
  max-width: 520px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.primary-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent);
  color: #090909;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 0 30px var(--accent-soft);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 42px rgba(242, 184, 75, 0.26);
}

.workspace,
.next-section,
.flow-section {
  margin-top: 24px;
}

.hero,
.workspace,
.next-section,
.flow-section {
  scroll-margin-top: 86px;
}

.studio-workspace {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.studio-workspace-grid {
  display: grid;
  grid-template-columns: minmax(230px, 268px) minmax(0, 1fr);
  grid-template-areas:
    "controls monitor";
  gap: 18px;
  align-items: stretch;
  direction: ltr;
}

.control-panel {
  grid-area: controls;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
  align-content: start;
  direction: rtl;
}

.upload-card,
.algorithm-selector,
.main-chord-display,
.lyrics-panel,
.timeline-panel,
.next-section,
.flow-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.055), rgba(244, 241, 232, 0.018)),
    rgba(14, 16, 18, 0.64);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.upload-card,
.algorithm-selector {
  min-width: 0;
  padding: 14px;
}

.upload-card h2,
.algorithm-selector h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 1rem;
}

.file-picker {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(242, 184, 75, 0.08);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-picker:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.file-picker input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.algorithm-selector .file-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-items: stretch;
  text-align: start;
}

.algorithm-selector .file-picker span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.file-picker select {
  position: static;
  width: 100%;
  height: auto;
  opacity: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.file-picker select option {
  background: var(--panel-2);
  color: var(--text);
}

.file-name {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.reanalyze-btn {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent);
  color: #090909;
  font-weight: 900;
  cursor: pointer;
}

.beat-control {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.beat-control input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: center;
}

.beat-control input:focus,
.file-picker:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.main-chord-display {
  grid-area: monitor;
  display: flex;
  min-width: 0;
  min-height: 544px;
  flex-direction: column;
  justify-content: flex-start;
  padding: 30px;
  direction: rtl;
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 184, 75, 0.16), transparent 22rem),
    linear-gradient(180deg, rgba(244, 241, 232, 0.055), rgba(244, 241, 232, 0.016)),
    rgba(8, 10, 12, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 26px 80px rgba(0, 0, 0, 0.34);
}

.main-chord-display.is-analyzing {
  border-color: var(--accent-line);
  box-shadow:
    inset 0 0 0 1px rgba(242, 184, 75, 0.1),
    0 0 52px rgba(242, 184, 75, 0.12),
    0 26px 80px rgba(0, 0, 0, 0.46);
}

#currentChord {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 5.7rem;
  line-height: 0.9;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-shadow: 0 0 34px rgba(242, 184, 75, 0.2);
}

#currentRange {
  min-height: 1.4em;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

#currentChordLabel,
#currentChord {
  text-align: center;
}

.analysis-animation {
  width: min(360px, 100%);
  margin: 4px 0 26px;
  padding: 18px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.1), transparent),
    rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 34px rgba(242, 184, 75, 0.08), 0 0 38px rgba(242, 184, 75, 0.12);
}

.analysis-animation[hidden] {
  display: none;
}

.studio-strings {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.studio-strings span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.42;
  transform-origin: center;
  animation: string-vibrate 720ms ease-in-out infinite;
}

.studio-strings span:nth-child(2) {
  animation-delay: 80ms;
}

.studio-strings span:nth-child(3) {
  animation-delay: 160ms;
}

.studio-strings span:nth-child(4) {
  animation-delay: 240ms;
}

.studio-strings span:nth-child(5) {
  animation-delay: 320ms;
}

.studio-strings span:nth-child(6) {
  animation-delay: 400ms;
}

.piano-loader {
  display: grid;
  height: 74px;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  align-items: end;
  direction: ltr;
}

.piano-loader span {
  display: block;
  height: 42px;
  border: 1px solid rgba(242, 184, 75, 0.22);
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, rgba(244, 241, 232, 0.94), rgba(244, 241, 232, 0.7));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  animation: piano-key 960ms ease-in-out infinite;
}

.piano-loader span:nth-child(2) {
  animation-delay: 80ms;
}

.piano-loader span:nth-child(3) {
  animation-delay: 160ms;
}

.piano-loader span:nth-child(4) {
  animation-delay: 240ms;
}

.piano-loader span:nth-child(5) {
  animation-delay: 320ms;
}

.piano-loader span:nth-child(6) {
  animation-delay: 400ms;
}

.piano-loader span:nth-child(7) {
  animation-delay: 480ms;
}

.piano-loader span:nth-child(8) {
  animation-delay: 560ms;
}

@keyframes string-vibrate {
  0%,
  100% {
    opacity: 0.32;
    transform: scaleX(0.96) translateY(0);
  }

  50% {
    opacity: 0.85;
    transform: scaleX(1.02) translateY(-1px);
  }
}

@keyframes piano-key {
  0%,
  100% {
    height: 42px;
    filter: brightness(0.92);
    transform: translateY(0);
  }

  45% {
    height: 64px;
    filter: brightness(1.12);
    transform: translateY(-2px);
  }
}

audio {
  display: none;
}

.studio-player {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.025);
}

.play-toggle {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent);
  color: #090909;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(242, 184, 75, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.play-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 38px rgba(242, 184, 75, 0.28);
  filter: brightness(1.04);
}

.play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-inline-start: 4px;
  border-block: 11px solid transparent;
  border-inline-start: 17px solid currentColor;
}

.play-toggle.is-playing .play-icon {
  width: 18px;
  height: 22px;
  margin-inline-start: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.player-main {
  min-width: 0;
}

.time-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
  direction: ltr;
  color: var(--muted);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.seek-wrap {
  position: relative;
  display: block;
  min-width: 0;
  height: 22px;
}

.studio-seek {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.progress-track {
  position: absolute;
  inset: 6px 0;
  display: block;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

#progressFill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(242, 184, 75, 0.45);
  transition: width 120ms linear;
}

.lyrics-panel {
  grid-area: lyrics;
  display: flex;
  min-width: 0;
  min-height: 430px;
  flex-direction: column;
  padding: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading p {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.lyrics-picker {
  margin-bottom: 14px;
}

.lyrics-line {
  flex: 1;
  min-height: 210px;
  max-height: 330px;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 2.1;
}

.word {
  position: relative;
  display: inline-block;
  margin: 20px 5px 0;
  padding: 0 4px;
  border-radius: 6px;
}

.word::before {
  content: attr(data-chord);
  position: absolute;
  right: 50%;
  bottom: 100%;
  transform: translateX(50%);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.active-word {
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.timeline-panel {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.045), rgba(244, 241, 232, 0.012)),
    rgba(10, 12, 14, 0.62);
}

.main-chord-display .timeline-panel {
  direction: rtl;
}

.timeline {
  display: flex;
  min-height: 112px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 72px
    ),
    #0b0d0f;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
  direction: ltr;
}

.segment {
  position: relative;
  display: flex;
  flex: 0 0 var(--segment-width);
  min-width: 92px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 0;
  border-inline-start: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.segment:first-child {
  border-inline-start: 0;
}

.segment:hover {
  background: rgba(255, 255, 255, 0.085);
}

.segment.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 24px rgba(242, 184, 75, 0.16);
}

.segment strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.segment span {
  color: var(--muted);
  font-size: 0.78rem;
  direction: ltr;
  text-align: right;
}

.next-section,
.flow-section {
  padding: 22px;
}

.next-section {
  min-height: 180px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.up-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.next-card,
.flow-grid article {
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.next-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 1.45rem;
}

.next-card span {
  display: inline-block;
  color: var(--muted);
  font-size: 0.88rem;
  direction: ltr;
}

.flow-section {
  margin-bottom: 52px;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.flow-grid article span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.flow-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (min-width: 861px) {
  main#top {
    width: 100%;
    padding-bottom: 0;
  }

  main#top > .hero,
  main#top > .workspace,
  main#top > .flow-section {
    position: sticky;
    isolation: isolate;
    top: 0;
    width: 100vw;
    min-height: 100vh;
    margin-top: 0;
    margin-inline: calc(50% - 50vw);
    padding: 92px max(28px, calc((100vw - 1220px) / 2 + 28px)) 34px;
  }

  main#top > .hero {
    z-index: 1;
  }

  main#top > .workspace {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    min-height: 118vh;
    padding-bottom: 220px;
  }

  main#top > .workspace > .section-kicker {
    margin-bottom: 0;
  }

  main#top > .workspace .studio-workspace-grid {
    flex: 0 1 auto;
    max-height: none;
  }

  main#top > .flow-section {
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-copy {
    min-height: calc(100vh - 126px);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
  }

  .hero-copy,
  main#top > .workspace,
  main#top > .flow-section {
    overflow: hidden;
  }

  main#top > .workspace,
  main#top > .flow-section {
    background: transparent;
  }

  main#top > .workspace::before,
  main#top > .flow-section::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(circle at var(--cursor-x) var(--cursor-y), rgba(242, 184, 75, 0.18), transparent 30rem),
      radial-gradient(circle at 18% 18%, rgba(244, 241, 232, 0.08), transparent 28rem),
      linear-gradient(180deg, rgba(12, 14, 16, 0.98), rgba(7, 8, 9, 0.96));
    content: "";
  }
}

.info-page main {
  padding-top: 28px;
}

.algorithm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.08), transparent),
    var(--panel-2);
  box-shadow: var(--shadow);
}

.algorithm-hero > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
}

.algorithm-hero h1 {
  max-width: 720px;
  font-size: 3rem;
}

.algorithm-hero p:not(.eyebrow) {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.algorithm-hero img,
.algorithm-card img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}

.algorithm-hero img {
  min-height: 360px;
}

.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.algorithm-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.algorithm-card img {
  min-height: 230px;
}

.algorithm-card > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.algorithm-card p {
  color: var(--muted);
  line-height: 1.65;
}

.algorithm-note {
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.algorithm-summary {
  margin: 22px 0 52px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid p {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  line-height: 1.55;
}

.summary-grid strong {
  color: var(--text);
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 18px 0;
  color: var(--muted);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.github-link:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.github-link svg {
  flex: 0 0 auto;
}

@media (max-width: 1120px) {
  .studio-workspace-grid {
    grid-template-columns: minmax(210px, 246px) minmax(0, 1fr);
  }

  .main-chord-display {
    padding: 24px;
  }

  #currentChord {
    font-size: 5rem;
  }
}

@media (max-width: 980px) {
  .studio-workspace-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "monitor"
      "controls";
  }

  .main-chord-display {
    min-height: 340px;
  }

  #currentChord {
    font-size: 4.8rem;
  }

  .control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .algorithm-hero,
  .algorithm-grid,
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .algorithm-card {
    grid-template-columns: 1fr;
  }

  .algorithm-card img {
    min-height: 210px;
  }
}

@media (max-width: 720px) {
  .site-header,
  .top-bar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1;
    text-align: center;
  }

  main,
  .site-footer {
    width: min(100% - 20px, 1220px);
  }

  .hero-copy {
    min-height: 100vh;
    padding: 54px 18px;
  }

  .hero-video-controls {
    top: 14px;
    left: 14px;
    gap: 8px;
  }

  .hero-video-controls button {
    width: 44px;
    height: 44px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .studio-workspace {
    padding: 0;
  }

  .studio-workspace-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "monitor"
      "controls";
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .main-chord-display,
  .next-section,
  .flow-section {
    padding: 16px;
  }

  .timeline-panel {
    padding: 14px;
  }

  .main-chord-display {
    min-height: 300px;
  }

  #currentChord {
    font-size: 4.2rem;
  }

  .lyrics-line {
    min-height: 170px;
    max-height: 260px;
  }

  .timeline {
    min-height: 118px;
  }

  .segment {
    min-width: 108px;
    padding: 12px 10px;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 8px;
  }

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

  .algorithm-hero,
  .algorithm-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .algorithm-hero {
    padding: 16px;
  }

  .algorithm-hero > div,
  .algorithm-hero img {
    min-height: 260px;
  }

  .algorithm-hero h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 2rem;
  }

  .hero-copy {
    min-height: 100vh;
  }

  .hero-video-controls {
    top: 12px;
    left: 12px;
  }

  .hero-video-controls button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
  }

  .hero-video-play-icon,
  .hero-video-sound-icon {
    width: 22px;
    height: 22px;
  }

  .primary-link,
  .file-picker,
  .reanalyze-btn {
    width: 100%;
  }

  #currentChord {
    font-size: 3.4rem;
  }

  .time-row {
    grid-template-columns: 44px 1fr 44px;
    font-size: 0.78rem;
  }

  .studio-player {
    grid-template-columns: 1fr;
  }

  .play-toggle {
    width: 100%;
  }

  .beat-control {
    grid-template-columns: 1fr;
  }

  .beat-control input {
    text-align: start;
  }

  .lyrics-line {
    font-size: 1rem;
    line-height: 2;
  }

  .segment strong {
    font-size: 1.12rem;
  }
}
