:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --soft: rgba(255, 255, 255, 0.78);
  --indigo: #6366f1;
  --indigo-strong: #4f46e5;
  --teal: #2dd4bf;
  --purple: #a855f7;
  --danger: #dc2626;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-padding-top: 12rem;
  overflow-x: hidden;
}

html:has(body[data-page="site-home"]) {
  scroll-padding-top: 5.25rem;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, 0.18), transparent 24rem),
    radial-gradient(circle at 82% 16%, rgba(168, 85, 247, 0.18), transparent 24rem),
    linear-gradient(180deg, #000000 0%, #101014 48%, #000000 100%);
}

.star {
  position: absolute;
  width: var(--size);
  height: var(--size);
  top: var(--top);
  left: var(--left);
  border-radius: 999px;
  background: #fff;
  opacity: 0.78;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

.shooting-star {
  position: absolute;
  width: 2px;
  height: 120px;
  top: var(--top);
  right: var(--right);
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92), transparent);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
  transform: rotate(-135deg);
  animation: shoot 5.5s ease-out forwards;
}

.home-planet {
  position: absolute;
  top: 0;
  right: 8vw;
  width: min(25vw, 21rem);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  overflow: visible;
  transform: translate3d(0, 105vh, 0) scale(0.92);
  background:
    linear-gradient(18deg, transparent 34%, rgba(255, 255, 255, 0.13) 35%, transparent 39%),
    linear-gradient(164deg, transparent 46%, rgba(5, 10, 24, 0.18) 47%, transparent 53%),
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.52), transparent 0.35rem),
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.28), transparent 15%),
    radial-gradient(circle at 68% 72%, rgba(0, 0, 0, 0.34), transparent 42%),
    linear-gradient(135deg, #24d4c5 0%, #4e7cff 46%, #8b5cf6 100%);
  box-shadow:
    inset -2.2rem -2.6rem 4.6rem rgba(0, 0, 0, 0.38),
    inset 1.3rem 1rem 2.8rem rgba(255, 255, 255, 0.12),
    0 0 5.5rem rgba(99, 102, 241, 0.34);
  will-change: opacity, transform;
}

.home-planet::before {
  content: "";
  position: absolute;
  inset: 35% -31%;
  z-index: 1;
  border: 0.28rem solid transparent;
  border-bottom-color: rgba(218, 229, 255, 0.18);
  border-left-color: rgba(218, 229, 255, 0.26);
  border-right-color: rgba(218, 229, 255, 0.12);
  border-radius: 50%;
  clip-path: inset(50% 0 0 0);
  transform: rotate(-16deg);
  filter: blur(0.2px);
  pointer-events: none;
}

.home-planet::after {
  content: "";
  position: absolute;
  inset: 39% -24%;
  z-index: 1;
  border: 0.45rem solid transparent;
  border-bottom-color: rgba(218, 229, 255, 0.38);
  border-left-color: rgba(218, 229, 255, 0.48);
  border-right-color: rgba(218, 229, 255, 0.2);
  border-radius: 50%;
  clip-path: inset(50% 0 0 0);
  transform: rotate(-16deg);
  filter: blur(0.2px) drop-shadow(0 0 0.75rem rgba(159, 186, 255, 0.22));
  pointer-events: none;
}

