/* ============================================================
   ronde-projects.css: the new ("Ronde") projects page, projects-ronde.html
   ------------------------------------------------------------
   Only that page loads this file; it does not use style.css or
   ronde-home.css (header rules live in ronde-header.css).
   Rules: docs/rondeDesignRules.md and docs/halftoneInkElement.md.
   One project is open as a large card showing its header picture; the
   others stand beside it as tall pills. js/rondeProjects.js runs it.
   The selected project sets the page tint and the colour of the streak of
   lines that then rides the wave (js/rondeWave.js) behind the glass.
   Default state (.pj-stage.is-overview, body[data-scene="overview"]): no
   project open, the panels share the stage evenly, each clear glass showing
   its own picture sharp but see-through, on a white page with that wave as
   separate dots behind the glass.
   ============================================================ */

/* Tokens: the same values as css/ronde-home.css, plus cyan and the glass. */
:root {
    --rh-bg: #fafafa;
    --rh-card: #fff;
    --rh-ink: #111214;
    --rh-text-2: rgba(17, 18, 20, .62);
    --rh-muted: rgba(17, 18, 20, .42);
    --rh-line: rgba(17, 18, 20, .1);
    --rh-line-strong: rgba(17, 18, 20, .22);
    --rh-fill: rgba(17, 18, 20, .07);
    --rh-fill-hover: rgba(17, 18, 20, .04);
    --rh-glass: rgba(255, 255, 255, .74);
    --rh-ultramarine: #3B2E9E;
    --rh-magenta: #D9479C;
    --rh-red-orange: #E0482B;
    --rh-cyan: #3FB3E3;
    --rh-ease: cubic-bezier(.2, .8, .2, 1);
    --pj-closed: 88px;
    --pj-gap: 12px;
}

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

