/* ============================================================
   Canadian Private Investments — design system v6
   Warm light editorial · emerald accents · dark statement bands
   Fraunces + Inter
   ============================================================ */

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Light canvas */
  --bg: #faf8f2;
  --surface: #ffffff;
  --ink: #14201a;
  --mid: #55645b;
  --faint: #8b978f;
  --line: rgba(20, 32, 26, 0.12);
  --line-soft: rgba(20, 32, 26, 0.07);

  /* Emerald system */
  --em: #157a51;
  --em-deep: #0e5c3c;
  --em-bright: #35d597;
  --teal: #1d8f8a;
  --mint: #8df0c4;
  --em-tint: #e9f4ec;
  --em-tint-2: #d9ecdf;
  --em-line: rgba(21, 122, 81, 0.35);

  /* Dark statement sections */
  --dark-bg: #0d1411;
  --dark-ink: #f1f6f2;
  --dark-mid: #9fada4;
  --dark-line: rgba(241, 246, 242, 0.11);

  --grad-text: linear-gradient(94deg, #0e6b44 0%, #158a60 48%, #1d8f8a 100%);
  --grad-btn: linear-gradient(92deg, #38d89a, #2fc6b8);
  --on-grad: #04150e;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 26, 0.05);
  --shadow-md: 0 2px 4px rgba(20, 32, 26, 0.04), 0 14px 40px rgba(20, 32, 26, 0.08);
  --shadow-lg: 0 4px 8px rgba(20, 32, 26, 0.05), 0 24px 64px rgba(20, 32, 26, 0.12);
  --shadow-glow: 0 10px 32px rgba(47, 198, 152, 0.35);
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain — keeps the light canvas from feeling flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

a { color: var(--em); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 530;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

::selection { background: var(--em-tint-2); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--em);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Scroll reveal ---------- */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--rv-delay, 0s);
}
.rv.in { opacity: 1; transform: none; }
.no-js .rv, .no-io .rv { opacity: 1; transform: none; }

/* ---------- Spotlight cards ---------- */
.card, .group-card, .article-tile, .resource, .term, .acc, .opt, .result-box, .explorer, .step-row {
  position: relative;
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
              rgba(21, 122, 81, 0.07), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.spot:hover::before { opacity: 1; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 242, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50% 50% 50% 4px;
  background: var(--grad-btn);
  box-shadow: 0 0 10px rgba(53, 213, 151, 0.5);
  flex: none;
}
.brand span { color: var(--em); }

.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--mid);
  text-decoration: none;
  font-size: 14px;
  font-weight: 520;
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(20, 32, 26, 0.05); }
.nav-links a.active { color: var(--em-deep); background: var(--em-tint); }

.btn-funnel {
  margin-left: 10px;
  background: var(--grad-btn) !important;
  color: var(--on-grad) !important;
  padding: 10px 18px !important;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease) !important;
}
.btn-funnel:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  filter: brightness(1.05);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 650;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  letter-spacing: -0.01em;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
              background 0.16s var(--ease), border-color 0.16s var(--ease),
              color 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad-btn); color: var(--on-grad); }
.btn-primary:hover { box-shadow: var(--shadow-glow); filter: brightness(1.05); }
.btn-secondary { background: transparent; color: var(--ink); border-color: rgba(20, 32, 26, 0.25); }
.btn-secondary:hover { border-color: var(--em); color: var(--em-deep); }
.btn-ghost { background: transparent; color: var(--dark-ink); border-color: rgba(241, 246, 242, 0.28); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 42% at 82% 4%, rgba(53, 213, 151, 0.16), transparent 62%),
    radial-gradient(42% 46% at 4% 70%, rgba(29, 143, 138, 0.12), transparent 60%);
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.55;
}
.orb-1 {
  width: 560px; height: 560px;
  right: -140px; top: -160px;
  background: radial-gradient(circle, rgba(53, 213, 151, 0.32), transparent 65%);
  animation: drift1 24s ease-in-out infinite alternate;
}
.orb-2 {
  width: 480px; height: 480px;
  left: -170px; top: 340px;
  background: radial-gradient(circle, rgba(29, 143, 138, 0.24), transparent 65%);
  animation: drift2 28s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, 70px) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(90px, -60px) scale(1.1); } }

