/* NeuroSoundWave — Premium calm design system
   Palette: deep indigo, soft periwinkle, teal accent, warm cream
   Fonts: Fraunces (headings, serif), Inter (body, sans)
*/

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ----- Tokens ----- */
:root {
  --bg: #faf8f3;
  --bg-alt: #f1ecdf;
  --surface: #ffffff;
  --ink: #14213d;
  --ink-soft: #3a4566;
  --ink-mute: #6b7590;
  --line: #e6e0d0;
  --primary: #2d3561;      /* deep indigo */
  --primary-2: #4d5a8f;
  --accent: #5cb3a8;       /* calm teal */
  --accent-2: #7a89c2;     /* soft periwinkle */
  --warm: #d9a05b;         /* sunset warmth for CTA */
  --shadow: 0 10px 30px rgba(20, 33, 61, 0.08);
  --shadow-lg: 0 25px 60px rgba(20, 33, 61, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1240px;
  --readw: 720px;
}

/* ----- Base ----- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: .75rem; }
p { margin-bottom: 1.1rem; color: var(--ink-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.container-read { max-width: var(--readw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 1.5rem); }

/* ----- Header ----- */
.site-header {
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.25rem;
  color: var(--ink);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--primary));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 4px 12px rgba(45,53,97,.25);
}
.nav-links { display: flex; gap: 1.75rem; align-items: center; font-size: .95rem; }
.nav-links a { color: var(--ink-soft); font-weight: 500; }
.nav-links a:hover { color: var(--primary); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); gap: 1rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; font-size: 1.4rem; color: var(--ink); }
}

/* ----- Hero (home) ----- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(ellipse at top left, rgba(122,137,194,.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(92,179,168,.15), transparent 60%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero .eyebrow {
  display: inline-block; padding: .35rem .8rem; border-radius: 999px;
  background: rgba(45,53,97,.08); color: var(--primary);
  font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 55ch; margin-bottom: 2rem; }
.hero-visual {
  aspect-ratio: 4/3; border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(45,53,97,.85), rgba(92,179,168,.55)),
    url('https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=1200&q=80&auto=format&fit=crop') center/cover;
  box-shadow: var(--shadow-lg);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .95rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(45,53,97,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(45,53,97,.3); background: var(--primary-2); }
.btn-warm { background: var(--warm); color: #1a1a1a; box-shadow: 0 8px 20px rgba(217,160,91,.35); }
.btn-warm:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(217,160,91,.45); }
.btn-ghost { color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }

/* ----- Sections ----- */
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-title { text-align: center; margin-bottom: .75rem; }
.section-sub { text-align: center; color: var(--ink-mute); max-width: 60ch; margin: 0 auto 3rem; }

