/* The Stack Method Academy — standalone design system.
   Self-contained. No dependency on the CRM. */
:root {
  --bg: #0a0e14;
  --bg-2: #0f1521;
  --panel: #141c2b;
  --panel-2: #1a2436;
  --line: #243049;
  --line-2: #2f3e5c;
  --txt: #e8eef7;
  --txt-dim: #9fb0c8;
  --txt-mute: #6b7b96;
  --accent: #4f9dff;
  --accent-2: #2bd9a8;
  --gold: #ffc24b;
  --danger: #ff6b6b;
  --grad: linear-gradient(120deg, #4f9dff 0%, #2bd9a8 100%);
  --grad-gold: linear-gradient(120deg, #ffc24b 0%, #ff8a3d 100%);
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 75% -10%, #16233b 0%, transparent 55%),
              radial-gradient(900px 600px at 0% 10%, #102219 0%, transparent 50%),
              var(--bg);
  color: var(--txt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 750; letter-spacing: -0.02em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 20, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--txt); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #04121f;
  box-shadow: 0 4px 14px rgba(79, 157, 255, 0.4);
}
.brand .mark::before { content: "≡"; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--txt-dim); padding: 8px 13px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.nav-links a:hover { color: var(--txt); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--txt); background: var(--panel-2); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { padding: 70px 0 40px; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-2);
  background: rgba(43, 217, 168, 0.1); border: 1px solid rgba(43, 217, 168, 0.25);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(32px, 6vw, 58px); margin: 0 0 18px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 2.3vw, 21px); color: var(--txt-dim); max-width: 720px; margin: 0 0 30px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; border: none;
  font-family: var(--font); font-size: 15px; font-weight: 700; padding: 12px 22px; border-radius: 12px;
  background: var(--panel-2); color: var(--txt); border: 1px solid var(--line-2);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--grad); color: #04121f; border: none; }
.btn.gold { background: var(--grad-gold); color: #2a1700; border: none; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card.link { transition: transform 0.14s ease, border-color 0.14s ease; }
.card.link:hover { transform: translateY(-4px); border-color: var(--line-2); text-decoration: none; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { color: var(--txt-dim); margin: 0; font-size: 15px; }
.card .ico { font-size: 26px; margin-bottom: 12px; display: block; }
.section { padding: 48px 0; }
.section h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; }
.section .sub { color: var(--txt-dim); margin: 0 0 28px; font-size: 16px; max-width: 680px; }

/* ---------- stat chips ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; min-width: 130px; }
.stat .n { font-size: 26px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { font-size: 12.5px; color: var(--txt-mute); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- clip / lesson layout ---------- */
.clip { margin-bottom: 26px; scroll-margin-top: 84px; }
.clip-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.clip-badge {
  width: 46px; height: 46px; border-radius: 12px; background: var(--grad); color: #04121f;
  display: grid; place-items: center; font-weight: 900; font-size: 20px; flex-shrink: 0;
}
.clip-head h3 { margin: 0; font-size: 21px; }
.clip-head .meta { color: var(--txt-mute); font-size: 13.5px; margin-top: 2px; }
audio { width: 100%; margin: 6px 0 16px; border-radius: 10px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 0; flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; color: var(--txt-mute); font-family: var(--font);
  font-size: 14px; font-weight: 700; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--txt-dim); }
.tab-btn.active { color: var(--txt); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 18px 2px; }
.tab-panel.active { display: block; }

.transcript-line { display: flex; gap: 12px; padding: 4px 0; align-items: baseline; }
.transcript-line .ts {
  color: var(--accent); font-variant-numeric: tabular-nums; font-size: 12.5px; cursor: pointer;
  font-weight: 700; flex-shrink: 0; min-width: 52px; opacity: 0.85;
}
.transcript-line .ts:hover { text-decoration: underline; }
.transcript-line .tx { color: var(--txt-dim); }
.cleaned p { color: var(--txt); margin: 0 0 14px; }
.filtered ul { margin: 0; padding-left: 4px; list-style: none; }
.filtered li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); color: var(--txt); }
.filtered li:last-child { border-bottom: none; }
.filtered li::before { content: "▸"; position: absolute; left: 4px; color: var(--accent-2); font-weight: 900; }
.filtered li b { color: var(--gold); }

/* ---------- prose (course/essays) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin: 38px 0 12px; font-size: 27px; }
.prose h3 { margin: 28px 0 10px; font-size: 20px; color: var(--accent-2); }
.prose p { color: var(--txt-dim); margin: 0 0 16px; }
.prose ul, .prose ol { color: var(--txt-dim); padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--txt); }
.prose blockquote {
  border-left: 3px solid var(--accent); background: var(--panel); margin: 18px 0; padding: 14px 18px;
  border-radius: 0 12px 12px 0; color: var(--txt-dim); font-style: italic;
}
.callout {
  background: linear-gradient(180deg, rgba(255, 194, 75, 0.08), rgba(255, 138, 61, 0.04));
  border: 1px solid rgba(255, 194, 75, 0.3); border-radius: 12px; padding: 16px 18px; margin: 20px 0;
}
.callout b { color: var(--gold); }

/* table of contents */
.toc { position: sticky; top: 84px; align-self: start; }
.toc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.toc-card h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--txt-mute); }
.toc-card a { display: block; color: var(--txt-dim); font-size: 14px; padding: 5px 0; }
.toc-card a:hover { color: var(--txt); text-decoration: none; }
.split { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }

/* ---------- glossary ---------- */
.gloss-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.gloss-item dt { font-weight: 750; font-size: 17px; color: var(--txt); margin-bottom: 6px; }
.gloss-item dd { margin: 0; color: var(--txt-dim); }
.gloss-search {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--txt); font-family: var(--font); font-size: 15px; margin-bottom: 8px;
}

/* ---------- quiz ---------- */
.quiz-bar { position: sticky; top: 64px; z-index: 20; background: rgba(10,14,20,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 24px; }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); width: 0; transition: width 0.3s ease; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.q .qmeta { font-size: 12px; color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.q h4 { margin: 0 0 16px; font-size: 18px; }
.opt {
  display: block; padding: 13px 16px; border: 1px solid var(--line-2); border-radius: 11px; margin-bottom: 10px;
  cursor: pointer; color: var(--txt-dim); transition: all 0.12s ease; background: var(--bg-2);
}
.opt:hover { border-color: var(--accent); color: var(--txt); }
.opt.selected { border-color: var(--accent); background: rgba(79, 157, 255, 0.1); color: var(--txt); }
.opt.correct { border-color: var(--accent-2); background: rgba(43, 217, 168, 0.13); color: var(--txt); }
.opt.wrong { border-color: var(--danger); background: rgba(255, 107, 107, 0.12); color: var(--txt); }
.opt.disabled { pointer-events: none; }
.explain { display: none; margin-top: 12px; padding: 13px 15px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-dim); font-size: 14.5px; }
.explain.show { display: block; }
.explain b { color: var(--accent-2); }
.scorecard { text-align: center; padding: 40px 24px; }
.scorecard .big { font-size: 60px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- downloads ---------- */
.dl-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dl-row .dl-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--panel-2); display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.dl-row .dl-meta { flex: 1; min-width: 180px; }
.dl-row .dl-meta b { display: block; color: var(--txt); }
.dl-row .dl-meta span { color: var(--txt-mute); font-size: 13px; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); color: var(--txt-dim); border: 1px solid var(--line-2); }
.tag.cond { background: rgba(43, 217, 168, 0.12); color: var(--accent-2); border-color: rgba(43, 217, 168, 0.3); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0; color: var(--txt-mute); font-size: 13.5px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.disclaimer { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; color: var(--txt-mute); font-size: 13px; margin-top: 20px; }

/* ---------- imagery ---------- */
.hero-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 30px; align-items: center; }
.hero-art { position: relative; }
.hero-art img { width: 100%; border-radius: 22px; border: 1px solid var(--line-2); box-shadow: var(--shadow); display: block; }
.hero-art::after { content: ""; position: absolute; inset: -30px; background: radial-gradient(closest-side, rgba(79,157,255,0.25), transparent 70%); z-index: -1; }

.card .card-art { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.card.imgcard { padding: 16px; }
.card.imgcard h3 { margin: 0 0 6px; font-size: 17px; }
.card.imgcard p { font-size: 14px; }

figure.illus { margin: 24px 0; }
figure.illus img { width: 100%; border-radius: 16px; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); display: block; }
figure.illus figcaption { color: var(--txt-mute); font-size: 13px; margin-top: 10px; text-align: center; font-style: italic; }
.illus.float-right { float: right; width: 320px; margin: 6px 0 18px 26px; }
@media (max-width: 720px) { .illus.float-right { float: none; width: 100%; margin: 18px 0; } }

