/* ═══════════════════════════════════════════════════════
   IN-KluSo Design System v2.0 — April 2026
   Single source of truth for all pages.
   ═══════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --cream: #FAF6EE;
  --black: #111;
  --surface: #131313;
  --surface2: #1a1a1a;
  --border: #1f1f1f;
  --border2: #2a2a2a;

  /* Brand */
  --orange-logo: #f27d23;
  --orange: #E8602C;

  /* Divisions */
  --thrive: #F37D24;
  --pulse: #4DAACB;
  --ground: #AFD274;
  --flow: #D54D9B;
  --axis: #FCB912;
  --core: #4D4D4D;

  /* Text */
  --dim: #666;
  --warm-gray: #8A8578;
  --light: #E8E4DC;

  /* Scoring */
  --high: #2E9B6F;
  --moderate: #C9A84C;
  --low: #C94C4C;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Typography ─── */
.font-headline, h1, h2 { font-family: 'DM Serif Display', serif; }
.font-body, p, li, blockquote { font-family: 'Lora', serif; }
.font-ui, nav, button, .btn, label, input { font-family: 'Inter', sans-serif; }
.font-data, code, .badge, .tag, .sci-badge, .article-id { font-family: 'JetBrains Mono', monospace; }

body {
  background: var(--black);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Light mode (article pages) */
body.light {
  background: var(--cream);
  color: var(--black);
}

/* ─── Reading Progress Bar ─── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  z-index: 200;
  transition: width 0.1s linear;
}
.reading-progress.rp-thrive { background: var(--thrive); }
.reading-progress.rp-pulse { background: var(--pulse); }
.reading-progress.rp-ground { background: var(--ground); }
.reading-progress.rp-flow { background: var(--flow); }
.reading-progress.rp-axis { background: var(--axis); }
.reading-progress.rp-core { background: var(--core); }

/* ─── Shared Nav (dual bar from CORE prototype) ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17,17,17,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 12px;
}
.nav-logo { flex: 0 1 auto; min-width: 80px; max-width: 220px; }
.nav-logo svg { height: 38px; width: auto; display: block; }

/* Section bar */
.section-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  position: sticky;
  top: 52px;
  z-index: 99;
}
.section-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 40px;
}
.sb-sections {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.sb-sections::-webkit-scrollbar { display: none; }
.sb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 40px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}
.sb-item:hover { background: var(--surface2); }
.sb-item.active { border-bottom-color: var(--cream); }
.sb-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sb-name {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.15s;
}
.sb-item:hover .sb-name, .sb-item.active .sb-name { color: var(--cream); }

.sb-auth-btn {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--dim);
  text-decoration: none;
}
.sb-auth-btn:hover { color: var(--cream); border-color: #444; }
.sb-auth-btn.premium {
  background: var(--orange-logo);
  color: var(--black);
  border-color: var(--orange-logo);
  font-weight: 800;
}

/* ─── SCI Badges ─── */
.sci-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 1px;
  font-weight: 600;
}
.sci-high { background: var(--high); color: white; }
.sci-moderate { background: var(--moderate); color: var(--black); }
.sci-low { background: var(--low); color: white; }

/* ─── Section Pills ─── */
.section-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  color: white;
}
.pill-thrive { background: var(--thrive); }
.pill-pulse { background: var(--pulse); }
.pill-ground { background: var(--ground); color: var(--black); }
.pill-flow { background: var(--flow); }
.pill-axis { background: var(--axis); color: var(--black); }
.pill-core { background: var(--core); }

/* ─── Tags ─── */
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
body.light .tag { background: #f0ede6; color: var(--warm-gray); }
body:not(.light) .tag { background: var(--surface); color: var(--dim); border: 1px solid var(--border); }

/* ─── Article Page Styles (light mode) ─── */
.article-header { padding: 60px 40px 40px; max-width: 780px; margin: 0 auto; }
.article-body { max-width: 780px; margin: 0 auto; padding: 0 40px 60px; }
.article-body h3 { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700; margin: 36px 0 12px; }
.article-body blockquote {
  border-left: 3px solid var(--orange);
  padding: 12px 20px;
  margin: 30px 0;
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 20px;
  color: #444;
  line-height: 1.5;
}

/* ─── Signal Intel Box ─── */
.signal-intel-box {
  border-left: 4px solid;
  padding: 16px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--warm-gray);
  line-height: 1.6;
  font-style: italic;
}

/* ─── CTA Section ─── */
.cta {
  background: var(--black);
  color: var(--cream);
  text-align: center;
  padding: 60px 40px;
}
.cta h2 { font-size: 32px; margin-bottom: 12px; }
.cta p { font-size: 15px; color: var(--warm-gray); margin-bottom: 24px; }
.cta a {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 32px;
  text-decoration: none;
  border-radius: 4px;
}