/* ----- Article cards ----- */
.grid { display: grid; gap: 1.75rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card-body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.card h3 { margin: 0; font-size: 1.2rem; }
.card p { font-size: .95rem; color: var(--ink-mute); margin: 0; }
.card-link { margin-top: auto; font-weight: 600; color: var(--primary); font-size: .9rem; padding-top: 1rem; }

/* Pillar highlight card */
.card-pillar {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.card-pillar h3, .card-pillar h2 { color: #fff; }
.card-pillar .card-body { padding: clamp(1.5rem, 3vw, 2.5rem); }
.card-pillar p { color: rgba(255,255,255,.85); }
.card-pillar .card-tag { color: #ffd7a6; }
.card-pillar .card-link { color: #ffd7a6; }
@media (max-width: 720px) { .card-pillar { grid-template-columns: 1fr; } }

/* Cluster map (unwritten) */
.cluster-map { background: var(--bg-alt); }
.cluster-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
@media (max-width: 720px) { .cluster-list { grid-template-columns: 1fr; } }
.cluster-item {
  background: var(--surface); padding: 1.1rem 1.3rem; border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  display: flex; align-items: baseline; gap: .8rem;
}
.cluster-item .num { font-family: 'Fraunces', serif; font-weight: 600; color: var(--accent); font-size: 1.05rem; min-width: 1.5ch; }
.cluster-item .t { color: var(--ink); font-weight: 500; font-size: .98rem; line-height: 1.4; }
.cluster-item .badge { margin-left: auto; font-size: .7rem; color: var(--ink-mute); background: var(--bg-alt); padding: .2rem .55rem; border-radius: 999px; }

/* ----- Article page ----- */
.article-hero {
  padding: clamp(2rem, 5vw, 4rem) 0 1.5rem;
  background: var(--bg-alt);
}
.article-meta { display: flex; gap: 1rem; align-items: center; color: var(--ink-mute); font-size: .9rem; margin-bottom: 1rem; }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-mute); display: inline-block; }
.article-hero h1 { margin-bottom: 1rem; max-width: 22ch; }
.article-hero p.dek { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.article-cover {
  width: 100%; aspect-ratio: 21/9; object-fit: cover;
  margin: 2rem 0 0; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-body { padding: 3rem 0; }
.article-body h2 { margin-top: 3rem; }
.article-body h2:first-child { margin-top: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.5rem 1.25rem; color: var(--ink-soft); }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--primary); border-bottom: 1px solid rgba(45,53,97,.25); }
.article-body a:hover { border-bottom-color: var(--primary); }
.article-body img { border-radius: var(--radius); margin: 2rem 0; box-shadow: var(--shadow); }
.article-body figcaption { text-align: center; color: var(--ink-mute); font-size: .85rem; margin-top: -1rem; margin-bottom: 2rem; }

/* Answer block */
.answer-block {
  background: linear-gradient(180deg, #fff, #f7f4ea);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-sm);
  margin: 0 0 2.5rem;
  box-shadow: var(--shadow);
}
.answer-block .label {
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.answer-block p { margin: 0; color: var(--ink); font-size: 1.05rem; }
.answer-block p strong { color: var(--primary); }

/* Data callout */
.data-callout {
  background: var(--bg-alt);
  padding: 1.3rem 1.6rem; border-radius: var(--radius-sm);
  margin: 1.5rem 0; font-style: italic; color: var(--ink-soft);
  border-left: 3px solid var(--accent-2);
}
.data-callout cite { font-style: normal; font-size: .82rem; color: var(--ink-mute); display: block; margin-top: .5rem; }

/* Affiliate box */
.affiliate-box {
  background: linear-gradient(135deg, #fff, #f5efe0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0;
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
@media (max-width: 640px) { .affiliate-box { grid-template-columns: 1fr; text-align: center; } }
.affiliate-box h3 { margin: 0 0 .5rem; color: var(--primary); font-size: 1.35rem; }
.affiliate-box p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.affiliate-box .disclosure { font-size: .78rem; color: var(--ink-mute); margin-top: .75rem; font-style: italic; }

/* Author card (inline) */
.author-card {
  display: flex; gap: 1.25rem; align-items: center;
  padding: 1.5rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin: 3rem 0;
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 600;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25);
}
.avatar-lg { width: 140px; height: 140px; font-size: 3.2rem; }
.author-card .who { color: var(--primary); font-weight: 600; }
.author-card p { margin: .2rem 0 0; font-size: .93rem; color: var(--ink-soft); }

/* FAQ */
.faq { margin-top: 3rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.4rem;
  margin-bottom: .75rem;
}
.faq summary {
  font-weight: 600; color: var(--ink); cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  font-family: 'Fraunces', serif; font-size: 1.05rem;
}
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.4rem; font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin-top: .8rem; margin-bottom: 0; }

/* Table of contents */
.toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin-bottom: 2.5rem;
}
.toc h4 { font-family: 'Inter', sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); margin-bottom: .6rem; }
.toc ol { margin: 0 0 0 1.2rem; padding: 0; }
.toc li { margin: .3rem 0; font-size: .95rem; }
.toc a { color: var(--ink-soft); border-bottom: none; }
.toc a:hover { color: var(--primary); }

/* Related */
.related { background: var(--bg-alt); }

/* About page */
.about-hero {
  padding: 5rem 0 3rem;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
}
.about-hero-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: center; }
@media (max-width: 720px) { .about-hero-grid { grid-template-columns: 1fr; text-align: center; } .about-hero-grid .avatar-lg { margin: 0 auto; } }
.credentials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 3rem 0; }
@media (max-width: 640px) { .credentials { grid-template-columns: 1fr; } }
.credential { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); text-align: center; }
.credential .n { font-family: 'Fraunces', serif; font-size: 2rem; color: var(--accent); display: block; margin-bottom: .3rem; }
.credential .l { font-size: .88rem; color: var(--ink-mute); }

/* Footer */
.site-footer {
  background: var(--primary); color: rgba(255,255,255,.85);
  padding: 3rem 0 2rem; margin-top: 4rem;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-grid h5 { font-family: 'Inter', sans-serif; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: .4rem; font-size: .95rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem; color: rgba(255,255,255,.6);
}
.footer-brand p { color: rgba(255,255,255,.75); font-size: .95rem; max-width: 40ch; margin-top: .5rem; }

/* Utility */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 3rem 0; }
