/* ============================================================================
   Entrain — Spectrum design system (web)
   Mirrors the iOS app theme: deep blue-black, indigo→cyan accents,
   Sora display + JetBrains Mono, 26px round corners, dot-grid + corner glows.
   ========================================================================== */

:root {
  /* Core palette (from AppTheme) */
  --bg: #080B13;
  --panel: #0E1322;
  --panel2: #121A2E;
  --ink: #EAF0FF;
  --muted: #9FB0D8;
  --faint: #5E6E98;
  --hairline: rgba(234, 240, 255, 0.10);
  --hairline-strong: rgba(234, 240, 255, 0.16);

  /* Accents */
  --indigo: #6678F6;   /* binaural / primary */
  --cyan: #28D3EE;     /* isochronic */

  /* Band colours */
  --delta: #6678F6;
  --theta: #A86EF5;
  --alpha: #28D3EE;
  --beta:  #9BD64A;
  --gamma: #F0B54A;

  /* Per-page accent (overridable on band pages) */
  --accent: var(--indigo);
  --accent-2: var(--cyan);

  /* Geometry */
  --radius: 26px;
  --radius-sm: 18px;
  --radius-xs: 12px;

  /* Type */
  --display: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --maxw: 1120px;
  --maxw-prose: 720px;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Dot-grid + dual corner glows, fixed behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(234, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(620px 480px at 12% -6%, rgba(102, 120, 246, 0.20), transparent 60%),
    radial-gradient(560px 460px at 92% 4%, rgba(40, 211, 238, 0.16), transparent 60%);
  pointer-events: none;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; }
p { color: var(--muted); }
a { color: var(--accent); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ink); }
strong { color: var(--ink); font-weight: 600; }
::selection { background: rgba(102, 120, 246, 0.32); color: #fff; }

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow-line { color: var(--faint); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ── Layout helpers ─────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--maxw-prose); }
section { position: relative; padding: clamp(56px, 9vw, 110px) 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head p { margin-top: 14px; font-size: 1.05rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.divider { height: 1px; background: var(--hairline); border: 0; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 11, 19, 0.72);
  border-bottom: 1px solid var(--hairline);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 13px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: 4px; }

/* Wordmark */
.wordmark { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; }
.wordmark .mark { width: 26px; height: 26px; display: block; }
.wordmark b { font-weight: 800; color: var(--accent); }
.wordmark:hover { color: var(--ink); }

/* Mobile nav toggle */
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 24px; height: 24px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 8px 26px rgba(102, 120, 246, 0.34); }
.btn-primary:hover { color: var(--bg); transform: translateY(-2px); box-shadow: 0 12px 34px rgba(102, 120, 246, 0.46); }
.btn-ghost { background: rgba(234, 240, 255, 0.04); color: var(--ink); border-color: var(--hairline-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); background: rgba(234, 240, 255, 0.07); }
.btn svg { width: 17px; height: 17px; }

