/* =========================================================
   Braintunes — Marketing Website
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0b0e1a;
  --bg-raised:  #12162a;
  --surface:    #1a1f36;
  --line:       rgba(255,255,255,0.08);
  --text:       #e8eaf0;
  --muted:      #9ea2b8;
  --white:      #ffffff;

  --focus:      #4b90ff;
  --focus-g1:   #1f4bff;
  --focus-g2:   #1fd6ff;

  --relax:      #c8b7ff;
  --relax-g1:   #b999ff;
  --relax-g2:   #9bb7ff;

  --sleep:      #6e6ebf;
  --sleep-g1:   #3f4786;
  --sleep-g2:   #7564a2;

  --meditate:   #8cb5a9;
  --meditate-g1:#2f7f8e;
  --meditate-g2:#9ed5b6;

  --radius:     16px;
  --max-w:      1120px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mode-card, .btn, .feature-card { transition: none; }
  .mode-card:hover { transform: none; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--focus); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

/* --- Utility --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--white); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
p  { max-width: 640px; }

.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 580px; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .2s;
  text-decoration: none;
  color: var(--white);
}
.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--focus-g1), var(--focus-g2));
  color: #fff;
  box-shadow: 0 4px 24px rgba(31,75,255,.3);
}
.btn-primary:hover { box-shadow: 0 6px 32px rgba(31,75,255,.4); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
}
.btn-outline:hover { border-color: rgba(255,255,255,.2); }

.btn-sm { padding: 10px 22px; font-size: .9rem; }

.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(11,14,26,.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo { height: 22px; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--white); opacity: 1; }
.nav-links .btn-primary { color: #fff; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(11,14,26,.96);
  backdrop-filter: blur(20px);
  z-index: 99;
  padding: 40px 28px;
}
.mobile-menu.open { display: flex; flex-direction: column; gap: 24px; }
body.menu-open { overflow: hidden; }
.mobile-menu a { color: var(--text); font-size: 1.2rem; font-weight: 500; }
.mobile-menu a:hover { color: var(--focus); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
}

/* --- Hero --- */
.hero {
  padding: 115px 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(31,75,255,.12) 0%, rgba(31,214,255,.06) 40%, transparent 70%);
  pointer-events: none;
}
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin: 0 auto 40px; }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--muted);
}
.badge svg { width: 16px; height: 16px; }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-mockup {
  margin-top: 56px;
  position: relative;
  z-index: 1;
}
.hero-mockup img {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at center, #000 35%, transparent 68%);
  mask-image: radial-gradient(ellipse 70% 70% at center, #000 35%, transparent 68%);
}

/* --- Sections --- */
section { padding: 100px 0; }

.section-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--focus);
  margin-bottom: 12px;
}

.section-header { margin-bottom: 56px; }
.section-header p { margin-top: 16px; }

/* --- Modes Grid --- */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.mode-card {
  border-radius: var(--radius);
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.mode-card:hover { transform: translateY(-4px); }

.mode-card > * { position: relative; z-index: 1; }

.mode-card.focus  { background: linear-gradient(135deg, var(--focus-g1), var(--focus-g2)); }
.mode-card.relax  { background: linear-gradient(135deg, var(--relax-g1), var(--relax-g2)); }
.mode-card.sleep  { background: linear-gradient(135deg, var(--sleep-g1), var(--sleep-g2)); }
.mode-card.meditate { background: linear-gradient(135deg, var(--meditate-g1), var(--meditate-g2)); }

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.mode-icon svg { width: 26px; height: 26px; stroke: var(--white); fill: none; stroke-linecap: round; stroke-linejoin: round; }

.mode-card h3 { margin-bottom: 6px; }
.mode-card .mode-subtitle { color: rgba(255,255,255,.8); font-size: .92rem; margin-bottom: 16px; }
.mode-card .mode-desc { color: rgba(255,255,255,.78); font-size: .88rem; line-height: 1.55; }
.mode-card .mode-band {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,.12);
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}

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

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color .2s;
}
.feature-card:hover { border-color: rgba(255,255,255,.14); }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-icon svg { width: 22px; height: 22px; stroke: var(--focus); fill: none; stroke-linecap: round; stroke-linejoin: round; }