body.rh {
    min-height: 100vh;
    isolation: isolate;
    overflow-x: clip;
    background: var(--rh-bg);
    color: var(--rh-ink);
    font-family: 'Urbanist', system-ui, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

body.rh a { color: inherit; text-decoration: none; }
body.rh button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

:focus-visible { outline: 2px solid var(--rh-ink); outline-offset: 3px; }

/* Page-wide light from the open project's cover, on tinted paper, and the
   colour of its streak (--wave): steel blue, sea glass, apricot, gold. */
body[data-scene="drone"] {
    --paper: #faf8f4;
    --wash: #ddc9ae;
    --night: #43392c;
    --wave: #5f95ab;
}
body[data-scene="orca"] {
    --paper: #f6f8fc;
    --wash: #b9c9e9;
    --night: #283659;
    --wave: #57b0a6;
}
body[data-scene="panda"] {
    --paper: #fbf8fa;
    --wash: #dcc1d3;
    --night: #4a3147;
    --wave: #dd9d72;
}
body[data-scene="kalshi"] {
    --paper: #f7faf6;
    --wash: #bed5bd;
    --night: #294839;
    --wave: #cda347;
}
/* Default state: plain white (near-black in dark mode), no wash or cover. */
body[data-scene="overview"] {
    --paper: #fff;
    --wash: transparent;
    --night: transparent;
}

.reflection {
    position: fixed;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--paper);
    transition: background-color .24s ease-out;
}
.reflection::before, .reflection::after {
    content: "";
    position: absolute;
    inset: 0;
}
.reflection::before {
    background-color: var(--wash);
    mask-image: radial-gradient(ellipse at 80% 79%, black 4%, #000b 47%, #0002 94%, transparent 116%);
    transition: background-color .24s ease-out;
}
.reflection::after {
    background: radial-gradient(ellipse at 27% 23%, #fff7, transparent 65%);
    transition: opacity .24s ease-out;
}
body[data-scene="overview"] .reflection::after { opacity: 0; }

/* The wave, drawn by rondeWave.js on two canvases that cross-fade: separate
   dots in the page's ink in the default state (__wave), and a streak of fine
   lines along the same wave in the open project's --wave otherwise
   (__streak). Each is drawn in its element's `color`. */
.reflection__wave, .reflection__streak {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .5s ease-out;
}
/* The open project's mark, echoed large in two corners of the window in its
   colour (js/rondeProjectsEcho.js). Under the streak, so the moving lines
   stay on top. */
.reflection__echo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* The echo's colour: each project's ink, deepened and muted so it stands
   out from that project's tinted page without getting loud (dark mode: a
   soft, lighter shade, below). */
.pj-panel[data-project="drone"] { --echo: #44508f; }
.pj-panel[data-project="orca"] { --echo: #a8466f; }
.pj-panel[data-project="panda"] { --echo: #1b5f80; }
.pj-panel[data-project="kalshi"] { --echo: #b04a32; }
.reflection__wave { color: var(--rh-ink); }
.reflection__streak { color: var(--wave, var(--rh-ink)); }
body[data-scene="overview"] .reflection__wave,
body:not([data-scene="overview"]) .reflection__streak { opacity: 1; }
.reflection__covers {
    position: absolute;
    inset: -12%;
    filter: blur(clamp(40px, 7vw, 105px)) saturate(.92);
    opacity: .30;
    mask-image: linear-gradient(138deg, #0002 0%, #0004 30%, #000a 60%, black 100%);
}
.reflection__covers img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    object-fit: cover;
    object-position: 65% 58%;
    transition: opacity .24s ease-out;
}
body[data-scene="drone"] [data-cover="drone"],
body[data-scene="orca"] [data-cover="orca"],
body[data-scene="panda"] [data-cover="panda"],
body[data-scene="kalshi"] [data-cover="kalshi"] {
    opacity: 1;
}

.rh-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px 48px;
}

.rh-lab { color: var(--rh-text-2); font-size: 14px; }

.rh-hub {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--rh-ink);
    font-size: 14px;
}

body.rh .rh-hub { color: var(--rh-bg); }

/* ── Page head: title with its count, intro on the right ── */
.pj-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-top: 56px;
}

.pj-title {
    margin-top: 8px;
    white-space: nowrap;
    font-size: clamp(46px, 5.6vw, 68px);
    font-weight: 400;
    line-height: 1.04;
}

.pj-title sup {
    margin-left: 10px;
    color: var(--rh-muted);
    font-size: .3em;
    vertical-align: top;
    position: relative;
    top: .5em;
}

.pj-head__side {
    display: flex;
    max-width: 400px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 8px;
}

.pj-head__side p {
    color: var(--rh-text-2);
    font-size: 17px;
    line-height: 1.6;
}

/* Secondary action in the RDL pattern: outline pill label with the arrow in
   a circle at its end. Black stays reserved for each panel's "View build". */
.pj-gh {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--rh-line-strong);
    border-radius: 999px;
    font-size: 14px;
    transition: background .2s, transform .15s;
}

.pj-gh:hover { background: var(--rh-fill-hover); transform: translateY(-1px); }

body.rh .pj-gh .rh-hub {
    border: 1px solid var(--rh-line-strong);
    background: var(--rh-bg);
    color: var(--rh-ink);
    transition: background .2s, color .2s, border-color .2s;
}

body.rh .pj-gh:hover .rh-hub {
    border-color: var(--rh-ink);
    background: var(--rh-ink);
    color: var(--rh-bg);
}

/* ── Bar: segmented filter and step buttons ── */
.pj-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 30px;
}

.pj-filter {
    display: inline-flex;
    max-width: 100%;
    gap: 2px;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid var(--rh-line);
    border-radius: 999px;
    scrollbar-width: none;
}

.pj-filter button {
    display: inline-flex;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--rh-text-2);
    font-size: 14px;
    transition: background .2s, color .2s;
}

.pj-filter button small { color: var(--rh-muted); font-size: 12px; }
.pj-filter button:hover { background: var(--rh-fill-hover); }

body.rh .pj-filter button[aria-pressed="true"] {
    background: var(--rh-ink);
    color: var(--rh-bg);
}

.pj-filter button[aria-pressed="true"] small { color: inherit; opacity: .6; }

/* Sliding pill (added by rondeProjects.js): one black pill glides to the
   pressed button. It sits above the buttons and carries a white copy of their
   labels (__ghost) that slides the opposite way, so text turns white exactly
   where the pill covers it, mid-slide included. */
