/*
 * Ledger — Pricing Strategy Provider Intelligence
 * Financial dashboard aesthetic: precise, authoritative, data-heavy
 * Navy + emerald + slate
 */

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

:root {
    --navy-900: #0F172A;
    --navy-800: #1E293B;
    --navy-700: #334155;
    --navy-600: #475569;
    --emerald-500: #10B981;
    --emerald-400: #34D399;
    --emerald-600: #059669;
    --emerald-muted: rgba(16,185,129,0.10);
    --emerald-border: rgba(16,185,129,0.25);
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --card-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.06);
    --card-shadow-hover: 0 4px 12px rgba(15,23,42,0.10), 0 2px 4px rgba(15,23,42,0.06);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--slate-100);
    -webkit-font-smoothing: antialiased;
}

/* === NAVIGATION === */

.ledger-nav {
    background: var(--navy-900);
    border-bottom: 2px solid var(--emerald-500);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ledger-nav .nav-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.brand-symbol {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--emerald-500);
    line-height: 1;
}

.brand-name {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.ledger-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.ledger-nav .nav-links li a {
    display: block;
    padding: 0.85rem 1rem;
    color: var(--slate-400);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.ledger-nav .nav-links li a:hover {
    color: var(--emerald-400);
    border-bottom-color: var(--emerald-500);
}

.ledger-nav .nav-links li.active a {
    color: var(--emerald-400);
    border-bottom-color: var(--emerald-500);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--navy-700);
    color: var(--slate-400);
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--slate-400);
    margin: 3px 0;
    transition: transform 0.2s;
}

/* === HERO === */

.ledger-hero {
    background: var(--navy-900);
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-ledger-lines {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2.5rem,
            rgba(16,185,129,0.04) 2.5rem,
            rgba(16,185,129,0.04) calc(2.5rem + 1px)
        );
    pointer-events: none;
}

.hero-ledger-lines::before {
    content: '';
    position: absolute;
    left: 4rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(16,185,129,0.08);
}

.hero-ledger-lines::after {
    content: '';
    position: absolute;
    left: 4.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(16,185,129,0.06);
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--emerald-400);
    border: 1px solid var(--emerald-border);
    padding: 0.25rem 0.75rem;
    margin-bottom: 1.25rem;
    background: rgba(16,185,129,0.06);
}

.badge-mono {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
}

.ledger-hero h1 {
    font-family: 'Space Mono', monospace;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-accent {
    color: var(--emerald-400);
}

.hero-deck {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--slate-400);
    max-width: 34rem;
    margin: 0 auto;
}

.hero-breadcrumb {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    margin-bottom: 1rem;
    color: var(--slate-500);
}

.hero-breadcrumb a {
    color: var(--emerald-500);
    text-decoration: none;
}

.hero-breadcrumb a:hover {
    text-decoration: underline;
}

.bc-sep {
    margin: 0 0.4rem;
    color: var(--navy-700);
}

.bc-current {
    color: var(--slate-400);
}

/* Hero metrics row */
.hero-metrics {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--navy-700);
}

.metric-block {
    text-align: center;
}

.metric-value {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--emerald-400);
    line-height: 1;
}

.metric-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
}

/* === CONTENT === */

.content-wrap {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

/* === TYPOGRAPHY === */

.content h1 {
    font-family: 'Space Mono', monospace;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1.25;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.content h2 {
    font-family: 'Space Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-800);
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--emerald-500);
}

.content h3 {
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy-800);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.content h4 {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.content a {
    color: var(--emerald-600);
    text-decoration: underline;
    text-decoration-color: var(--emerald-border);
    text-underline-offset: 2px;
    font-weight: 600;
    transition: color 0.15s;
}

.content a:hover {
    color: var(--emerald-500);
    text-decoration-color: var(--emerald-500);
}

.content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

/* === LISTS === */

.content ul, .content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.content li strong {
    color: var(--text-primary);
}

/* === TABLES — Financial ledger style === */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.83rem;
    line-height: 1.5;
    overflow-x: auto;
    display: block;
}

.content thead th {
    background: var(--navy-900);
    color: var(--emerald-400);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    border-bottom: 2px solid var(--emerald-500);
}

.content tbody td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--slate-200);
    vertical-align: top;
    background: var(--white);
    font-variant-numeric: tabular-nums;
}

.content tbody tr:hover td {
    background: var(--emerald-muted);
}

.content tbody tr:last-child td {
    border-bottom: 2px solid var(--navy-900);
}

.content tbody td:first-child {
    font-weight: 700;
    color: var(--navy-800);
    font-family: 'Inter', sans-serif;
}

/* Ledger-line left border accent on first column */
.content tbody td:first-child {
    border-left: 3px solid var(--emerald-500);
}

/* Harvey ball alignment */
.content td:not(:first-child),
.content th:not(:first-child) {
    text-align: center;
}

