/* ============================================================
   YCTC — V5 "Research Desk"
   Layers ON TOP of styles.css. Adds:
   · dark↔light section rhythm (Paper sections) — no user toggle
   · editorial type + strict mono for all figures/labels
   · 12-column grid, global focus states
   · component styles: Insights Library, Election Data Explorer,
     gated Reports, Methodology, interactive Tool, global Search
   Single accent only: brass (--brass / --brass-ink on Paper).
   ============================================================ */

/* ---------- Global type refinements ---------- */
:root {
  /* Paper-mode text tokens (all AA on #F6F4EF) */
  --pt:    #14161C;                     /* primary on paper  ~16:1 */
  --pt-2:  #454B54;                     /* secondary          ~8:1  */
  --pt-3:  #626B76;                     /* muted / labels     ~5:1  */
  --p-line:   rgba(20, 22, 28, 0.12);
  --p-line-2: rgba(20, 22, 28, 0.20);
  --p-card:   #FFFFFF;
}

/* Every figure, stat, code and data label is mono with tabular figures */
.mono, .fig, .stat-fig, [data-count], .odo, .exp-fig, .lib-meta,
.eyebrow, .idx, .ghost-idx, .p-meta, .p-cat, .tag, .cred, .step-n {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
.fig { font-family: var(--font-mono); letter-spacing: -0.01em; }

/* ---------- Accessibility: visible focus everywhere ---------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 2px;
  border-radius: 3px;
}
.section--paper a:focus-visible, .section--paper button:focus-visible,
.section--paper input:focus-visible, .section--paper select:focus-visible {
  outline-color: var(--brass-ink);
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--brass); color: #14110a; font-family: var(--font-mono);
  font-size: 0.8rem; padding: 0.6rem 1rem; border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 12-column grid utility ---------- */
.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1rem, 2.4vw, 2rem); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-12 { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .grid12 { grid-template-columns: repeat(6, 1fr); }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: 1 / -1; }
}

/* ============================================================
   DARK ↔ LIGHT RHYTHM — Paper sections
   Add class="section--paper" to any <section>. Alternate down the
   page: dark hero → paper → dark band → paper → dark CTA/footer.
   ============================================================ */
.section--paper {
  background: var(--paper);
  color: var(--pt);
  position: relative;
  z-index: 1;
}
/* kill the global dark dot-grid / grain inside paper bands */
.section--paper::before, .section--paper::after { display: none !important; }
.section--paper .eyebrow { color: var(--brass-ink); }
.section--paper .eyebrow .idx, .section--paper .idx { color: var(--pt-3); }
.section--paper .ghost-idx { color: rgba(20,22,28,0.05); }
.section--paper .section-title,
.section--paper h1, .section--paper h2, .section--paper h3, .section--paper h4 { color: var(--pt); }
.section--paper .section-title .it, .section--paper .it { color: var(--brass-ink); }
.section--paper .lead { color: var(--pt-2); }
.section--paper p { color: var(--pt-2); }
.section--paper .muted, .section--paper .p-meta, .section--paper small { color: var(--pt-3); }
.section--paper .divider, .section--paper hr { background: var(--p-line); border-color: var(--p-line); }
.section--paper a:not(.btn):not(.card):not(.post):not(.case) { color: var(--brass-ink); }
.section--paper .text-link { color: var(--brass-ink); border-color: var(--p-line-2); }
.section--paper .text-link:hover { color: var(--pt); border-color: var(--brass-ink); }

/* Cards / surfaces on paper */
.section--paper .card,
.section--paper .rh-card,
.section--paper .lib-card,
.section--paper .sector {
  background: var(--p-card);
  border-color: var(--p-line);
  color: var(--pt);
  box-shadow: 0 1px 2px rgba(20,22,28,0.04);
}
.section--paper .card:hover,
.section--paper .rh-card:hover,
.section--paper .lib-card:hover {
  border-color: var(--brass-ink);
  box-shadow: 0 12px 30px rgba(20,22,28,0.10);
}
.section--paper .card p, .section--paper .lib-card p, .section--paper .rh-card p { color: var(--pt-2); }
.section--paper .icn-box { background: rgba(192,137,46,0.10); border-color: rgba(192,137,46,0.28); color: var(--brass-ink); }
.section--paper .icn { color: var(--brass-ink); }

