/* Hub finish, shared by /guides/, /faq/, /glossary/ and /analysis. Five palette families colour the five topics: brand pink, success green,
   warm bronze, error coral and plum. Each topic carries --c (fills and glows) and --ct (text, dark enough to read on light). A drifting
   gradient aura sits behind the hero, stats count up, the path draws itself, and cards light up under the cursor and rise in on scroll.
   Behaviour is public/guides/hub.js; without it everything is simply visible. */

:root {
  --hc-1: #8A1157; --hc-2: #A50F66; --hc-3: #C80E7D; --hc-4: #E61C9A; --hc-5: #FC6AD0;
  --hc-t: #8A1157;      /* ramp as text */
  --hp-fill: #C80E7D;   /* filled marks and actions */
  --hc-on: #FFFFFF;
}
:root[data-theme="dark"] {
  --hc-1: #C80E7D; --hc-2: #E61C9A; --hc-3: #FC6AD0; --hc-4: #FEA3E5; --hc-5: #FECCF1;
  --hc-t: #FEA3E5;
  --hp-fill: #FC6AD0;
  --hc-on: #0F0F0F;
}
[data-c="pink"] { --c: var(--hc-1); --ct: var(--hc-t); }
[data-c="green"] { --c: var(--hc-2); --ct: var(--hc-t); }
[data-c="bronze"] { --c: var(--hc-3); --ct: var(--hc-t); }
[data-c="coral"] { --c: var(--hc-4); --ct: var(--hc-t); }
[data-c="plum"] { --c: var(--hc-5); --ct: var(--hc-t); }

/* ── hero: a plain header with one soft wash ── */
body > header { position: relative; background: radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--hc-1) 9%, transparent), transparent 75%); }
body > header h1 em { font-style: normal; background: linear-gradient(100deg, var(--hc-1) 5%, var(--hc-3) 50%, var(--hc-4) 100%); background-size: 240% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── scroll reveal (only when script runs) ── */
.js-hub [data-rv] { opacity: 0; transform: translateY(22px) scale(.985); transition: opacity .8s cubic-bezier(0.16, 1, 0.3, 1), transform .9s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.js-hub [data-rv].is-in { opacity: 1; transform: none; }

/* ── cursor-lit surface, shared by every card ── */
.hub-lit { --mx: 50%; --my: 0%; position: relative; overflow: hidden; isolation: isolate; }
.hub-lit::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(240px circle at var(--mx) var(--my), color-mix(in srgb, var(--c, var(--hc-1)) 14%, transparent), transparent 70%); }
.hub-lit:hover::after { opacity: 1; }
.hub-lit > * { position: relative; z-index: 1; }

/* ── reading path ── */
.hub-path { margin: 8px 0 54px; }
.hub-path__lede { margin: 0 0 30px; color: var(--text-2); }
.hub-steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 52px 0 0; list-style: none; counter-reset: step; }
.hub-steps::before { content: ""; position: absolute; left: 35px; right: calc(25% - 35px + 4px); top: 19px; height: 3px; border-radius: 3px; z-index: 0; background: linear-gradient(90deg, var(--hc-1), var(--hc-2), var(--hc-3), var(--hc-4)); transform-origin: 0 50%; opacity: .9; }
.js-hub .hub-steps::before { transform: scaleX(0); transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1) .2s; }
.js-hub .hub-steps.is-in::before { transform: none; }
.hub-step { display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 18px; margin-top: 0; border: 1px solid var(--border-soft); border-radius: 22px; background: rgba(var(--ink-rgb), 0.03);
  transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1), border-color .4s, background-color .4s, box-shadow .6s cubic-bezier(0.16, 1, 0.3, 1); }
