/* Reports: news-style stories built from the tracked data — builds on style.css */

.story-page { max-width: 820px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) var(--gutter) 0; }
.reports-page { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) var(--gutter) 0; }

/* ---------- Story cover: the picture carries the headline ---------- */
/* Wider than the text column, so the story opens like a magazine spread */
.story-cover {
    --cover-w: min(1080px, 100vw - 2 * var(--gutter));
    position: relative;
    margin-inline: calc((100% - var(--cover-w)) / 2);
    min-height: clamp(340px, 46vw, 520px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: var(--r);
    background: #0b1030;
    color: #fff;
    isolation: isolate;
    box-shadow: 0 30px 60px -30px rgba(10, 20, 80, 0.55);
}
.story-cover img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; }
.story-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(6, 9, 30, 0) 20%, rgba(6, 9, 30, 0.55) 55%, rgba(6, 9, 30, 0.94)),
        linear-gradient(90deg, rgba(6, 9, 30, 0.55), rgba(6, 9, 30, 0) 65%);
}
.story-cover-copy { width: 100%; max-width: 860px; padding: clamp(22px, 4.5vw, 52px); }
.story-cover .story-kicker { color: #fff; padding: 6px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.story-cover .story-kicker .live-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
.story-cover .story-title { margin-top: 14px; color: #fff; font-size: clamp(1.85rem, 5.2vw, 3.4rem); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.story-cover-credit { position: absolute; top: 14px; right: 16px; font-size: 0.7rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.6); }

.story-head { margin-top: 26px; }
.story-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.story-kicker .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.story-title { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.06; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.story-dek { font-size: clamp(1.1rem, 2.3vw, 1.3rem); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.story-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-3); }
.story-byline span + span::before { content: "·"; margin-right: 14px; color: var(--ink-3); }
.story-byline b { color: var(--ink); font-weight: 600; }

/* Reading progress, drawn by report-page.js */
.read-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)); transform: scaleX(0); transform-origin: left; pointer-events: none; }

/* ---------- Body copy ---------- */
.story-body { margin-top: var(--gap-lg); background: rgba(255, 255, 255, 0.86); font-size: 1.06rem; line-height: 1.75; }
.story-body > * + * { margin-top: 16px; }
.story-body h2 { margin-top: 38px; font-size: 1.45rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.story-body p { color: #2a2e3a; text-wrap: pretty; }
.story-body p.lede::first-letter { float: left; margin: 6px 10px 0 0; font-size: 3.4rem; line-height: 0.8; font-weight: 700; color: var(--blue); }
.story-body strong { color: var(--ink); }
.story-body .handle { font-weight: 700; color: var(--ink); white-space: nowrap; }
.story-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.win { color: var(--ok); font-weight: 700; }
.loss { color: var(--err); font-weight: 700; }

.pull {
    position: relative;
    margin: 30px 0;
    padding: 18px 22px 18px 58px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, rgba(47, 85, 232, 0.08), rgba(139, 92, 246, 0.08));
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-wrap: balance;
}
.pull::before { content: "\201C"; position: absolute; left: 18px; top: 6px; font-size: 3.4rem; line-height: 1; font-weight: 700; color: var(--blue); opacity: 0.55; }

/* ---------- Numbers strip ---------- */
.story-stats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: var(--gap-lg); }
.story-stats li { position: relative; overflow: hidden; padding: 16px 14px 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--glass-edge); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); min-width: 0; }
.story-stats li::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)); opacity: 0.8; }
.story-stats b { display: block; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.story-stats small { display: block; margin-top: 2px; font-size: 0.8rem; line-height: 1.3; color: var(--ink-3); }

/* ---------- Figures ---------- */
.fig { margin: 24px 0; padding: 16px; border-radius: var(--r-sm); background: var(--card-2); }
.fig-title { font-size: 0.95rem; font-weight: 700; }
.fig-note { margin-top: 2px; font-size: 0.82rem; line-height: 1.4; color: var(--ink-3); }
.fig-chart { position: relative; margin-top: 10px; }
.fig-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 0.8rem; color: var(--ink-2); }
.fig-legend span { display: inline-flex; align-items: center; gap: 7px; }
.fig-legend i { width: 16px; height: 0; border-top: 2.5px solid var(--blue); }
.fig-legend i.dash { border-top: 2px dashed var(--ink-3); }
.fig-legend i.sq { width: 10px; height: 10px; border: 0; border-radius: 3px; background: var(--blue-soft); }
.fig-legend i.sq.win { background: var(--ok); }

