*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

:root {
  --bg: #e7edf5;
  --surface: #e7edf5;
  --text: #364152;
  --muted: #6e7891;
  --accent: #6f7ef7;
  --shadow-light: #ffffff;
  --shadow-dark: #c7d0de;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --transition: 180ms ease;
}

html[data-theme='dark'] {
  --bg: #1f2530;
  --surface: #1f2530;
  --text: #e7edf6;
  --muted: #9ba8be;
  --accent: #8c9bff;
  --shadow-light: #2a3342;
  --shadow-dark: #151a22;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 28px;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

.neo-surface {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.neo-inset {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 8px 8px 14px var(--shadow-dark), inset -8px -8px 14px var(--shadow-light);
}

.topbar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;

  & a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 8px 12px;
    transition: color var(--transition), box-shadow var(--transition);

    &:hover {
      color: var(--text);
      box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;

  & h1 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
  }
}

.brand-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #8ec5ff);
  box-shadow: 3px 3px 8px var(--shadow-dark), -2px -2px 6px var(--shadow-light);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
}

.hero-copy {
  padding: 8px 6px;

  & h2 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
  }

  & p {
    margin: 0;
    color: var(--muted);
    max-width: 52ch;
  }
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.hero-stats,
.music-card,
.control-card,
.component-card,
.faq-card {
  padding: 22px;

  & h3 {
    margin: 0 0 14px;
    font-size: 1rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: var(--radius-lg);

  & .label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  & strong {
    font-size: 1.25rem;
  }
}

.demo-grid,
.component-showcase {
  display: grid;
  gap: 22px;
}

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

.component-showcase {
  grid-template-columns: 1.2fr 1fr;
}

.component-card {
  & .muted {
    margin-bottom: 16px;
  }
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.progress-card {
  padding: 14px;
}

.faq-card {
  display: grid;
  gap: 10px;
}

.faq-item {
  border-radius: var(--radius-lg);
  padding: 12px 14px;

  & summary {
    position: relative;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding-right: 22px;

    &::-webkit-details-marker {
      display: none;
    }

    &::after {
      content: '▾';
      position: absolute;
      right: 2px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      transition: transform var(--transition), color var(--transition);
    }
  }

  & p {
    margin: 10px 0 0;
    color: var(--muted);
  }

  &[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--text);
  }
}

.page-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;

  & p {
    margin: 0;
    font-weight: 600;
  }

  & nav {
    display: flex;
    gap: 12px;
  }

  & a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;

    &:hover {
      color: var(--text);
    }
  }
}

.neo-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 460px;
  width: calc(100% - 24px);

  &::backdrop {
    background: rgba(8, 12, 20, 0.45);
  }
}

.dialog-content {
  margin: 0;
  padding: 22px;
  border-radius: var(--radius-xl);

  & h3 {
    margin: 0 0 10px;
  }

  & p {
    margin: 0;
    color: var(--muted);
  }
}

.dialog-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.muted {
  margin: -8px 0 16px;
  color: var(--muted);
}

.album {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;

  & .album-inner {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(from 45deg, var(--accent), #95cbff, #f2b4ff, var(--accent));
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  }
}

.player-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.neo-button,
.icon-btn {
  border: none;
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), color var(--transition);

  &:hover {
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(1px);
    box-shadow: inset 6px 6px 10px var(--shadow-dark), inset -6px -6px 10px var(--shadow-light);
  }
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #8eb4ff);
  box-shadow: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light);
}

.ghost {
  color: var(--text);
}

.full {
  width: 100%;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
}

.neo-input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  margin-bottom: 14px;
}

input[type='range'] {
  width: 100%;
  appearance: none;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent) 35%, transparent 35%), var(--surface);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  outline: none;

  &::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  }
}

.toggle-row {
  margin: 8px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.switch {
  width: 62px;
  height: 34px;
  border: none;
  padding: 4px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;

  & .switch-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), #8eb4ff);
    display: block;
    transition: transform var(--transition);
    box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  }

  &[aria-checked='true'] .switch-thumb {
    transform: translateX(28px);
  }
}

@media (max-width: 960px) {
  .hero,
  .demo-grid,
  .component-showcase {
    grid-template-columns: 1fr;
  }

  body {
    padding: 18px;
  }

  html {
    scroll-padding-top: 96px;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle {
    display: grid;
    order: 2;
  }

  .topbar-actions {
    order: 3;
    margin-left: auto;
  }

  .top-nav {
    order: 4;
    width: 100%;
    display: none;
    padding-top: 8px;
    flex-direction: column;
    align-items: stretch;

    & a {
      text-align: center;
    }
  }

  .topbar.nav-open .top-nav {
    display: flex;
  }
}