.hub-step__n { position: absolute; top: -52px; left: 18px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; font-weight: 700; color: var(--hc-on); background: var(--hp-fill); box-shadow: 0 0 0 6px color-mix(in srgb, var(--hp-fill) 22%, transparent), 0 8px 20px color-mix(in srgb, var(--hp-fill) 40%, transparent); z-index: 2; }
.hub-step::before { content: ""; position: absolute; top: -14px; left: 37px; width: 2px; height: 14px; background: linear-gradient(180deg, var(--hp-fill), color-mix(in srgb, var(--hp-fill) 15%, transparent)); }
.hub-step__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hc-t); }
.hub-step__meta svg { width: 18px; height: 18px; }
.hub-step__meta span { margin-left: auto; font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--text-3); }
.js-hub .hub-steps.is-in .hub-step__n { animation: hub-pop .8s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 280ms + 300ms); }
@keyframes hub-pop { 0% { transform: scale(0); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.hub-step:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 55%, var(--border-soft)); background: color-mix(in srgb, var(--c) 6%, transparent); box-shadow: 0 18px 38px color-mix(in srgb, var(--c) 18%, transparent); }
.hub-step h3 { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text-1); }
.hub-step p { margin: 0; font-size: 0.9063rem; line-height: 1.5; color: var(--text-2); }
.hub-step a { margin-top: auto; padding-top: 8px; font-size: 0.875rem; font-weight: 600; color: var(--ct); text-decoration: none; }
.hub-step a span { display: inline-block; transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1); }
.hub-step:hover a span { transform: translateX(5px); }

/* ── topic sections ── */
.hub-group { margin: 0 0 52px; }
.hub-group__head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.hub-group__ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; color: var(--ct); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.hub-group__ic svg { width: 24px; height: 24px; }
.hub-group__head h2 { margin: 0; }
.hub-group__head p { margin: 2px 0 0; font-size: 0.9063rem; color: var(--text-3); }
.hub-group__head > div { min-width: 0; }
.hub-group__count { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; color: var(--ct); background: color-mix(in srgb, var(--c) 12%, transparent); }
.hub-group .guide-cards { gap: 16px; }
.guide-card { position: relative; overflow: hidden; isolation: isolate; gap: 6px; transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1), border-color .4s, box-shadow .6s cubic-bezier(0.16, 1, 0.3, 1), background-color .4s; }
.hub-group .guide-card { --mx: 50%; --my: 0%; }
.hub-group .guide-card::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 15%, transparent), transparent 70%); }
.hub-group .guide-card > * { position: relative; z-index: 1; }
.hub-group .guide-card:hover::after, .hub-group .guide-card:focus-visible::after { opacity: 1; }
.hub-group .guide-card:hover, .hub-group .guide-card:focus-visible { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 50%, var(--border-soft)); box-shadow: 0 16px 34px color-mix(in srgb, var(--c) 14%, transparent); }
.hub-group .guide-card__eyebrow { color: var(--ct); }
.guide-card__go { margin-top: auto; padding-top: 12px; font-size: 0.875rem; font-weight: 600; color: var(--ct, var(--hc-3)); }
.guide-card__go span { display: inline-block; transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1); }
.guide-card:hover .guide-card__go span, .guide-card:focus-visible .guide-card__go span { transform: translateX(6px); }

@media (max-width: 960px) { .hub-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 64px; } .hub-steps::before { display: none; } }
@media (max-width: 560px) { .hub-steps { grid-template-columns: 1fr; } .hub-group__count { display: none; } }
@media (prefers-reduced-motion: reduce) {
  body > header::before, body > header::after, .hub-aura i, body > header h1 em { animation: none; }
  .js-hub [data-rv] { opacity: 1; transform: none; transition: none; }
  .js-hub .hub-steps::before { transform: none; transition: none; }
  .js-hub .hub-steps.is-in .hub-step__n { animation: none; }
  .hub-step, .guide-card, .guide-card::before { transition: none; }
}

.hub-step { position: relative; }