.fig svg .grid { stroke: var(--line); }
.fig svg .zero { stroke: var(--ink-3); }
.fig svg .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.fig svg .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fig svg .rest { fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-dasharray: 4 4; }
.fig svg .note-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.fig svg .note { font-size: 11px; font-weight: 600; fill: var(--ink); font-family: var(--font); }
.fig svg .note-dot { fill: var(--ok); stroke: #fff; stroke-width: 2; }
.fig svg .bar { fill: var(--blue-soft); }
.fig svg .bar.win { fill: var(--ok); }
.fig svg .bar-label { font-size: 10.5px; font-weight: 700; fill: var(--ok); font-family: var(--font); }

/* Figures animate in once scrolled to (see the page script) */
.fig svg .line, .fig svg .rest { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
.fig svg .rest { stroke-dasharray: 4 4; stroke-dashoffset: 0; opacity: 0; }
.fig.drawn svg .line { transition: stroke-dashoffset 1.8s cubic-bezier(.45, .05, .25, 1); stroke-dashoffset: 0; }
.fig.drawn svg .rest { transition: opacity 0.8s ease 1s; opacity: 1; }
.fig svg .note-group { opacity: 0; transform: translateY(6px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2, .8, .2, 1); }
.fig.drawn svg .note-group { opacity: 1; transform: none; transition-delay: calc(0.5s + var(--k) * 0.35s); }
.fig svg .bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
.fig.drawn svg .bar { transform: none; transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--k) * 60ms); }
.fig svg .bar-label { opacity: 0; }
.fig.drawn svg .bar-label { opacity: 1; transition: opacity 0.4s ease; transition-delay: calc(var(--k) * 60ms + 0.5s); }

/* ---------- Spin-by-spin table ---------- */
.spin-table-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--r-sm); border: 1px solid var(--line); }
.spin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.spin-table th, .spin-table td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.spin-table th:first-child, .spin-table td:first-child, .spin-table th:nth-child(2), .spin-table td:nth-child(2) { text-align: left; }
.spin-table thead th { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); background: var(--card-2); }
.spin-table tbody tr:last-child td { border-bottom: 0; }
.spin-table tr.hit td { background: rgba(22, 163, 74, 0.08); }
.coin { display: inline-flex; align-items: center; gap: 6px; }
.coin::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-3)); }

/* ---------- Supporting cast ---------- */
.cast { list-style: none; display: grid; gap: 10px; margin: 18px 0; }
.cast li { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--card-2); }
.cast .cast-num { grid-row: span 2; align-self: center; min-width: 5.5ch; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
.cast b { font-size: 1rem; }
.cast p { margin: 0; font-size: 0.93rem; line-height: 1.5; color: var(--ink-2); }

.method { margin-top: 30px; padding: 16px 18px; border-radius: var(--r-sm); background: var(--blue-wash); font-size: 0.9rem; line-height: 1.6; color: var(--ink-2); }
.method h3 { font-size: 0.95rem; color: var(--ink); margin-bottom: 6px; }
.method ul { margin: 6px 0 0 1.1rem; }

.story-foot { margin: 18px 0 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 0.88rem; color: var(--ink-2); }
.story-foot a { color: var(--blue); font-weight: 600; }

/* ---------- Reports index ---------- */
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-facts li { padding: 6px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3); font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); }
.hero-facts b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