.pj-filter.has-pill { position: relative; }

body.rh .pj-filter.has-pill button[aria-pressed="true"] {
    background: transparent;
    color: var(--rh-text-2);
}

.pj-filter.has-pill button[aria-pressed="true"] small { color: var(--rh-muted); opacity: 1; }

.pj-filter__pill,
.pj-filter__ghost {
    transition: transform .32s cubic-bezier(.4, 0, .2, 1), width .32s cubic-bezier(.4, 0, .2, 1);
}

.pj-filter__pill {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--rh-ink);
    pointer-events: none;
}

.pj-filter__ghost {
    display: flex;
    width: max-content;
    gap: 2px;
    padding: 4px;
}

.pj-filter .pj-filter__ghost button { color: var(--rh-bg); }
.pj-filter .pj-filter__ghost small { color: inherit; opacity: .6; }

.pj-filter__pill.is-instant,
.pj-filter__pill.is-instant .pj-filter__ghost { transition: none; }

/* Filter glitch (rondeProjects.js): on a filter change each label, its copy
   in the pill, the title, the open card's glass bar parts and the collapsed
   pills get a canvas that rebuilds their text and icons from dots. Their own
   text and icons are hidden meanwhile; text-fill doesn't touch the colour
   transitions, so it hides and comes back at once. */
.pj-filter button,
.pj-title,
.pj-glass > * { position: relative; }

.pj-glitch { position: absolute; pointer-events: none; }

.is-glitching { -webkit-text-fill-color: transparent; }

.can-sample-marks .pj-thumb.is-glitching img,
.is-glitching .rh-hub,
.pj-motif.is-glitching span { visibility: hidden; }

/* While glitching, parts that are fading in or out snap to where they end up
   (their own text and icons are hidden meanwhile anyway), so the dots start
   at once and land in the right place: a closing pill's tab and side text,
   the default-state face, the open card's glass bar. */
.pj-stage .pj-tab.is-glitch-snap,
.pj-stage .pj-tab.is-glitch-snap .pj-tab__title,
.pj-stage .pj-tab.is-glitch-snap .pj-tab__num,
.pj-stage .pj-tab.is-glitch-snap .pj-tab__face,
.pj-stage .pj-tab .pj-tab__face.is-glitch-snap,
.pj-stage .pj-panel .pj-glass > .is-glitch-snap { transition: none; }

/* A closing card's tab sits above its shrinking picture, so its dots show
   from the start instead of once the picture has gone. */
.pj-panel:not(.is-active) .pj-tab { z-index: 1; }

.pj-steps { display: flex; flex: 0 0 auto; gap: 8px; }

.pj-step {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rh-line-strong) !important;
    border-radius: 50%;
    font-size: 16px;
    transition: background .2s, transform .15s;
}

.pj-step:hover { background: var(--rh-fill-hover); }
.pj-step:active { transform: scale(.94); }

/* ── Stage: one open card, the rest stand as tall pills ── */
.pj-stage {
    position: relative;
    isolation: isolate;
    display: flex;
    gap: var(--pj-gap);
    height: 500px;
    margin-top: 16px;
    container-type: inline-size;
}

.pj-panel {
    position: relative;
    flex: 0 0 var(--pj-closed);
    min-width: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 44px;
    /* Thin glass: beside an open project, the closed tabs show the streak's
       lines moving behind them. More blur than this dissolves the lines. */
    background: rgba(255, 255, 255, .2);
    -webkit-backdrop-filter: blur(2.5px);
    backdrop-filter: blur(2.5px);
    box-shadow: inset -1px 0 1px #ffffffb3, 0 2px 8px #26221d0a;
    transition: flex-grow .7s var(--rh-ease), flex-basis .7s var(--rh-ease),
                border-radius .7s var(--rh-ease), opacity .4s, margin .7s var(--rh-ease),
                border-color .3s, transform .2s, background .5s, box-shadow .5s,
                -webkit-backdrop-filter .5s, backdrop-filter .5s;
}