.hero-inner { position: relative; padding: 118px 0 0; max-width: 1020px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mid);
  margin: 0 0 34px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--em-bright);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(53, 213, 151, 0.7); }
  50% { box-shadow: 0 0 14px rgba(53, 213, 151, 1); }
}
.hero-inner h1 {
  font-size: clamp(46px, 7.4vw, 92px);
  margin: 0 0 30px;
  font-weight: 480;
  line-height: 1.04;
}
.hero-inner h1 em {
  font-style: italic;
  font-weight: 450;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-inner .lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--mid);
  margin: 0 0 44px;
  max-width: 620px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 84px;
  padding: 48px 0 64px;
  border-top: 1px solid var(--line);
}
.stat { padding-top: 20px; position: relative; }
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 56px; height: 3px;
  border-radius: 2px;
  background: var(--grad-btn);
}
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 470;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .l { font-size: 14px; color: var(--mid); margin-top: 10px; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 18px 0;
  position: relative;
}
.marquee::before, .marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mq-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mid);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  background: var(--bg);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.mq-chip:hover { color: var(--em-deep); border-color: var(--em-line); }
.mq-chip i { font-style: normal; font-family: var(--font-display); color: var(--em); font-size: 13px; }

/* ---------- Sections ---------- */
.home-section { padding: 108px 0; }
.kicker {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--em);
  margin: 0 0 18px;
}
.section-head { max-width: 720px; margin-bottom: 58px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 52px); margin: 0 0 18px; font-weight: 500; }
.section-head p { color: var(--mid); font-size: 17px; margin: 0; line-height: 1.65; }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 30px 28px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover { border-color: var(--em-line); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cols .card:nth-child(2) { margin-top: 34px; }
.card .idx {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 52px;
  font-weight: 450;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--em);
  margin-bottom: 22px;
  opacity: 0.8;
}
.card h3 { margin: 0 0 12px; font-size: 21px; font-weight: 540; }
.card p { margin: 0; color: var(--mid); font-size: 14.5px; line-height: 1.7; }

/* ---------- Dark statement band ---------- */
.band-dark {
  position: relative;
  overflow: hidden;
  padding: 118px 0;
  color: var(--dark-ink);
  background:
    radial-gradient(50% 60% at 85% 75%, rgba(53, 213, 151, 0.13), transparent 60%),
    radial-gradient(40% 50% at 8% 10%, rgba(29, 143, 138, 0.1), transparent 58%),
    var(--dark-bg);
}
.ghost {
  position: absolute;
  right: -0.06em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(200px, 28vw, 400px);
  font-weight: 500;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(53, 213, 151, 0.18);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  animation: ghostFloat 9s ease-in-out infinite alternate;
}
@keyframes ghostFloat { from { transform: translateY(-53%); } to { transform: translateY(-47%); } }
.band-inner { position: relative; max-width: 700px; }
.band-inner .kicker { color: var(--mint); }
.band-inner h2 { font-size: clamp(34px, 4.8vw, 56px); margin: 0 0 20px; font-weight: 480; color: #fff; }
.band-inner p { color: var(--dark-mid); font-size: 17px; line-height: 1.65; margin: 0 0 38px; max-width: 560px; }

/* ---------- Reading rows ---------- */
.read-list { border-top: 1px solid var(--line); }
.read-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 32px 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.16s var(--ease), padding 0.16s var(--ease);
}
.read-row:hover { background: var(--em-tint); padding-left: 20px; padding-right: 0; }
.read-row .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  color: transparent;
  -webkit-text-stroke: 1.1px var(--em);
}
.read-row .t h3 { margin: 0 0 5px; font-size: clamp(19px, 2.2vw, 25px); font-weight: 520; }
.read-row .t span { font-size: 13.5px; color: var(--faint); }
.read-row .arrow {
  font-size: 26px;
  color: var(--faint);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.read-row:hover .arrow { transform: translateX(8px); color: var(--em); }

/* ---------- Page shells ---------- */
.page-hero { position: relative; overflow: hidden; padding: 86px 0 54px; }
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(46% 60% at 84% 0%, rgba(53, 213, 151, 0.13), transparent 60%);
  pointer-events: none;
}
.page-hero .kicker { margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(40px, 5.6vw, 68px); margin: 0 0 18px; font-weight: 480; max-width: 800px; }
.page-hero .lede { font-size: 17.5px; color: var(--mid); margin: 0; line-height: 1.68; max-width: 640px; }