/* App Store badge (inline SVG-styled link) */
.appstore {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 11px 20px 11px 18px; border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-family: var(--display); transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 8px 26px rgba(0,0,0,0.4);
}
.appstore:hover { color: var(--bg); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .as-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore .as-small { font-size: 10px; font-family: var(--mono); letter-spacing: 0.04em; opacity: 0.7; }
.appstore .as-big { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.devices { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.08em; }

/* ── Panels / cards ─────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
}
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--hairline-strong); }
a.card { color: inherit; display: block; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Pills / chips */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 7px 13px; border-radius: 999px;
  background: rgba(102, 120, 246, 0.09); border: 1px solid rgba(102, 120, 246, 0.28);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Tile icon */
.tile {
  width: 46px; height: 46px; border-radius: var(--radius-xs);
  display: grid; place-items: center;
  background: rgba(102, 120, 246, 0.14); border: 1px solid rgba(102, 120, 246, 0.24);
  color: var(--accent); flex: none;
}
.tile svg { width: 22px; height: 22px; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(50px, 8vw, 96px); text-align: center; }
.hero h1 { margin: 18px auto 0; max-width: 14ch; }
.hero .lede { margin: 22px auto 30px; max-width: 56ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); }
.hero .cta-row { justify-content: center; }
.hero-orb-wrap { position: relative; margin: 8px auto 0; width: min(560px, 88vw); height: clamp(170px, 30vw, 260px); }
#hero-canvas { display: block; width: 100%; height: 100%; }

/* Orb */
.orb {
  position: relative; width: 132px; height: 132px; margin: 0 auto;
  display: grid; place-items: center;
}
.orb .core {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(102,120,246,0.55), rgba(40,211,238,0.18) 60%, transparent 72%);
  border: 1px solid rgba(102,120,246,0.5);
  box-shadow: 0 0 50px rgba(102,120,246,0.4);
}
.orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(102,120,246,0.28); animation: orbpulse 3s ease-out infinite; }
.orb .ring:nth-child(2) { animation-delay: 1s; }
.orb .ring:nth-child(3) { animation-delay: 2s; }
@keyframes orbpulse { 0% { transform: scale(0.7); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }

/* ── Feature list / bands ───────────────────────────────────── */
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature h4 { margin-bottom: 4px; }
.feature p { font-size: 0.95rem; }

.band-row {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  transition: transform .2s ease, border-color .2s ease;
  color: inherit;
}
.band-row:hover { transform: translateX(4px); border-color: var(--band, var(--accent)); }
.band-swatch { width: 12px; align-self: stretch; min-height: 44px; border-radius: 999px; background: var(--band, var(--accent)); flex: none; box-shadow: 0 0 18px var(--band, var(--accent)); }
.band-row .b-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.band-row .b-range { font-family: var(--mono); font-size: 12px; color: var(--band, var(--accent)); }
.band-row .b-tag { color: var(--muted); font-size: 0.92rem; }
.band-row .b-arrow { margin-left: auto; color: var(--faint); }

/* ── Pricing ────────────────────────────────────────────────── */
.price-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; margin: 0 auto; }
.plan { position: relative; text-align: left; }
.plan.best { border-color: rgba(40, 211, 238, 0.5); box-shadow: 0 0 0 1px rgba(40,211,238,0.25), 0 18px 50px rgba(40,211,238,0.12); }
.plan .badge { position: absolute; top: 18px; right: 18px; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; padding: 4px 9px; border-radius: 999px; background: var(--cyan); color: var(--bg); }
.plan .p-name { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.plan .p-price { font-family: var(--display); font-weight: 800; font-size: 2.6rem; color: var(--ink); margin: 10px 0 2px; letter-spacing: -0.03em; }
.plan .p-price span { font-size: 1rem; font-weight: 500; color: var(--muted); font-family: var(--mono); }
.plan .p-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.plan ul { list-style: none; }
.fine { font-size: 11px; color: var(--faint); line-height: 1.6; max-width: 560px; margin: 24px auto 0; text-align: center; }

/* checklists */
.check { list-style: none; }
.check li { position: relative; padding-left: 28px; margin: 9px 0; color: var(--muted); }
.check li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 16px; height: 16px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Comparison table ───────────────────────────────────────── */
.compare { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 14px; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--hairline); }
.compare thead th { font-family: var(--display); font-size: 15px; color: var(--ink); }
.compare thead th.us { color: var(--accent); }
.compare td.us { color: var(--ink); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.compare .yes { color: var(--cyan); }
.compare .no { color: var(--faint); }
.compare tbody tr:hover { background: rgba(234,240,255,0.02); }
.table-scroll { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 4px; font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--ink); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); font-size: 1.4rem; color: var(--accent); transition: transform .2s ease; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 4px 22px; color: var(--muted); }
.faq .faq-body p + p { margin-top: 12px; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 26px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin: 0 8px; opacity: 0.5; }

/* ── Article ────────────────────────────────────────────────── */
.article { max-width: var(--maxw-prose); margin: 0 auto; padding-top: 18px; }
.article .lede { font-size: 1.18rem; color: var(--ink); margin: 18px 0 8px; line-height: 1.55; }
.article h2 { margin: 48px 0 16px; }
.article h3 { margin: 32px 0 12px; }
.article p { margin: 14px 0; }
.article ul, .article ol { margin: 14px 0 14px 22px; color: var(--muted); }
.article li { margin: 8px 0; }
.article .callout { border-left: 3px solid var(--accent); background: rgba(102,120,246,0.06); padding: 16px 20px; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin: 24px 0; }
.article .callout p { margin: 0; color: var(--muted); }
.related { display: grid; gap: 14px; grid-template-columns: repeat(2,1fr); margin: 12px 0; }

/* inline CTA band */
.cta-band { text-align: center; }
.cta-band .panel { padding: clamp(36px, 6vw, 60px); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--hairline); padding: 56px 0 40px; margin-top: 40px; }
.footer .cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.footer h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer ul li { margin: 9px 0; }
.footer ul a { color: var(--muted); font-size: 14px; }
.footer ul a:hover { color: var(--ink); }
.footer .tag { color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 30ch; }
.footer .legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--faint); }
.disclaimer { font-size: 11px; color: var(--faint); line-height: 1.7; margin-top: 18px; max-width: 70ch; }

/* ── Utilities ──────────────────────────────────────────────── */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.mt-s { margin-top: 16px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 48px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(8,11,19,0.97); border-bottom: 1px solid var(--hairline); padding: 8px 24px 20px; backdrop-filter: blur(14px); }
  .nav-links.open a { padding: 13px 0; border-bottom: 1px solid var(--hairline); width: 100%; }
  .nav-links.open .nav-cta { margin: 14px 0 0; }
  .nav-toggle { display: block; }
  .grid-2, .grid-3, .grid-4, .price-grid, .related { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; gap: 28px; }
  section { padding: 48px 0; }
}

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

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