.pj-panel.is-active {
    flex-grow: 1;
    border-radius: 32px;
}

.pj-panel:not(.is-active):hover { transform: translateY(-2px); }
.pj-panel:has(.pj-tab:focus-visible) { outline: 2px solid var(--rh-ink); outline-offset: 3px; }

.pj-panel.is-out {
    flex-basis: 0;
    flex-grow: 0;
    margin-right: calc(var(--pj-gap) * -1);
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}

/* Default state: the visible panels take equal shares as clear glass in the
   RDL manner: a lightly frosted base that softens the dot wave behind it
   without hiding it, a faint glow of the project's colour from the top right,
   light along the inside of the edge, and a soft shadow lifting the card. The
   lit rim is ::after. No border here: the rim sits on the outer edge. */
.pj-stage.is-overview .pj-panel:not(.is-out) {
    flex-grow: 1;
    border-width: 0;
    border-radius: 32px;
    background-color: rgba(255, 255, 255, .14);
    background-image: radial-gradient(80% 55% at 100% 0, color-mix(in srgb, var(--ink) 12%, transparent), transparent 70%);
    -webkit-backdrop-filter: blur(4px) saturate(1.5);
    backdrop-filter: blur(4px) saturate(1.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .28),
                inset 0 0 10px rgba(255, 255, 255, .32),
                0 22px 44px -24px rgba(38, 34, 29, .24), 0 1px 2px rgba(38, 34, 29, .06);
}

/* Lit rim: bright along the top and left, fading round the sides, catching
   the light again at the bottom right. Only in the default state. */
.pj-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(150deg, #fff 0%, rgba(255, 255, 255, .85) 16%, rgba(255, 255, 255, .2) 42%,
                                rgba(255, 255, 255, .08) 68%, rgba(255, 255, 255, .7) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease-out;
}

.is-overview .pj-panel::after { opacity: 1; }

/* ...and shows the project's own picture over that base, sharp (no blur) but
   see-through, so the softened wave still reads through it. */
.pj-frost {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease-out;
}

.pj-frost img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    filter: saturate(1.12) contrast(1.06);
}

/* One narrow specular sweep from the top left, nothing across the body. */
.pj-frost::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(158deg, rgba(255, 255, 255, .34) 0, rgba(255, 255, 255, .08) 22%, transparent 34%);
}

.is-overview .pj-frost { opacity: .38; }

/* Under the picture, a pale veil at the bottom keeps the wave from crowding
   the label and title. */
.pj-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 52%, rgba(255, 255, 255, .6) 82%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease-out;
}

.is-overview .pj-panel::before { opacity: 1; }

/* Closed face: the project's dotted mark, title up the side, and number. */
.pj-tab {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 15px 0 22px;
    transition: opacity .3s;
}

.pj-panel.is-active .pj-tab { opacity: 0; pointer-events: none; }

/* Include the 1px border when centering the mark in the closed pill.
   Its position stays fixed as the panel widens into an overview card. */
.pj-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    align-self: flex-start;
    margin-left: 15px;
    overflow: hidden;
    border-radius: 50%;
}

.pj-thumb img {
    display: block;
    width: 100%;
    height: 100%;
}