.page { padding: 0 0 110px; }
.page-narrow { max-width: 800px; }

.chapter { padding: 66px 0; border-top: 1px solid var(--line-soft); }
.chapter-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.chapter-label { position: sticky; top: 100px; }
.chapter-label .cnum {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 44px;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--em);
  margin-bottom: 10px;
}
.chapter-label h2 { font-size: 24px; margin: 0; font-weight: 540; }
.chapter-body p { color: #37453d; margin: 0 0 15px; font-size: 15.8px; line-height: 1.75; }
.chapter-body b { color: var(--ink); }
.chapter-body ul { color: #37453d; margin: 0 0 15px; padding-left: 22px; font-size: 15.8px; line-height: 1.72; }
.chapter-body li { margin-bottom: 8px; }
.chapter-body h3 { font-family: var(--font-ui); font-size: 16px; font-weight: 700; margin: 26px 0 10px; letter-spacing: -0.01em; color: var(--ink); }
.chapter-body .aside { color: var(--faint); font-size: 13.5px; }

.callout {
  background: var(--em-tint);
  border-left: 3px solid var(--em);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 26px 0;
}
.callout p { margin: 0 !important; font-size: 14.5px; color: var(--em-deep); line-height: 1.65; }
.callout b { color: var(--ink); }

/* ---------- Sub-nav pills ---------- */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 28px; }
.subnav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mid);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 16px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.subnav a:hover { border-color: var(--em-line); color: var(--em-deep); transform: translateY(-1px); }

