/* =============================================================
   GOOGLE FONTS — add this to the <head> of every HTML file,
   just before your stylesheet <link>:

   <link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@400;500;600&display=swap" rel="stylesheet">
   ============================================================= */


/* =============================================================
   DESIGN TOKENS
   ============================================================= */

:root {
    --accent:         #1a2e4a;
    --accent-light:   #e8edf3;
    --accent-faint:   #f0f3f7;
    --text:           #111111;
    --text-muted:     #666666;
    --border:         #dddddd;
    --bg:             #f7f7f7;
    --card-bg:        #ffffff;

    --font-body:      'Libre Baskerville', Georgia, serif;
    --font-ui:        'DM Sans', system-ui, sans-serif;
}


/* =============================================================
   GLOBAL RESET & BASE
   ============================================================= */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.7;
    padding-top: 56px;
}


/* =============================================================
   TYPOGRAPHY
   ============================================================= */

h1, h2, h3, h4 {
    font-family: var(--font-ui);
    color: var(--accent);
}

h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

h2 {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 24px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
}

h4 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #c5d0de;
    display: inline-block;
}

p {
    font-size: 15px;
    margin-top: 0;
}

ul, ol {
    font-size: 15px;
    padding-left: 20px;
}

a {
    color: var(--accent);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}


/* =============================================================
   LAYOUT
   ============================================================= */

main, header, footer {
    max-width: 820px;
    margin: auto;
    padding: 30px 40px;
    background: var(--card-bg);
}

header {
    border-bottom: none;
    margin-bottom: 0;
}


/* =============================================================
   BANNER
   ============================================================= */

.banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    padding: 0 48px;
    box-sizing: border-box;
    height: 56px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 8px solid #b5d1ff;
    box-shadow: 0 3px 0 0 #000;
}

.banner .banner-title {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.banner a {
    color: #fff;
    text-decoration: none;
    opacity: 0.75;
    font-size: 12px;
}

.banner a:hover {
    opacity: 1;
    text-decoration: none;
}


/* =============================================================
   HOMEPAGE SECTIONS
   These are plain cards — no counters, no sticky headers.
   ============================================================= */

.homepage-main {
    padding: 0;
    background: transparent;
}

.about,
.coverage,
.methodology {
    max-width: 820px;
    margin: 0 auto 32px auto;
    padding: 30px 40px;
    background: var(--card-bg);
    border: 1px solid #c5d0de;
    position: relative;
}

/* Number each homepage section in top-right corner */
.homepage-main {
    counter-reset: homepage-counter;
}

.about::before,
.coverage::before,
.methodology::before {
    counter-increment: homepage-counter;
    content: counter(homepage-counter, decimal-leading-zero);
    position: absolute;
    top: 24px;
    right: 40px;
    font-family: var(--font-ui);
    font-size: 48px;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.about {
    border-top: none;
}

.about h2,
.coverage h2,
.methodology h2 {
    /* plain h2 — no sticky behaviour on homepage */
    position: static;
    background: transparent;
    padding-left: 12px;
    margin-bottom: 20px;
}


/* =============================================================
   ARTICLE PAGE — scoped to .article-main
   Sticky h2s, numbered sections, dividers all live here only.
   ============================================================= */

.article-main {
    counter-reset: section-counter;
    padding: 0;
    background: transparent;
}

.article-main section {
    padding: 40px;
    border-top: 2px solid #c5d0de;
    max-width: 820px;
    margin: 0 auto;
    background: var(--card-bg);
    position: relative;
}

.article-main section:first-child {
    border-top: none;
}

/* Large faint section number */
.article-main section::before {
    counter-increment: section-counter;
    content: counter(section-counter, decimal-leading-zero);
    position: absolute;
    top: 36px;
    right: 40px;
    font-family: var(--font-ui);
    font-size: 48px;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* Sticky h2 */
.article-main section h2 {
    position: sticky;
    top: 56px;
    background: var(--card-bg);
    padding-top: 14px;
    padding-bottom: 14px;
    margin-left: -40px;
    margin-right: -40px;
    padding-left: 52px;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    border-left: none;
    margin-bottom: 28px;
}

/* Accent left border via pseudo-element */
.article-main section h2::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent);
    border-radius: 2px;
}


/* =============================================================
   LEFT-SIDE PROGRESS NAV
   ============================================================= */

.progress-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: calc(50% - 410px - 220px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 160px;
    visibility: hidden;
}

@media (min-width: 1280px) {
    .progress-nav {
        visibility: visible;
    }
}

.progress-nav__link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
    color: var(--text-muted);
}