/* Buttons on paper */
.section--paper .btn-ghost { color: var(--pt); border-color: var(--p-line-2); }
.section--paper .btn-ghost:hover { border-color: var(--pt); background: rgba(20,22,28,0.04); }
/* btn-primary (brass fill, dark text) already reads well on paper */

/* Eyebrow tick + chips on paper */
.section--paper .tag, .section--paper .p-cat { background: rgba(192,137,46,0.12); color: var(--brass-ink); border-color: rgba(192,137,46,0.30); }
.section--paper .cred { border-color: var(--p-line-2); color: var(--pt-2); }

/* ============================================================
   EDITORIAL / ARTICLE (Insights article template)
   ============================================================ */
.article-wrap { max-width: 720px; margin-inline: auto; }
.article-head { max-width: 760px; margin: 0 auto clamp(2rem,4vw,3rem); }
.article-kicker { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brass-ink); }
.section--paper .article-title { font-family: var(--font-display); font-weight: 460;
  font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; margin: 1rem 0 1.2rem; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--pt-3); padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--p-line); }
.byline .who { color: var(--pt); }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brass); }
.prose { font-size: 1.08rem; line-height: 1.75; color: var(--pt-2); }
.prose > * + * { margin-top: 1.2rem; }
.prose h2 { font-family: var(--font-display); font-weight: 460; font-size: 1.7rem; line-height: 1.2;
  color: var(--pt); letter-spacing: -0.015em; margin-top: 2.6rem; }
.prose h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.28rem; color: var(--pt); margin-top: 2rem; }
.prose strong { color: var(--pt); font-weight: 600; }
.prose a { color: var(--brass-ink); border-bottom: 1px solid var(--p-line-2); }
.prose a:hover { border-color: var(--brass-ink); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-top: 0.5rem; }
.prose blockquote { border-left: 3px solid var(--brass); padding: 0.2rem 0 0.2rem 1.4rem;
  font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--pt); }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-family: var(--font-mono); font-size: 0.74rem; color: var(--pt-3); margin-top: 0.6rem; }
.pull-data { font-family: var(--font-mono); font-variant-numeric: tabular-nums; background: rgba(192,137,46,0.08);
  border: 1px solid rgba(192,137,46,0.24); border-radius: 12px; padding: 1.4rem 1.6rem; margin: 2rem 0; }
.pull-data .n { font-size: clamp(2rem,5vw,2.8rem); color: var(--brass-ink); font-weight: 600; letter-spacing: -0.02em; }
.pull-data .l { font-size: 0.82rem; color: var(--pt-2); margin-top: 0.3rem; }

.article-foot { max-width: 760px; margin: 3rem auto 0; padding-top: 1.6rem; border-top: 1px solid var(--p-line); }
.share-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.share-row .lbl { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pt-3); margin-right: 0.4rem; }
.share-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.5rem 0.9rem; border: 1px solid var(--p-line-2); border-radius: 999px; color: var(--pt); background: var(--p-card);
  cursor: pointer; transition: border-color 0.18s var(--ease), color 0.18s var(--ease); }
.share-btn:hover { border-color: var(--brass-ink); color: var(--brass-ink); }

.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.4rem; }
@media (max-width: 760px) { .related { grid-template-columns: 1fr; } }

/* ============================================================
   INSIGHTS LIBRARY — searchable / filterable archive
   ============================================================ */
.lib-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.4rem; align-items: end; margin-bottom: 1.6rem; }
@media (max-width: 720px) { .lib-toolbar { grid-template-columns: 1fr; } }
.lib-search { position: relative; }
.lib-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 2.7rem; color: var(--text); font-size: 0.98rem;
}
.section--paper .lib-search input { background: var(--p-card); border-color: var(--p-line-2); color: var(--pt); }
.lib-search input::placeholder { color: var(--text-3); }
.section--paper .lib-search input::placeholder { color: var(--pt-3); }
.lib-search svg { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }
.section--paper .lib-search svg { color: var(--pt-3); }
.lib-sort { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }
.section--paper .lib-sort { color: var(--pt-3); }
.lib-sort select, .exp-controls select {
  font-family: var(--font-mono); font-size: 0.82rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 0.5rem 0.7rem; cursor: pointer;
}
.section--paper .lib-sort select { background: var(--p-card); color: var(--pt); border-color: var(--p-line-2); }