body[data-page="site-home"] .home-planet {
  opacity: var(--home-planet-opacity, 0);
  transform:
    translate3d(
      calc(var(--home-planet-x, 0) * 1px),
      calc(var(--home-planet-y, 0) * 1px),
      0
    )
    scale(var(--home-planet-scale, 0.92));
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(3, 7, 18, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.account-bar {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-menu-wrap {
  position: relative;
}

.account-link {
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.account-link:hover {
  color: #fff;
}

.account-email {
  max-width: 14rem;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 18rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.4rem 0.45rem 0;
  border-radius: 999px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.account-menu-button:hover,
.account-menu-button[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.account-menu-arrow {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

.account-menu-button[aria-expanded="true"] .account-menu-arrow {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 8;
  min-width: 12rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
}

.account-menu-link {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--soft);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.account-menu-link:hover,
.account-menu-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: 0;
}

.account-button,
.save-song-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.account-button:hover,
.save-song-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.account-button:disabled,
.save-song-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.account-button.primary,
.save-song-button {
  background: var(--indigo);
}

.account-button.primary:hover,
.save-song-button:hover {
  background: var(--indigo-strong);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-link img {
  width: auto;
  height: 4.4rem;
}

.mobile-nav-toggle {
  display: none;
}

.primary-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.primary-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.primary-nav a,
.account-link,
.account-button,
.account-menu-button,
.mobile-nav-toggle {
  -webkit-tap-highlight-color: transparent;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.site-header.is-mobile-nav {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.65rem;
}

.site-header.is-mobile-nav .mobile-nav-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 2.7rem;
  height: 2.7rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.site-header.is-mobile-nav .mobile-nav-toggle:hover,
.site-header.is-mobile-nav .mobile-nav-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: 0;
}

.site-header.is-mobile-nav .mobile-nav-toggle span {
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-header.is-mobile-nav.is-nav-open .mobile-nav-toggle span:nth-child(1) {
  transform: translateY(0.37rem) rotate(45deg);
}

.site-header.is-mobile-nav.is-nav-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-mobile-nav.is-nav-open .mobile-nav-toggle span:nth-child(3) {
  transform: translateY(-0.37rem) rotate(-45deg);
}

.site-header.is-mobile-nav .primary-nav {
  display: none;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.76);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.site-header.is-mobile-nav .primary-nav a {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  font-size: 0.92rem;
}

.site-header.is-mobile-nav.is-nav-open .primary-nav {
  display: flex;
}

.site-header.is-mobile-nav .account-bar {
  width: 100%;
  display: none;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
  margin: -0.25rem 0 0;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.76);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.site-header.is-mobile-nav.is-nav-open .account-bar {
  display: flex;
}

.site-header.is-mobile-nav .account-menu-wrap {
  max-width: 100%;
  min-width: 0;
}

.site-header.is-mobile-nav .account-email {
  max-width: min(13rem, 54vw);
}

.site-header.is-mobile-nav .account-menu-button {
  min-width: 0;
}

.site-header.is-mobile-nav .account-menu {
  position: static;
  flex-basis: 100%;
  max-width: calc(100vw - 1.5rem);
  margin-top: 0.45rem;
}

.site-main {
  flex: 1;
  width: 100%;
  padding: 1.25rem 1rem 6rem;
}

body[data-page="site-home"] .site-main {
  padding: 0 0 5rem;
}

.home-view,
.results-view,
.saved-view,
.privacy-view,
.content-page,
.section-grid,
.landing-hero {
  width: min(100%, 920px);
  margin: 0 auto;
}

.home-view {
  position: relative;
  min-height: 38rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1rem 7rem;
}

.landing-hero {
  min-height: calc(100vh - 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(16rem, 0.95fr);
  align-items: center;
  gap: 2rem;
  padding: 4rem 1rem 3rem;
}

.landing-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 42rem;
  margin: 0 0 1.5rem;
  color: var(--soft);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.68;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-actions .try-button,
.landing-actions .account-button {
  margin-top: 0;
  text-decoration: none;
}

.landing-hero__image {
  width: 100%;
  max-height: 30rem;
  object-fit: contain;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.38));
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 2rem 1rem 4rem;
}

.section-card {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 1rem;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  color: #fff;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.35);
}

.section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 24%, rgba(3, 7, 18, 0.84));
}

.section-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: scale 220ms ease, opacity 220ms ease;
}

.section-card:hover img {
  scale: 1.04;
  opacity: 0.9;
}

.section-card span,
.section-card strong {
  position: relative;
  z-index: 2;
}

.section-card span {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.section-card strong {
  font-size: 1.12rem;
  line-height: 1.35;
}

.home-feature-panels {
  width: 100%;
}

.home-feature-panel {
  --panel-reveal: 0.18;
  position: relative;
  min-height: calc(100vh - 5.25rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.85rem, 2.4vw, 1.35rem);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) max(1.25rem, calc((100vw - 920px) / 2)) clamp(4.5rem, 8vw, 7rem);
  color: #fff;
  text-decoration: none;
  transform-origin: center;
  will-change: opacity, transform;
}

.home-feature-panel::before,
.home-feature-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.home-feature-panel::before {
  background: transparent;
}

.home-feature-panel::after {
  inset: auto 0 0;
  height: 1px;
  opacity: 0.6;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.home-feature-copy {
  display: contents;
  min-width: 0;
}

.home-feature-panel .eyebrow {
  order: 1;
  margin-bottom: 0;
}

.home-feature-title {
  max-width: 44rem;
  margin: 0;
  display: block;
  order: 2;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: 0;
}

.home-feature-text {
  max-width: 38rem;
  margin: 0;
  display: block;
  order: 4;
  color: var(--soft);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.home-feature-cta {
  width: fit-content;
  min-height: 2.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  order: 5;
  margin-top: 0.75rem;
  padding: 0.72rem 1.05rem;
  border-radius: 999px;
  color: #fff;
  background: var(--indigo);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
}

.home-feature-cta::after {
  content: ">";
  font-size: 1.05rem;
  line-height: 1;
}

.tool-section {
  scroll-margin-top: 7rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-copy h1,
.hero-copy h2 {
  max-width: 850px;
  margin: 0 0 1.25rem;
  padding-block: 0.25rem;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: 0;
  color: transparent;
  background: linear-gradient(90deg, #818cf8, var(--teal), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.38));
}

.hero-copy p {
  max-width: 580px;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.65;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.record-button,
.try-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.record-button {
  color: #050505;
  background: #fff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.record-button:hover,
.try-button:hover {
  transform: translateY(-1px);
}

.record-button img {
  width: 1.25rem;
  height: 1.25rem;
}

.record-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--danger);
  animation: pulse-dot 1s infinite;
}

.recording-countdown {
  margin-top: 0.9rem;
  color: var(--soft);
  font-size: 0.95rem;
  font-weight: 700;
}

.recording-countdown.is-warning {
  color: #fecaca;
}

.upload-copy {
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.92rem;
  line-height: 1.6;
}

.text-link {
  padding: 0;
  color: #fff;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.text-link:hover {
  color: #d8b4fe;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.overlay.is-visible {
  display: flex;
}

.loader-card {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 4px solid #fff;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 900ms linear infinite;
}

.message {
  width: min(100%, 620px);
  margin: 1.25rem auto 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(0, 0, 0, 0.28);
}

.message.is-error {
  border-color: rgba(248, 113, 113, 0.44);
  color: #fecaca;
}

.results-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 1rem 7rem;
  text-align: center;
}

.saved-view {
  padding: 5rem 1rem 7rem;
  text-align: center;
}

.saved-view h1 {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: 0;
}

.saved-intro {
  max-width: 42rem;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  line-height: 1.65;
}

.audio-panel {
  width: min(100%, 640px);
  margin: 0 auto 1.5rem;
}

.results-toolbar {
  width: min(100%, 720px);
  padding: 0;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, padding 180ms ease;
}

.results-toolbar-spacer {
  width: min(100%, 720px);
  margin-bottom: 0.25rem;
}

.results-toolbar.is-sticky {
  position: fixed;
  left: 50%;
  top: var(--results-sticky-top, 6rem);
  z-index: 6;
  width: min(calc(100% - 2rem), 720px);
  padding: 0.9rem;
  background: rgba(3, 7, 18, 0.86);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.results-toolbar-close {
  display: none;
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.results-toolbar.is-sticky .results-toolbar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.results-toolbar-close:hover,
.results-toolbar-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.file-name {
  margin: 0 0 0.6rem;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.92rem;
}

.file-name strong {
  color: #fff;
}

audio {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.92rem;
}

.badge-link {
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.badge-link:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.badge strong {
  font-weight: 800;
}

.follow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  color: var(--soft);
  font-size: 0.92rem;
  cursor: pointer;
}

.follow-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--indigo);
}

.results-view h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: 0;
}

.save-song-button {
  margin: -0.6rem 0 1.5rem;
}

.saved-results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: -0.6rem 0 1.5rem;
}

.saved-results-actions .save-song-button {
  margin: 0;
  text-decoration: none;
}

.results-message {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.chord-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0.2rem;
  scroll-margin-top: 12rem;
}

.chord-card {
  min-height: 6.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 8px;
  color: #d1d5db;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.chord-card.is-active {
  color: #fff;
  background: var(--indigo);
  transform: scale(1.04);
}

.chord-name {
  font-size: 1.18rem;
  font-weight: 800;
}

.chord-time {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.try-button {
  margin-top: 1.5rem;
  color: #fff;
  background: var(--indigo);
  text-decoration: none;
}

.try-button:hover {
  background: var(--indigo-strong);
}

.saved-list {
  display: grid;
  gap: 1.4rem;
}

.library-section {
  display: grid;
  gap: 0.9rem;
}

.library-section > h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.saved-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel);
}

.saved-card > div:first-child,
.saved-card-main {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.saved-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.saved-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.saved-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.account-button.danger {
  background: rgba(220, 38, 38, 0.84);
}

.account-button.danger:hover {
  background: #b91c1c;
}

.privacy-view {
  padding: 5rem 1rem 7rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.72;
}

.content-page {
  min-height: calc(100vh - 8rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.82fr);
  align-items: center;
  gap: 2rem;
  padding: 5rem 1rem 7rem;
}

.content-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.content-page p {
  color: var(--soft);
  line-height: 1.7;
}

.support-page {
  grid-template-columns: minmax(0, 46rem);
  justify-content: center;
  text-align: center;
}

.feature-panel,
.support-list article {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.feature-panel h2,
.support-list h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.feature-panel ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--soft);
  line-height: 1.65;
}

.support-list {
  display: grid;
  gap: 1rem;
}

.saved-response-view {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 4rem 1rem 7rem;
}

.saved-response-view h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.saved-response-content {
  display: grid;
  gap: 1rem;
}

.saved-response-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft);
}

.saved-response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.saved-response-panel {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel);
}

.saved-response-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  letter-spacing: 0;
}

