:root {
    /* TRR 266 palette, with insol using blue + red rather than petrol */
    --primary: #2aafd2;
    --primary-dark: #1d758d;
    --primary-light: #6ecae2;

    --aux: #6f354b;
    --aux-light: #944664;

    --lilac: #22355d;
    --petrol: #14676b;

    --ink: #252b35;
    --muted: #65717b;
    --line: #dbe2e6;
    --paper: #ffffff;
    --tint: #f3f9fb;
    --aux-tint: #f8f1f4;

    --shell: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family:
        "Helvetica Neue",
        Helvetica,
        Arial,
        system-ui,
        sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--primary);
}

img,
svg {
    display: block;
    max-width: 100%;
}

.top-rule {
    height: 8px;
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--primary) 72%,
        var(--aux) 72%,
        var(--aux) 100%
    );
}

.shell {
    width: min(calc(100% - 48px), var(--shell));
    margin: 0 auto;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.trr-brand {
    display: block;
    width: min(390px, 48vw);
}

.trr-brand img {
    width: 100%;
    height: auto;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 28px;
    font-size: 0.92rem;
    font-weight: 600;
}

.top-nav a {
    color: var(--ink);
    text-decoration: none;
}

.top-nav a:hover {
    color: var(--primary);
}

.hero {
    padding: 92px 0 104px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
    gap: 80px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(4.5rem, 10vw, 8rem);
    font-weight: 300;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.subtitle {
    max-width: 660px;
    margin-bottom: 34px;
    color: var(--primary-dark);
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    font-weight: 400;
    line-height: 1.3;
}

.lead {
    max-width: 720px;
    margin-bottom: 36px;
    font-size: 1.08rem;
}

.lead > ul {
    margin-block: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-block;
    padding: 12px 20px;
    border: 1px solid var(--primary);
    font-weight: 650;
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.button-secondary {
    border-color: var(--aux);
    background: transparent;
    color: var(--aux);
}

.button-secondary:hover {
    background: var(--aux-tint);
    color: var(--aux);
}

.hero-mark {
    width: min(100%, 330px);
    justify-self: end;
    opacity: 0.95;
}

.mark-base {
    fill: #f4f8fa;
}

.mark-teal {
    fill: var(--primary);
}

.mark-mid {
    fill: var(--aux);
}

.mark-light {
    fill: var(--primary-light);
}

.mark-pale {
    fill: var(--aux-light);
}

.section {
    padding: 82px 0;
}

.section-white {
    background: #fff;
}

.section-tint {
    background: var(--tint);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-heading {
    max-width: 720px;
    margin-bottom: 42px;
}

h2 {
    margin-bottom: 22px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 350;
    letter-spacing: -0.025em;
    line-height: 1.12;
}

h3 {
    margin-bottom: 12px;
    font-size: 1.22rem;
    line-height: 1.3;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.card {
    padding: 32px 34px 26px 0;
}

.card + .card {
    padding-left: 34px;
    border-left: 1px solid var(--line);
}

.card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.card-number {
    display: block;
    margin-bottom: 30px;
    color: var(--aux);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
    gap: 90px;
    align-items: start;
}

.link-panel {
    background: #fff;
    border-top: 5px solid var(--aux);
    box-shadow: 0 14px 38px rgba(34, 41, 44, 0.08);
}

.panel-label {
    margin: 0;
    padding: 18px 24px 12px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.link-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.link-panel a:hover {
    background: var(--tint);
    color: var(--primary-dark);
}

.project-note {
    display: grid;
    grid-template-columns: 90px minmax(0, 720px);
    gap: 32px;
    align-items: center;
}

.project-note p:last-child {
    margin-bottom: 0;
}

.mini-mark {
    width: 78px;
}

.site-footer {
    padding: 52px 0 28px;
    background: var(--ink);
    color: #dfe7e8;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.site-footer strong {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 500;
}

.site-footer p {
    margin: 6px 0 0;
    color: #aebbbc;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.site-footer a {
    color: #fff;
}

.funding {
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid #455053;
    color: #9da9ab;
    font-size: 0.8rem;
}

@media (max-width: 820px) {
    .header-inner {
        padding: 22px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .trr-brand {
        width: min(430px, 100%);
    }

    .top-nav {
        justify-content: flex-start;
    }

    .hero {
        padding: 64px 0 72px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .hero-mark {
        width: 180px;
        justify-self: start;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .card,
    .card + .card {
        padding: 28px 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .card:first-child {
        border-top: 0;
    }

    .split {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .shell {
        width: min(calc(100% - 32px), var(--shell));
    }

    .top-nav {
        gap: 16px;
    }

    .hero-mark {
        display: none;
    }

    .section {
        padding: 62px 0;
    }

    .project-note {
        grid-template-columns: 1fr;
    }
}



/* Soft launch ------------------------------------------------------------- */

.soft-launch {
    background: var(--aux);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.soft-launch:hover,
.soft-launch:focus {
    background: var(--aux-light);
    outline: none;
}

.soft-launch-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: baseline;
    padding: 16px 0;
}

.soft-launch-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.soft-launch p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.5;
}

.soft-launch code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-weight: 700;
}


.soft-launch-close {
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 300;
}

@media (max-width: 620px) {
    .soft-launch-inner {
        grid-template-columns: 1fr auto;
        gap: 4px 14px;
    }

    .soft-launch-label {
        grid-column: 1;
    }

    .soft-launch p:not(.soft-launch-label) {
        grid-column: 1 / -1;
    }

    .soft-launch-close {
        grid-column: 2;
        grid-row: 1;
    }
}


/* Codebook --------------------------------------------------------------- */

.codebook-hero {
    padding: 64px 0 52px;
    background: var(--tint);
    border-bottom: 1px solid var(--line);
}

.codebook-title {
    max-width: 900px;
    margin-bottom: 24px;
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    line-height: 1.02;
}

.codebook-intro {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
}

.release-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.release-badges span {
    padding: 7px 11px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.84rem;
}

.codebook-section {
    padding: 56px 0 90px;
}

.codebook-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
}

.codebook-toc {
    position: sticky;
    top: 28px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    border-top: 4px solid var(--aux);
    background: var(--tint);
}

.codebook-toc a {
    display: block;
    padding: 8px 18px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.84rem;
    line-height: 1.3;
    text-decoration: none;
}

.codebook-toc a:hover {
    background: #fff;
    color: var(--primary-dark);
}

.codebook-toc .toc-sub {
    padding-left: 30px;
    color: var(--muted);
    font-size: 0.78rem;
}

.codebook-content {
    min-width: 0;
    max-width: 900px;
}

.codebook-content > :first-child {
    margin-top: 0;
}

.codebook-content h2 {
    margin-top: 58px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.codebook-content h3 {
    margin-top: 42px;
    font-size: 1.45rem;
}

.codebook-content h2 + h2 {
    margin-top: 28px;
}

.codebook-content p,
.codebook-content li {
    max-width: 78ch;
}

.codebook-content code {
    padding: 0.08em 0.28em;
    border-radius: 3px;
    background: #eef7fa;
    color: #22355d;
    font-size: 0.9em;
}

.codebook-content ul,
.codebook-content ol {
    padding-left: 1.5rem;
}

.table-wrap {
    width: 100%;
    margin: 26px 0 38px;
    overflow-x: auto;
    border: 1px solid var(--line);
}

.codebook-content table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.88rem;
    line-height: 1.45;
}

.codebook-content th,
.codebook-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.codebook-content thead th {
    background: var(--tint);
    color: var(--ink);
    font-weight: 700;
}

.codebook-content tbody tr:last-child td {
    border-bottom: 0;
}

.codebook-content tbody tr:nth-child(even) {
    background: #fbfcfd;
}

@media (max-width: 880px) {
    .codebook-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .codebook-toc {
        position: static;
        max-height: none;
        columns: 2;
    }

    .codebook-toc .panel-label {
        column-span: all;
    }

    .codebook-toc a {
        break-inside: avoid;
    }
}

@media (max-width: 560px) {
    .codebook-toc {
        columns: 1;
    }
}

/* Public daily data explorer */
.daily-controls fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
}

.daily-controls legend {
    padding: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.daily-controls label {
    display: grid;
    gap: 4px;
    flex: 1 1 150px;
    min-width: 0;
}

.daily-controls select,
.daily-controls input {
    width: 100%;
    min-height: 44px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.daily-controls :focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 3px;
}

.daily-chart {
    width: 100%;
    min-height: 360px;
    background: var(--paper);
    border-radius: 8px;
}

.daily-chart text {
    fill: var(--muted);
    font-size: 12px;
}

.daily-grid { stroke: var(--line); }
.daily-dot {
    fill: var(--primary-dark);
    opacity: 0.4;
    stroke: transparent;
    stroke-width: 6;
    pointer-events: all;
}
.daily-dot:hover { opacity: 1; }
.daily-trend {
    fill: none;
    stroke: var(--aux);
    stroke-width: 2.5;
    pointer-events: none;
}
.daily-dot-key { color: var(--primary-dark); }
.daily-line-key { color: var(--aux); margin-left: 16px; }
.daily-note, .daily-coverage { color: var(--muted); font-size: 0.9rem; }

.registration { max-width: 720px; }
.registration h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
.registration fieldset { border: 0; padding: 0; margin: 24px 0; }
.registration legend { font-size: 1.3rem; font-weight: 600; }
.registration label { display: block; margin-top: 16px; }
.registration input {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 4px 0 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
    background: var(--paper);
}
.registration button { font: inherit; cursor: pointer; }
.registration :disabled { cursor: wait; opacity: 0.7; }
.registration :focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 3px;
}