.filterbar { display: flex; flex-wrap: wrap; gap: 1.4rem; padding: 1rem 0 1.4rem; border-block: 1px solid var(--line); margin-bottom: 2rem; }
.section--paper .filterbar { border-color: var(--p-line); }
.filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.filter-group > .fg-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-right: 0.2rem; }
.section--paper .fg-label { color: var(--pt-3); }
.chip {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.02em; cursor: pointer;
  padding: 0.4rem 0.85rem; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text-2); background: transparent; transition: all 0.16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--gold-line); }
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #14110a; }
.section--paper .chip { color: var(--pt-2); border-color: var(--p-line-2); }
.section--paper .chip:hover { color: var(--pt); border-color: var(--brass-ink); }
.section--paper .chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #14110a; }

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .lib-grid { grid-template-columns: 1fr; } }
.lib-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; transition: border-color 0.18s var(--ease), transform 0.18s var(--ease); }
.lib-card:hover { transform: translateY(-3px); border-color: var(--gold-line); }
.lib-card .lc-thumb { aspect-ratio: 16/9; border-bottom: 1px solid var(--line); background: linear-gradient(160deg,#16202b,#0d1117); }
.section--paper .lib-card .lc-thumb { border-color: var(--p-line); }
.lib-card .lc-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.lib-card h3 { font-family: var(--font-display); font-weight: 480; font-size: 1.18rem; line-height: 1.25; letter-spacing: -0.01em; }
.lib-card .lib-meta { margin-top: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); display: flex; gap: 0.7rem; flex-wrap: wrap; }
.section--paper .lib-card .lib-meta { color: var(--pt-3); }
.lib-empty { text-align: center; padding: 4rem 1rem; font-family: var(--font-mono); color: var(--text-3); }
.lib-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); margin-bottom: 1rem; }
.section--paper .lib-count { color: var(--pt-3); }

/* ============================================================
   RESEARCH & DATA HUB
   ============================================================ */
.rh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
@media (max-width: 780px) { .rh-grid { grid-template-columns: 1fr; } }
.rh-card { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.8rem; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); transition: border-color 0.18s var(--ease), transform 0.18s var(--ease); }
.rh-card:hover { transform: translateY(-3px); border-color: var(--gold-line); }
.rh-card .rh-k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }
.section--paper .rh-card .rh-k { color: var(--brass-ink); }
.rh-card h3 { font-family: var(--font-display); font-weight: 480; font-size: 1.5rem; letter-spacing: -0.01em; }
.rh-card .rh-go { margin-top: auto; font-family: var(--font-mono); font-size: 0.82rem; color: var(--brass); }
.section--paper .rh-card .rh-go { color: var(--brass-ink); }

/* ============================================================
   ELECTION DATA EXPLORER
   ============================================================ */
.explorer { border: 1px solid var(--line); border-radius: 18px; background: var(--ink-2); overflow: hidden; }
.section--paper .explorer { background: var(--p-card); border-color: var(--p-line); }
.exp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.section--paper .exp-bar { background: #efece4; border-color: var(--p-line); }
.exp-title { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.section--paper .exp-title { color: var(--pt-2); }
.exp-controls { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.exp-controls label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); display: flex; flex-direction: column; gap: 0.25rem; }
.section--paper .exp-controls label { color: var(--pt-3); }
.exp-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; }
@media (max-width: 880px) { .exp-body { grid-template-columns: 1fr; } }
.exp-chart { padding: 1.6rem 1.4rem; border-right: 1px solid var(--line); min-width: 0; }
.section--paper .exp-chart { border-color: var(--p-line); }
@media (max-width: 880px) { .exp-chart { border-right: 0; border-bottom: 1px solid var(--line); } }
.exp-side { padding: 1.6rem 1.4rem; display: flex; flex-direction: column; gap: 1.1rem; }
.exp-fig { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.exp-fig .n { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.section--paper .exp-fig .n { color: var(--pt); }
.exp-fig .l { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-3); margin-top: 0.4rem; }
.section--paper .exp-fig .l { color: var(--pt-3); }
.exp-metric { display: grid; gap: 0.55rem; }
.exp-metric .em-row { display: grid; gap: 0.3rem; }
.exp-metric .em-lab { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); }
.section--paper .exp-metric .em-lab { color: var(--pt-2); }
.exp-metric .em-lab b { color: var(--text); }
.section--paper .exp-metric .em-lab b { color: var(--pt); }
.exp-track { height: 7px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.section--paper .exp-track { background: var(--n-200); }
.exp-track > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-2)); border-radius: 6px;
  width: 0; transition: width 0.7s var(--ease); }