.saved-response-panel p {
  margin: 0;
  color: var(--soft);
  line-height: 1.6;
}

.saved-response-panel pre {
  max-height: none;
  overflow: auto;
  margin: 0;
  color: #fff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.tab-agent-workspace {
  width: min(100%, 920px);
  min-height: calc(100vh - 8rem);
  margin: 0 auto;
  padding: 1rem 1rem 10rem;
}

.tab-agent-intro {
  max-width: 48rem;
  margin: 0 auto 1.35rem;
  text-align: center;
}

.tab-agent-intro h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.tab-agent-intro p {
  margin: 0;
  color: var(--soft);
  line-height: 1.7;
}

body[data-page="site-home"] .tab-agent-intro p {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.tab-chat-shell {
  display: grid;
  grid-template-rows: minmax(22rem, 1fr);
  min-height: 34rem;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.tab-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1rem 7rem;
  overflow-y: auto;
}

.tab-chat-message {
  width: fit-content;
  max-width: min(100%, 46rem);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  color: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
}

.tab-chat-message--assistant {
  align-self: flex-start;
  background: transparent;
}

.tab-chat-message--user {
  align-self: flex-end;
  background: var(--indigo);
}

.tab-chat-message.is-error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.58);
}

.tab-message-actions {
  margin-top: 0.8rem;
  white-space: normal;
}

