/* ============================================================
   ronde-project.css: the new ("Ronde") project pages
   ------------------------------------------------------------
   Loaded by project1-ronde.html and project2-ronde.html (header rules:
   ronde-header.css; the trading charts: ronde-trading.css).
   Rules: docs/rondeDesignRules.md. A short hero, the cover photo in
   a rounded frame, a row of stat widgets, a short overview with the
   stack as chips, the build steps as small cards, then the page's own
   pictures and animations and a next-project row. The one accent
   (--pr-accent, the project's colour from the projects page) is the
   first stat's soft wash. Follows the system light or dark appearance.
   ============================================================ */

/* Tokens: the same values as the other Ronde pages. */
:root {
    --rh-bg: #fafafa;
    --rh-card: #fff;
    --rh-ink: #111214;
    --rh-text-2: rgba(17, 18, 20, .7);
    --rh-muted: rgba(17, 18, 20, .45);
    --rh-line: rgba(17, 18, 20, .08);
    --rh-line-strong: rgba(17, 18, 20, .22);
    --rh-fill: rgba(17, 18, 20, .07);
    --rh-fill-hover: rgba(17, 18, 20, .04);
    --rh-primary-hover: #34363b;
    --rh-green: #3DA73C;
    --rh-ultramarine: #3B2E9E;
    --rh-panel-shadow: 0 4px 10px rgba(17, 18, 20, .025), 0 12px 28px rgba(17, 18, 20, .055);
    --rh-ease: cubic-bezier(.2, .8, .2, 1);
    /* The showcase frame stays dark in both modes: the images are dark. */
    --pr-show-bg: #111214;
    --pr-accent: var(--rh-ultramarine);
}

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

body.rh {
    min-height: 100vh;
    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; }

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

/* Same column as every Ronde page, so the header tabs line up. */
.pr-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px 72px;
}

/* ── Shared bits (same as the other Ronde pages) ── */
.rh-lab {
    color: var(--rh-muted);
    font-size: 14px;
}

.rh-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--rh-line-strong);
    border-radius: 999px;
    font-size: 14px;
    white-space: nowrap;
}

.rh-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--rh-green);
}

.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-bg);
    color: var(--rh-ink);
    font-size: 14px;
}

.pr-h2 {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.pr-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

/* ── Hero ── */
.pr-main > * + * { margin-top: clamp(80px, 10vw, 128px); }
.pr-main > .pr-cover,
.pr-main > .pr-stats { margin-top: 16px; }

.pr-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-top: clamp(56px, 8vw, 96px);
    padding-bottom: 32px;
}

.pr-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--rh-muted);
    font-size: 14px;
    transition: color .2s;
}

.pr-back:hover { color: var(--rh-ink); }

.pr-title {
    max-width: 12ch;
    font-size: clamp(44px, 6.4vw, 80px);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: .98;
}

.pr-lede {
    max-width: 520px;
    margin-top: 20px;
    color: var(--rh-text-2);
    font-size: clamp(18px, 1.6vw, 20px);
    line-height: 1.5;
}

.pr-hero__meta {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Cover: the header photo, rounded. pageTransition.js shrinks the
   "View build" picture onto this frame (.proj-cover). ── */
.pr-cover {
    overflow: hidden;
    height: clamp(260px, 44vw, 520px);
    border-radius: 32px;
    background: var(--rh-fill);
}

.pr-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 50%;
}

/* ── Stat widgets: the number is the headline ── */
.pr-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pr-stat {
    position: relative;
    display: flex;
    min-height: 176px;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    overflow: hidden;
    border-radius: 28px;
    background: var(--rh-card);
    box-shadow: var(--rh-panel-shadow);
}

.pr-stat__label {
    position: relative;
    color: var(--rh-muted);
    font-size: 14px;
}

.pr-stat__value {
    position: relative;
    font-size: clamp(48px, 5.4vw, 68px);
    font-weight: 300;
    letter-spacing: -.04em;
    line-height: 1;
}