/* ---------- Category explorer ---------- */
.explorer {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.explorer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.cat-pill {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--mid);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.cat-pill:hover { border-color: var(--em-line); color: var(--em-deep); transform: translateY(-1px); }
.cat-pill.on { background: var(--grad-btn); border-color: transparent; color: var(--on-grad); }
.cat-pill.on .ct { color: var(--on-grad); }
.cat-pill .ct { opacity: 0.75; font-weight: 500; margin-left: 5px; color: var(--em); }
.explorer-detail { padding: 30px; min-height: 190px; }
.explorer-detail .placeholder { color: var(--faint); font-size: 14.5px; }
.explorer-detail h3 { margin: 0 0 6px; font-size: 24px; font-weight: 530; }
.explorer-detail .ecount { font-size: 13.5px; color: var(--faint); margin: 0 0 18px; }
.explorer-detail .egroups { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.explorer-detail .egroups span {
  font-size: 12.5px;
  font-weight: 600;
  background: var(--em-tint);
  color: var(--em-deep);
  border: 1px solid var(--em-tint-2);
  border-radius: 999px;
  padding: 5px 13px;
}
.explorer-detail p { color: var(--mid); font-size: 14.5px; line-height: 1.7; margin: 0 0 20px; }
.explorer-detail .btn { padding: 12px 22px; font-size: 14px; }

/* ---------- Group cards ---------- */
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.group-card {
  display: block;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  text-decoration: none;
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.group-card:hover { border-color: var(--em-line); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.group-card b {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 650;
  margin-bottom: 6px;
}
.group-card b i {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--em);
  white-space: nowrap;
}
.group-card span { font-size: 13.5px; color: var(--mid); line-height: 1.6; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 0; counter-reset: step; }
.step-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.step-row:last-child { border-bottom: none; }
.step-row::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: transparent;
  -webkit-text-stroke: 1px var(--em);
  line-height: 1.2;
}
.step-row b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.step-row p { margin: 0 !important; font-size: 14px; color: var(--mid); line-height: 1.65; }

/* ---------- Accordions ---------- */
.acc {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.acc + .acc { margin-top: 12px; }
.acc[open] { border-color: var(--em-line); box-shadow: var(--shadow-md); }
.acc summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  transition: background 0.15s var(--ease);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: var(--em-tint); }
.acc .anum {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: transparent;
  -webkit-text-stroke: 1.1px var(--em);
}
.acc summary h3 { margin: 0; font-size: 20px; font-weight: 540; }
.acc summary .sub { display: block; font-size: 13px; color: var(--faint); font-family: var(--font-ui); font-weight: 400; margin-top: 4px; }
.acc .chev {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--mid);
  transition: transform 0.25s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.acc[open] .chev { transform: rotate(45deg); background: var(--grad-btn); border-color: transparent; color: var(--on-grad); }
.acc-body { padding: 4px 26px 28px 110px; }
.acc-body p { color: #37453d; margin: 0 0 14px; font-size: 15.3px; line-height: 1.75; }
.acc-body b { color: var(--ink); }
.acc-body ul { color: #37453d; margin: 0 0 14px; padding-left: 20px; font-size: 15.3px; line-height: 1.7; }
.acc-body li { margin-bottom: 7px; }
.acc-body h4 { font-size: 14.5px; font-weight: 700; margin: 20px 0 8px; color: var(--ink); }

/* ---------- Glossary ---------- */
.glossary-search { margin: 0 0 18px; max-width: 380px; }
.glossary-search input {
  width: 100%;
  padding: 13px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 14.5px;
  font-family: var(--font-ui);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.glossary-search input::placeholder { color: var(--faint); }
.glossary-search input:focus {
  outline: none;
  border-color: var(--em);
  box-shadow: 0 0 0 4px var(--em-tint);
}
.glossary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.term {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.term:hover { border-color: var(--em-line); transform: translateY(-2px); }
.term b { display: block; font-size: 15px; margin-bottom: 5px; color: var(--ink); }
.term span { font-size: 13.5px; color: var(--mid); line-height: 1.6; }
.glossary-empty { color: var(--faint); font-size: 14px; padding: 8px 2px; }

/* ---------- Resource links ---------- */
.resources { display: grid; gap: 10px; }
.resource {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px;
  text-decoration: none;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.resource:hover { border-color: var(--em-line); transform: translateX(5px); box-shadow: var(--shadow-md); }
.resource b { display: block; color: var(--ink); font-size: 15px; font-weight: 650; }
.resource span { font-size: 13.5px; color: var(--mid); line-height: 1.55; }
.resource::after { content: "→"; font-size: 18px; color: var(--em); flex: none; }
.resource[target="_blank"]::after { content: "↗"; }

/* ---------- Article tiles ---------- */
.article-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.article-cards .article-tile:nth-child(2) { margin-top: 26px; }
.article-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  text-decoration: none;
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.article-tile:hover { border-color: var(--em-line); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.article-tile .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  color: transparent;
  -webkit-text-stroke: 1.1px var(--em);
  margin-bottom: 16px;
}
.article-tile h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.3; font-weight: 540; color: var(--ink); }
.article-tile p { margin: 0 0 16px; color: var(--mid); font-size: 13.5px; line-height: 1.6; flex: 1; }
.article-meta { font-size: 12px; color: var(--faint); }
.article-meta .dot { margin: 0 6px; }

/* ---------- Article page ---------- */
.article { padding: 72px 0 110px; max-width: 720px; }
.crumb {
  display: inline-block;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 0 0 30px;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.crumb:hover { color: var(--em); }
.article h1 { font-size: clamp(32px, 4.6vw, 48px); margin: 0 0 20px; font-weight: 510; }
.article .byline {
  font-size: 13.5px;
  color: var(--faint);
  margin: 0 0 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.article h2 { font-size: 25px; margin: 42px 0 14px; font-weight: 530; }
.article p { margin: 0 0 18px; color: #333f38; font-size: 16.5px; line-height: 1.78; }
.article ul { margin: 0 0 24px; padding-left: 22px; color: #333f38; font-size: 16.5px; line-height: 1.72; }
.article li { margin-bottom: 8px; }

.article-note {
  background: var(--em-tint);
  border-left: 3px solid var(--em);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin: 0 0 34px;
}
.article-note p { margin: 0; font-size: 13.5px; color: var(--em-deep); line-height: 1.65; }

.related {
  background:
    radial-gradient(60% 90% at 90% 10%, rgba(53, 213, 151, 0.12), transparent 60%),
    var(--dark-bg);
  color: var(--dark-ink);
  border-radius: var(--radius);
  margin-top: 52px;
  padding: 34px 36px;
}
.related h2 { font-size: 22px; margin: 0 0 10px; color: #fff; }
.related p { font-size: 14px; color: var(--dark-mid); margin: 0 0 22px; line-height: 1.65; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links .btn { padding: 12px 22px; font-size: 14px; }
.related .btn-secondary { color: var(--dark-ink); border-color: rgba(241, 246, 242, 0.28); background: transparent; }
.related .btn-secondary:hover { border-color: var(--mint); color: var(--mint); }

.refs { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 26px; }
.refs h2 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 0 0 12px;
}
.refs ul { margin: 0; padding-left: 20px; }
.refs li { color: var(--mid); font-size: 13.5px; margin-bottom: 5px; }

/* ---------- Directory ---------- */
.dir-head { padding: 72px 0 30px; }
.dir-head h1 { font-size: clamp(38px, 5vw, 58px); margin: 0 0 12px; font-weight: 480; }
.dir-head p { margin: 0; color: var(--faint); font-size: 14px; }

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  margin-bottom: 8px;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--em);
  background: #fff;
  box-shadow: 0 0 0 4px var(--em-tint);
}

.filter-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 4px 18px;
  font-size: 13.5px;
  color: var(--mid);
  flex-wrap: wrap;
}
#count {
  background: var(--grad-btn);
  color: var(--on-grad);
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
}
.filter-meta button {
  background: none;
  border: none;
  color: var(--em);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-ui);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 96px;
}

.list-shell {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.scroller { height: 640px; overflow-y: auto; position: relative; }
.rows { position: relative; width: 100%; }
.row {
  position: absolute;
  left: 0;
  right: 0;
  height: 68px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  background: var(--surface);
  overflow: hidden;
  transition: background 0.12s var(--ease);
}
.row:hover { background: var(--em-tint); }
.row.selected { background: var(--em-tint); box-shadow: inset 4px 0 0 var(--em); }
.row-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.empty { padding: 52px 20px; text-align: center; color: var(--faint); font-size: 14.5px; }

.detail {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: sticky;
  top: 96px;
  max-height: 640px;
  overflow-y: auto;
}
.detail > * { animation: rise 0.3s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.detail-empty { color: var(--faint); font-size: 14.5px; text-align: center; padding: 52px 12px; }
.detail h2 { font-size: 27px; margin: 0 0 5px; font-weight: 510; }
.detail .nrd { font-size: 13px; color: var(--faint); margin: 0 0 24px; }
.detail-close {
  display: none;
  float: right;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  padding: 6px 11px;
  font-size: 14px;
  color: var(--mid);
}
.dl { border-top: 1px solid var(--line-soft); padding: 18px 0 0; margin: 0 0 18px; }
.dl h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  margin: 0 0 10px;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px;
  font-weight: 550;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  color: var(--mid);
  background: var(--bg);
}
.chip-accent { background: var(--em-tint); border-color: var(--em-tint-2); color: var(--em-deep); }
.contact-list { display: grid; gap: 9px; }
.contact-list .cl { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 13.5px; }
.contact-list .cl b { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 1px; }
.contact-list .cl span, .contact-list .cl a { color: var(--ink); line-height: 1.5; word-break: break-word; }
.detail-note {
  font-size: 12.5px;
  color: var(--faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  margin: 0;
  line-height: 1.65;
}

/* ---------- Funnel ---------- */
.funnel { padding: 88px 0 110px; max-width: 680px; }
.progress { display: flex; gap: 7px; margin-bottom: 40px; }
.progress i { height: 4px; flex: 1; background: var(--line); border-radius: 3px; transition: background 0.3s var(--ease); }
.progress i.done { background: var(--grad-btn); }
.step-count {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--em);
  margin: 0 0 12px;
}
.funnel h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 0 0 12px; font-weight: 500; }
.funnel .hint { color: var(--mid); margin: 0 0 32px; font-size: 15.5px; line-height: 1.6; }

.opts { display: grid; gap: 12px; margin-bottom: 34px; }
.opt {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  background: var(--surface);
  text-align: left;
  font-family: var(--font-ui);
  width: 100%;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease),
              transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.opt:hover { border-color: var(--em-line); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.opt.on { border-color: var(--em); background: var(--em-tint); }
.opt-box {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--faint);
  border-radius: 6px;
  flex: none;
  margin-top: 2px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.opt.on .opt-box { background: var(--em); border-color: var(--em); }
.opt-box.radio { border-radius: 50%; }
.opt-t { display: block; font-size: 15.5px; font-weight: 620; color: var(--ink); }
.opt-d { display: block; font-size: 13.5px; color: var(--mid); margin-top: 3px; line-height: 1.55; }
.funnel-nav { display: flex; gap: 12px; align-items: center; }
.funnel-nav .spacer { flex: 1; }
.link-back {
  background: none;
  border: none;
  color: var(--mid);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 550;
  font-family: var(--font-ui);
  padding: 0;
}
.link-back:hover { color: var(--ink); }

.result-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
  margin-bottom: 24px;
}
.result-box h3 { margin: 0 0 12px; font-size: 16px; font-family: var(--font-ui); font-weight: 700; color: var(--ink); }
.result-box ul { margin: 0; padding-left: 18px; color: var(--mid); font-size: 14.5px; line-height: 1.65; }
.result-box li { margin-bottom: 7px; }
.result-box .resources { margin-top: 4px; }

/* ---------- Footer (stays dark) ---------- */
.footer { background: var(--dark-bg); border-top: 1px solid var(--dark-line); color: var(--dark-mid); margin-top: auto; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 64px 28px 72px; }
.footer-brand {
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.footer-brand::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50% 50% 50% 4px;
  background: var(--grad-btn);
  box-shadow: 0 0 12px rgba(53, 213, 151, 0.5);
}
.footer-tag { font-size: 13.5px; margin: 0 0 36px; color: var(--dark-mid); }
.footer p { font-size: 12.5px; color: rgba(159, 173, 164, 0.8); margin: 0 0 10px; max-width: 900px; line-height: 1.7; }
.footer strong { color: var(--dark-mid); }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
  .marquee-track { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; gap: 16px; }
  .cols .card:nth-child(2) { margin-top: 0; }
  .article-cards { grid-template-columns: 1fr; }
  .article-cards .article-tile:nth-child(2) { margin-top: 0; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .glossary, .group-grid { grid-template-columns: 1fr; }
  .ghost { display: none; }
  .chapter-grid { grid-template-columns: 1fr; gap: 18px; }
  .chapter-label { position: static; display: flex; align-items: baseline; gap: 14px; }
  .chapter-label .cnum { margin-bottom: 0; font-size: 32px; }
  .read-row { grid-template-columns: 1fr; gap: 8px; }
  .read-row .num, .read-row .arrow { display: none; }
  .acc summary { grid-template-columns: 1fr auto; }
  .acc .anum { display: none; }
  .acc-body { padding: 4px 26px 28px; }
  .detail {
    position: fixed;
    inset: 0;
    z-index: 50;
    border-radius: 0;
    max-height: none;
    overflow-y: auto;
    display: none;
  }
  .detail.open { display: block; }
  .detail-close { display: block; }
  .detail-placeholder { display: none; }
  .hero-inner { padding: 78px 0 0; }
  .stats { margin-top: 58px; }
  .home-section, .band-dark { padding: 76px 0; }
  .orb { display: none; }
}

@media (max-width: 640px) {
  .filters { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 28px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 9px; }
  .btn-funnel { margin: 10px 0 0; text-align: center; }
  .scroller { height: 70vh; }
  .stats { grid-template-columns: 1fr; gap: 26px; padding-bottom: 48px; }
  .hero-inner h1 { font-size: clamp(38px, 11vw, 54px); }
  .home-section, .band-dark { padding: 60px 0; }
  .related { padding: 26px 24px; }
  .explorer-detail { padding: 22px; }
}