/* === HARVEY BALL SPRITE === */
/* SVG sprite strip: 5 balls at 24px cells = 120x24 */
/* Navy stroke (#1E293B), emerald fill (#10B981) */

.hb {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxMjAgMjQiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFFMjkzQiIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMzYiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiNGRkZGRkYiLz48cGF0aCBkPSJNMzYsMTIgTDM2LDIgQTEwLDEwIDAgMCwxIDQ2LDEyIFoiIGZpbGw9IiMxMEI5ODEiLz48Y2lyY2xlIGN4PSIzNiIgY3k9IjEyIiByPSIxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMUUyOTNCIiBzdHJva2Utd2lkdGg9IjIiLz48Y2lyY2xlIGN4PSI2MCIgY3k9IjEyIiByPSIxMCIgZmlsbD0iI0ZGRkZGRiIvPjxwYXRoIGQ9Ik02MCwxMiBMNjAsMiBBMTAsMTAgMCAwLDEgNjAsMjIgWiIgZmlsbD0iIzEwQjk4MSIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxRTI5M0IiIHN0cm9rZS13aWR0aD0iMiIvPjxjaXJjbGUgY3g9Ijg0IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PHBhdGggZD0iTTg0LDEyIEw4NCwyIEExMCwxMCAwIDEsMSA3NCwxMiBaIiBmaWxsPSIjMTBCOTgxIi8+PGNpcmNsZSBjeD0iODQiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFFMjkzQiIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjMTBCOTgxIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxRTI5M0IiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPgo=");
    background-repeat: no-repeat;
    background-size: 110px 22px;
    vertical-align: middle;
    position: relative;
}

.hb-1 { background-position: 0 0; }
.hb-2 { background-position: -22px 0; }
.hb-3 { background-position: -44px 0; }
.hb-4 { background-position: -66px 0; }
.hb-5 { background-position: -88px 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* === BLOCKQUOTES === */

.content blockquote {
    border-left: 3px solid var(--emerald-500);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--emerald-muted);
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 0.25rem 0.25rem 0;
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content blockquote strong {
    font-style: normal;
}

/* === CODE — Monospace data panels === */

.content code {
    font-family: 'Space Mono', monospace;
    font-size: 0.82em;
    background: var(--slate-100);
    padding: 0.15em 0.45em;
    border-radius: 0.2rem;
    color: var(--navy-900);
    border: 1px solid var(--border);
}

.content pre {
    background: var(--navy-900);
    color: var(--emerald-400);
    padding: 1.25rem 1.5rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--navy-700);
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
}

/* === GLOSSARY INDEX — Dashboard grid === */

.glossary-index h1 {
    display: none; /* Suppressed — hero handles it */
}

.glossary-index ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}

.glossary-index ul li {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald-500);
    border-radius: 0.25rem;
    padding: 0;
    margin: 0;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.glossary-index ul li:hover {
    box-shadow: var(--card-shadow-hover);
    border-left-color: var(--emerald-400);
}

.glossary-index ul li a {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--navy-900);
}

.glossary-index ul li a:hover {
    color: var(--emerald-600);
}

/* Glossary entry content panels */
.glossary-entry h2 {
    border-bottom-color: var(--emerald-500);
}

.glossary-entry h2::before {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--emerald-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

/* === COMPARISON DETAIL — Dashboard panels === */

.comparison-detail h2 {
    position: relative;
    padding-left: 0;
}

/* === FOOTER === */

.ledger-footer {
    background: var(--navy-900);
    color: var(--slate-500);
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-top: 2px solid var(--emerald-500);
}

.footer-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.footer-brand .brand-symbol {
    font-size: 1.1rem;
    color: var(--emerald-500);
}

.footer-disclosure {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
    color: var(--slate-500);
}

.footer-edition {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--navy-700);
    letter-spacing: 0.04em;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    html { font-size: 15px; }

    .nav-toggle { display: flex; flex-direction: column; align-items: center; }

    .ledger-nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 0.5rem;
        border-top: 1px solid var(--navy-700);
    }

    .ledger-nav .nav-links.open { display: flex; }

    .ledger-nav .nav-inner {
        flex-wrap: wrap;
    }

    .ledger-nav .nav-links li a {
        text-align: center;
        padding: 0.5rem 1rem;
    }

    .ledger-hero { padding: 2rem 1rem 1.5rem; }
    .ledger-hero h1 { font-size: 1.65rem; }

    .hero-metrics {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .content-wrap { padding: 1.25rem 0.75rem 3rem; }
    .content { padding: 1.5rem; }

    .glossary-index ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ledger-hero h1 { font-size: 1.35rem; }
    .hero-deck { font-size: 0.88rem; }
    .content h1 { font-size: 1.35rem; }
    .content h2 { font-size: 1rem; }
    .brand-name { font-size: 0.85rem; }
}