.progress-nav__link:hover {
    background: var(--accent-light);
    text-decoration: none;
    color: var(--accent);
}

.progress-nav__link--active {
    color: var(--accent);
}

.progress-nav__link--active .progress-nav__num {
    color: var(--accent);
    opacity: 1;
}

.progress-nav__link--active .progress-nav__label {
    font-weight: 600;
}

.progress-nav__num {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    opacity: 0.4;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.progress-nav__label {
    font-family: var(--font-ui);
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* =============================================================
   INLINE SECTION LINKS
   ============================================================= */

a.section-link {
    color: var(--accent);
    text-decoration: none;
    background-color: var(--accent-light);
    border-bottom: 1px solid #c5d0de;
    padding: 1px 4px;
    border-radius: 3px;
    font-style: italic;
    transition: background-color 0.15s ease;
}

a.section-link:hover {
    background-color: #c5d0de;
    text-decoration: none;
}


/* =============================================================
   ARTICLE HEADER
   ============================================================= */

.article-header {
    padding-top: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.article-dates {
    display: flex;
    gap: 20px;
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-subtitle {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 16px;
}

.article-scorecard {
    display: flex;
    align-items: center;
    margin-top: 20px;
    border: 1px solid #c5d0de;
    border-radius: 6px;
    overflow: hidden;
    background: var(--accent-faint);
    width: fit-content;
}

.scorecard-item {
    display: flex;
    flex-direction: column;
    padding: 12px 24px;
    gap: 4px;
}

.scorecard-divider {
    width: 1px;
    height: 40px;
    background: #c5d0de;
    flex-shrink: 0;
}

.scorecard-label {
    font-family: var(--font-ui);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.scorecard-value {
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.scorecard-value--small {
    font-size: 13px;
    font-weight: 500;
    padding-top: 3px;
}


/* =============================================================
   ARTICLE META PILLS
   ============================================================= */

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.meta span {
    font-family: var(--font-ui);
    font-size: 12px;
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid #c5d0de;
    border-radius: 4px;
    padding: 3px 10px;
}


/* =============================================================
   ARTICLE FOOTER
   ============================================================= */

.article-footer {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 40px;
    background: var(--card-bg);
    border-top: 2px solid #c5d0de;
}

.footer-top {
    margin-bottom: 20px;
}

.footer-top a {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

.footer-top a:hover {
    text-decoration: underline;
}

.footer-disclosure {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 14px 16px;
    border-left: 3px solid #c5d0de;
    background: var(--accent-faint);
    border-radius: 0 4px 4px 0;
    margin-bottom: 20px;
}

.footer-copy {
    font-family: var(--font-ui);
    font-size: 11px;
    color: #aaa;
    text-align: right;
}


/* =============================================================
   IMAGES
   ============================================================= */

figure {
    background: var(--accent-faint);
    border: 1px solid #c5d0de;
    border-radius: 6px;
    padding: 16px;
    margin: 24px 0;
}

.article-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

figcaption {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}


/* =============================================================
   HOMEPAGE — hero header
   ============================================================= */

.site-header {
    max-width: 820px;
    margin: 16 auto;
    margin-bottom: 32px;
    padding: 40px 40px 36px 40px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.15);
}

.site-header__left {
    flex: 1;
}

.site-header__eyebrow {
    display: block;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
}

.site-header__title {
    font-family: var(--font-ui);
    font-size: 38px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0 0 14px 0;
}

.site-header__rule {
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    margin-bottom: 14px;
}

.site-header__tagline {
    font-family: var(--font-ui);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.5;
}

.site-header__stats {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.site-header__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    gap: 4px;
}

.site-header__stat-value {
    font-family: var(--font-ui);
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1;
}

.site-header__stat-label {
    font-family: var(--font-ui);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.site-header__stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}


/* =============================================================
   HOMEPAGE — site tagline
   ============================================================= */

.site-tagline {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}


/* =============================================================
   HOMEPAGE — methodology collapsible
   ============================================================= */

.methodology-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--accent-faint);
    border: 1px solid #c5d0de;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    text-align: left;
}

.methodology-toggle:hover {
    background: var(--accent-light);
}

.methodology-toggle__icon {
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.methodology-body {
    display: none;
    padding: 20px 0 10px 0;
}

.methodology-body--open {
    display: block;
}

.methodology-body h4 {
    margin-top: 20px;
}

.methodology-body p {
    font-size: 14px;
    color: #333;
}


/* =============================================================
   COVERAGE INDEX TABLE
   ============================================================= */

.coverage-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 13px;
    table-layout: fixed;
}

.coverage-table colgroup col:nth-child(1) { width: 11%; }  /* Asset */
.coverage-table colgroup col:nth-child(2) { width: 14%; }  /* Company */
.coverage-table colgroup col:nth-child(3) { width: 8%; }   /* Ticker */
.coverage-table colgroup col:nth-child(4) { width: 12%; }  /* Condition */
.coverage-table colgroup col:nth-child(5) { width: 12%; }  /* Trial */
.coverage-table colgroup col:nth-child(6) { width: 16%; }  /* Prob of Success */
.coverage-table colgroup col:nth-child(7) { width: 16%; }  /* Materiality */
.coverage-table colgroup col:nth-child(8) { width: 12%; }  /* Last Edit */

.coverage-table thead tr {
    background: var(--accent-faint);
    border-bottom: 2px solid #c5d0de;
}

.coverage-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    padding: 10px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coverage-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.coverage-row {
    cursor: pointer;
    transition: background 0.12s ease;
}

.coverage-row:hover {
    background: var(--accent-faint);
}

.coverage-asset {
    font-weight: 600;
    color: var(--accent);
}

.coverage-ticker {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.coverage-trial {
    white-space: nowrap;
}

.coverage-date {
    font-size: 12px;
    color: var(--text-muted);
}


/* =============================================================
   PHASE BADGES
   ============================================================= */

.phase-badge {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.phase-badge--1 {
    background: #fef3e2;
    color: #b45309;
    border: 1px solid #fcd896;
}

.phase-badge--2 {
    background: #e8edf3;
    color: var(--accent);
    border: 1px solid #c5d0de;
}

.phase-badge--3 {
    background: #e6f4ea;
    color: #1a5c2a;
    border: 1px solid #a8d5b0;
}


/* =============================================================
   SCORE BADGES — PoA and Materiality Score
   Red: <50% or <5    Yellow: 50-75% or 5-7.5    Green: >75% or >7.5
   ============================================================= */

.score-badge {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-block;
}

.score-badge--red {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f5a0a0;
}

.score-badge--yellow {
    background: #fef9e7;
    color: #92610a;
    border: 1px solid #f9d871;
}

.score-badge--green {
    background: #e6f4ea;
    color: #1a5c2a;
    border: 1px solid #a8d5b0;
}


/* =============================================================
   HOMEPAGE — article cards (kept for future use)
   ============================================================= */

.article-card {
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 15px;
    background: var(--card-bg);
    transition: border-color 0.15s ease;
}

.article-card:hover {
    border-color: var(--accent);
}

.article-card h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--accent);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.article-meta span {
    font-family: var(--font-ui);
    font-size: 11px;
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid #c5d0de;
    border-radius: 4px;
    padding: 2px 8px;
}


/* =============================================================
   SITE FOOTER
   ============================================================= */

.site-footer {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 40px;
    background: var(--card-bg);
    border-top: 2px solid #c5d0de;
}

.site-footer .footer-disclosure {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 14px 16px;
    border-left: 3px solid #c5d0de;
    background: var(--accent-faint);
    border-radius: 0 4px 4px 0;
    margin-bottom: 16px;
}

.site-footer .footer-copy {
    font-family: var(--font-ui);
    font-size: 11px;
    color: #aaa;
    text-align: right;
}