/* ---------- SVG infographics ---------- */
.infographic { background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%); border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin: 26px 0; box-shadow: var(--shadow-sm); }
.infographic h3 { margin: 0 0 4px; font-size: 19px; }
.infographic .cap { color: var(--txt-mute); font-size: 13.5px; margin: 0 0 18px; }
.infographic svg { width: 100%; height: auto; display: block; }
.flow-node { fill: var(--panel-2); stroke: var(--line-2); }
.flow-accent { fill: rgba(79,157,255,0.14); stroke: var(--accent); }
.flow-accent2 { fill: rgba(43,217,168,0.14); stroke: var(--accent-2); }
.flow-gold { fill: rgba(255,194,75,0.14); stroke: var(--gold); }
.flow-t { fill: var(--txt); font: 600 14px var(--font); }
.flow-t.sm { font-size: 11.5px; fill: var(--txt-dim); font-weight: 500; }
.flow-t.big { font-size: 17px; font-weight: 750; }
.flow-t.lbl { fill: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.flow-line { stroke: var(--accent); stroke-width: 2.5; fill: none; marker-end: url(#arrow); }
.flow-line.g { stroke: var(--accent-2); marker-end: url(#arrowg); }
.flow-line.gold { stroke: var(--gold); marker-end: url(#arrowgold); }
.flow-line.dash { stroke-dasharray: 6 5; }

/* visual page steps */
.vstep { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.vstep .vnum { width: 56px; height: 56px; border-radius: 16px; background: var(--grad); color: #04121f; display: grid; place-items: center; font-weight: 900; font-size: 24px; box-shadow: 0 6px 18px rgba(79,157,255,0.35); }
.vstep h3 { margin: 2px 0 6px; font-size: 21px; }
.vstep p { color: var(--txt-dim); margin: 0 0 12px; }
.vstep .vart { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; margin-top: 8px; }
.vstep .vart img { width: 100%; border-radius: 14px; border: 1px solid var(--line-2); }
@media (max-width: 720px) { .vstep .vart { grid-template-columns: 1fr; } .vstep { grid-template-columns: 44px 1fr; gap: 12px; } .vstep .vnum { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; } }

/* image gallery / lightbox */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; transition: transform 0.14s ease, border-color 0.14s ease; }
.gallery img:hover { transform: scale(1.03); border-color: var(--accent); }
.lightbox { position: fixed; inset: 0; background: rgba(4,8,14,0.92); display: none; place-items: center; z-index: 200; padding: 30px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 16px; box-shadow: var(--shadow); }

/* ---------- risk module ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
.compare .col { border-radius: 16px; padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.compare .col.good { border-color: rgba(43,217,168,0.35); background: linear-gradient(180deg, rgba(43,217,168,0.07), var(--bg-2)); }
.compare .col.bad { border-color: rgba(255,107,107,0.32); background: linear-gradient(180deg, rgba(255,107,107,0.06), var(--bg-2)); }
.compare .col h4 { margin: 0 0 4px; font-size: 17px; }
.compare .col .tagline { color: var(--txt-mute); font-size: 13px; margin: 0 0 14px; }
.compare .col img { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 14px; }
.compare ul { list-style: none; padding: 0; margin: 0; }
.compare li { position: relative; padding: 7px 0 7px 26px; color: var(--txt-dim); font-size: 14.5px; border-bottom: 1px solid var(--line); }
.compare li:last-child { border-bottom: none; }
.compare li::before { position: absolute; left: 2px; font-weight: 900; }
.compare .good li::before { content: "✓"; color: var(--accent-2); }
.compare .bad li::before { content: "✕"; color: var(--danger); }
.compare li b { color: var(--txt); }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }

.riskmeter { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.riskmeter .bar { flex: 1; height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.riskmeter .bar > span { display: block; height: 100%; }
.riskmeter .lvl { font-weight: 800; font-size: 13px; white-space: nowrap; }
.fill-low { width: 30%; background: linear-gradient(90deg,#2bd9a8,#4f9dff); }
.fill-med { width: 58%; background: linear-gradient(90deg,#ffc24b,#ff8a3d); }
.fill-high { width: 86%; background: linear-gradient(90deg,#ff8a3d,#ff6b6b); }

.verdict { border-radius: 16px; padding: 22px 24px; margin: 24px 0; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%); }
.verdict h3 { margin: 0 0 10px; font-size: 20px; }
.verdict .badge { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.badge.warn { background: rgba(255,194,75,0.14); color: var(--gold); border: 1px solid rgba(255,194,75,0.35); }
.badge.danger { background: rgba(255,107,107,0.13); color: var(--danger); border: 1px solid rgba(255,107,107,0.35); }
.badge.ok { background: rgba(43,217,168,0.13); color: var(--accent-2); border: 1px solid rgba(43,217,168,0.35); }

.waterfall { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wf { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.wf h4 { margin: 0 0 12px; font-size: 15px; }
.wf .tier { padding: 10px 12px; border-radius: 9px; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); }
.wf .tier small { display: block; font-weight: 500; color: var(--txt-mute); font-size: 12px; margin-top: 2px; }
.tier.senior { background: rgba(79,157,255,0.14); border-color: var(--accent); }
.tier.you { background: rgba(43,217,168,0.12); border-color: var(--accent-2); }
.tier.seller-eq { background: rgba(255,107,107,0.12); border-color: var(--danger); }
.tier.seller-1st { background: rgba(43,217,168,0.16); border-color: var(--accent-2); }
@media (max-width: 720px) { .waterfall { grid-template-columns: 1fr; } }

.checklist { columns: 2; column-gap: 28px; margin: 8px 0; }
.checklist .ci { break-inside: avoid; display: flex; gap: 10px; padding: 8px 0; color: var(--txt-dim); font-size: 14.5px; }
.checklist .ci::before { content: "▢"; color: var(--accent); font-weight: 800; }
@media (max-width: 720px) { .checklist { columns: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) { .hero-layout { grid-template-columns: 1fr; } .hero-art { order: -1; max-width: 460px; } }
@media (max-width: 820px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .toc { position: static; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: grid; place-items: center; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--txt); font-size: 20px; cursor: pointer; }
}