.exp-foot { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.3rem; border-top: 1px solid var(--line); background: var(--surface);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.section--paper .exp-foot { background: #efece4; border-color: var(--p-line); color: var(--pt-3); }
.exp-foot a { color: var(--brass); } .section--paper .exp-foot a { color: var(--brass-ink); }
.exp-updated .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; margin-right: 0.4rem; box-shadow: 0 0 8px rgba(46,204,113,0.7); }

/* SVG chart bars */
.bar-col { transition: height 0.6s var(--ease), y 0.6s var(--ease); }
.exp-axis { font-family: var(--font-mono); font-size: 8px; fill: var(--text-3); }
.section--paper .exp-axis { fill: var(--pt-3); }

/* mini map dots */
.map-dot { transition: opacity 0.3s var(--ease); cursor: pointer; }
.map-dot.on { opacity: 1; }
.map-dot.off { opacity: 0.18; }

/* ============================================================
   GATED REPORTS
   ============================================================ */
.report-grid { display: grid; grid-template-columns: 0.8fr 1fr; gap: clamp(1.6rem,4vw,3rem); align-items: start; }
@media (max-width: 860px) { .report-grid { grid-template-columns: 1fr; } }
.report-cover { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: linear-gradient(165deg,#161c26,#0c0f15); position: sticky; top: 96px; }
.section--paper .report-cover { background: linear-gradient(165deg,#161c26,#0c0f15); border-color: var(--p-line); }
.report-cover .rc-top { padding: 1.8rem; border-bottom: 1px solid var(--line); }
.report-cover .rc-badge { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-2); }
.report-cover h3 { font-family: var(--font-display); color: #fff; font-weight: 480; font-size: 1.5rem; margin-top: 0.8rem; line-height: 1.15; }
.report-cover .rc-meta { padding: 1rem 1.8rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-3); display: flex; gap: 1.2rem; flex-wrap: wrap; }
.gate { border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.4rem,3vw,2rem); background: var(--surface); }
.section--paper .gate { background: var(--p-card); border-color: var(--p-line); }
.gate h3 { font-family: var(--font-display); font-weight: 480; font-size: 1.4rem; }
.contents-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.55rem; }
.contents-list li { display: flex; gap: 0.7rem; font-size: 0.95rem; color: var(--text-2); }
.section--paper .contents-list li { color: var(--pt-2); }
.contents-list li .cn { font-family: var(--font-mono); font-size: 0.78rem; color: var(--brass); }
.section--paper .contents-list li .cn { color: var(--brass-ink); }
.gate-form { display: grid; gap: 0.9rem; margin-top: 1.2rem; }
.gate-form input { background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 0.8rem 1rem; color: var(--text); font-size: 0.95rem; }
.section--paper .gate-form input { background: #fff; border-color: var(--p-line-2); color: var(--pt); }
.gate-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); }
.section--paper .gate-note { color: var(--pt-3); }

/* ============================================================
   INTERACTIVE TOOL (self-assessment)
   ============================================================ */
.tool-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.section--paper .tool-card { background: var(--p-card); border-color: var(--p-line); }
.tool-progress { height: 4px; background: var(--surface-2); }
.section--paper .tool-progress { background: var(--n-200); }
.tool-progress > i { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.4s var(--ease); }
.tool-stage { padding: clamp(1.6rem, 4vw, 2.6rem); }
.tool-q-num { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.section--paper .tool-q-num { color: var(--brass-ink); }
.tool-q { font-family: var(--font-display); font-weight: 460; font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.18; letter-spacing: -0.015em; margin: 0.6rem 0 1.6rem; }
.tool-opts { display: grid; gap: 0.7rem; }
.tool-opt { display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left; cursor: pointer;
  padding: 1rem 1.1rem; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; color: var(--text);
  font-size: 1rem; transition: border-color 0.16s var(--ease), background 0.16s var(--ease); }
.tool-opt:hover { border-color: var(--gold-line); background: var(--gold-dim); }
.tool-opt[aria-checked="true"] { border-color: var(--brass); background: var(--gold-dim); }
.section--paper .tool-opt { color: var(--pt); border-color: var(--p-line-2); }
.section--paper .tool-opt:hover, .section--paper .tool-opt[aria-checked="true"] { border-color: var(--brass-ink); background: rgba(192,137,46,0.08); }
.tool-opt .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-3); flex: none; display: grid; place-items: center; }
.tool-opt[aria-checked="true"] .tick { border-color: var(--brass); background: var(--brass); }
.tool-nav { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1.6rem,4vw,2.6rem); border-top: 1px solid var(--line); }
.section--paper .tool-nav { border-color: var(--p-line); }

