/* ========================================
   MiMo-V2.6 Release Page
   ======================================== */

:root {
    --bg: #F9F6F3;
    --bg-block: #F3EEE8;
    --text: #1D0601;
    --text-body: #1D0601B2;
    --text-muted: #888;
    --border: #E8E2DB;
    --accent: #FF6700;
    --font-serif: "PT Serif", Georgia, serif;
    --font-title: "Ubuntu", -apple-system, BlinkMacSystemFont, sans-serif;
    --site-nav-height: 64px;
    --fig-gap: 3.5rem;    /* vertical space between any figure block and the text around it */
}

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

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

body {
    font-family: var(--font-serif);
    font-weight: 400;
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* ---- Site Nav ---- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0 40px;
    background: rgba(250, 247, 245, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.site-nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-nav-logo-img {
    width: 141px;
    height: 18px;
}

.site-nav-back {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    padding: 8px 0;
    position: relative;
}

.site-nav-back::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5px;
    background: #000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.site-nav-back:hover::after {
    transform: scaleX(1);
}

/* Article Container */
.article {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
}

/* Figures break out of the text column: wider, still centred on it */
.breakout,
.teaser,
.img-placeholder,
.section > img,
.section > video {
    --wide: min(1040px, calc(100vw - 2.5rem));
    width: var(--wide);
    margin-left: calc(50% - var(--wide) / 2);
    margin-right: calc(50% - var(--wide) / 2);
}

/* ---- Hero ---- */
.hero {
    margin-bottom: 2.5rem;
}

.hero-date {
    display: block;
    font-family: var(--font-title);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-title);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 1rem;
}

.nowrap {
    white-space: nowrap;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-body);
    max-width: 600px;
    margin-bottom: 2rem;
}

/* Hero Buttons */
.hero-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-title);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    transition: all 0.2s;
}

.btn-chevron {
    font-size: 1.1em;
    line-height: 1;
}

.btn-filled {
    background: var(--text);
    color: #fff;
    border: 1px solid var(--text);
}

.btn-filled:hover {
    background: #3a1a10;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid #ccc;
}

.btn-outline:hover {
    border-color: #999;
}

/* ---- Teaser ---- */
.teaser {
    position: relative;
    aspect-ratio: 12 / 5;
    background: var(--bg-block);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: var(--fig-gap);
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.teaser canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Sections ---- */
.section {
    margin-bottom: 4.5rem;   /* keep h2 boundaries stronger than the figure gap inside a section */
}

h2 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    scroll-margin-top: calc(var(--site-nav-height) + 1rem);
}

h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: calc(var(--site-nav-height) + 1rem);
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--accent);
}

.section > ul,
.section > ol {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.section > ul li + li,
.section > ol li + li {
    margin-top: 0.35rem;
}

.section > ul li::marker,
.section > ol li::marker {
    color: var(--text-muted);
}

.section > ul:last-child,
.section > ol:last-child {
    margin-bottom: 0;
}

code {
    font-family: "Ubuntu Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-block);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    color: var(--text);
}

/* ---- Images & placeholders ---- */
.section > img,
.section > video {
    border-radius: 10px;
    border: 1.5px solid var(--border);
    margin-block: var(--fig-gap);
    display: block;
}

.img-placeholder {
    background: var(--bg-block);
    border-radius: 10px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 0.8rem;
    color: #bbb;
    margin-block: var(--fig-gap);
}

.img-placeholder.short {
    min-height: 200px;
}

.caption {
    font-family: var(--font-title);
    font-size: 0.72rem;
    color: #aaa;
    line-height: 1.6;
    margin-top: calc(-1 * var(--fig-gap) + 0.75rem);
    margin-bottom: var(--fig-gap);
}

/* ---- Benchmark overview ---- */
.bench {
    background: var(--bg-block);
    border-radius: 10px;
    padding: 1.6rem 2rem 1.25rem;
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
}

.bench-section + .bench-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E4DCD2;
}

.bench-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.bench-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.bench-head span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* two sections sharing one card row: the section name rides above its first card */
.bench-eyebrow {
    margin: 0 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    min-height: 1.2em;    /* empty eyebrows keep the cards in the row level */
}