/* ─── Footer ─── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 28px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--warm-gray);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .nav { padding: 0 16px; }
  .section-bar { padding: 0 16px; }
  .article-header, .article-body { padding-left: 20px; padding-right: 20px; }
  .sb-item { padding: 0 10px; }
}
@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .article-body p { font-size: 16px; }
  .nav-inner { gap: 8px; }
}

/* ═══════════════════════════════════════════════════════
   IN-KluSo Light Mode — Variable Overrides
   Single block that cascades to all pages via var().
   Per RED-TO-AMBER-LIGHT-MODE-SPEC-2026-04-27 + Joe's directive 2026-05-03.
   Default for new users (no localStorage) is light mode.
   ═══════════════════════════════════════════════════════ */

html.light-mode,
html.light-mode {
  /* Core palette — roles swap */
  --cream: #111111;
  --black: #FAF6EE;
  --surface: #FFFFFF;
  --surface2: #F5F1E8;
  --border: #E8E4DC;
  --border2: #D4CFC6;

  /* Text hierarchy — warmed grays for cream context */
  --dim: #6B6560;
  --warm-gray: #8A8578;
  --light: #3D3830;

  /* Scoring */
  --high: #1F7A54;

  /* Brand + division colors UNCHANGED (--orange, --orange-logo,
     --thrive, --pulse, --ground, --flow, --axis, --core, --moderate, --low) */
}

/* ─── Theme toggle button (.theme-toggle for inline nav, .unified-theme-toggle for unified-nav) ─── */
.theme-toggle,
.unified-theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dim);
  border-radius: 3px;
  transition: all 0.15s;
  border: 1px solid transparent;
  background: transparent;
  flex-shrink: 0;
}
.theme-toggle:hover,
.unified-theme-toggle:hover {
  color: var(--cream);
  border-color: var(--border2);
}
.theme-toggle svg,
.unified-theme-toggle svg { width: 14px; height: 14px; }

/* DEFAULT (dark mode) shows the SUN icon (which would switch you to light).
   In light mode, show the MOON (which would switch you back to dark). */
.theme-icon-moon { display: none; }
html.light-mode .theme-icon-sun { display: none; }
html.light-mode .theme-icon-moon { display: inline-block; }

/* ─── Logo color via currentColor ─── */
/* Inline logo SVGs use fill="currentColor"; explicit color on each logo
   container so cream→dark theme swap works regardless of where the SVG sits.
   Orange slash stays orange (hardcoded #f27d23). */
.nav-logo,
.unified-nav-logo,
.footer-col-logo,
.unified-drawer-header a { color: var(--cream); }

/* ─── COMPONENT OVERRIDES (light mode) ─── */

