/* ── Entrain Studio · marketing + learn design system ────────────────────────
   Shared by index.html (landing) and the /learn pages so every page reads as
   one polished system: aurora background, glass surfaces, motion, and a
   long-form "prose" style for the deep-info articles. */

:root {
  --bg: #070a0f;
  --bg-2: #0d1219;
  --panel: #121824;
  --panel-2: #18202e;
  --line: #212b3b;
  --text: #eef3f9;
  --muted: #8a97a9;
  --accent: #2ed3b7;
  --accent-2: #4e9bff;
  --violet: #9b6bff;
  --radius: 20px;
  --measure: 760px;                 /* one reading column, shared by hero + prose */
  --gutter: clamp(20px, 5vw, 26px); /* responsive side padding */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }
.narrow { max-width: var(--measure); }
.section { padding: clamp(56px, 9vw, 104px) 0; position: relative; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; }

/* ---------- moving aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; mix-blend-mode: screen; will-change: transform; }
.aurora .a1 { width: 640px; height: 640px; top: -180px; left: -120px; background: radial-gradient(circle, var(--accent), transparent 62%); animation: drift1 22s ease-in-out infinite; }
.aurora .a2 { width: 560px; height: 560px; top: 10%; right: -160px; background: radial-gradient(circle, var(--accent-2), transparent 62%); animation: drift2 26s ease-in-out infinite; }
.aurora .a3 { width: 520px; height: 520px; bottom: -160px; left: 30%; background: radial-gradient(circle, var(--violet), transparent 62%); animation: drift3 30s ease-in-out infinite; opacity: 0.32; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px,80px) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-100px,120px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-90px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- nav ---------- */
nav { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); background: rgba(7,10,15,0.6); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.logo .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent), 0 0 0 4px rgba(46,211,183,.16); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a.here { color: var(--text); }
@media (max-width: 820px) { .nav-links a.link { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: none; cursor: pointer; text-decoration: none; font-family: inherit; font-weight: 700; border-radius: 999px; transition: transform .12s ease, box-shadow .2s ease, filter .2s; position: relative; overflow: hidden; }
.btn-primary { color: #04231e; background: linear-gradient(180deg, var(--accent), #1fb79e); box-shadow: 0 10px 34px rgba(46,211,183,.34); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 44px rgba(46,211,183,.44); }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -80%; width: 60%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); animation: sheen 4.2s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { left: -80%; } 85%, 100% { left: 140%; } }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.03); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }
.btn-lg { padding: 17px 32px; font-size: 1.06rem; }
@media (prefers-reduced-motion: reduce) { .btn-primary::after { animation: none; display: none; } }

/* ---------- shared headings ---------- */
.kicker { color: var(--accent); font-weight: 700; font-size: 0.78rem; letter-spacing: 1.6px; text-transform: uppercase; margin-bottom: 12px; }
.kicker.center { text-align: center; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 45%, var(--violet)); background-size: 220% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: flow 8s linear infinite; }
@keyframes flow { to { background-position: 220% center; } }
@media (prefers-reduced-motion: reduce) { .grad { animation: none; } }

/* ---------- content-page hero ---------- */
/* The hero shares the prose reading column (var(--measure)) so the headline and
   the body it introduces line up on one left edge — no more left-pinned title
   over a centred column with a dead right gutter. */
.page-hero { padding: clamp(60px, 9vw, 100px) 0 clamp(26px, 4vw, 40px); }
.page-hero .wrap { max-width: var(--measure); }
/* Hub / index pages (wide card grid) keep the full-width hero so the headline
   lines up with the cards below it, not the narrower article measure. */
.page-hero .wrap.wide-hero { max-width: 1100px; }
/* On wide screens the article gains a TOC column; offset the hero into the same
   prose track so the headline stays aligned with the body it introduces. */
@media (min-width: 1080px) {
  .page-hero .wrap:not(.wide-hero) {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 210px minmax(0, var(--measure));
    gap: clamp(40px, 5vw, 72px);
    justify-content: center;
    padding: 0 var(--gutter);
  }
  .page-hero .wrap:not(.wide-hero) > * { grid-column: 2; }
  /* the eyebrow is an inline pill — keep it from stretching to the grid track */
  .page-hero .wrap:not(.wide-hero) > .eyebrow { justify-self: start; }
}
.page-hero .eyebrow { display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(46,211,183,.35); border-radius: 999px; padding: 6px 14px; margin-bottom: 22px; background: rgba(46,211,183,.06); }
.page-hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.5rem); font-weight: 850; margin: 0 0 18px; max-width: 20ch; }
.page-hero .standfirst { font-size: clamp(1.08rem, 2.1vw, 1.3rem); color: var(--muted); max-width: 62ch; margin: 0; line-height: 1.5; }