.bench-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2.25rem;
    row-gap: 1.4rem;
}

.bench-name {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.45rem;
}

.bench-name em {
    font-style: normal;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-left: 0.3rem;
}

.bench-row {
    display: grid;
    grid-template-columns: 6.9rem 1fr 2.6rem;
    align-items: center;
    column-gap: 0.55rem;
    height: 1.2rem;
    font-size: 0.66rem;
    color: var(--text-body);
}

.bench-model {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bench-row.ours .bench-model,
.bench-row.ours .bench-value {
    color: var(--text);
    font-weight: 600;
}

.bench-track {
    position: relative;
    height: 0.55rem;
}

.bench-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: #D6CEC4;
}

.bench-row.pro .bench-bar {
    background: var(--accent);
}

.bench-row.flash .bench-bar {
    background: #FF9A57;
}

.bench-value {
    font-variant-numeric: tabular-nums;
    text-align: left;
}

/* ---- Appendix: full benchmark table ---- */
.benchtable {
    background: var(--bg-block);
    border-radius: 10px;
    padding: 1.1rem 1.6rem 0.9rem;
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
    overflow-x: auto;
}

.bt-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-body);
}

.bt-table thead th:first-child {
    width: 21%;
}

.bt-table th,
.bt-table td {
    padding: 0.42rem 0.3rem;
    text-align: center;
    vertical-align: bottom;
    white-space: nowrap;
    font-weight: 400;
}

.bt-table thead th {
    padding-bottom: 0.6rem;
    font-size: 0.64rem;
    color: var(--text-muted);
    border-bottom: 1px solid #DCD4CA;
}

.bt-table thead th.ours {
    color: var(--text);
    font-weight: 700;
}

.bt-table td.ours,
.bt-table th.ours {
    background: rgba(255, 103, 0, 0.055);
}

.bt-table tbody th {
    text-align: left;
    padding-left: 0;
    color: var(--text);
    font-weight: 500;
}

