/* ============================================================
   ix.report — style.css
   Light / clean theme. Aptient family tokens (Open Sans body,
   Roboto Mono for data/figures, Aptient blue accent).
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --bg:            #f6f8fb;
    --surface:       #ffffff;
    --surface-2:     #f0f4f8;
    --border:        #e2e8f0;
    --border-strong: #cfd8e3;

    --text:          #0f1b2d;
    --text-2:        #475569;
    --muted:         #7a8aa0;

    --accent:        #0d6fb8;   /* links / interactive (AA on white) */
    --accent-strong: #0a5790;
    --accent-bright: #4ab0ff;   /* Aptient brand highlight / bars */
    --accent-soft:   #e8f3fc;
    --accent-line:   rgba(74, 176, 255, 0.45);

    --gold:          #b58a00;
    --silver:        #6b7686;
    --bronze:        #a06a3c;

    --font:          'Open Sans', system-ui, -apple-system, sans-serif;
    --mono:          'Roboto Mono', ui-monospace, monospace;

    --max-w:         1160px;
    --radius:        9px;
    --header-h:      62px;
    --shadow:        0 1px 2px rgba(15, 27, 45, 0.04), 0 6px 24px rgba(15, 27, 45, 0.05);
    --transition:    160ms ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
code, .mono { font-family: var(--mono); }

/* ── Layout ─────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.main { min-height: 60vh; }
.section { padding: 56px 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand { display: inline-flex; align-items: baseline; font-family: var(--mono); font-weight: 500;
         font-size: 1.2rem; letter-spacing: -0.03em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--text); }
.brand-dot  { color: var(--accent-bright); }
.brand-name { color: var(--accent); }
.brand--footer { font-size: 1.05rem; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { font-size: 0.9rem; font-weight: 600; color: var(--text-2); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px;
              background: none; border: none; cursor: pointer; padding: 9px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px;
                   transition: transform var(--transition), opacity var(--transition); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 70% 60% at 50% -20%, rgba(74, 176, 255, 0.12) 0%, transparent 70%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 18px;
}
.hero-eyebrow::before { content: ''; width: 26px; height: 2px; background: var(--accent-bright); }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.03em; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.08rem; color: var(--text-2); line-height: 1.7; max-width: 60ch; margin-top: 18px; }

/* ── Page hero (interior pages) ─────────────────────────── */
.page-hero { padding: 40px 0 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.page-hero .lead { color: var(--text-2); margin-top: 10px; max-width: 70ch; }
.page-hero .eyebrow {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 12px;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb .current { color: var(--text-2); }

/* ── Stat strip ─────────────────────────────────────────── */
.stat-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px; background: var(--border); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.stat { background: var(--surface); padding: 22px 24px; }
.stat-value { font-family: var(--mono); font-size: 1.75rem; font-weight: 500; color: var(--text); line-height: 1; }
.stat-value .unit { font-size: 0.95rem; color: var(--muted); margin-left: 3px; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-top: 9px; }

/* ── Section heading ────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
                margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.4rem; }
.section-head .more { font-size: 0.875rem; font-weight: 600; }

/* ── Cards grid (hub links) ─────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    color: inherit;
}
a.card:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { font-size: 0.9rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.card .card-link { margin-top: 16px; font-size: 0.85rem; font-weight: 600; color: var(--accent); }

/* ── Ranking table ──────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
              overflow: hidden; box-shadow: var(--shadow); }
.rank-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.rank-table thead th {
    text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface-2); white-space: nowrap;
}
.rank-table th.num, .rank-table td.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.rank-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rank-table tbody tr:last-child td { border-bottom: none; }
.rank-table tbody tr:hover { background: var(--accent-soft); }
.rank-table .rank { font-family: var(--mono); color: var(--muted); width: 1%; white-space: nowrap; text-align: right; }
.rank-table .rank--1 { color: var(--gold); font-weight: 700; }
.rank-table .rank--2 { color: var(--silver); font-weight: 700; }
.rank-table .rank--3 { color: var(--bronze); font-weight: 700; }
.rank-table .name { font-weight: 600; }
.rank-table .name a { color: var(--text); }
.rank-table .name a:hover { color: var(--accent); }
.rank-table .sub { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* inline magnitude bar (width set inline by generator) */
.bar-cell { width: 30%; min-width: 90px; }
.bar { height: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-bright), var(--accent));
       min-width: 2px; }
.bar-track { background: var(--surface-2); border-radius: 4px; overflow: hidden; }

/* ── Badges / pills ─────────────────────────────────────── */
.pill { display: inline-block; font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
        padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong);
        border: 1px solid var(--accent-line); }
.flag { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); text-transform: uppercase; }

/* Pill row (exchanges-in-metro list) */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
a.pill { text-decoration: none; transition: background var(--transition), border-color var(--transition); }
a.pill:hover { background: #d8ecfb; border-color: var(--accent); text-decoration: none; }
.pill-n { color: var(--muted); font-weight: 400; }
.pill--muted { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
a.pill--muted:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

/* ── Notice / stub ──────────────────────────────────────── */
.notice { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
          padding: 36px; text-align: center; color: var(--text-2); }
.notice h2 { color: var(--text); margin-bottom: 10px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0; margin-top: 64px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; justify-content: space-between; }
.footer-col { max-width: 280px; }
.footer-tagline { font-size: 0.85rem; color: var(--text-2); margin-top: 10px; }
.footer-nav { display: flex; flex-direction: column; gap: 9px; }
.footer-nav a { font-size: 0.875rem; color: var(--text-2); }
.footer-nav a:hover { color: var(--accent); text-decoration: none; }
.footer-heading { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em;
                  color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.footer-meta { font-size: 0.8rem; color: var(--muted); text-align: right; }
.footer-meta p { margin-bottom: 6px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .site-nav {
        display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 0 14px;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 13px 24px; }

    .footer-inner { flex-direction: column; gap: 24px; }
    .footer-meta { text-align: left; }

    /* Let wide ranking tables scroll horizontally on small screens */
    .table-wrap { overflow-x: auto; }
    .rank-table { min-width: 560px; }
    .bar-cell { display: none; }
}