.pj-tab__title {
    flex: 1;
    font-size: 16px;
    text-align: right;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.pj-tab__num { color: #4f4e54; font-size: 13px; }

/* In the default state the side title and number give way to a face with the
   label and title across the bottom. Its width follows the stage, not the
   panel, so the text doesn't re-wrap while the panels resize. */
.pj-tab__title,
.pj-tab__num { transition: opacity .3s .3s; }

.is-overview .pj-tab__title,
.is-overview .pj-tab__num { opacity: 0; transition: opacity .15s; }

.pj-tab__face {
    position: absolute;
    bottom: 22px;
    left: 22px;
    display: flex;
    width: calc((100cqw - 3 * var(--pj-gap)) / 4 - 44px);
    flex-direction: column;
    gap: 4px;
    text-align: left;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .15s, transform .15s;
}

.is-overview .pj-tab__face {
    opacity: 1;
    transform: none;
    transition: opacity .2s .1s, transform .2s var(--rh-ease) .1s;
}

.pj-tab__name {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
}

/* Open face: the header picture, revealed by a circle that grows
   out of the thumbnail's spot. */
.pj-open {
    position: absolute;
    top: 0;
    left: 0;
    width: max(100%, calc(100cqw - 3 * (var(--pj-closed) + var(--pj-gap))));
    height: 100%;
    clip-path: circle(0 at 44px 44px);
    opacity: 0;
    pointer-events: none;
    /* Closing, the picture also fades out quickly, so the pill's mark and
       text rebuilding over it (the glitch) read against the glass, not
       dark on the shrinking photo. */
    transition: clip-path .8s var(--rh-ease), opacity .2s ease-out;
}

.pj-panel.is-active .pj-open {
    clip-path: circle(150% at 44px 44px);
    opacity: 1;
    pointer-events: auto;
    transition: clip-path .8s var(--rh-ease), opacity 0s;
}

.pj-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pj-photo--contain { object-fit: contain; background: #000; }

/* A low glass bar, so the picture keeps most of the card. Ronde glass, see-
   through: a light glass blur (3px) over the photo, which is lifted (--lift:
   lower contrast, brighter) rather than covered in white, so its shapes and
   colour show through while the dark text still reads. The thin white is
   even across, so the chips at the right read as well as the title. In
   Chromium a light ripple distorts it too (.pj-warp, below). Gloss, as
   background layers under the content: a reflection over the upper part, a
   soft glint behind the chips, a sheen from the left. Then crisp highlights
   on the top and bottom edges with light gathered inside them, a soft lift,
   and a lit rim (::before). */
.pj-glass {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px 14px 14px;
    border-radius: 30px;
    background:
        linear-gradient(172deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .14) 32%, rgba(255, 255, 255, 0) 46%),
        linear-gradient(110deg, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, .16) 58%, rgba(255, 255, 255, .05) 64%, rgba(255, 255, 255, 0) 68%),
        linear-gradient(100deg, rgba(255, 255, 255, .24) 0%, rgba(255, 255, 255, 0) 28%),
        linear-gradient(100deg, rgba(255, 255, 255, .17) 0%, rgba(255, 255, 255, .15) 100%);
    --lift: contrast(.64) brightness(1.5);
    -webkit-backdrop-filter: blur(3px) saturate(1.5) var(--lift);
    backdrop-filter: blur(3px) saturate(1.5) var(--lift);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .4),
                inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 10px 18px -12px rgba(255, 255, 255, .7),
                inset 0 -10px 18px -14px rgba(255, 255, 255, .5),
                0 18px 36px -18px rgba(17, 18, 20, .4), 0 1px 2px rgba(17, 18, 20, .1);
}

/* Chromium only (rondeProjects.js sets .pj-warp on <html>): the same filter
   with a light ripple first, like rolled glass, from the SVG filter #pj-warp
   in projects-ronde.html. Unprefixed only: Safari never gets this rule. */
.pj-warp .pj-glass {
    backdrop-filter: url(#pj-warp) blur(3px) saturate(1.5) var(--lift);
}

/* Trash Panda's cover is pure black under the bar, so there is nothing to see
   through there: lift it a little more to keep its text as readable. */
.pj-panel[data-project="panda"] .pj-glass { --lift: contrast(.56) brightness(1.62); }

/* Lit rim: bright along the top and left, catching the light again at the
   bottom right. Under the bar's content (its children are positioned after). */
.pj-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(160deg, #fff 0%, rgba(255, 255, 255, .92) 20%, rgba(255, 255, 255, .26) 46%,
                                rgba(255, 255, 255, .12) 70%, rgba(255, 255, 255, .85) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.pj-glass > * {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
}

.pj-panel.is-active .pj-glass > * {
    opacity: 1;
    transform: none;
    transition: opacity .5s .35s, transform .5s var(--rh-ease) .35s;
}

.pj-glass__text { flex: 1; min-width: 0; }

.pj-glass h2 {
    margin-top: 2px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
}

.pj-glass p {
    margin-top: 2px;
    color: var(--rh-text-2);
    font-size: 14px;
    line-height: 1.45;
}

.pj-chips { display: flex; flex: 0 0 auto; gap: 6px; }

@container (max-width: 1000px) {
    .pj-chips { display: none; }
}

.pj-chips span {
    padding: 5px 12px;
    border: 1px solid var(--rh-line-strong);
    border-radius: 999px;
    font-size: 13px;
}

/* The one primary action: black pill, arrow in a circle. */
.pj-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 18px;
    border-radius: 999px;
    background: var(--rh-ink);
    font-size: 14px;
    transition: transform .15s;
}

body.rh .pj-cta { color: var(--rh-bg); }
.pj-cta:hover { transform: translateY(-1px); }
.pj-cta .rh-hub { background: var(--rh-bg); }
body.rh .pj-cta .rh-hub { color: var(--rh-ink); }

/* Ink motif: circles only, halftone fill, count shows the type. */
/* Trash Panda's light cyan reads too faintly here: a deeper shade of it. */
.pj-panel[data-project="panda"] .pj-motif { --ink: #1f78a3; }
.pj-motif {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
}

.pj-motif span {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ink) 42%, transparent 47%) 0 0 / 4px 4px;
}

