/* =========================================================
   TinyCubeWay — insights and article pages (builds on redesign.css)
   Headings in the display serif, long-form body in Source Serif 4,
   data and interface in IBM Plex Sans, code in IBM Plex Mono.
   ========================================================= */

:root {
    /* variables used by the research charts */
    --gradient: var(--blue);
    --bar-muted: #C9D4E0;
    --bar-mid: #6E9BD0;
    --negative: #B4501A;
    --accent-2: var(--blue);
    --text: var(--ink);
    --text-muted: var(--slate);
    --bg-card: var(--white);
    --bg-alt: var(--white);
    --border: var(--line);
    --border-glow: var(--line);
    --radius: 2px;
    --measure: 700px;
}

/* ---------- Article header ---------- */
.article-hero { background: radial-gradient(90% 120% at 85% 0%, #0A3460 0%, var(--navy) 50%, var(--abyss) 100%); color: var(--mist); padding: calc(var(--header-h) + 80px) 0 64px; }
.article-hero .wrap, .article-body .wrap { max-width: calc(var(--measure) + var(--gutter) * 2); }
.breadcrumb { display: inline-block; font-size: 0.92rem; color: var(--haze); text-decoration: none; margin-bottom: 32px; }
.breadcrumb:hover { color: var(--white); }
.section-label { display: block; font-size: 0.95rem; font-weight: 500; color: var(--signal); margin-bottom: 16px; }
.article-hero h1 { font-family: var(--display); font-weight: 380; color: var(--white); font-size: clamp(2.2rem, 4.8vw, 3.4rem); line-height: 1.06; letter-spacing: -0.028em; margin-bottom: 24px; }
.article-dek { font-family: var(--serif); font-size: 1.25rem; line-height: 1.55; color: var(--mist); margin-bottom: 28px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 0.9rem; color: var(--haze); }
.article-meta span + span::before { content: none; }

/* ---------- Article body ---------- */
.article-body { padding: 64px 0 112px; background: var(--paper); }
.article-body p, .article-body li { font-family: var(--serif); font-size: 1.16rem; line-height: 1.72; color: var(--ink); }
.article-body p { margin: 0 0 1.1em; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 0.45em; }
.article-body li::marker { color: var(--slate); }
.article-body h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.018em; margin: 2.2em 0 0.6em; }
.article-body h3 { font-family: var(--display); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.01em; margin: 1.8em 0 0.5em; }
.article-body strong { font-weight: 600; }
.article-body a, .article-body a.inline { color: var(--blue); }
.article-body code { overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.86em; background: #E9EFF6; border-radius: 2px; padding: 0.1em 0.35em; }
.article-body pre { background: var(--abyss); color: var(--on-navy); border-radius: 2px; padding: 20px 22px; overflow-x: auto; margin: 1.4em 0 1.6em; }
.article-body pre code { background: none; padding: 0; font-size: 0.86rem; line-height: 1.65; color: inherit; overflow-wrap: normal; word-break: normal; }
.article-body pre .c { color: var(--on-navy-muted); }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* summary at the top of an article */
.findings, .summary { background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 2px 2px 0; padding: 24px 28px 10px; margin-bottom: 2.2em; }
.findings h2, .summary h2 { font-family: var(--sans); font-weight: 600; font-size: 1rem; margin: 0 0 12px; letter-spacing: 0; }
.findings li, .summary li { font-size: 1.06rem; }

/* notes and warnings in the flow */
.callout { background: #FFF6E0; border: 1px solid #F3D9A0; border-radius: 2px; padding: 18px 22px 4px; margin: 1.6em 0; }
.callout p, .callout li { font-size: 1.05rem; }
.callout .callout-title { font-family: var(--sans); font-weight: 600; font-size: 0.98rem; margin-bottom: 6px; color: var(--amber-ink); }

/* diagrams */
figure.diagram { margin: 1.8em 0 2em; }
figure.diagram svg { width: 100%; height: auto; }
figure.diagram figcaption, .chart figcaption, .article-body p.chart-note { font-family: var(--sans); font-size: 0.88rem; line-height: 1.5; color: var(--slate); margin-top: 10px; }
figure.diagram-wide { margin-left: calc((min(100vw - var(--gutter) * 2, 960px) - 100%) / -2); margin-right: calc((min(100vw - var(--gutter) * 2, 960px) - 100%) / -2); }
.diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram-scroll svg { min-width: 720px; }

/* numbered procedure steps (only where order matters) */
.procedure { list-style: none; padding: 0 !important; counter-reset: proc; border-top: 1px solid var(--line); }
.procedure > li { counter-increment: proc; position: relative; padding: 18px 0 8px 48px; border-bottom: 1px solid var(--line); margin: 0; }
.procedure > li::before { content: counter(proc); position: absolute; left: 0; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--white); font: 600 0.9rem/30px var(--sans); text-align: center; }
.procedure h3 { margin: 2px 0 6px; font-size: 1.2rem; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.6em; border: 1px solid var(--line); border-radius: 2px; background: var(--white); }
table.data { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.95rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data th { font-size: 0.86rem; font-weight: 600; color: var(--ink); background: #EEF3F8; }
table.data td { color: var(--ink); line-height: 1.5; }
table.data tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.tag-core, .tag-core { color: var(--blue); font-weight: 600; }
table.data td.tag-enab, .tag-enab { color: #3E6FA8; }
table.data td.tag-peri, .tag-peri { color: var(--slate); }

/* ---------- Research charts (India Startup Pulse) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 1.6em 0 0.8em; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: 2px; padding: 18px; }
.stat-card .num { display: block; font-family: var(--display); font-size: 2.2rem; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stat-card .num.hl { color: var(--blue); }
.stat-card .lbl { display: block; font-family: var(--sans); font-size: 0.88rem; line-height: 1.45; color: var(--slate); }
.chart { background: var(--white); border: 1px solid var(--line); border-radius: 2px; padding: 22px 22px 16px; margin: 1.6em 0 0.8em; }
.chart-title { font-family: var(--sans); font-weight: 600; font-size: 1rem; margin-bottom: 16px; color: var(--ink); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 14px; }
.bar-label { font-family: var(--sans); font-size: 0.92rem; color: var(--ink); }
.bar-label.hl { color: var(--blue); font-weight: 600; }
.bar-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar { height: 22px; border-radius: 3px; background: var(--bar-muted); flex: none; }
.bar.hl { background: var(--blue); }
.bar.mid { background: var(--bar-mid); }
.bar.neg { background: var(--negative); }
.bar-val { font-family: var(--sans); font-size: 0.86rem; color: var(--slate); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-val.hl { color: var(--blue); font-weight: 600; }
.bar-val.neg { color: var(--negative); }
.cols-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cols { display: flex; align-items: flex-end; gap: 18px; height: 220px; border-bottom: 1px solid var(--slate); padding: 0 6px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.col .bar { width: 100%; height: auto; border-radius: 3px 3px 0 0; }
.col-labels { display: flex; gap: 18px; padding: 8px 6px 0; }
.col-labels span { flex: 1; text-align: center; font-family: var(--sans); font-size: 0.82rem; color: var(--slate); }
.col-labels span.hl { color: var(--blue); font-weight: 600; }
.div-row { display: grid; grid-template-columns: 120px 1fr 1.6fr; align-items: center; min-height: 42px; }
.div-neg { display: flex; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.div-pos { display: flex; align-items: center; gap: 8px; border-left: 2px solid var(--slate); height: 42px; }
.stack { display: flex; height: 36px; border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.stack span { display: block; height: 100%; }
.stack-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack-legend h4 { font-size: 0.98rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.stack-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.stack-legend p { font-size: 0.95rem !important; color: var(--slate); line-height: 1.5; margin: 0 0 6px; }
.moat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.4em 0 0.6em; }
.moat-card { background: var(--white); border: 1px solid var(--line); border-radius: 2px; padding: 16px 18px; }
.moat-card h4 { font-size: 1rem; margin-bottom: 6px; }
.moat-card p { font-size: 0.98rem !important; color: var(--slate); line-height: 1.5; margin: 0; }
.moat-card.exception { border-color: #E2A47E; }
.moat-card.exception h4 { color: var(--negative); }
.pull { border-left: 2px solid var(--amber); padding: 4px 0 4px 24px; margin: 1.8em 0; font-family: var(--display); font-size: 1.55rem; font-weight: 400; line-height: 1.45; color: var(--ink); }
.takeaways { display: grid; gap: 0; margin: 1.4em 0; counter-reset: tk; border-top: 1px solid var(--line); }
.takeaway { padding: 18px 0 6px 48px; position: relative; border-bottom: 1px solid var(--line); }
.takeaway::before { counter-increment: tk; content: counter(tk); position: absolute; left: 0; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--white); font: 600 0.9rem/30px var(--sans); text-align: center; }
.takeaway h3 { margin: 2px 0 6px; }

/* ---------- Closing call to action ---------- */
.article-cta { margin: 3em 0 0; padding: 40px 40px 34px; border-radius: 2px; background: radial-gradient(80% 120% at 100% 0%, #0A3460 0%, var(--navy) 55%, var(--abyss) 100%); color: var(--on-navy); }
.article-cta h2 { color: var(--white); margin: 0 0 14px; font-size: clamp(1.6rem, 2.6vw, 2rem); }
.article-cta p, .article-cta li { color: var(--on-navy); font-family: var(--sans); font-size: 1.02rem; }
.article-cta ul { padding-left: 1.2em; margin: 0 0 22px; }
.article-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.article-cta-actions a:not(.btn) { color: var(--on-navy); }
.article-cta .btn-ghost { color: var(--on-navy); border: 1px solid var(--line-navy); }

/* ---------- Sources ---------- */
.sources { border-top: 1px solid var(--line); margin-top: 3em; padding-top: 24px; }
.sources h2 { margin-top: 0; font-size: 1.15rem; }
.sources li, .sources p { font-family: var(--sans); font-size: 0.95rem; color: var(--slate); }
.sources ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
details.appendix { margin-top: 24px; border: 1px solid var(--line); border-radius: 2px; padding: 14px 18px; background: var(--white); }
details.appendix summary { cursor: pointer; font-family: var(--sans); font-weight: 600; }

/* ---------- Insights index ---------- */
.insights-index { padding: 56px 0 96px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .article-hero { padding: 36px 0 32px; }
    .article-body p, .article-body li { font-size: 1.08rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid.three, .moat-grid, .stack-legend, .cols-wrap { grid-template-columns: 1fr; }
    .bar-row { grid-template-columns: 1fr; gap: 4px; }
    .bar-line { flex-wrap: wrap; row-gap: 4px; }
    .div-row { grid-template-columns: 92px 1fr 1.3fr; }
    .article-cta { padding: 24px 20px; }
    .findings, .summary { padding: 20px 18px 6px; }
    figure.diagram-wide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 480px) {
    .div-row { grid-template-columns: 1fr; gap: 4px; }
    .div-neg { justify-content: flex-start; }
}

/* research article call-to-action kicker */
.article-cta .cta-kicker { font-family: var(--sans); font-size: 0.95rem; font-weight: 500; color: var(--amber); margin-bottom: 8px; }