.bt-table tbody th em {
    font-style: normal;
    font-weight: 400;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.bt-table tbody tr + tr td,
.bt-table tbody tr + tr th.bt-name {
    border-top: 1px solid #E8E1D8;
}

.bt-table tr.bt-sec th,
.bt-table tr.bt-sec td {
    padding-top: 1.35rem;
    padding-bottom: 0.35rem;
    background: none;
    border-top: none;
}

.bt-table tr.bt-sec th {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.bt-table tr.bt-sec + tr td,
.bt-table tr.bt-sec + tr th.bt-name {
    border-top: none;
}

.bt-table td {
    font-variant-numeric: tabular-nums;
}

.bt-table td.best {
    font-weight: 700;
    color: var(--text);
}

.bt-table td.na {
    color: #B3ACA5;
}

/* ---- Audio tracks ---- */
.tracks {
    background: var(--bg-block);
    border-radius: 10px;
    padding: 0.4rem 2rem;
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
}

.track {
    display: grid;
    grid-template-columns: auto minmax(0, 17rem) 1fr auto;
    align-items: center;
    column-gap: 1.25rem;
    padding: 1.1rem 0;
}

.track + .track {
    border-top: 1px solid #E4DCD2;
}

.track-btn {
    appearance: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.track-btn svg {
    width: 0.8rem;
    height: 0.8rem;
    fill: currentColor;
}

.track-btn:hover {
    border-color: var(--text);
}

.track.playing .track-btn {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.track-meta b {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.track-meta span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.track-bar {
    position: relative;
    height: 1.2rem;
    cursor: pointer;
    outline: none;
}

.track-bar::before,
.track-bar i {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
}

.track-bar::before {
    right: 0;
    background: #D6CEC4;
}

.track-bar i {
    width: 0;
    background: var(--accent);
}

.track-bar:focus-visible::before {
    box-shadow: 0 0 0 2px var(--bg-block), 0 0 0 3px var(--text-muted);
}

.track-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .tracks {
        padding: 0.2rem 1rem;
    }

    .track {
        grid-template-columns: auto 1fr auto;
        row-gap: 0.5rem;
        column-gap: 0.9rem;
    }

    .track-bar {
        grid-column: 1 / -1;
    }
}

/* ---- RL training curves ---- */
.rlcurves {
    position: relative;
    background: var(--bg-block);
    border-radius: 10px;
    padding: 1.4rem 2rem 1rem;
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
}

.rlc-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.68rem;
    color: var(--text-body);
    margin-bottom: 0.4rem;
}

.rlc-legend i {
    display: inline-block;
    width: 14px;
    height: 2px;
    border-radius: 1px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.rlc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 1.6rem;
}

.rlc-panel {
    margin: 0;
    min-width: 0;
}

.rlc-head {
    margin-bottom: 0.3rem;
}

.rlc-head span {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted);
}

.rlc-head b {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.rlc-panel svg {
    display: block;
    overflow: visible;
}

.rlc-tick {
    font-size: 0.6rem;
    fill: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rlc-axis-label {
    font-size: 0.62rem;
    fill: var(--text-muted);
}

.rlc-end {
    font-size: 0.64rem;
    font-weight: 600;
    fill: var(--text);
    font-variant-numeric: tabular-nums;
}

.rlc-tip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 3;
    pointer-events: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.45rem 0.65rem 0.5rem;
    font-size: 0.66rem;
    color: var(--text-body);
    white-space: nowrap;
}

.rlc-tip-head {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.rlc-tip table {
    border-collapse: collapse;
}

.rlc-tip th {
    font-weight: 400;
    color: var(--text-muted);
    text-align: right;
    padding: 0 0 0.15rem 0.8rem;
}

.rlc-tip td {
    text-align: right;
    padding: 0.05rem 0 0.05rem 0.8rem;
    font-variant-numeric: tabular-nums;
}

.rlc-tip th:first-child,
.rlc-tip td:first-child {
    text-align: left;
    padding-left: 0;
}

.rlc-tip i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: -1px;
}

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

@media (max-width: 700px) {
    .rlcurves {
        padding: 1.25rem 1rem 0.75rem;
    }

    .rlc-grid {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
    }
}

@media (max-width: 1000px) {
    .bench-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* joined row at two columns: the second section's pair stays together on
       row one, the first section's card drops to row two under its own label */
    .bench-section.joined .bench-card.lead {
        order: 1;
    }

    .bench-eyebrow:empty {
        visibility: hidden;
    }

    /* table scrolls sideways; benchmark names stay put. The block's side
       padding moves onto the first / last cells so the sticky column sits
       flush with the scroll edge and nothing peeks out beside it */
    .benchtable {
        padding-inline: 0;
    }

    .bt-table {
        min-width: 860px;
    }

    .bt-table thead th:first-child {
        width: 9.5rem;
    }

    .bt-table tr > :first-child {
        padding-left: 1.6rem;
    }

    .bt-table tr > :last-child {
        padding-right: 1.6rem;
    }

    .bt-table tbody th,
    .bt-table thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--bg-block);
        box-shadow: 4px 0 6px -4px rgba(29, 6, 1, 0.12);
    }

    .bt-table tbody th.bt-name {
        white-space: normal;
        padding-right: 0.5rem;
    }

    .bt-table tbody th.bt-name em {
        display: block;
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .bench {
        padding: 1.25rem 1rem 1rem;
    }

    .benchtable {
        padding: 1.25rem 0 1rem;
    }

    .bt-table tr > :first-child {
        padding-left: 1rem;
    }

    .bt-table tr > :last-child {
        padding-right: 1rem;
    }

    .bench-grid {
        grid-template-columns: 1fr;
        row-gap: 1.25rem;
    }

    .bench-row {
        grid-template-columns: 6.6rem 1fr 2.4rem;
        font-size: 0.66rem;
    }

    .bench-eyebrow:empty {
        display: none;
    }
}

/* ---- Showcase: 3D viewer block ---- */
.showcase {
    position: relative;
    aspect-ratio: 2 / 1;
    background: var(--bg-block);
    border-radius: 10px;
    overflow: hidden;
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
}

.showcase canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: pan-y;
}

.showcase canvas:active {
    cursor: grabbing;
}

/* the bifurcation block is click-to-pause, not drag */
.showcase[data-bifurcation] canvas,
.showcase[data-bifurcation] canvas:active {
    cursor: pointer;
    touch-action: manipulation;
}

.showcase-bar {
    position: absolute;
    z-index: 2;
    top: 1.1rem;
    left: 1.4rem;
    right: 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    pointer-events: none;
}

.showcase-bar > * {
    pointer-events: auto;
}

.showcase-tabs {
    display: flex;
    gap: 1.1rem;
}

.showcase-tabs button {
    appearance: none;
    background: none;
    border: 0;
    padding: 0.15rem 0 0.35rem;
    font-family: var(--font-title);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.showcase-tabs button span {
    font-weight: 400;
    margin-left: 0.3rem;
}

.showcase-tabs button:hover {
    color: var(--text);
}

.showcase-tabs button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.showcase-stats {
    display: flex;
    gap: 1.6rem;
    text-align: right;
}

.showcase-stat b {
    display: block;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.showcase-stat b small {
    font-size: 0.7em;
    color: var(--text-muted);
    font-weight: 400;
}

.showcase-stat span {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.showcase-hint {
    position: absolute;
    z-index: 2;
    right: 1.4rem;
    bottom: 1rem;
    font-size: 0.66rem;
    color: #bbb;
    pointer-events: none;
    transition: opacity 0.5s;
}

.showcase.touched .showcase-hint {
    opacity: 0;
}

@media (max-width: 700px) {
    .showcase {
        aspect-ratio: 4 / 3;
    }

    .showcase-bar {
        top: 0.8rem;
        left: 1rem;
        right: 1rem;
    }

    .showcase-tabs {
        gap: 0.7rem;
    }

    .showcase-tabs button span {
        display: none;
    }

    .showcase-stat b {
        font-size: 1rem;
    }

    .showcase-hint {
        display: none;
    }
}

/* ---- Video gallery ---- */
.gallery {
    margin-block: var(--fig-gap);
    font-family: var(--font-title);
    outline: none;
}

.gal-strip-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;   /* inside the gallery block: closer to the stage than the block is to the text */
    /* thumbnail width is derived from the block, not the strip, so the strip can shrink to its
       contents: six fill the row between the arrows, fewer sit centred with the arrows beside them */
    --thumb-w: calc((var(--wide) - 2 * (1.7rem + 0.5rem) - 4px - 5 * 0.6rem) / 6);
}

.gal-strip {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    flex: 0 1 auto;
    min-width: 0;
    padding: 2px;
}

.gal-strip::-webkit-scrollbar {
    display: none;
}

.gal-thumb {
    appearance: none;
    flex: 0 0 var(--thumb-w);
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-block);
    cursor: pointer;
    scroll-snap-align: center;
    outline: 2px solid transparent;
    outline-offset: 0;
    opacity: 0.7;
    transition: opacity 0.15s, outline-color 0.15s;
}

.gal-thumb:hover {
    opacity: 1;
}

.gal-thumb.active {
    opacity: 1;
    outline-color: var(--accent);
}

.gal-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gal-arrow {
    appearance: none;
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.1rem;
    transition: border-color 0.15s;
}

.gal-arrow:hover {
    border-color: var(--text);
}

.gal-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-block);
}