.report-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--gap-lg); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--glass-edge); background: var(--card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip span { font-size: 0.75rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.6); }
.chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.report-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0 44px; }
.report-list > li[hidden] { display: none; }
.report-card { display: flex; flex-direction: column; height: 100%; padding: 0; overflow: hidden; color: inherit; text-decoration: none; }
.report-card img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; background: #0b1030; flex: none; }
.report-card .report-copy { flex: 1; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.report-card h2 { font-size: 1.18rem; line-height: 1.22; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.report-card p { font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); }
.report-card small { margin-top: auto; padding-top: 4px; font-size: 0.8rem; color: var(--ink-3); }

/* A lone last card fills its row, picture on the left */
.report-list > li.wide { grid-column: 1 / -1; }
@media (min-width: 641px) {
    .wide .report-card { flex-direction: row; }
    .wide .report-card img { width: 50%; aspect-ratio: auto; height: auto; min-height: 100%; }
    .wide .report-card .report-copy { justify-content: center; }
}

/* The lead story: full width, headline over the picture */
.report-list > li.featured { grid-column: 1 / -1; }
.featured .report-card { position: relative; min-height: clamp(320px, 40vw, 440px); justify-content: flex-end; color: #fff; isolation: isolate; border-color: transparent; }
.featured .report-card img { position: absolute; inset: 0; z-index: -2; height: 100%; aspect-ratio: auto; }
.featured .report-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6, 9, 30, 0) 25%, rgba(6, 9, 30, 0.9)), linear-gradient(90deg, rgba(6, 9, 30, 0.5), rgba(6, 9, 30, 0) 60%); }
.featured .report-copy { flex: 0; max-width: 720px; padding: clamp(22px, 4vw, 40px); }
.featured .story-kicker { color: #fff; }
.featured .story-kicker .live-dot { background: #4ade80; }
.featured .report-card h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.1; color: #fff; }
.featured .report-card p { font-size: 1rem; color: rgba(255, 255, 255, 0.82); }
.featured .report-card small { color: rgba(255, 255, 255, 0.65); }

@media (hover: hover) {
    .report-card { transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s ease; }
    .report-card:hover { transform: translateY(-4px); box-shadow: var(--glass-shadow), 0 24px 40px -24px rgba(30, 50, 140, 0.45); }
    .report-card img { transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); }
    .report-card:hover img { transform: scale(1.04); }
    .chip { transition: background 0.2s ease, color 0.2s ease; }
    .chip[aria-pressed="false"]:hover { background: rgba(255, 255, 255, 0.9); color: var(--ink); }
}

/* "More reports" at the end of each story */
.more-reports { margin-top: 44px; }
.more-reports h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.more-reports .report-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.more-reports .report-card h2 { font-size: 1rem; }
.more-reports .report-copy { padding: 14px 16px 16px; }

@media (max-width: 860px) {
    .more-reports .report-list { grid-template-columns: 1fr; }
    .more-reports .report-card { flex-direction: row; }
    .more-reports .report-card img { width: 38%; aspect-ratio: auto; height: auto; min-height: 100%; }
}

@media (max-width: 640px) {
    .story-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-body { font-size: 1rem; }
    .story-cover { min-height: 400px; border-radius: var(--r-sm); }
    .story-cover-copy { padding: 20px 18px 22px; }
    .story-cover .story-kicker { font-size: 0.7rem; }
    .report-list { grid-template-columns: 1fr; }
    .report-filter { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
    .report-filter::-webkit-scrollbar { display: none; }
    .chip { flex: none; }
    .story-byline span + span::before { content: none; }
    .featured .report-card { min-height: 380px; }
    .pull { padding: 16px 16px 16px 48px; }
    .pull::before { left: 12px; font-size: 3rem; }
    .spin-table th, .spin-table td { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .read-progress { display: none; }
}