/* result */
.gauge-wrap { display: grid; place-items: center; gap: 0.4rem; }
.gauge { width: 200px; height: 200px; }
.gauge .g-track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.section--paper .gauge .g-track { stroke: var(--n-200); }
.gauge .g-fill { fill: none; stroke: var(--brass); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.gauge-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 600; fill: var(--text); }
.section--paper .gauge-num { fill: var(--pt); }
.tool-band { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--gold-line); color: var(--brass); }
.section--paper .tool-band { color: var(--brass-ink); border-color: var(--brass-ink); }

/* ============================================================
   GLOBAL SEARCH overlay
   ============================================================ */
.nav-search { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; border: 1px solid var(--line-2);
  color: var(--text-2); border-radius: 999px; padding: 0.45rem 0.8rem; font-family: var(--font-mono); font-size: 0.74rem; cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease); }
.nav-search:hover { color: var(--text); border-color: var(--gold-line); }
.nav-search kbd { font-family: var(--font-mono); font-size: 0.66rem; border: 1px solid var(--line-2); border-radius: 4px; padding: 0.05rem 0.3rem; color: var(--text-3); }
.search-overlay { position: fixed; inset: 0; z-index: 300; display: none; }
.search-overlay.open { display: block; }
.search-overlay .so-scrim { position: absolute; inset: 0; background: rgba(6,7,10,0.72); backdrop-filter: blur(4px); }
.search-panel { position: relative; max-width: 640px; margin: 10vh auto 0; background: var(--ink-2); border: 1px solid var(--line-2);
  border-radius: 16px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.6); }
