/* Ben W. Ansell — main site styles.
   Modelled on the WordPress.com "Creative" theme used at benwansell.com. */

:root {
    --accent: #15487e;
    --accent-hover: #0e3459;
    --accent-on-dark: #8fb4de;
    --text: #555;
    --heading: #444;
    --muted: #aaa;
    --nav: #b4b4b4;
    --page-bg: #f9f9f9;
    --header-bg: #fff;
    --rule: #808080;
    --card-border: #e6e6e6;
    --footer-bg: #2d3339;
    --footer-bottom-bg: #22262b;
    --footer-text: #717f8f;
    --footer-text-hover: #9ba6b0;
    --serif: Merriweather, Georgia, serif;
    --sans: Lato, "Helvetica Neue", Arial, sans-serif;
    --wrap: 1140px;
    --content: 850px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--page-bg);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s linear; }
a:hover, a:focus { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-family: var(--sans);
    color: var(--heading);
    font-weight: 700;
    line-height: 1.2;
}

p { margin: 0 0 1.5em; }

hr {
    border: 0;
    border-top: 2px solid var(--rule);
    margin: 1.5rem 0;
    opacity: 0.8;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 100;
    background: #fff;
    padding: 0.5rem 1rem;
}

/* ---------- Header ---------- */

.site-header { background: var(--header-bg); }

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
}

.site-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.site-title a { color: var(--muted); }
.site-title a:hover { color: var(--heading); }

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.main-nav a {
    display: block;
    padding: 0.5rem 0 0.5rem 2.2rem;
    font-family: var(--sans);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--nav);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--heading);
    font-family: var(--sans);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Main ---------- */

.site-main {
    flex: 1;
    padding: 3rem 0 5rem;
}

.content { max-width: var(--content); }
.content-wide { max-width: none; }

.page-title {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0 0 3rem;
}

.section-label {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 2.5rem 0 1.5rem;
}
.section-label:first-child { margin-top: 0; }

.sub-label {
    font-family: var(--serif);
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
}

.lead-large { font-size: 1.125rem; }

/* Papers / publication lists */
.pub-list p { font-size: 1.0625rem; }

/* File / download lists */
.file-list {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
}
.file-list li { margin-bottom: 0.6rem; }

/* ---------- Home ---------- */

.slideshow {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2400 / 1042;
    background: #ddd;
    margin-bottom: 1rem;
}
.slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.slideshow img.is-active { opacity: 1; }
.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1rem;
    line-height: 28px;
    cursor: pointer;
    padding: 0;
}
.slide-btn:hover { background: rgba(0, 0, 0, 0.6); }
.slide-btn.prev { left: 4px; }
.slide-btn.next { right: 4px; }
.slide-dots {
    display: flex;
    gap: 6px;
    margin: 0 0 2.25rem;
}
.slide-dots button {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: #bbb;
    cursor: pointer;
}
.slide-dots button[aria-current="true"] { background: #444; }

.intro {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 0;
    margin-bottom: 1.25rem;
}
/* The photo grows to match the text height, but only up to 8% taller than
   its natural 2:3 shape, so the sides are never cropped by much. */
.intro-photo {
    margin: 0;
    container-type: inline-size;
    display: flex;
    align-items: center;
}
.intro-photo img {
    width: 100%;
    height: 100%;
    min-height: 150cqi;
    max-height: 162cqi;
    object-fit: cover;
    object-position: 50% 20%;
}
.intro-text {
    align-self: center;
    padding: 0 4% 0 9%;
    font-size: 1.0625rem;
}
.intro-text p { margin-bottom: 1.4em; }
.intro-text p:last-child { margin-bottom: 0; }

.contact h2 {
    font-size: 1rem;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
}
.contact p {
    font-size: 1.0625rem;
    margin: 0;
}
.contact p span + span { margin-left: 0.6rem; }

/* ---------- Books ---------- */

.book {
    display: grid;
    align-items: center;
    gap: 0;
    margin-bottom: 2.5rem;
}
.book figure { margin: 0; }
.book .book-text { padding: 0 8%; }
.book .book-text p:last-child { margin-bottom: 0; }
.book.wide { grid-template-columns: 64% 1fr; }
.book.left { grid-template-columns: 37% 1fr; }
.book.right { grid-template-columns: 1fr 36%; }
.book.right figure { order: 2; }

/* ---------- Projects ---------- */

.projects-intro { margin-bottom: 2.5rem; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--accent);
    padding: 1.4rem 1.5rem 1.25rem;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.15s;
}
.project-card:hover,
.project-card:focus {
    color: var(--text);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}