.gal-stage video,
.gal-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* recordings are not all 16:9; show the whole frame and let the stage colour fill the rest */
.gal-stage video {
    object-fit: contain;
    background: var(--bg-block);
}

/* live page: laid out at desktop width, scaled by gallery.js to fill the stage */
.gal-stage.page {
    background-size: cover;
    background-position: top center;
}

.gal-stage iframe {
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
    transform-origin: 0 0;
    background: #fff;
}

.gal-open {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    font-family: var(--font-title);
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.gal-open:hover {
    background: #fff;
}

.gal-open svg {
    width: 0.65em;
    height: 0.65em;
}

/* deck pager: same pill as .gal-open, bottom right, with page arrows */
.gal-pager {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.35rem;
    border-radius: 100px;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    font-family: var(--font-title);
    font-size: 0.7rem;
    font-weight: 500;
}

.gal-pager b {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-width: 3.2em;
    text-align: center;
}

.gal-pager button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    padding-bottom: 0.1rem;
    cursor: pointer;
}

.gal-pager button:hover {
    background: var(--bg-block);
}

.gal-stage.deck img {
    cursor: pointer;
}

/* light decks would otherwise merge with the page: same hairline as .section > img */
.gal-stage.deck::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1.5px var(--border);
    pointer-events: none;
}