/* ── Under the stage: dot pager and the running count ── */
.pj-under {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
}

/* Fixed-width track: the open project's bar takes most of it and the others
   split what's left evenly (flex-grow 6 vs 1). Filtered-out bars shrink to
   nothing, so the rest re-share the space. */
.pj-dots {
    display: flex;
    width: min(240px, 60%);
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

body.rh .pj-dots button {
    min-width: 0;
    height: 8px;
    flex: 1 1 0;
    border-radius: 999px;
    background: var(--rh-line-strong);
    transition: flex-grow .5s var(--rh-ease), margin .5s var(--rh-ease), background .3s, opacity .3s;
}

body.rh .pj-dots button.is-active { flex-grow: 6; background: var(--ink); }
body.rh .pj-dots button.is-out { flex-grow: 0; margin-right: -6px; opacity: 0; pointer-events: none; }

.pj-count { font-size: 40px; line-height: 1; }
.pj-count small { margin-left: 4px; color: var(--rh-muted); font-size: 15px; }

/* ── Load-in (only with JS) ── */
.js .pj-fx {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .6s, transform .6s var(--rh-ease);
    transition-delay: calc(var(--d, 0) * 70ms);
}

.js .is-ready .pj-fx { opacity: 1; transform: none; }

.js .pj-stage:not(.is-ready) .pj-panel {
    opacity: 0;
    transform: translateY(12px);
}

/* Approved startup animation; presentation controls stay in docs/demos/. */
html.pj-intro-pending .rh-page,
html.pj-intro-pending .reflection { visibility: hidden; }
html.pj-intro-pending body,
body.pj-intro-running { overflow: hidden; }
#pj-intro-canvas {
    position: fixed; inset: 0; z-index: 20;
    width: 100%; height: 100%; pointer-events: none;
}
#pj-intro-canvas[hidden], .pj-intro-skip[hidden] { display: none; }
.js body.pj-intro-running .rh-head,
.js body.pj-intro-running .pj-head,
.js body.pj-intro-running .pj-bar,
.js body.pj-intro-running .pj-under { opacity: var(--pj-intro-copy, 0); }
body.pj-intro-running .reflection { opacity: var(--pj-intro-world, 0); }
body.pj-intro-running .pj-thumb { opacity: 0; }
body.pj-intro-running #pj-stage .pj-panel,
body.pj-intro-running #pj-main .pj-fx { transition: none; transform: none !important; }
body.rh .pj-intro-skip {
    position: fixed; z-index: 21; right: 20px; bottom: max(20px, env(safe-area-inset-bottom));
    min-height: 44px; padding: 0 18px; border-radius: 999px;
    background: var(--rh-card); color: var(--rh-ink);
    box-shadow: inset 0 0 0 1px var(--rh-line); font-size: 13px;
}
body.rh .pj-intro-skip:hover { background: var(--rh-fill-hover); }