/* ---------- long-form prose ---------- */
/* Centred reading column, aligned with the hero, with a hairline lead-in rule
   so the article reads as one deliberate document. */
.article { padding-bottom: clamp(32px, 5vw, 56px); }
.article > * { position: relative; z-index: 1; }
.prose { max-width: var(--measure); margin: 0 auto; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 820; margin: 56px 0 14px; }
.prose h3 { font-size: 1.24rem; font-weight: 750; margin: 34px 0 10px; }
.prose p { color: #cdd6e2; font-size: 1.06rem; margin: 0 0 18px; }
.prose p.lead { font-size: 1.2rem; color: var(--text); }
.prose a.inline { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(46,211,183,.4); }
.prose a.inline:hover { border-color: var(--accent); }
.prose ul, .prose ol { color: #cdd6e2; font-size: 1.05rem; padding-left: 22px; margin: 0 0 18px; }
.prose li { margin: 8px 0; }
.prose strong { color: var(--text); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 46px 0; }

/* pull quote */
.pull { margin: 40px 0; padding: 6px 0 6px 26px; border-left: 3px solid var(--accent); font-size: 1.5rem; font-weight: 650; line-height: 1.35; letter-spacing: -0.02em; }
.pull .grad { font-weight: 750; }
.pull cite { display: block; margin-top: 12px; font-size: 0.9rem; font-weight: 500; color: var(--muted); font-style: normal; }

/* callout box */
.callout { margin: 30px 0; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; background: rgba(255,255,255,.025); }
.callout.accent { border-color: rgba(46,211,183,.4); background: linear-gradient(180deg, rgba(46,211,183,.08), transparent); }
.callout.warn { border-color: rgba(245,165,36,.4); background: linear-gradient(180deg, rgba(245,165,36,.08), transparent); }
.callout .c-title { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.callout p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* figure / diagram frame */
.figure { margin: 34px 0; border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: rgba(255,255,255,.02); }
.figure .cap { margin-top: 16px; font-size: 0.82rem; color: var(--muted); text-align: center; }
.prose p.sources-note { font-size: 0.86rem; color: var(--muted); line-height: 1.7; margin-top: -6px; }
.prose p.sources-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(46,211,183,.35); }
.prose p.sources-note a:hover { border-color: var(--accent); }

/* EEG band ladder */
.bands { display: flex; flex-direction: column; gap: 8px; }
.bandrow { display: flex; align-items: center; gap: 14px; }
.bandrow .bl { flex: 0 0 92px; font-weight: 700; font-size: 0.9rem; }
.bandrow .bt { flex: 1; height: 30px; border-radius: 8px; display: flex; align-items: center; padding-left: 12px; font-size: 0.78rem; color: #04231e; font-weight: 600; }
.bandrow .bhz { flex: 0 0 76px; text-align: right; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

/* two-tone beat diagram */
.beatviz { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: center; }
@media (max-width: 560px) { .beatviz { grid-template-columns: 1fr; } }
.ear { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.ear .hz { font-size: 1.8rem; font-weight: 800; }
.ear .lbl { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.ear .wv { height: 40px; margin-top: 12px; background:
  repeating-linear-gradient(90deg, transparent 0, transparent 3px, rgba(46,211,183,.5) 3px, rgba(46,211,183,.5) 4px); border-radius: 6px; }
.ear.right .wv { background:
  repeating-linear-gradient(90deg, transparent 0, transparent 4px, rgba(78,155,255,.5) 4px, rgba(78,155,255,.5) 5px); }

/* step / phase chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.chips span { border: 1px solid var(--line); background: rgba(255,255,255,.02); border-radius: 999px; padding: 7px 14px; font-size: 0.82rem; color: var(--muted); }
.chips span b { color: var(--text); }

/* who-cards */
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 20px 0; }
@media (max-width: 700px) { .who-grid { grid-template-columns: 1fr; } }
.who-card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: rgba(255,255,255,.025); transition: transform .2s, border-color .2s; }
.who-card:hover { transform: translateY(-3px); border-color: rgba(46,211,183,.4); }
.who-card .ic { font-size: 1.5rem; }
.who-card h3 { margin: 10px 0 6px; font-size: 1.08rem; }
.who-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* learn hub cards */
.hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 760px) { .hub { grid-template-columns: 1fr; } }
.hub a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); transition: transform .2s, border-color .2s, box-shadow .2s; }
.hub a:hover { transform: translateY(-4px); border-color: rgba(46,211,183,.4); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.hub .n { color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.hub h3 { margin: 8px 0 6px; font-size: 1.25rem; }
.hub p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* prev/next + inline CTA */
.readnext { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 60px; border-top: 1px solid var(--line); padding-top: 28px; }
.readnext a { text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.readnext a:hover { color: var(--text); }
.readnext a b { display: block; color: var(--text); font-size: 1.05rem; margin-top: 4px; }
.cta-inline { margin: 60px 0 0; text-align: center; border: 1px solid rgba(46,211,183,.4); border-radius: 24px; padding: 46px 28px; background: radial-gradient(120% 140% at 50% 0%, rgba(46,211,183,.16), var(--panel) 60%); }
.cta-inline h2 { margin: 0 0 8px; font-size: clamp(1.5rem,3.5vw,2rem); }
.cta-inline p { color: var(--muted); margin: 0 0 22px; }

/* ---------- article + sticky table of contents (built by marketing.js) ---------- */
/* On wide screens the TOC and prose share a centred two-column grid, so the
   article uses the width instead of floating a narrow column in a void. It
   collapses to a single centred column (TOC hidden) below 1080px. */
.article-layout { display: block; }
@media (min-width: 1080px) {
  .article-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, var(--measure));
    gap: clamp(40px, 5vw, 72px);
    justify-content: center;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--gutter);
  }
  /* the grid supplies the side padding, so the prose column drops its own */
  .article-layout .prose.in-layout { max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
}

.toc-rail { display: none; }
@media (min-width: 1080px) {
  .toc-rail { display: block; position: sticky; top: 92px; align-self: start; }
}
.toc { font-size: 0.9rem; }
.toc .t { text-transform: uppercase; letter-spacing: 1px; font-size: 0.7rem; font-weight: 700; color: var(--muted); margin-bottom: 12px; padding-left: 14px; }
.toc-links { display: flex; flex-direction: column; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 6px 0 6px 14px; font-size: 0.86rem; line-height: 1.35; border-left: 2px solid var(--line); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); border-color: var(--muted); }
.toc a.on { color: var(--text); border-left-color: var(--accent); font-weight: 600; }

/* ---------- visual depth ---------- */
/* a soft glow behind the hero title so it lifts off the aurora */
.page-hero { position: relative; }
.page-hero .wrap::before {
  content: ""; position: absolute; z-index: -1; left: 0; top: -40px;
  width: 420px; height: 320px; pointer-events: none;
  background: radial-gradient(60% 60% at 20% 30%, rgba(46,211,183,.12), transparent 70%);
}
/* subtle accent tab on section headings, for scannable rhythm */
.prose h2 { position: relative; padding-top: 6px; }
.prose h2::before {
  content: ""; position: absolute; top: -6px; left: 0; width: 40px; height: 3px;
  border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* footer */
footer { border-top: 1px solid var(--line); padding: 44px 0; color: var(--muted); font-size: 0.85rem; position: relative; z-index: 1; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.disclaimer { max-width: 1100px; margin: 24px auto 0; padding: 0 var(--gutter); color: var(--muted); font-size: 0.76rem; line-height: 1.6; opacity: .75; }