.gal-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 100%;
    color: #bbb;
    font-size: 0.72rem;
    background-image: repeating-linear-gradient(-45deg, transparent 0 11px, rgba(29, 6, 1, 0.035) 11px 12px);
}

.gal-ph-stage {
    font-size: 0.8rem;
}

.gal-play {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    position: relative;
}

.gal-play::after {
    content: '';
    position: absolute;
    left: 55%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.45rem 0 0.45rem 0.75rem;
    border-color: transparent transparent transparent #ccc;
}

.gal-meta {
    margin-top: 1rem;
}

.gal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.gal-meta[hidden] {
    display: none;
}

.gal-title {
    margin: 0;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.gal-demo {
    padding: 0.35rem 0.9rem;
    font-size: 0.72rem;
}

.gal-demo[hidden] {
    display: none;
}

.gal-desc {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-body);
    margin: 0;
}

@media (max-width: 700px) {
    /* no arrows; about 3.4 thumbnails visible so the strip reads as scrollable */
    .gal-strip-wrap {
        --thumb-w: calc((var(--wide) - 4px - 2 * 0.6rem) / 3.4);
    }

    .gal-strip-wrap .gal-arrow {
        display: none;
    }

    .gal-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ---- Spec table ---- */
.spec-table-wrap {
    overflow-x: auto;
    margin-block: var(--fig-gap);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-title);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    background: #fff;
    border: 1px solid var(--bg-block);
    border-radius: 10px;
    overflow: hidden;
}

.spec-table th,
.spec-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-block);
    white-space: nowrap;
}

.spec-table thead th {
    background: var(--bg-block);
    font-weight: 600;
    color: var(--text);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.spec-table tbody tr:last-child td {
    border-bottom: none;
}

.spec-table tbody td {
    color: var(--text-body);
}

.spec-table tbody td:first-child {
    color: var(--text);
    font-weight: 500;
}

.spec-table tbody td a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.spec-table tbody td a:hover {
    text-decoration: underline;
}

/* ---- Table of contents (left gutter, wide screens only) ---- */
.toc {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: calc(50% + 520px + 2.5rem);   /* 2.5rem clear of the breakout edge */
    width: min(12rem, calc(50% - 520px - 3.75rem));
    font-family: var(--font-title);
    font-size: 0.7rem;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.toc.visible {
    opacity: 1;
    pointer-events: auto;
}

.toc ol {
    list-style: none;
}

.toc li + li {
    margin-top: 0.6rem;
}

.toc ol ol {
    margin: 0.35rem 0 0 0.8rem;
}

.toc ol ol li + li {
    margin-top: 0.3rem;
}

.toc a {
    display: block;
    color: #B3ACA5;
    text-decoration: none;
    transition: color 0.15s;
}

.toc > ol > li > a {
    font-weight: 500;
}

.toc a:hover {
    color: var(--text-muted);
}

.toc a.active {
    color: var(--text);
}

@media (min-width: 1440px) {
    .toc {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toc,
    .toc a {
        transition: none;
    }
}

@media print {
    .toc {
        display: none;
    }
}

/* ---- Footer ---- */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
    .site-nav {
        height: 56px;
        padding: 0 20px;
    }

    :root {
        --site-nav-height: 56px;
        --fig-gap: 2.5rem;
    }

    .article {
        padding: 2rem 1.25rem 4rem;
    }

    .section {
        margin-bottom: 3.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.88rem;
    }

    .teaser {
        aspect-ratio: 3 / 2;
    }

    .spec-table {
        font-size: 0.72rem;
    }

    .spec-table th,
    .spec-table td {
        padding: 0.5rem 0.6rem;
    }
}