.project-card h2 {
    font-size: 1.125rem;
    margin: 0 0 0.4rem;
}
.project-card p {
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0 0 1rem;
    flex: 1;
}
.project-card .project-link {
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
}
.site-footer .footer-widgets { padding: 4rem 0 3.5rem; }
.site-footer h2 {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--footer-text);
}
.social-links {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.social-links a {
    display: block;
    color: var(--footer-text);
}
.social-links a:hover { color: var(--footer-text-hover); }
.social-links svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    display: block;
}
.social-links svg.stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.social-links svg.stroke .dot {
    fill: currentColor;
    stroke: none;
}
.site-info {
    background: var(--footer-bottom-bg);
    color: #657380;
    padding: 1.5rem 0;
    font-size: 0.8125rem;
}
.site-info p { margin: 0; }
.site-info a { color: var(--footer-text); text-decoration: underline; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .main-nav a { padding-left: 1.4rem; }
}

@media (max-width: 860px) {
    .site-header .wrap { flex-wrap: wrap; min-height: 64px; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        width: 100%;
        padding-bottom: 1rem;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; }
    .main-nav a {
        padding: 0.6rem 0;
        border-top: 1px solid #eee;
    }
}

@media (max-width: 700px) {
    body { font-size: 15px; }
    .wrap { padding: 0 16px; }
    .site-main { padding: 2rem 0 3rem; }
    .page-title { font-size: 2.25rem; margin-bottom: 2rem; }
    .intro,
    .book.wide,
    .book.left,
    .book.right { grid-template-columns: 1fr; }
    .intro-photo { margin-bottom: 1.75rem; }
    .intro-photo img { min-height: 0; max-height: 520px; }
    .intro-text { padding: 0; }
    .book figure { margin-bottom: 1.25rem; }
    .book.right figure { order: 0; }
    .book.left figure,
    .book.right figure { max-width: 260px; }
    .book .book-text { padding: 0; }
    .project-grid { grid-template-columns: 1fr; }
}

/* ---------- Home page (draft redesign) ---------- */