.feature-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.feature-card p { color: var(--muted); font-size: .92rem; }

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

/* --- How It Works (homepage short version) --- */
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  counter-reset: step;
}
.how-step { counter-increment: step; }
.how-step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--focus);
  margin-bottom: 18px;
}
.how-step h3 { margin-bottom: 8px; }
.how-step p { color: var(--muted); font-size: .92rem; }

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

/* --- Intensity --- */
.intensity-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.intensity-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.intensity-card h3 { margin-bottom: 6px; }
.intensity-card p { color: var(--muted); font-size: .88rem; margin: 0 auto; }

@media (max-width: 600px) { .intensity-row { grid-template-columns: 1fr; } }

/* --- CTA Banner --- */
.cta-banner {
  text-align: center;
  padding: 80px 0;
  position: relative;
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(31,75,255,.05) 50%, transparent);
  pointer-events: none;
}
.cta-banner h2 { margin-bottom: 16px; }
.cta-banner p { margin: 0 auto 32px; }
.cta-banner .hero-cta { position: relative; z-index: 1; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 280px; }
.footer-brand img { height: 20px; margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: .85rem; }

.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li + li { margin-top: 10px; }
.footer-col a { color: var(--text); font-size: .9rem; }
.footer-col a:hover { color: var(--focus); opacity: 1; }

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { color: var(--muted); font-size: .82rem; }

/* --- Science page --- */
.science-hero {
  padding: 140px 0 60px;
  text-align: center;
}
.science-hero .lead { margin: 16px auto 0; }

.science-content { max-width: 780px; margin: 0 auto; padding: 0 28px; }

.science-content h2 {
  margin-top: 64px;
  margin-bottom: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.science-content h2:first-of-type { border-top: none; margin-top: 40px; }

.science-content h3 { margin-top: 36px; margin-bottom: 12px; color: var(--text); }
.science-content p { color: var(--muted); margin-bottom: 16px; max-width: none; }
.science-content p strong { color: var(--text); }
.science-content ul { color: var(--muted); margin-bottom: 16px; padding-left: 24px; }
.science-content li { margin-bottom: 8px; }

.science-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
}
.science-table th,
.science-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.science-table th { color: var(--white); font-weight: 600; }
.science-table td { color: var(--muted); }

.callout {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--focus);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 28px 0;
}
.callout p { margin-bottom: 0; color: var(--text); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--focus);
  letter-spacing: -0.03em;
}
.stat-card .stat-label {
  color: var(--muted);
  font-size: .88rem;
  margin-top: 4px;
}

@media (max-width: 600px) { .stat-row { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; }
  .footer-brand { max-width: none; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* --- Legal pages --- */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 128px 28px 80px;
}
.legal-content h1 { margin-bottom: 8px; }
.legal-content .legal-date { color: var(--muted); font-size: .88rem; margin-bottom: 40px; }
.legal-content h2 { font-size: 1.3rem; margin-top: 40px; margin-bottom: 12px; }
.legal-content p { color: var(--muted); margin-bottom: 14px; max-width: none; }
.legal-content ul { color: var(--muted); margin-bottom: 14px; padding-left: 24px; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--focus); }

html.embed-legal .nav,
html.embed-legal .mobile-menu {
  display: none !important;
}

html.embed-legal .legal-content {
  padding-top: 56px;
}

@media (max-width: 768px) {
  html.embed-legal .legal-content {
    padding-top: 44px;
  }
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.faq-item summary {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p {
  color: var(--muted);
  font-size: .92rem;
  margin-top: 12px;
  max-width: none;
  line-height: 1.7;
}

/* --- Language switcher --- */
.lang-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lang-switcher a {
  color: var(--muted);
  text-decoration: none;
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.lang-switcher a:hover { color: var(--white); background: var(--surface); }
.lang-switcher a.active { color: var(--white); font-weight: 600; }
