
:root {
    --bg: #0a0d12;
    --surface: #111620;
    --surface-2: #171d28;
    --border: #252d3a;
    --text: #f4f7fb;
    --muted: #8994a5;
    --accent: #71a7ff;
    --accent-soft: rgba(113,167,255,.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 22px 5vw;

    border-bottom:
        1px solid var(--border);

    position: sticky;
    top: 0;

    background:
        rgba(10,13,18,.95);

    backdrop-filter: blur(12px);

    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border-radius: 12px;

    background: var(--accent);
    color: #07101d;

    font-weight: 900;
}

.brand h1 {
    margin: 0;
    font-size: 17px;
}

.brand p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

nav {
    display: flex;
    gap: 8px;
}

.nav-button,
#back-button {
    border: 0;
    border-radius: 8px;
    padding: 9px 13px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;
}

.nav-button.active,
.nav-button:hover,
#back-button:hover {
    background: var(--surface-2);
    color: var(--text);
}

main {
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding: 48px 0 80px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: end;

    margin-bottom: 30px;
}

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}

.hero h2,
#methodology-view h2 {
    font-size: clamp(30px, 5vw, 52px);
    margin: 8px 0;
}

.hero p,
.method-intro {
    color: var(--muted);
    max-width: 660px;
}

.hero-stat {
    text-align: right;
}

.hero-stat span {
    display: block;
    font-size: 38px;
    font-weight: 800;
}

.hero-stat small {
    color: var(--muted);
}

.controls {
    margin: 20px 0;
}

#search {
    width: 100%;
    max-width: 420px;

    padding: 12px 14px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface);
    color: var(--text);
}

.table-wrap {
    overflow-x: auto;

    border:
        1px solid var(--border);

    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface-2);
}

th,
td {
    text-align: left;
    padding: 14px 16px;

    border-bottom:
        1px solid var(--border);

    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background: var(--accent-soft);
}

.rank {
    color: var(--muted);
}

.qpi-score {
    font-weight: 800;
    font-size: 18px;
}

.sample-warning {
    color: #f7c56a;
    font-size: 11px;
}

.hidden {
    display: none !important;
}

.player-header {
    margin: 35px 0;
}

.player-header h2 {
    font-size: 42px;
    margin: 4px 0;
}

.player-header p {
    color: var(--muted);
}

.score-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin: 25px 0 40px;
}

.score-card {
    min-width: 160px;
    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background: var(--surface);
}

.score-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.score-card strong {
    display: block;
    font-size: 30px;
    margin-top: 5px;
}

.component-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(260px, 1fr));

    gap: 16px;
}

.component {
    padding: 18px;
    border:
        1px solid var(--border);

    border-radius: 12px;
    background: var(--surface);
}

.component-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.bar {
    height: 8px;
    border-radius: 10px;
    background: var(--surface-2);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
}

.formula-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(300px, 1fr));

    gap: 18px;

    margin: 30px 0 45px;
}

.formula-card {
    padding: 22px;
    border:
        1px solid var(--border);

    border-radius: 14px;
    background: var(--surface);
}

.formula-row {
    display: flex;
    justify-content: space-between;

    padding: 10px 0;

    border-bottom:
        1px solid var(--border);
}

#methodology-view h3 {
    margin-top: 38px;
}

#methodology-view p {
    color: var(--muted);
    line-height: 1.7;
}

@media (max-width: 700px) {

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-stat {
        text-align: left;
    }
}


/* ==========================================================
   QPI METHODOLOGY
   ========================================================== */

.method-section {
    margin-top: 42px;
    max-width: 850px;
}

.method-section h3 {
    margin-bottom: 10px;
}

.method-section p {
    color: var(--muted);
    line-height: 1.75;
}

.method-pill-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 14px;

    margin-top: 20px;
}