.save-response-button {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.save-response-button:hover,
.save-response-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.save-response-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.save-response-button.is-saved {
  color: #fff;
  background: var(--indigo);
}

.save-response-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.save-response-button::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  z-index: 4;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  color: #fff;
  background: rgba(3, 7, 18, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.2rem);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.save-response-button:hover::after,
.save-response-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tab-chat-message--thinking {
  min-width: 4.2rem;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.thinking-dots span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  animation: pulse-dot 900ms ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 280ms;
}

.tab-chat-form {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 5;
  width: min(calc(100% - 2rem), 920px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.75rem;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: rgba(12, 18, 32, 0.94);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.tab-chat-form textarea {
  width: 100%;
  height: 2.4rem;
  min-height: 2.4rem;
  max-height: 8rem;
  resize: none;
  padding: 0.52rem 0.55rem 0.52rem 1.2rem;
  border: 0;
  color: #fff;
  background: transparent;
  line-height: 1.4;
  overflow-y: hidden;
}

.tab-chat-form textarea:focus {
  outline: 0;
}

.tab-chat-form:focus-within {
  border-color: rgba(99, 102, 241, 0.72);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(99, 102, 241, 0.24);
}

.tab-chat-submit {
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--indigo);
  cursor: pointer;
  transition: background 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.tab-chat-submit:hover {
  background: var(--indigo-strong);
  transform: scale(1.04);
}

.tab-chat-submit:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.tab-chat-submit svg {
  width: 1.35rem;
  height: 1.35rem;
}

.privacy-view h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.privacy-view h2 {
  margin: 1.5rem 0 0.35rem;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.privacy-view p {
  margin: 0.4rem 0;
}

.privacy-date {
  color: rgba(255, 255, 255, 0.56);
}

.privacy-view a {
  color: #a5b4fc;
}

.site-footer {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 100%;
  padding: 1rem;
  color: rgba(156, 163, 175, 0.8);
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  text-decoration: underline;
}

.site-footer a:hover {
  color: #fff;
}

.footer-separator {
  margin-inline: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.94);
  box-shadow: var(--shadow);
}

.auth-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-dialog h2 {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  letter-spacing: 0;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--soft);
  font-size: 0.9rem;
}

.required-marker {
  color: #fecaca;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.signup-notice {
  margin: -0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.signup-notice a {
  color: #c4b5fd;
}

.signup-notice a:hover {
  color: #fff;
}

.auth-actions {
  display: flex;
  gap: 0.75rem;
}

.auth-actions .account-button {
  flex: 1;
}

.auth-mode-button {
  width: fit-content;
  justify-self: center;
  padding: 0;
  color: #c4b5fd;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.auth-mode-button:hover {
  color: #fff;
}

.auth-message {
  min-height: 1.3rem;
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-message.is-error {
  color: #fecaca;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.78;
  }

  50% {
    opacity: 0.16;
  }
}

@keyframes shoot {
  from {
    opacity: 1;
    translate: 0 0;
  }

  to {
    opacity: 0;
    translate: -800px 800px;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .site-header {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .brand-link img {
    height: clamp(3rem, 14vw, 3.6rem);
  }

  .mobile-nav-toggle {
    position: absolute;
    top: 1.25rem;
    right: 0.75rem;
    width: 2.7rem;
    height: 2.7rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: 0;
  }

  .mobile-nav-toggle span {
    width: 1.1rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .site-header.is-nav-open .mobile-nav-toggle span:nth-child(1) {
    transform: translateY(0.37rem) rotate(45deg);
  }

  .site-header.is-nav-open .mobile-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-nav-open .mobile-nav-toggle span:nth-child(3) {
    transform: translateY(-0.37rem) rotate(-45deg);
  }

  .primary-nav {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(3, 7, 18, 0.76);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  }

  .primary-nav a {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    font-size: 0.92rem;
  }

  .site-header.is-nav-open .primary-nav {
    display: flex;
  }

  .account-bar {
    width: 100%;
    display: none;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.55rem;
    min-width: 0;
    margin: -0.25rem 0 0;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(3, 7, 18, 0.76);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  }

  .site-header.is-nav-open .account-bar {
    display: flex;
  }

  .account-menu-wrap {
    max-width: 100%;
    min-width: 0;
  }

  .account-email {
    max-width: min(13rem, 54vw);
  }

  .account-menu-button {
    min-width: 0;
  }

  .account-menu {
    position: static;
    flex-basis: 100%;
    max-width: calc(100vw - 1.5rem);
    margin-top: 0.45rem;
  }

  .home-view {
    padding-top: 4rem;
  }

  .landing-hero,
  .content-page {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
  }

  .landing-hero__image {
    max-height: 18rem;
  }

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

  .section-card {
    min-height: 14rem;
  }

  body[data-page="site-home"] .site-main {
    padding-bottom: 4rem;
  }

  .home-feature-panel {
    min-height: calc(100svh - 8.5rem);
    padding: 4rem 1rem 5rem;
  }

  .home-feature-panel::before {
    background: transparent;
  }

  .home-feature-title {
    font-size: clamp(2.25rem, 13vw, 4rem);
  }

  .home-feature-text {
    font-size: 1rem;
  }

  .home-planet {
    top: 0;
    right: -8vw;
    width: min(42vw, 11rem);
  }

  .saved-response-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-view {
    padding-top: 3rem;
  }

  .results-toolbar {
    width: 100%;
  }

  .results-toolbar.is-sticky {
    padding: 0.7rem;
  }

  .audio-panel {
    margin-bottom: 0.9rem;
  }

  .tab-agent-workspace {
    width: 100%;
    min-height: calc(100svh - 8rem);
    padding: 1rem 0.9rem 8.25rem;
  }

  body[data-page="site-home"] .tab-agent-intro p {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }

  .tab-chat-shell {
    min-height: calc(100svh - 15rem);
  }

  .tab-chat-messages {
    padding: 0.75rem 0 7.25rem;
  }

  .tab-chat-message {
    max-width: 92%;
    padding: 0.8rem 0.9rem;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }

  .tab-chat-form {
    bottom: 0;
    width: 100%;
    min-height: 4.2rem;
    padding: 0.5rem calc(0.65rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.65rem + env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .tab-chat-form textarea {
    font-size: 16px;
    padding-left: 0.7rem;
  }

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

  .site-footer {
    font-size: 0.82rem;
  }
}

@media (max-width: 430px) {
  .site-main {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  body[data-page="site-home"] .site-main {
    padding-right: 0;
    padding-left: 0;
  }

  .account-link,
  .account-button,
  .account-menu-link {
    font-size: 0.84rem;
  }

  .account-email {
    max-width: 48vw;
    font-size: 0.8rem;
  }

  .button-row {
    width: 100%;
  }

  .record-button,
  .try-button {
    width: 100%;
  }

  .footer-separator {
    display: none;
  }

  .site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.7rem;
  }

  .saved-card {
    align-items: stretch;
    flex-direction: column;
  }

  .saved-card-actions {
    justify-content: stretch;
  }

  .saved-card-actions .account-button {
    flex: 1;
  }

  .saved-response-actions {
    width: 100%;
  }

  .saved-response-actions .account-button {
    flex: 1;
  }
}

body[data-page="tab-agent"]:not(.tab-chat-started) .tab-agent-workspace,
body[data-page="site-home"]:not(.tab-chat-started) .tab-agent-workspace {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 12rem);
  padding: 1rem;
}

body[data-page="tab-agent"]:not(.tab-chat-started) .tab-agent-intro,
body[data-page="site-home"]:not(.tab-chat-started) .tab-agent-intro {
  margin-bottom: 1rem;
}

body[data-page="tab-agent"].tab-chat-started .tab-agent-intro,
body[data-page="site-home"].tab-chat-started .tab-agent-intro {
  display: none;
}

body[data-page="tab-agent"]:not(.tab-chat-started) .tab-chat-shell,
body[data-page="site-home"]:not(.tab-chat-started) .tab-chat-shell {
  display: block;
  min-height: auto;
  border: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

body[data-page="tab-agent"]:not(.tab-chat-started) .tab-chat-messages,
body[data-page="site-home"]:not(.tab-chat-started) .tab-chat-messages {
  display: none;
}

body[data-page="tab-agent"]:not(.tab-chat-started) .tab-chat-form,
body[data-page="site-home"]:not(.tab-chat-started) .tab-chat-form {
  position: static;
  width: min(100%, 720px);
  margin: 0 auto;
  transform: none;
}

@media (orientation: landscape) and (max-height: 520px) {
  .results-toolbar.is-sticky {
    padding: 0.45rem 0.6rem;
  }

  .results-toolbar.is-sticky .audio-panel {
    margin-bottom: 0.45rem;
  }

  .results-toolbar.is-sticky .file-name {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
  }

  .results-toolbar.is-sticky .badge-row {
    gap: 0.4rem;
    margin-bottom: 0.2rem;
  }

  .results-toolbar.is-sticky .badge,
  .results-toolbar.is-sticky .follow-toggle {
    padding: 0.42rem 0.55rem;
    font-size: 0.75rem;
  }

  .results-toolbar.is-sticky .results-toolbar-close {
    top: 0.4rem;
    right: 0.4rem;
  }
}