/* ── FAQ: each tool's block takes a palette colour, so a long page has visible landmarks ── */
.hub-section[id^="faq-"] { --c: var(--hc-1); --ct: var(--hc-t); margin-bottom: 40px; }
.hub-section[id^="faq-"]:nth-of-type(5n+2) { --c: var(--hc-2); --ct: var(--hc-t); }
.hub-section[id^="faq-"]:nth-of-type(5n+3) { --c: var(--hc-3); --ct: var(--hc-t); }
.hub-section[id^="faq-"]:nth-of-type(5n+4) { --c: var(--hc-4); --ct: var(--hc-t); }
.hub-section[id^="faq-"]:nth-of-type(5n) { --c: var(--hc-5); --ct: var(--hc-t); }
.hub-section[id^="faq-"] h2::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 12px; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 20%, transparent); vertical-align: 0.05em; }
.hub-section[id^="faq-"] .hub-toolline a { color: var(--ct); }
.hub-section[id^="faq-"] .guide-q { transition: border-color .3s, background-color .3s, box-shadow .5s; }
.hub-section[id^="faq-"] .guide-q[open] { border-color: color-mix(in srgb, var(--c) 45%, var(--border-soft)); background: color-mix(in srgb, var(--c) 6%, transparent); }
.hub-section[id^="faq-"] .guide-q summary:hover { color: var(--ct); }

/* ── glossary: topic colours on every term card ── */
.gl-group[data-group="basics"] { --c: var(--hc-1); --ct: var(--hc-t); }
.gl-group[data-group="chain"] { --c: var(--hc-2); --ct: var(--hc-t); }
.gl-group[data-group="positioning"] { --c: var(--hc-3); --ct: var(--hc-t); }
.gl-group[data-group="volatility"] { --c: var(--hc-4); --ct: var(--hc-t); }
.gl-group[data-group="strategy"] { --c: var(--hc-5); --ct: var(--hc-t); }
.gl-group > h2 { display: flex; align-items: center; gap: 12px; }
.gl-group > h2::before { content: ""; width: 14px; height: 14px; border-radius: 5px; background: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent); }
.gl-term { position: relative; overflow: hidden; isolation: isolate; --mx: 50%; --my: 0%; transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1), border-color .4s, box-shadow .6s cubic-bezier(0.16, 1, 0.3, 1), background-color .4s; }
.gl-term::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(240px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 14%, transparent), transparent 70%); }
.gl-term > * { position: relative; z-index: 1; }
.gl-term:hover::after { opacity: 1; }
.gl-term:hover, .gl-term:target { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, var(--border-soft)); box-shadow: 0 18px 36px color-mix(in srgb, var(--c) 15%, transparent); }
.gl-term dt { color: var(--text-1); }
.gl-links a { color: var(--ct); }
.gl-chip.is-on { border-color: color-mix(in srgb, var(--hc-1) 55%, transparent); background: color-mix(in srgb, var(--hc-1) 11%, transparent); }
.gl-search:focus-within { box-shadow: 0 0 0 2px var(--hc-1); }

/* ── analysis: indices pink, stocks green; five readings in the five colours ── */
.an-feat-grid { --c: var(--hc-1); --ct: var(--hc-t); }
.an-feat-grid + .an-feat-grid { --c: var(--hc-2); --ct: var(--hc-t); }
.an-feat { --mx: 50%; --my: 0%; overflow: hidden; isolation: isolate; }
.an-feat::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(200px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 16%, transparent), transparent 70%); }
.an-feat > * { position: relative; z-index: 1; }
.an-feat:hover::after { opacity: 1; }
.an-feat:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--border-soft)); box-shadow: 0 18px 36px color-mix(in srgb, var(--c) 16%, transparent); }
.an-feat__go { color: var(--ct); }
.an-feat b { color: var(--text-1); }
.an-readings li:nth-child(1) { --c: var(--hc-1); --ct: var(--hc-t); }
.an-readings li:nth-child(2) { --c: var(--hc-2); --ct: var(--hc-t); }
.an-readings li:nth-child(3) { --c: var(--hc-3); --ct: var(--hc-t); }
.an-readings li:nth-child(4) { --c: var(--hc-4); --ct: var(--hc-t); }
.an-readings li:nth-child(5) { --c: var(--hc-5); --ct: var(--hc-t); }
.an-readings li { position: relative; overflow: hidden; transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1), border-color .4s, box-shadow .6s cubic-bezier(0.16, 1, 0.3, 1); }
.an-readings li:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, var(--border-soft)); box-shadow: 0 16px 32px color-mix(in srgb, var(--c) 15%, transparent); }
.an-readings__n { color: var(--hc-on); background: var(--hp-fill); }
.an-letters a:hover, .an-letters a:focus-visible { border-color: var(--hc-1); }
.sahi-learn__dirgroup h3 { color: var(--hc-t); }