.method-pill {
    padding: 18px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.method-pill strong {
    display: block;

    margin-bottom: 8px;

    font-size: 15px;
}

.method-pill span {
    display: block;

    color: var(--muted);

    line-height: 1.55;

    font-size: 13px;
}


.technical-methodology {
    margin-top: 55px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background: var(--surface);
}

.technical-methodology summary {
    padding: 20px 22px;

    cursor: pointer;

    font-weight: 700;

    font-size: 16px;

    list-style: none;
}

.technical-methodology summary::-webkit-details-marker {
    display: none;
}

.technical-methodology summary::after {
    content: "+";

    float: right;

    color: var(--accent);

    font-size: 20px;
}

.technical-methodology[open] summary::after {
    content: "−";
}

.technical-content {
    padding:
        0 22px 25px;

    border-top:
        1px solid var(--border);
}

.technical-content > h3 {
    margin-top: 30px;
}

.technical-content p {
    color: var(--muted);

    line-height: 1.7;
}

.technical-list {
    color: var(--muted);

    line-height: 1.7;

    padding-left: 22px;
}

.technical-list li {
    margin-bottom: 10px;
}



/* ==========================================================
   QPI LAUNCH POLISH
   ========================================================== */

body {
    background:
        radial-gradient(
            circle at 20% -10%,
            rgba(113,167,255,.08),
            transparent 32%
        ),
        var(--bg);
}


/* ---------- HERO ---------- */

.hero {
    padding: 28px 0 12px;
}

.hero h2 {
    letter-spacing: -.035em;
    line-height: 1.02;
}

.hero p {
    font-size: 16px;
    line-height: 1.65;
}


/* ---------- TOP THREE ---------- */

.top-three {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin:
        28px 0 30px;
}


.leader-card {
    position: relative;

    min-height: 180px;

    padding: 22px;

    border:
        1px solid var(--border);

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            rgba(113,167,255,.09),
            rgba(17,22,32,.96) 45%
        );

    overflow: hidden;

    cursor: pointer;

    transition:
        transform .15s ease,
        border-color .15s ease;
}


.leader-card:hover {
    transform: translateY(-2px);

    border-color:
        rgba(113,167,255,.55);
}


.leader-card-rank {
    position: absolute;

    top: 15px;
    right: 17px;

    font-size: 44px;

    font-weight: 900;

    color:
        rgba(255,255,255,.08);

    letter-spacing: -.06em;
}


.leader-card .label {
    color: var(--accent);

    font-size: 11px;

    text-transform: uppercase;

    font-weight: 800;

    letter-spacing: .12em;
}


.leader-card h3 {
    margin:
        20px 0 3px;

    font-size: 23px;

    letter-spacing: -.025em;
}


.leader-card .team {
    color: var(--muted);

    font-size: 13px;
}


.leader-card-score {
    display: flex;

    align-items: baseline;

    gap: 8px;

    margin-top: 21px;
}


.leader-card-score strong {
    font-size: 35px;

    line-height: 1;

    letter-spacing: -.04em;
}


.leader-card-score span {
    color: var(--muted);

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: .08em;
}


/* ---------- SEARCH ---------- */

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: 12px;
}


#search {
    min-height: 44px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}


#search:focus {
    outline: none;

    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(113,167,255,.10);
}


/* ---------- LEADERBOARD ---------- */

.table-wrap {
    background: var(--surface);

    box-shadow:
        0 20px 50px rgba(0,0,0,.12);
}


#leaderboard tbody tr:last-child td {
    border-bottom: none;
}


#leaderboard td {
    height: 68px;
}


#leaderboard tbody tr {
    transition:
        background .12s ease;
}


.rank-number {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 8px;

    background: var(--surface-2);

    font-weight: 750;

    color: var(--muted);
}


.qb-cell {
    min-width: 190px;
}


.qb-name {
    display: block;

    font-weight: 750;

    letter-spacing: -.01em;
}


.team-cell {
    color: var(--muted);
}


.metric-number {
    font-variant-numeric:
        tabular-nums;
}