/* ── Small screens: the pills lie down and the stage stacks ── */
@media (max-width: 760px) {
    .rh-page { padding: 0 16px 32px; }

    .pj-head { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 36px; }
    .pj-bar { margin-top: 28px; margin-bottom: 22px; }
    .pj-steps { display: none; }

    .pj-stage { height: auto; flex-direction: column; }
    .pj-panel {
        flex: none;
        height: 72px;
        border-radius: 36px;
        transition: height .7s var(--rh-ease), border-radius .7s var(--rh-ease),
                    opacity .4s, margin .7s var(--rh-ease), border-color .3s, background .5s,
                    -webkit-backdrop-filter .5s, backdrop-filter .5s;
    }

    .pj-panel.is-active { height: 460px; border-radius: 28px; }
    .pj-panel.is-out { height: 0; margin: 0 0 calc(var(--pj-gap) * -1); }
    .pj-stage.is-overview .pj-panel:not(.is-out) { height: 150px; border-radius: 28px; }

    .pj-tab { flex-direction: row; gap: 14px; padding: 0 22px 0 7px; }
    /* Top left, where a 72px row centres it, so it holds still as rows grow. */
    .pj-thumb { margin: 7px 0 0; }
    .pj-tab__title { text-align: left; writing-mode: horizontal-tb; transform: none; }
    .pj-tab__face { right: 22px; bottom: 18px; left: 20px; width: auto; }

    .pj-open { width: 100%; height: 460px; clip-path: circle(0 at 36px 36px); }
    .pj-panel.is-active .pj-open { clip-path: circle(150% at 36px 36px); }

    .pj-glass { right: 12px; bottom: 12px; left: 12px; flex-wrap: wrap; gap: 12px; border-radius: 24px; }
    .pj-glass__text { flex-basis: calc(100% - 60px); }
    .pj-chips { flex: 1; }
}

@media (prefers-color-scheme: dark) {
    :root {
        --rh-bg: #0e0f11;
        --rh-card: #232427;
        --rh-ink: #f7f7f7;
        --rh-text-2: #c6c6cb;
        --rh-muted: #afafb4;
        --rh-line: #ffffff22;
        --rh-line-strong: #ffffff44;
        --rh-glass: #212225cf;
        --rh-fill-hover: #ffffff16;
    }
    .reflection { background-color: #101115; }
    .reflection::before { background-color: var(--night); }
    .reflection__covers { opacity: .14; }
    .reflection::after { background: radial-gradient(ellipse at 25% 19%, #0e0f1159, transparent 65%); }
    .pj-panel { background: #191b2033; box-shadow: inset -1px 0 1px #ffffff25, 0 3px 12px #0002; }
    /* The bar's text is light here: keep its dark glass, not the light one. */
    .pj-glass { background: var(--rh-glass); }
    .pj-stage.is-overview .pj-panel:not(.is-out) { background: #191b2014; }
    .pj-panel::before { background: linear-gradient(transparent 52%, #0e0f11a6 82%); }
    .pj-frost::after {
        background:
            linear-gradient(transparent 50%, #0e0f1199),
            linear-gradient(155deg, #ffffff1f, transparent 50%);
    }
    .pj-thumb img { filter: invert(1); }
    .pj-tab__num { color: #c1c0c4; }
    .pj-panel[data-project="drone"] { --echo: #a3aee8; }
    .pj-panel[data-project="orca"] { --echo: #e59ac0; }
    .pj-panel[data-project="panda"] { --echo: #74b4d2; }
    .pj-panel[data-project="panda"] .pj-motif { --ink: #4aa6d4; }
    .pj-panel[data-project="kalshi"] { --echo: #f0a08a; }
}

/* Returning to the overview is quicker than the opening reveal. Keep this
   after the phone layout so its height transition uses the same timing. */
.pj-stage.is-overview .pj-panel,
.pj-stage.is-overview .pj-open,
.pj-stage.is-overview .pj-frost,
.pj-stage.is-overview .pj-panel::before,
.pj-stage.is-overview .pj-panel::after,
body[data-scene="overview"] .reflection__wave,
body[data-scene="overview"] .reflection__streak {
    transition-duration: .3s;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