.pr-stat__value small {
    margin-left: 4px;
    color: var(--rh-muted);
    font-size: .38em;
    font-weight: 400;
    letter-spacing: 0;
}

.pr-stat__value .pr-stat__pre { margin: 0 2px 0 0; }

/* The page's one colour moment: a blurred wash of the project's colour. */
.pr-stat--accent::before {
    content: '';
    position: absolute;
    right: -30%;
    bottom: -60%;
    width: 120%;
    height: 140%;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--pr-accent), transparent);
    opacity: .22;
    filter: blur(24px);
    pointer-events: none;
}

.pr-meter {
    position: absolute;
    right: 24px;
    bottom: 34px;
    width: 64px;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--rh-fill);
}

.pr-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--pr-accent);
}

/* A dot per item, for a count stat (rule 5's dot-row). */
.pr-dots {
    position: absolute;
    right: 24px;
    bottom: 32px;
    display: flex;
    gap: 6px;
}

.pr-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pr-accent);
}

/* ── Overview: heading left, short text and chips right ── */
.pr-about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 32px;
}

.pr-about__body { max-width: 680px; }

.pr-about__body p {
    color: var(--rh-text-2);
    font-size: clamp(18px, 1.6vw, 20px);
    line-height: 1.6;
}

.pr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    list-style: none;
}

.pr-chips li {
    display: inline-flex;
    height: 34px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--rh-card);
    box-shadow: var(--rh-panel-shadow);
    font-size: 14px;
}

/* ── Build steps: eight small cards ── */
.pr-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
}

.pr-steps li {
    display: flex;
    min-height: 168px;
    flex-direction: column;
    padding: 20px 22px 22px;
    border-radius: 24px;
    background: var(--rh-card);
    box-shadow: var(--rh-panel-shadow);
}

.pr-steps__n {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rh-line-strong);
    border-radius: 50%;
    color: var(--rh-text-2);
    font-size: 14px;
}

.pr-steps h3 {
    margin-top: 28px;
    font-size: 20px;
    font-weight: 500;
}

.pr-steps p {
    margin-top: 6px;
    color: var(--rh-text-2);
    font-size: 15px;
    line-height: 1.45;
}

/* Five steps fit on one row. */
.pr-steps--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ── Screenshots: dark rounded frames, short caption under each ── */
.pr-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pr-frame {
    display: flex;
    flex-direction: column;
    padding: clamp(14px, 1.6vw, 20px);
    border-radius: 28px;
    background: var(--pr-show-bg);
}

.pr-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 14px;
    /* The screenshots are terminals on black, so letterboxing blends in. */
    background: #000;
}

.pr-frame figcaption {
    padding: 14px 4px 2px;
    color: rgba(255, 255, 255, .6);
    font-size: 14px;
}

/* ── Showcase: the rotating images, on a dark rounded frame ── */
.pr-show {
    padding: clamp(16px, 2.4vw, 28px);
    border-radius: 32px;
    background: var(--pr-show-bg);
    color: #fff;
    cursor: pointer;
}

.pr-show__stage {
    position: relative;
    aspect-ratio: 16 / 10;
}

.proj-showcase__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 600ms var(--rh-ease), visibility 0s linear 600ms;
}

.proj-showcase__slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 600ms var(--rh-ease), visibility 0s;
}

.proj-showcase__slide img {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    object-fit: contain;
    border-radius: 16px;
}

.proj-showcase__slide figcaption {
    padding-top: 16px;
    color: rgba(255, 255, 255, .6);
    font-size: 14px;
}

.pr-show__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.proj-showcase__progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.proj-showcase__progress span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .28);
    transition: width .3s var(--rh-ease), background .3s;
}

.proj-showcase__progress span.is-active {
    width: 24px;
    background: #fff;
}