.home .kicker {
    margin: 0 0 0.9rem;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 3.5rem;
    align-items: start;
    padding: 1rem 0 3.5rem;
}
.hero .hero-title {
    margin: 0 0 1.25rem;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 2.35rem;
    line-height: 1.22;
    color: var(--heading);
}
.hero-roles {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #777;
    margin-bottom: 1.75rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--accent);
    border-radius: 2px;
}
.btn em { font-style: normal; }
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover, .btn-solid:focus { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover, .btn-ghost:focus { background: var(--accent); color: #fff; }

/* Chart */
.hero-chart {
    margin: 0;
    background: #fff;
    border: 1px solid var(--card-border);
    padding: 1.1rem 1.1rem 0.8rem;
}
.hero-chart figcaption { margin-bottom: 0.4rem; }
.chart-title {
    display: block;
    font-family: var(--sans);
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--heading);
}
.chart-sub { display: block; font-size: 0.8rem; line-height: 1.5; color: #777; }
.chart-frame { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; touch-action: none; }
.chart-grid line { stroke: #ececec; stroke-width: 1; }
.chart-tick { font-family: var(--sans); font-size: 11px; fill: #999; }
.chart-axis { font-family: var(--sans); font-size: 11.5px; font-weight: 700; fill: #777; }
.chart-dots circle { fill-opacity: 0.45; stroke: #fff; stroke-width: 0.6; transition: r 0.1s; }
.chart-dots circle.is-labelled { fill-opacity: 1; stroke: var(--heading); stroke-width: 1.5; r: 5; }
.chart-dots circle.is-hot { fill-opacity: 1; stroke: var(--heading); stroke-width: 1.5; r: 6; }
.chart-trend { stroke: var(--heading); stroke-width: 2.2; stroke-dasharray: 6 4; }
.chart-note-svg { font-family: var(--sans); font-size: 11.5px; font-weight: 700; fill: var(--heading); }
.chart-tip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 12px));
    background: var(--heading);
    color: #fff;
    font-family: var(--sans);
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
}
.chart-tip b { display: block; }
.chart-note { font-size: 0.72rem; line-height: 1.5; color: #999; margin: 0.4rem 0 0; min-height: 2.2em; }
.chart-sub { min-height: 3em; }
.chart-frame { min-height: 120px; }

/* Carousel controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}
.chart-prev, .chart-next {
    width: 34px;
    height: 34px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    font-size: 1.35rem;
    line-height: 1;
    padding: 0 0 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.chart-prev:hover, .chart-next:hover, .chart-prev:focus-visible, .chart-next:focus-visible { background: var(--accent); color: #fff; }
.chart-next { margin-left: auto; }
.chart-dotsnav { display: flex; gap: 7px; }
.chart-dotsnav button {
    width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
    background: #d5d5d5; cursor: pointer;
}
.chart-dotsnav button[aria-current="true"] { background: var(--accent); }
.chart-count { font-family: var(--sans); font-size: 0.75rem; color: #999; }

/* Oxford photo strip in the About section */
.photo-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin: 0 0 2.25rem; }
.photo-strip figure { margin: 0; }
.photo-strip img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.photo-strip figcaption { font-family: var(--sans); font-size: 0.75rem; color: #999; margin-top: 0.4rem; }
@media (max-width: 700px) { .photo-strip { grid-template-columns: 1fr; gap: 1rem; } }
.chart-failed .chart-frame { display: none; }

/* Section headings on the home page */
.band-title {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1rem;
    padding-top: 1.1rem;
    border-top: 2px solid var(--heading);
}

/* Latest strip */
.now { margin-bottom: 3rem; }
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.now-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--accent);
    padding: 1.15rem 1.25rem 1rem;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.15s;
}
.now-card:hover, .now-card:focus { color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07); transform: translateY(-2px); }
.now-label {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.now-card h3 { font-family: var(--serif); font-size: 1.1rem; line-height: 1.35; margin: 0 0 0.5rem; }
.now-card p { font-size: 0.86rem; line-height: 1.6; color: #666; margin: 0 0 0.9rem; flex: 1; }
.now-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    font-family: var(--sans);
    font-size: 0.75rem;
    color: #999;
}
.now-cta { color: var(--accent); font-weight: 700; margin-left: auto; }

/* Three doors */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 3.5rem; }
.door {
    display: flex;
    flex-direction: column;
    background: var(--footer-bg);
    color: #c9d0d7;
    padding: 1.5rem 1.4rem 1.3rem;
    transition: background 0.2s;
}
.door:hover, .door:focus { background: #20252a; color: #c9d0d7; }
.door-kicker {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-on-dark);
}
.door h3 { color: #fff; font-family: var(--serif); font-size: 1.2rem; margin: 0.5rem 0 0.6rem; }
.door p { font-size: 0.88rem; line-height: 1.6; margin: 0 0 1rem; flex: 1; }
.door-links { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }

.about .band-title { margin-bottom: 1.5rem; }

@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; gap: 2rem; }
    .hero .hero-title { font-size: 2rem; }
    .now-grid, .doors { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .hero { padding-top: 0; }
    .hero .hero-title { font-size: 1.65rem; }
    .hero-chart { padding: 0.9rem 0.6rem 0.6rem; }
}

/* Reith Lectures box in the hero */
.listen-box {
    display: flex;
    gap: 1rem;
    margin-top: calc(1.6rem - 7px);
    padding: 0.95rem 1.25rem 0.85rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--accent);
}
.listen-icon { flex: 0 0 34px; width: 34px; height: 34px; fill: var(--accent); margin-top: 2px; }
.listen-kicker {
    margin: 0 0 0.2rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.listen-title { font-family: var(--serif); font-size: 1.05rem; line-height: 1.35; margin: 0 0 0.6rem; }
.listen-list {
    margin: 0;
    padding-left: 1.3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.75rem;
    row-gap: 0.2rem;
    font-size: 0.9rem;
}
.listen-list li::marker { font-family: var(--sans); font-weight: 700; color: #aaa; }
@media (max-width: 520px) { .listen-list { grid-template-columns: 1fr; } }

/* ---------- Papers: order and filter controls ---------- */
.pub-controls {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0 0 2.25rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--card-border);
}
.pub-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.pub-ctl-label {
    width: 4rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #999;
}
.pub-ctl button {
    font-family: var(--sans);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid #d6d6d6;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}
.pub-ctl button span { color: #aaa; margin-left: 0.15rem; }
.pub-ctl button:hover { border-color: var(--accent); color: var(--accent); }
.pub-ctl button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pub-ctl button[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.75); }
.pub-count { font-size: 0.85rem; color: #aaa; margin-left: 0.25rem; }
.pub-kind { display: none; }
.pub-view.by-topic .pub-kind {
    display: inline-block;
    margin-right: 0.5rem;
    padding: 0 0.45rem;
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.6;
    color: var(--footer-text);
    background: #eef0f2;
    border-radius: 3px;
    vertical-align: 2px;
}
.pub-extra { font-size: 0.95em; }
@media (max-width: 600px) { .pub-ctl-label { width: 100%; } }

/* ---------- Lab shelves ---------- */
.lab-shelf { margin-bottom: 3rem; }
.lab-shelf-intro { color: #777; margin: -0.5rem 0 1.25rem; }
.project-card { padding: 0; overflow: hidden; }
.project-card .project-body { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.4rem 1.1rem; }
.project-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #eee; border-bottom: 1px solid var(--card-border); }
.project-card h3 { font-family: var(--sans); font-size: 1.125rem; margin: 0 0 0.4rem; }
.project-card .project-body p { font-size: 0.9375rem; line-height: 1.65; margin: 0 0 1rem; flex: 1; }

.home .site-main, .site-main.home { padding-top: 2rem; }
/* Hero text column: the intro, then the Reith box directly under it */
.hero { align-items: start; }
.hero-text { display: flex; flex-direction: column; }
.hero-text .listen-box { margin-top: 0.5rem; }
.hero-roles { margin-bottom: 1.5rem; }
.photo-strip.single { grid-template-columns: 1fr; }
.photo-strip.single img { aspect-ratio: 16 / 4.5; }
@media (max-width: 960px) {
    .hero-text .listen-box { margin-top: 0.5rem; }
}
.hero .hero-title { font-size: 2.8rem; line-height: 1.18; margin-bottom: 1.5rem; }
.hero-roles { font-size: 1.02rem; line-height: 1.75; }
@media (max-width: 960px) { .hero .hero-title { font-size: 2.1rem; } }
@media (max-width: 700px) { .hero .hero-title { font-size: 1.7rem; } }
/* Two quieter companions under the Reith box: the book and the Substack */
.read-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.read-card {
    display: block;
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--accent);
    color: var(--text);
}
.read-card:hover, .read-card:focus-visible { border-color: var(--accent); color: var(--text); }
.read-kicker {
    display: block; margin-bottom: 0.15rem;
    font-family: var(--sans); font-size: 0.6875rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.read-title { display: block; font-family: var(--sans); font-weight: 700; color: var(--heading); line-height: 1.3; }
.read-note { display: block; margin-top: 0.1rem; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 520px) { .read-row { grid-template-columns: 1fr; } }

.chart-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.chart-kicker:hover, .chart-kicker:focus { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Splash (Option B: the chart as the image) ---------- */

/* Paper figures sit in the same box as the drawn charts (560 x 360), centred,
   so a squarer figure letterboxes instead of making the carousel jump. */
.chart-img {
    display: block;
    width: 100%;
    aspect-ratio: 560 / 360;
    object-fit: contain;
    object-position: center;
}

.splash { position: relative; overflow: hidden; background: var(--page-bg); }
.splash-bg {
    /* Right edge lines up with the content gutter, i.e. with LAB in the menu. */
    position: absolute; top: 0; bottom: 0;
    right: max(20px, (100% - var(--wrap)) / 2 + 20px);
    width: min(92vw, 1440px);
    pointer-events: none;
}
.splash-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.splash-slide.is-active { opacity: 1; }
.splash-slide svg, .splash-slide img { width: 100%; height: 100%; display: block; }
.splash-slide img { object-fit: contain; object-position: right center; opacity: 0.2; }
.q-dots circle { fill: var(--accent); fill-opacity: 0.17; }
.q-trend { stroke: var(--accent); stroke-opacity: 0.55; stroke-width: 3; stroke-linecap: round; fill: none; }
@media (prefers-reduced-motion: no-preference) {
    .splash-slide.is-active .q-trend { animation: q-draw 2.6s 0.4s ease-out both; }
    @keyframes q-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
    .splash-slide .q-trend { stroke-dasharray: var(--len); }
}

.splash::after {   /* keeps the text legible where the chart runs underneath it */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, var(--page-bg) 0%, rgba(249,249,249,0.78) 18%, rgba(249,249,249,0) 52%);
}
.splash-inner {
    position: relative; z-index: 2;
    display: flex; align-items: center;
    min-height: clamp(480px, 84svh, 700px);
    padding-top: 84px; padding-bottom: 4.5rem;
}
.splash-text { max-width: 640px; }
.splash-name {
    margin: 0 0 1.1rem;
    font-family: var(--sans); font-weight: 900;
    font-size: clamp(3.2rem, 8.4vw, 6.4rem);
    line-height: 1; letter-spacing: -0.02em;
    color: var(--heading);
}
.splash-id { margin: 0 0 2.2rem; max-width: 30em; font-size: 1.15rem; line-height: 1.6; color: #666; }
.splash-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.7rem; }
.splash-links a {
    font-family: var(--sans); font-weight: 700; font-size: 0.875rem;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--heading); padding: 0.45rem 0;
    border-bottom: 2px solid var(--accent);
}
.splash-links a:hover, .splash-links a:focus-visible { color: var(--accent); border-bottom-color: var(--heading); }

.splash-cap {
    position: absolute; left: 20px; right: 20px; bottom: 1.1rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
    font-family: var(--sans); font-size: 0.75rem; line-height: 1.4; color: #777;
}
.splash-cap[hidden] { display: none; }
.splash-cap-text { margin: 0; flex: 1 1 auto; min-width: 0; }
.splash-cap-kicker { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-right: 0.6rem; }
.splash-cap-title { color: var(--heading); font-weight: 700; margin-right: 0.6rem; }
.splash-cap-ctl { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; margin-left: auto; }
.splash-dots { display: flex; gap: 7px; }
.splash-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #d3d3d3; cursor: pointer; }
.splash-dots button[aria-current="true"] { background: var(--accent); }
.splash-pause {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    background: none; border: 1px solid #ccc; border-radius: 3px;
    color: #666; cursor: pointer;
}
.splash-pause svg { width: 13px; height: 13px; fill: currentColor; display: block; }
.splash-pause .icon-play { display: none; }
.splash-pause[aria-pressed="true"] .icon-pause { display: none; }
.splash-pause[aria-pressed="true"] .icon-play { display: block; }
.splash-pause:hover, .splash-pause:focus-visible { border-color: var(--accent); color: var(--accent); }

/* Header: transparent over the splash, white once scrolled past. Only when JS is running;
   without it the normal header sits above the splash as before. */
.js .splash-page .site-header {
    position: sticky; top: 0; z-index: 50; margin-bottom: -84px;
    background: transparent; transition: background 0.25s, box-shadow 0.25s;
}
.js .splash-page .site-header.is-solid { background: var(--header-bg); box-shadow: 0 1px 0 var(--card-border); }
.js .splash-page .site-title a { color: var(--heading); }
.js .splash-page .site-header:not(.is-solid) .main-nav a { color: #666; }
.js .splash-page .site-header:not(.is-solid) .main-nav a:hover,
.js .splash-page .site-header:not(.is-solid) .main-nav a[aria-current="page"] { color: var(--accent); }
.js .splash-page .site-header.has-menu { background: var(--header-bg); }

@media (max-width: 860px) {
    .js .splash-page .site-header { margin-bottom: -64px; }
    .splash-inner { align-items: flex-start; padding-top: 104px; }
}
@media (max-width: 700px) {
    /* The figure fills the splash and sits behind the name, rather than
       being parked below it; the scrim is lightest where the text is. */
    .splash-bg { width: 100%; right: 0; top: 24%; bottom: auto; height: 62%; }
    .splash-slide img { object-position: center; opacity: 0.16; }
    .splash::after { background: linear-gradient(180deg, rgba(249,249,249,0.72) 0%, rgba(249,249,249,0.45) 45%, rgba(249,249,249,0.8) 100%); }
    .splash-inner { min-height: max(370px, 54svh); padding-bottom: 3.75rem; }
    /* The hamburger already carries the nav on small screens. */
    .splash-links { display: none; }
    .splash-id { font-size: 1.02rem; margin-bottom: 1.5rem; }
    .splash-cap { left: 16px; right: 16px; }
    .splash-cap-title { display: block; }
}