/* ── search + filter bar (glossary, FAQ) ── */
.gl-tools { display: grid; gap: 14px; margin: 0 0 28px; }
.gl-search { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border: 1px solid var(--border-soft); border-radius: 16px; background: rgba(var(--ink-rgb), 0.05); transition: box-shadow .2s, background-color .2s; }
.gl-search svg { flex: none; width: 19px; height: 19px; color: var(--text-2); }
.gl-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--text-1); font: 500 1rem/1 var(--font-sans); -webkit-appearance: none; appearance: none; }
.gl-search input::placeholder { color: var(--text-2); opacity: 1; }
.gl-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.gl-search:focus-within { background: rgba(var(--ink-rgb), 0.08); box-shadow: 0 0 0 2px var(--hc-3); }
.gl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border-soft); border-radius: 999px; background: transparent; color: var(--text-2); font: 500 0.9375rem/1 var(--font-sans); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.gl-chip span { font-size: 0.75rem; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.gl-chip:hover { color: var(--text-1); background: rgba(var(--ink-rgb), 0.06); }
.gl-chip.is-on { color: var(--text-1); border-color: color-mix(in srgb, var(--hc-3) 55%, transparent); background: color-mix(in srgb, var(--hc-3) 10%, transparent); }
.gl-chip:focus-visible { outline: 2px solid var(--hc-3); outline-offset: 2px; }
.gl-count { margin: 0; font-size: 0.875rem; color: var(--text-3); }
.gl-chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #0F0F0F calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #0F0F0F calc(100% - 28px), transparent); }
.gl-chips--scroll::-webkit-scrollbar { display: none; }
.gl-chips--scroll .gl-chip { flex: none; }
.gl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gl-toggle { min-height: 36px; padding: 0 14px; border: 1px solid var(--border-soft); border-radius: 999px; background: transparent; color: var(--text-2); font: 600 0.875rem/1 var(--font-sans); cursor: pointer; transition: background-color .2s, color .2s; }
.gl-toggle:hover { color: var(--text-1); background: rgba(var(--ink-rgb), 0.06); }
.gl-toggle:focus-visible { outline: 2px solid var(--hc-3); outline-offset: 2px; }

/* ── space: a compact top, no breadcrumb row, tight section rhythm (all Learn hubs) ── */
/* Clears the site header (public/sahi-nav.css): 92px tall to its bottom edge on wide screens, 80px below 1200px. */
body > header { padding: 124px 24px 8px; }
@media (max-width: 1199px) { body > header { padding-top: 112px; } }
body > header h1 { margin-bottom: 12px; }
body > header .hero-actions { margin-top: 22px; }
body > .layout-wrapper { padding-top: 16px; }
.hub-path { margin: 0 0 32px; }
.hub-path > h2, .hub-group__head h2, .hub-section > h2, .gl-group > h2 { margin-top: 0; padding-top: 0; }
.hub-path > h2 { padding-bottom: 10px; margin-bottom: 6px; }
.hub-path__lede { margin: 0 0 22px; }
.hub-steps { padding-top: 46px; }
.hub-group { margin: 0 0 32px; }
.hub-group__head { margin: 0 0 14px; }
.hub-section { margin-top: 0; margin-bottom: 28px; }
.hub-section[id^="faq-"] { margin-bottom: 28px; }
.gl-tools { margin: 0 0 20px; }
.guide-more { margin-top: 12px; }
@media (max-width: 560px) { body > header { padding: 104px 16px 4px; } }