.proj-showcase__progress b {
    margin-left: 10px;
    color: rgba(255, 255, 255, .45);
    font-size: 13px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.pr-show__arrows {
    display: flex;
    gap: 8px;
}

.pr-circle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 50%;
    background: transparent;
    transition: background .2s, transform .15s;
}

body.rh .pr-circle { color: #fff; }
.pr-circle:hover { background: rgba(255, 255, 255, .1); }
.pr-circle:active { transform: scale(.94); }
.pr-show :focus-visible { outline-color: #fff; }

/* ── Next project row ── */
.pr-next {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pr-main > .pr-next { margin-top: 48px; }

.pr-btn {
    display: inline-flex;
    height: 48px;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border: 1px solid var(--rh-line-strong);
    border-radius: 999px;
    font-size: 15px;
    transition: background .2s, transform .15s;
}

.pr-btn:hover { background: var(--rh-fill-hover); }
.pr-btn:active { transform: scale(.97); }

.pr-btn--primary {
    padding: 0 9px 0 22px;
    border-color: var(--rh-ink);
    background: var(--rh-ink);
    color: var(--rh-bg);
}

body.rh .pr-btn--primary { color: var(--rh-bg); }
.pr-btn--primary:hover { background: var(--rh-primary-hover); }

/* ── Tablets ── */
@media (max-width: 960px) {
    .pr-hero { flex-direction: column; align-items: flex-start; }
    .pr-hero__meta { flex-shrink: 1; justify-content: flex-start; }
    .pr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-steps--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pr-about { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* ── Phones ── */
@media (max-width: 760px) {
    .pr-page { padding: 0 16px 48px; }
    .pr-cover { border-radius: 24px; }
    .pr-stats { gap: 12px; }
    .pr-stat { min-height: 144px; padding: 20px; border-radius: 24px; }
    .pr-stat__value { font-size: 44px; }
    .pr-meter { right: 20px; bottom: 26px; width: 40px; }
    .pr-dots { right: 20px; bottom: 24px; gap: 4px; }
    .pr-dots i { width: 6px; height: 6px; }
    .pr-gallery { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .pr-frame { border-radius: 24px; }
    .pr-steps li { min-height: 0; }
    .pr-steps h3 { margin-top: 20px; }
    .pr-show { border-radius: 24px; }
    .pr-show__stage { aspect-ratio: 4 / 3; }
    .pr-next { justify-content: stretch; }
    .pr-next .pr-btn { flex: 1 1 0; justify-content: center; }
    .pr-btn--primary { justify-content: space-between; }
}

/* Small phones: each step is one compact row, number on the left. */
@media (max-width: 480px) {
    .pr-steps,
    .pr-steps--5 { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .pr-steps li {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 14px;
        padding: 16px 18px;
        border-radius: 20px;
    }
    .pr-steps__n { grid-row: span 2; }
    .pr-steps h3 { margin-top: 3px; font-size: 18px; }
    .pr-steps p { margin-top: 2px; }
    .pr-stat__label { font-size: 13px; }
}

/* ── Dark: the same rules inverted ── */
@media (prefers-color-scheme: dark) {
    :root {
        --rh-bg: #0e0f11;
        --rh-card: #17181b;
        --rh-ink: #f7f7f7;
        --rh-text-2: rgba(255, 255, 255, .7);
        --rh-muted: rgba(255, 255, 255, .45);
        --rh-line: rgba(255, 255, 255, .1);
        --rh-line-strong: rgba(255, 255, 255, .24);
        --rh-fill: rgba(255, 255, 255, .1);
        --rh-fill-hover: rgba(255, 255, 255, .07);
        --rh-primary-hover: #d9d9dc;
        --rh-ultramarine: #8f86e8;
        --rh-panel-shadow: 0 4px 12px rgba(0, 0, 0, .25);
        --pr-show-bg: #17181b;
    }
}

@media (prefers-reduced-motion: reduce) {
    .proj-showcase__slide,
    .proj-showcase__progress span { transition: none; }
}