.qpi-score {
    color: var(--text);

    font-variant-numeric:
        tabular-nums;
}


.sample-text {
    color: var(--muted);

    font-size: 12px;
}


/* ---------- PLAYER PAGE ---------- */

.player-header {
    padding-bottom: 25px;

    border-bottom:
        1px solid var(--border);
}


.player-header h2 {
    letter-spacing: -.04em;
}


.score-card {
    background:
        linear-gradient(
            145deg,
            var(--surface),
            rgba(23,29,40,.76)
        );
}


.score-card:first-child {
    border-color:
        rgba(113,167,255,.38);
}


.component {
    transition:
        border-color .15s ease,
        transform .15s ease;
}


.component:hover {
    border-color:
        rgba(113,167,255,.35);

    transform:
        translateY(-1px);
}


.component-head strong {
    font-variant-numeric:
        tabular-nums;
}


/* ---------- MOBILE ---------- */

@media (max-width: 850px) {

    .top-three {
        grid-template-columns: 1fr;
    }

    .leader-card {
        min-height: 145px;
    }

}


@media (max-width: 650px) {

    main {
        width: 94vw;
        padding-top: 28px;
    }

    .brand h1 {
        font-size: 15px;
    }

    .hero h2 {
        font-size: 36px;
    }

    th,
    td {
        padding:
            12px 12px;
    }

}


/* ==========================================================
   QPI LIGHT THEME
   ========================================================== */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef2f7;
    --border: #d9e0ea;

    --text: #172033;
    --muted: #667085;

    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, .08);
}


/* ---------- PAGE ---------- */

body {
    background:
        radial-gradient(
            circle at 15% -10%,
            rgba(37, 99, 235, .08),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);
}


/* ---------- HEADER ---------- */

.site-header {
    background:
        rgba(255,255,255,.94);

    border-bottom:
        1px solid var(--border);

    box-shadow:
        0 1px 8px rgba(15, 23, 42, .04);
}


.brand-mark {
    background: var(--accent);
    color: white;
}


.nav-button {
    color: var(--muted);
}


.nav-button.active,
.nav-button:hover,
#back-button:hover {
    background: #e8eef9;
    color: var(--text);
}


/* ---------- TOP 3 ---------- */

.leader-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f2f6fc
        );

    border:
        1px solid var(--border);

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .05);
}


.leader-card:hover {
    border-color:
        rgba(37,99,235,.45);

    box-shadow:
        0 10px 28px rgba(15, 23, 42, .08);
}


.leader-card-rank {
    color:
        rgba(23,32,51,.07);
}


.leader-card .team {
    color: var(--muted);
}


/* ---------- SEARCH ---------- */

#search {
    background: white;
    color: var(--text);

    border:
        1px solid var(--border);
}


#search::placeholder {
    color: #98a2b3;
}


/* ---------- TABLE ---------- */

.table-wrap {
    background: white;

    border:
        1px solid var(--border);

    box-shadow:
        0 12px 30px rgba(15, 23, 42, .05);
}


thead {
    background: #eef2f7;
}


th {
    color: #667085;
}


td {
    color: var(--text);
}


tbody tr:hover {
    background: #f4f7fc;
}


.rank-number {
    background: #edf2f9;
    color: #536176;
}


.team-cell,
.sample-text {
    color: var(--muted);
}


.qpi-score {
    color: #163b77;
}


/* ---------- PLAYER PAGE ---------- */

.score-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f5f8fc
        );

    border:
        1px solid var(--border);

    box-shadow:
        0 6px 18px rgba(15,23,42,.04);
}


.score-card:first-child {
    border-color:
        rgba(37,99,235,.35);

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #eef5ff
        );
}


.component {
    background: white;

    border:
        1px solid var(--border);
}


.bar {
    background: #e9eef5;
}


.bar-fill {
    background:
        linear-gradient(
            90deg,
            #2563eb,
            #4f83f1
        );
}