/* Nav */
html.light-mode .nav,
html.light-mode .unified-nav,
html.light-mode .nav,
html.light-mode .unified-nav {
  background: rgba(250, 246, 238, 0.92);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Section bar */
html.light-mode .section-bar,
html.light-mode .unified-section-bar,
html.light-mode .section-bar,
html.light-mode .unified-section-bar {
  background: #FFFFFF;
  border-bottom-color: var(--border);
}

/* Ticker */
html.light-mode .ticker-wrap {
  background: var(--surface2);
  border-bottom-color: var(--border);
}
html.light-mode .ticker-item { color: #6B6560; }
html.light-mode .ticker-item:hover { color: #111; }

/* KPI strip */
html.light-mode .kpi-card {
  background: #FFFFFF;
  border-color: var(--border);
}

/* Filter pills */
html.light-mode .filter-pill {
  border-color: var(--border2);
  color: var(--dim);
}
html.light-mode .filter-pill:hover {
  color: #111;
  border-color: #999;
}
html.light-mode .filter-pill.active { color: #FAF6EE; }
html.light-mode .filter-pill[data-s="all"].active {
  background: #111;
  color: #FAF6EE;
}

/* Grid cells (division-colored cells keep backgrounds) */
html.light-mode .g-cell.g-crumb,
html.light-mode .g-cell.c-mixed {
  background: var(--surface);
  border-color: var(--border);
}

/* List view */
html.light-mode .list-view .l-card-new {
  background: #FFFFFF;
  border-color: var(--border);
}
html.light-mode .list-view .l-card:hover,
html.light-mode .list-view .l-card-new:hover { border-color: #D4CFC6; }
html.light-mode .l-card-img::before {
  background: linear-gradient(to right, #FFFFFF 0%, transparent 100%);
}

/* Bands view */
html.light-mode .bands-view .b-band { border-bottom-color: var(--border); }
html.light-mode .bands-view .b-num { color: rgba(0, 0, 0, 0.15); }

/* Stacks section */
html.light-mode .stack-card {
  background: #FFFFFF;
  border-color: var(--border);
}
html.light-mode .stack-card:hover { border-color: #D4CFC6; }
html.light-mode .stack-card-title { color: #111; }

/* Crumbs section */
html.light-mode .crumbs-section { border-top-color: var(--border); }
html.light-mode .crumb-row { border-bottom-color: var(--border); }

/* CTA section */
html.light-mode .cta-section {
  background: linear-gradient(135deg, #F5F1E8, #FAF6EE, #FFFFFF);
  border-top-color: var(--border);
}
html.light-mode .cta-btn-ghost {
  border-color: #D4CFC6;
  color: #111;
}
html.light-mode .cta-btn-ghost:hover {
  border-color: #999;
  background: rgba(0, 0, 0, 0.03);
}

/* Footer */
html.light-mode .footer {
  background: #FFFFFF;
  border-top-color: var(--border);
}
html.light-mode .footer-grid { border-bottom-color: var(--border); }

/* Explore modal */
html.light-mode .explore-overlay { background: rgba(17, 17, 17, 0.4); }
html.light-mode .explore-modal {
  background: #FFFFFF;
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
}
html.light-mode .explore-search-input { color: #111; }

/* Klu modal */
html.light-mode .klu-modal {
  background: #FFFFFF;
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
}
html.light-mode .klu-modal-title { color: #111; }
html.light-mode .klu-modal-earn-row { background: rgba(0, 0, 0, 0.02); }
html.light-mode .klu-modal-earn-action { color: #111; }

/* Mobile drawer */
html.light-mode .unified-mobile-drawer {
  background: #FFFFFF;
  border-left-color: var(--border);
}
html.light-mode .unified-drawer-header,
html.light-mode .unified-drawer-section { border-bottom-color: var(--border); }
html.light-mode .unified-drawer-link { color: #111; }

/* Article body — body p color comes from article.css via var(--cream) cascade */
html.light-mode .article-body .pull-quote {
  color: #111;
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}
html.light-mode .article-fade::after {
  background: linear-gradient(transparent, #FAF6EE);
}

/* Section page */
html.light-mode .section-card {
  background: #FFFFFF;
  border-color: var(--border);
}
html.light-mode .section-card:hover { border-color: #D4CFC6; }
html.light-mode .section-search-input {
  background: #FFFFFF;
  border-color: var(--border);
  color: #111;
}

/* Klu tooltip */
html.light-mode .klu-tooltip {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--border);
}

/* Article feed cards */
html.light-mode .af-card {
  background: #FFFFFF;
  border-color: var(--border);
}
html.light-mode .af-card:hover { border-color: #D4CFC6; }

/* SCI badges — adjusted green */
html.light-mode .sci-high {
  background: var(--high);
  color: white;
}

/* Scroll fade gradient for section bar */
html.light-mode .unified-sb-inner::after {
  background: linear-gradient(to right, transparent, #FFFFFF);
}

/* Search inputs */
html.light-mode .nav-search-input,
html.light-mode .unified-nav-search-input {
  background: #FFFFFF;
  border-color: var(--border);
  color: #111;
}
html.light-mode .nav-search-input::placeholder,
html.light-mode .unified-nav-search-input::placeholder {
  color: #999;
}

/* Validar buttons */
html.light-mode .l-validar,
html.light-mode .section-card .card-validar {
  border-color: var(--border2);
  color: var(--dim);
}
html.light-mode .l-validar:hover,
html.light-mode .section-card .card-validar:hover {
  border-color: #999;
  color: #111;
  background: rgba(0, 0, 0, 0.03);
}

/* ═══ END LIGHT MODE ═══ */

/* ═══════════════════════════════════════════════════════
   IN-KluSo Paywall — standalone article gate
   Used by assets/paywall.js to render the subscribe block.
   ═══════════════════════════════════════════════════════ */

.article-paywall {
  margin: 32px auto 0;
  max-width: 720px;
  padding: 32px 24px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  position: relative;
}
/* Soft fade-out cue above the paywall */
.article-paywall::before {
  content: '';
  position: absolute;
  top: -64px;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(transparent, var(--black));
  pointer-events: none;
}
.article-paywall .paywall-headline {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  line-height: 1.3;
  color: var(--cream);
  margin-bottom: 8px;
}
.article-paywall .paywall-sub {
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.6;
  margin-bottom: 20px;
}
.article-paywall .paywall-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.article-paywall .paywall-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.article-paywall .paywall-btn-premium {
  background: var(--orange-logo);
  color: white;
}
.article-paywall .paywall-btn-premium:hover { opacity: 0.9; }
.article-paywall .paywall-signin {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--dim);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
}
.article-paywall .paywall-signin:hover { color: var(--cream); }

