:root {
  --bg: #070a10;
  --bg-elev: #0e1420;
  --bg-card: #121a28;
  --bg-card-hover: #172233;
  --line: rgba(148, 163, 184, 0.14);
  --text: #f4f7fb;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --blue: #3b82f6;
  --blue-soft: #60a5fa;
  --cyan: #38bdf8;
  --magenta: #e879f9;
  --violet: #a78bfa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font-display: "Space Grotesk", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Source Sans 3", sans-serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(800px 400px at 90% 20%, rgba(232, 121, 249, 0.08), transparent 55%),
    radial-gradient(700px 380px at 10% 40%, rgba(56, 189, 248, 0.07), transparent 50%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--bg-elev);
  padding: 8px 12px;
  border-radius: 8px;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 16, 0.72);
  border-bottom: 1px solid transparent;
}

.site-header.is-solid {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2563eb, #7c3aed 55%, #db2777);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(37, 99, 235, 0.35);
}

.brand__mark svg {
  width: 20px;
  height: 20px;
}

.brand__text {
  font-size: 1.05rem;
}

.brand__text em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.72;
}

.brand__text strong {
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Share modal */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 1rem;
}

@media (min-width: 640px) {
  .share-modal {
    place-items: center;
  }
}

.share-modal[hidden] {
  display: none !important;
}

.share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.share-modal__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.15rem 1.2rem 1.35rem;
  box-shadow: var(--shadow);
  animation: share-in 0.22s ease;
}

@keyframes share-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.share-modal__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.share-modal__summary {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.share-modal__link-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.share-modal__link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.share-modal__link-row input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
}

.share-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.share-chip:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.4);
  text-decoration: none;
}

.share-chip__icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue-soft);
}

.share-modal__tip {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--muted);
  font-size: 0.85rem;
}

.share-poster {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.share-poster[hidden] {
  display: none !important;
}

.share-poster__hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.share-poster__hint strong {
  color: var(--blue-soft);
  font-weight: 600;
}

.share-poster img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #070a10;
  display: block;
  -webkit-touch-callout: default;
  user-select: none;
}

.share-poster__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.nav-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}

.nav-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  padding: 1.25rem 1.25rem 2rem;
  transform: translateX(12px);
  transition: transform 0.25s ease;
}

.nav-drawer.is-open .nav-panel {
  transform: translateX(0);
}

.nav-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.nav-panel nav {
  display: grid;
  gap: 0.35rem;
}

.nav-panel a {
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
}

.nav-panel a:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Hero */
.hero {
  padding: 5.5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  margin: 0 auto 1.1rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.55rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero h1 .c-focus {
  color: var(--cyan);
}

.hero h1 .c-sleep {
  background: linear-gradient(100deg, #f472b6, #c084fc 45%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0 auto 1rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero__meta {
  margin: 0 0 1.75rem;
  color: var(--muted-2);
  font-size: 0.92rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(180deg, #4f8cff, #2563eb);
  color: white;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(96, 165, 250, 0.55);
}

.btn--ghost:hover {
  background: rgba(59, 130, 246, 0.1);
}

.btn--sm {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.is-playing {
  background: linear-gradient(180deg, #64748b, #475569);
  box-shadow: none;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section__head {
  text-align: center;
  margin-bottom: 2rem;
}

.section__head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
  letter-spacing: -0.02em;
}

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

/* Presets */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab.is-active {
  color: white;
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
}

.cat-banner {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cat-banner h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.cat-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 720px) {
  .preset-grid {
    grid-template-columns: 1fr;
  }
}

.preset-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.preset-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.preset-card.is-playing {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), var(--shadow);
}

.preset-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.preset-card h4 {
  margin: 0;
  font-size: 1.12rem;
}

.preset-card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.preset-card__meta {
  margin: 0 0 0.35rem;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.preset-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.band-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.band-theta {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.12);
}

.band-alpha {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
}

.band-beta {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.14);
}

.band-delta {
  color: #f9a8d4;
  border-color: rgba(244, 114, 182, 0.4);
  background: rgba(244, 114, 182, 0.12);
}

/* Generator */
.generator-card {
  background: linear-gradient(165deg, rgba(37, 99, 235, 0.12), transparent 35%),
    var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.gen-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.is-live {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
  animation: pulse 1.6s ease infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
}

.controls {
  display: grid;
  gap: 1.15rem;
}

.control {
  display: grid;
  gap: 0.45rem;
}

.control__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.control__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
  align-items: center;
}

.control input[type="number"],
.control select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
}

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

.control select {
  grid-column: 1 / -1;
}

.control select optgroup {
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-elev);
}

.control select option {
  color: var(--text);
  background: var(--bg-card);
}

.gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hint {
  margin: 0.85rem 0 0;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.session-progress {
  margin-top: 1.25rem;
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--magenta));
  transition: width 0.25s linear;
}

.progress-text {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

details.settings-help {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

details.settings-help summary {
  cursor: pointer;
  color: var(--blue-soft);
  font-weight: 600;
}

.settings-help ul {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.support-note {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

/* How it works */
.how-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 800px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
}

.how-copy p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.wave-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 1.25rem;
  min-height: 180px;
  display: grid;
  place-items: center;
}

.wave-card svg {
  width: 100%;
  max-width: 320px;
  opacity: 0.9;
}

.freq-table {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 800px) {
  .freq-table {
    grid-template-columns: repeat(2, 1fr);
  }
}

.freq-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.freq-pill strong {
  display: block;
  margin-bottom: 0.2rem;
}

.freq-pill span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* FAQ */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 0.65rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
}

.faq-item__q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 1rem 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item__q::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
}

.faq-item.is-open .faq-item__q::after {
  content: "–";
}

.faq-item__a {
  display: none;
  padding: 0 1.1rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.faq-item.is-open .faq-item__a {
  display: block;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  background: rgba(0, 0, 0, 0.25);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer h4 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  color: var(--text);
  opacity: 0.85;
  text-decoration: none;
  font-size: 0.92rem;
}

.site-footer a:hover {
  opacity: 1;
  color: var(--blue-soft);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.headphones-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