/* ---------- METHODOLOGY ---------- */

.method-pill,
.formula-card,
.technical-methodology {
    background: white;

    border:
        1px solid var(--border);
}


.technical-content {
    background: #fbfcfe;
}


.method-section p,
.technical-content p,
.technical-list,
.method-pill span,
.method-intro {
    color: var(--muted);
}


/* ---------- LIMITED SAMPLE ---------- */

.sample-warning {
    color: #b45309;
}


/* ---------- SUBTLE ACCENT TEXT ---------- */

.eyebrow {
    color: var(--accent);
}



/* ==========================================================
   QPI PLAYER + TEAM ASSETS
   ========================================================== */


/* ---------- TOP 3 ---------- */

.leader-card {
    display: flex;
    align-items: stretch;

    padding: 0;

    min-height: 190px;

    border-top:
        4px solid var(--team-color);
}


.leader-visual {
    width: 42%;

    min-width: 105px;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    overflow: hidden;

    background:
        linear-gradient(
            160deg,
            color-mix(
                in srgb,
                var(--team-color) 13%,
                white
            ),
            white
        );
}


.leader-headshot {
    display: block;

    width: 100%;
    max-height: 190px;

    object-fit: contain;

    object-position:
        center bottom;
}


.leader-headshot.fallback-logo {
    width: 78%;
    height: 78%;

    padding: 25px;

    object-fit: contain;

    align-self: center;
}


.leader-info {
    flex: 1;

    position: relative;

    padding: 20px;
}


.leader-team-row {
    display: flex;
    align-items: center;

    gap: 7px;

    margin-top: 12px;

    color: var(--muted);

    font-size: 12px;
}


.leader-team-logo {
    width: 24px;
    height: 24px;

    object-fit: contain;
}


.leader-info h3 {
    margin:
        8px 0 0;
}


/* ---------- LEADERBOARD ---------- */

.team-table-wrap {
    display: flex;
    align-items: center;

    gap: 9px;
}


.table-team-logo {
    width: 28px;
    height: 28px;

    object-fit: contain;

    flex-shrink: 0;
}


/* ---------- PLAYER PROFILE ---------- */

.player-profile-hero {
    display: flex;
    align-items: stretch;

    min-height: 280px;

    margin:
        28px 0 30px;

    border:
        1px solid var(--border);

    border-top:
        5px solid var(--team-color);

    border-radius: 16px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--team-color) 8%,
                white
            ),
            white 50%
        );
}


.profile-image-wrap {
    width: 34%;
    min-width: 230px;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    background:
        color-mix(
            in srgb,
            var(--team-color) 8%,
            white
        );
}


.profile-headshot {
    width: 100%;
    height: 100%;

    max-height: 320px;

    object-fit: contain;

    object-position:
        center bottom;
}


.profile-headshot.fallback-logo {
    width: 65%;
    height: 65%;

    margin: auto;

    padding: 25px;

    object-fit: contain;
}


.player-profile-hero
.player-header {
    flex: 1;

    margin: 0;

    padding:
        45px 35px;

    border-bottom: none;

    align-self: center;
}


.profile-team-row {
    display: flex;
    align-items: center;

    gap: 9px;

    margin:
        15px 0 4px;

    color: var(--muted);

    font-weight: 650;
}


.profile-team-logo {
    width: 36px;
    height: 36px;

    object-fit: contain;
}


/* ---------- MOBILE ---------- */

@media (max-width: 850px) {

    .leader-card {
        min-height: 160px;
    }

    .leader-visual {
        width: 34%;
    }

    .player-profile-hero {
        min-height: 230px;
    }

    .profile-image-wrap {
        min-width: 180px;
    }

}


@media (max-width: 600px) {

    .player-profile-hero {
        flex-direction: column;
    }

    .profile-image-wrap {
        width: 100%;
        height: 230px;
    }

    .player-profile-hero
    .player-header {
        padding: 26px 22px;
    }

}