.search-panel .sp-input { display: flex; align-items: center; gap: 0.7rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.search-panel input { flex: 1; background: transparent; border: 0; color: var(--text); font-size: 1.1rem; }
.search-panel input:focus { outline: none; }
.search-results { max-height: 56vh; overflow-y: auto; padding: 0.5rem; }
.sr-item { display: block; padding: 0.8rem 1rem; border-radius: 10px; }
.sr-item:hover, .sr-item.active { background: var(--surface); }
.sr-item .sr-t { color: var(--text); font-weight: 500; }
.sr-item .sr-d { color: var(--text-3); font-size: 0.85rem; }
.sr-item .sr-k { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.sr-empty { padding: 1.4rem; color: var(--text-3); font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- Section index helper on paper ---------- */
.section--paper .statusline, .section--paper .statusline b { color: var(--pt-2); }

/* ---------- Last-updated / data caption ---------- */
.data-caption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.section--paper .data-caption { color: var(--pt-3); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .exp-track > i, .tool-progress > i, .gauge .g-fill, .bar-col { transition: none !important; }
}

/* ============================================================
   V6 — MOTION TUNING (smoother + faster hover/scroll)
   Loads after styles.css so these win the cascade.
   ============================================================ */

/* 1) Kill the film-grain blend repaint (a per-scroll-frame cost) and
      promote the two fixed decorative layers to their own GPU layer so
      they never repaint while scrolling. */
body::after { mix-blend-mode: normal !important; opacity: 0.02 !important; transform: translateZ(0); backface-visibility: hidden; }
body::before { transform: translateZ(0); backface-visibility: hidden; }

/* 2) Reveal-on-scroll: shorter travel + faster settle (was 0.8s / 26px), and
      NO blur filter (it's GPU-heavy on scroll and blurs text mid-reveal). */
.js [data-reveal] { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); transform: translateY(16px); filter: none !important; }
.js [data-reveal][data-delay="1"] { transition-delay: 0.06s; }
.js [data-reveal][data-delay="2"] { transition-delay: 0.12s; }
.js [data-reveal][data-delay="3"] { transition-delay: 0.18s; }
.js [data-reveal][data-delay="4"] { transition-delay: 0.24s; }

/* 2b) Hero headline reliability. The .display-key H1 was invisible/blurry until
      a JS per-word animation finished — so a slow load or JS hiccup showed a
      broken headline. Render it crisp and visible immediately (no JS needed). */
.js .display-key .w,
.js .display-key.words-in .w { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }

/* 3) Fix the slow-hover bug: on cards that ALSO carry [data-reveal], the
      reveal's 0.7s transform transition used to win the cascade, so the
      hover lift crawled. Give these one combined transition — gentle fade
      in, but a snappy 0.18s transform/border/background on hover. */
.js .card, .js a.card, .js .post, .js .sector, .js .model, .js .feature,
.js .rh-card, .js .lib-card, .js .srow, .js .role, .js .case, .js .dash-card {
  transition: opacity 0.5s var(--ease), transform 0.18s var(--ease),
              border-color 0.18s var(--ease), background 0.18s var(--ease),
              box-shadow 0.18s var(--ease) !important;
}
.js .icn-box { transition: background 0.18s var(--ease), transform 0.18s var(--ease) !important; }

/* 4) Buttons: make the magnetic pull + hover lift track the cursor almost
      instantly (transform was 0.35s → felt laggy). */
.js .btn { transition: background 0.22s var(--ease), color 0.22s var(--ease),
           border-color 0.22s var(--ease), transform 0.14s var(--ease) !important; }

/* 5) Small hover targets snappier too. */
.js .text-link, .js .chip, .js .share-btn, .js .nav-search, .js .tool-opt { transition-duration: 0.16s !important; }

/* ============================================================
   V8 — layout polish
   · Homepage hero headline was oversized (up to 6.2rem) → balanced scale.
   · Services practice bullets: the old display:flex split "<b>label</b> —
     description" into two staggered columns; flow them as one aligned line.
   ============================================================ */

/* Hero headline — professional, not billboard-sized. */
.display-key { font-size: clamp(2.05rem, 4.4vw, 4.35rem) !important; line-height: 1.06 !important; }

/* Services bullets: one clean flowing line each, all left-aligned. */
.srow li {
  display: block !important;
  position: relative;
  padding-left: 1.45rem;
  gap: 0 !important;
}
.srow li::before {
  position: absolute; left: 0; top: 0.6em; margin-top: 0 !important;
}
.srow li b { color: var(--text); }

/* ============================================================
   V7 — HERO MAP FRAMING (homepage #hero3d particle map of India)
   The map used to clip on the right and sprawl behind the headline.
   We soft-mask it into a contained cluster and darken the copy side so
   the hero reads clean and premium at every width.
   ============================================================ */

/* Desktop: concentrate the field into a soft cluster right-of-centre; fade it
   out toward the text (left) and before the right edge so nothing looks cut. */
#hero3d {
  -webkit-mask-image: radial-gradient(142% 152% at 57% 31%, #000 61%, rgba(0,0,0,0.4) 81%, transparent 96%);
          mask-image: radial-gradient(142% 152% at 57% 31%, #000 61%, rgba(0,0,0,0.4) 81%, transparent 96%);
}
/* Stronger, wider scrim so the headline always sits on clean dark. */
.hero--v3::after {
  background: linear-gradient(90deg,
    rgba(11,13,18,0.95) 0%, rgba(11,13,18,0.78) 32%,
    rgba(11,13,18,0.34) 60%, rgba(11,13,18,0) 100%) !important;
}

@media (max-width: 760px) {
  /* Mobile: the particle map is skipped (see hero3d.js) for a clean, fast
     text-first hero — so hide the canvas + scrim entirely and let the copy
     sit on clean dark with only the ambient glow. */
  #hero3d { display: none !important; }
  .hero--v3::after { background: none !important; }
  /* Tidy the utility bar: one clean centred credential line (no 2-line wrap). */
  .topbar .wrap { justify-content: center; }
  .topbar .tb-left { flex-wrap: nowrap; white-space: nowrap; gap: 0.55rem; font-size: 0.64rem; }
  .topbar .tb-left .dotsep,
  .topbar .tb-left > span:last-child { display: none; }
}
