/**
 * /campaigns — the page for the agency serving an OEM.
 * Builds on the .campaign-* base in marketing-layout.css; everything new or
 * overridden here is scoped to .cp-*.
 */

/* ---------- Hero ---------- */
.cp-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.cp-hero h1 {
    font-size: clamp(2.6rem, 4.6vw, 4.25rem);
    font-weight: 700;
    text-wrap: balance;
}

/* The film still is a shrink-to-fit grid item; give it a width so the image has one to fill. */
.cp-page .campaign-frame--film {
    width: 100%;
    max-width: 22rem;
    /* The whole 9:16 frame, so the film's own disclosure line stays in view. */
    aspect-ratio: 9 / 16;
}

.cp-page .campaign-frame--film video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0f1418;
}

/* Sound is off until someone asks for it. */
.cp-film-sound {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 3px;
    background: rgba(6, 12, 16, 0.78);
    color: #e5e7eb;
    font-size: 0.8125rem;
    cursor: pointer;
}

.cp-film-sound:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.cp-film-sound:focus-visible {
    outline: 2px solid #05c7bb;
    outline-offset: 2px;
}

.cp-film-sound[aria-pressed="false"] .fa-volume-high,
.cp-film-sound[aria-pressed="false"] .cp-film-sound__off,
.cp-film-sound[aria-pressed="true"] .fa-volume-xmark,
.cp-film-sound[aria-pressed="true"] .cp-film-sound__on {
    display: none;
}

/* Native controls take the bottom edge under reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .cp-film-sound { display: none; }
}

.cp-micro {
    margin: 0.85rem 0 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: rgba(156, 163, 175, 0.9);
}

/* ---------- Stats ---------- */
.cp-stats {
    /* The cost figure is the long one ("Hasta un 80 %"), so its card gets the room. */
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
}

.cp-stat--cost {
    border-color: rgba(5, 199, 187, 0.3);
    background:
        radial-gradient(ellipse 90% 70% at 0% 0%, rgba(5, 199, 187, 0.14), transparent 65%),
        rgba(11, 29, 40, 0.6);
}

.cp-stat--cost strong {
    color: #05c7bb;
    white-space: nowrap;
}

.campaign-stats .campaign-stat {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.campaign-stats .campaign-stat:hover,
.campaign-stats .campaign-stat:focus-visible {
    border-color: rgba(5, 199, 187, 0.45);
}

/* ---------- Range shots ---------- */
.cp-range {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(1.5rem, 4vw, 3.25rem);
    align-items: center;
}

.cp-range h2 {
    margin: 0 0 0.7rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #fff;
}

.cp-range p {
    margin: 0;
    max-width: 34rem;
    color: rgba(209, 213, 219, 0.86);
    font-size: 1.02rem;
    line-height: 1.65;
}

.cp-range-media {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
}

.cp-range-layers {
    width: 70%;
    justify-self: end;
}

/* ---------- Security ---------- */
.cp-agency-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cp-agency-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(5, 199, 187, 0.2);
    background: rgba(5, 199, 187, 0.05);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
}

.cp-agency-list i {
    flex: none;
    width: 1.1rem;
    text-align: center;
    color: #05c7bb;
}

.cp-agency {
    border-color: rgba(5, 199, 187, 0.2);
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(5, 199, 187, 0.08), transparent 60%),
        rgba(11, 29, 40, 0.5);
}

.cp-agency .campaign-agency-copy p {
    margin-top: 0.85rem;
}

/* ---------- Closer ---------- */
.cp-close {
    margin-top: clamp(4rem, 8vw, 6.5rem);
}

.cp-close-panel {
    max-width: 44rem;
    margin: 0 auto;
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.cp-close-panel h2 {
    margin: 0 0 0.85rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: #fff;
    text-wrap: balance;
}

.cp-close-panel p {
    margin: 0 auto 1.75rem;
    max-width: 36rem;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: rgba(209, 213, 219, 0.88);
}

.cp-close-actions {
    justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .cp-hero,
    .cp-stats,
    .cp-range {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-range-layers {
        width: 100%;
    }

    .campaign-stat {
        min-height: 0;
    }
}

@media (max-width: 767.98px) {
    .cp-page {
        padding-top: 7rem;
    }

    .cp-hero h1 {
        font-size: clamp(2.3rem, 10vw, 3rem);
    }

    .campaign-actions .hero-cta {
        justify-content: center;
    }

    .campaign-pair {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .campaign-pair figure {
        aspect-ratio: 4 / 5;
    }

    /* Wide placeholders get too short for their production note on a phone. */
    .cp-range-media .temp-asset {
        aspect-ratio: auto !important;
        min-height: 15rem;
        padding-top: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .campaign-stats .campaign-stat {
        transition: none;
    }
}

/* 06 · the film now sits on the right of its copy */
.cp-page .campaign-frame--film {
    justify-self: center;
}

/* 05 · Print size: the 4K render enlarged under the 8K print file.
   --pos (0–100) is the divider; the 8K side shows to the right of it.
   A transparent range input on top does the dragging, so keys work too. */
.cp-print-media {
    display: grid;
    gap: 0.75rem;
}

.cp-print-stage {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: #0f1418;
    user-select: none;
}

.cp-print-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-print-img--after {
    clip-path: inset(0 0 0 calc(var(--pos) * 1%));
}

.cp-print-label {
    position: absolute;
    top: 0.75rem;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2px;
    background: rgba(6, 12, 16, 0.78);
    color: #e5e7eb;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.cp-print-label b {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 500;
    color: rgba(209, 213, 219, 0.7);
}

.cp-print-label--before { left: 0.75rem; }
.cp-print-label--after { right: 0.75rem; }

.cp-print-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--pos) * 1%);
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.cp-print-handle i {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 2.25rem;
    border-radius: 3px;
    background: #fff;
    color: #0b1d28;
    font-size: 0.75rem;
    transform: translate(-50%, -50%);
}

.cp-print-stage:has(.cp-print-range:focus-visible) .cp-print-handle i {
    outline: 2px solid #05c7bb;
    outline-offset: 3px;
}

.cp-print-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    appearance: none;
    -webkit-appearance: none;
}

/* Which detail: the whole render, with the crop marked on it */
.cp-print-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.cp-print-pick {
    display: grid;
    gap: 0.4rem;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(209, 213, 219, 0.7);
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.cp-print-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.cp-print-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.cp-print-thumb i {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    width: calc(var(--w) * 1%);
    height: calc(var(--h) * 1%);
    min-width: 8px;
    min-height: 6px;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.cp-print-pick:hover,
.cp-print-pick[aria-pressed="true"] {
    color: #fff;
}

.cp-print-pick:hover .cp-print-thumb img,
.cp-print-pick[aria-pressed="true"] .cp-print-thumb img {
    opacity: 1;
}

.cp-print-pick[aria-pressed="true"] .cp-print-thumb {
    border-color: rgba(255, 255, 255, 0.45);
}

.cp-print-pick:focus-visible {
    outline: 2px solid #05c7bb;
    outline-offset: 3px;
    border-radius: 2px;
}

.cp-print-spec {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
}

@media (max-width: 539.98px) {
    .cp-print-label {
        font-size: 0.6875rem;
    }

    .cp-print-label b {
        display: none;
    }

    .cp-print-pick {
        font-size: 0.75rem;
    }
}

/* 01 · One source, three sign-offs.
   On reveal the wireframe dissolves into the shaded CAD, the approved
   frames arrive, then each sign-off ticks in turn. Hover the source to
   see the wireframe again. Without the motion class, everything shows. */
.cp-chain {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.25rem);
}

.cp-chain h2 {
    margin: 0 0 0.7rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #fff;
}

.cp-chain-copy p {
    margin: 0;
    max-width: 40rem;
    color: rgba(209, 213, 219, 0.86);
    font-size: 1.02rem;
    line-height: 1.65;
}

.cp-chain-flow {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}

.cp-chain-source {
    position: relative;
    margin: 0;
    aspect-ratio: 1600 / 926;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: #fff;
}

.cp-chain-source img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cp-chain-wire {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cp-chain-source:hover .cp-chain-wire {
    opacity: 1;
}

.cp-chain-source figcaption,
.cp-chain-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cp-chain-source figcaption {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(11, 29, 40, 0.18);
    border-radius: 2px;
    color: #0b1d28;
    background: rgba(255, 255, 255, 0.85);
}

.cp-chain-out {
    position: relative;
    display: grid;
    gap: 1.25rem;
}

/* An arrow in the gap: from the source to what was made from it */
.cp-chain-out::before {
    content: "\2192";
    position: absolute;
    top: 38%;
    left: calc(clamp(2rem, 4vw, 3.5rem) * -0.5);
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.25rem;
    line-height: 1;
}

.cp-chain-frames {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.cp-chain-frame {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: #0f1418;
}

.cp-chain-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Markers on the frame, named in the legend under it: what came straight from the CAD */
.cp-chain-pin,
.cp-chain-legend b {
    display: grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid #fff;
    border-radius: 2px;
    background: rgba(6, 12, 16, 0.8);
    color: #fff;
    font: 600 10px/1 'JetBrains Mono', ui-monospace, monospace;
}

.cp-chain-pin {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cp-chain-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    margin: -0.4rem 0 0;
    padding: 0;
    list-style: none;
}

.cp-chain-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8125rem;
    color: rgba(209, 213, 219, 0.78);
}

.cp-chain-legend b {
    flex: none;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
}

.cp-chain-signoff ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.55rem 0 0;
    padding: 0;
    list-style: none;
}

.cp-chain-label {
    color: rgba(209, 213, 219, 0.6);
}

.cp-chain-signoff li {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(209, 213, 219, 0.78);
}

.cp-chain-tag {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
}

.cp-chain-tag i {
    font-size: 9px;
}

/* The reveal, step by step */
.campaign-motion .cp-chain .cp-chain-wire {
    opacity: 1;
}

.campaign-motion .cp-chain.is-in .cp-chain-wire {
    opacity: 0;
    transition: opacity 1.2s ease 0.5s;
}

.campaign-motion .cp-chain.is-in .cp-chain-source:hover .cp-chain-wire {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.campaign-motion .cp-chain .cp-chain-frame,
.campaign-motion .cp-chain .cp-chain-pin,
.campaign-motion .cp-chain .cp-chain-signoff li {
    opacity: 0;
    transform: translateY(3px);
}

.campaign-motion .cp-chain .cp-chain-pin { transform: translate(-50%, calc(-50% + 3px)); }

.campaign-motion .cp-chain.is-in .cp-chain-frame,
.campaign-motion .cp-chain.is-in .cp-chain-pin,
.campaign-motion .cp-chain.is-in .cp-chain-signoff li {
    opacity: 1;
    transform: none;
    transition: opacity 0.45s ease var(--d), transform 0.45s ease var(--d);
}

.campaign-motion .cp-chain.is-in .cp-chain-pin { transform: translate(-50%, -50%); }

.cp-chain-frame:nth-child(1) { --d: 1.5s; }
.cp-chain-frame:nth-child(2) { --d: 1.7s; }
.cp-chain-pin:nth-of-type(1) { --d: 2.1s; }
.cp-chain-pin:nth-of-type(2) { --d: 2.3s; }
.cp-chain-pin:nth-of-type(3) { --d: 2.5s; }
.cp-chain-signoff li:nth-child(1) { --d: 2.9s; }
.cp-chain-signoff li:nth-child(2) { --d: 3.25s; }
.cp-chain-signoff li:nth-child(3) { --d: 3.6s; }

@media (max-width: 900px) {
    .cp-chain-flow {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-chain-out::before {
        display: none;
    }
}

@media (max-width: 539.98px) {
    .cp-chain-signoff ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-chain-signoff li {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .campaign-motion .cp-chain .cp-chain-wire,
    .campaign-motion .cp-chain.is-in .cp-chain-wire {
        opacity: 0;
        transition: none;
    }

    .campaign-motion .cp-chain .cp-chain-frame,
    .campaign-motion .cp-chain .cp-chain-pin,
    .campaign-motion .cp-chain .cp-chain-signoff li {
        opacity: 1;
        transition: none;
    }

    .campaign-motion .cp-chain .cp-chain-frame,
    .campaign-motion .cp-chain .cp-chain-signoff li { transform: none; }
    .campaign-motion .cp-chain .cp-chain-pin { transform: translate(-50%, -50%); }
}

/* All three figures at the big size. In "99+" the count runs in the inner
   span, so that span takes the figure's style, not the label's. */
.cp-stats .campaign-stat strong {
    font-size: clamp(2.6rem, 4vw, 3.6rem);
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.cp-stats .campaign-stat strong.cp-stat-num span {
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
}

/* Cost card: the same job as two bars. Classic CG at full length; SolidMeta
   starts the same, then drops the steps it doesn't need and ends at 20.
   Graphite only; the figure above keeps its colour. Without the motion
   class, or under reduced motion, the bars show their end state. */
.cp-cost-bars {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin-top: auto;
    padding-top: 0.9rem;
}

.cp-cost-lab {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(209, 213, 219, 0.6);
    white-space: nowrap;
}

.cp-cost-bar {
    display: flex;
    height: 0.5rem;
    border-radius: 1px;
    overflow: hidden;
}

.cp-cost-seg {
    flex: none;
    width: calc(var(--w) * 1%);
    height: 100%;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset -1px 0 0 rgba(8, 18, 24, 0.9);
}

.cp-cost-seg:nth-child(even) {
    background: rgba(255, 255, 255, 0.14);
}

.cp-cost-bar--sm .cp-cost-seg {
    background: rgba(255, 255, 255, 0.7);
}

.cp-cost-bar--sm .cp-cost-seg:nth-child(even) {
    background: rgba(255, 255, 255, 0.5);
}

/* End state: SolidMeta's steps at their own cost */
.cp-cost-bar--sm .cp-cost-seg {
    width: calc(var(--w3) * 1%);
}

.cp-cost-seg--gone {
    box-shadow: none;
}

/* With motion: start equal to classic CG, cut once in view */
.campaign-motion .cp-stat--cost:not(.is-cut) .cp-cost-bar--sm .cp-cost-seg {
    width: calc(var(--w) * 1%);
}

.campaign-motion .cp-stat--cost.is-cut .cp-cost-bar--sm .cp-cost-seg {
    transition: width 0.7s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s);
}

.cp-cost-bar--sm .cp-cost-seg--gone:nth-child(3) { --d: 0.5s; }
.cp-cost-bar--sm .cp-cost-seg--gone:nth-child(4) { --d: 0.62s; }
.cp-cost-bar--sm .cp-cost-seg--gone:nth-child(5) { --d: 0.74s; }
.cp-cost-bar--sm .cp-cost-seg--gone:nth-child(6) { --d: 0.86s; }
.cp-cost-bar--sm .cp-cost-seg:not(.cp-cost-seg--gone) { --d: 1.15s; }

@media (prefers-reduced-motion: reduce) {
    .campaign-motion .cp-stat--cost:not(.is-cut) .cp-cost-bar--sm .cp-cost-seg {
        width: calc(var(--w3) * 1%);
    }

    .campaign-motion .cp-stat--cost.is-cut .cp-cost-bar--sm .cp-cost-seg {
        transition: none;
    }
}

/* 04 · How the line-up is made: a board. The empty plate and six cars, each
   from its own CAD, wire into one Compose node; the range shot comes out.
   Coordinates are a 1600 × 1000 grid in % (nodes) and in the SVG viewBox
   (wires). A 9 s loop runs while it's on screen: each input sends a pulse in
   turn and gets a check, Compose fills a segment per car, then the shot
   fills in. Paused off screen; reduced motion shows the finished board. */
.cp-range-media {
    gap: 0.9rem;
}

.cp-range-shot {
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: #0f1418;
}

.cp-range-shot video,
.cp-range-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-board {
    position: relative;
    aspect-ratio: 16 / 10;
    container-type: inline-size;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.2px) 0 0 / 2.5cqi 2.5cqi,
        #0b1419;
}

.cp-board-wires {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
}

.cp-board-wires path {
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.cp-board-base path {
    stroke: rgba(255, 255, 255, 0.2);
}

.cp-board-pulse {
    stroke: #fff;
    stroke-width: 3 !important;
    stroke-linecap: round;
    stroke-dasharray: 26 100;
    stroke-dashoffset: 26;
    opacity: 0;
}

.cp-node {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 1.2cqi;
    width: 30%;
    padding: 0.7cqi;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5cqi;
    background: #121c22;
    color: #e5e7eb;
    font-size: 1.9cqi;
    line-height: 1.15;
    transition: border-color 0.3s ease;
}

.cp-node img {
    flex: none;
    height: 100%;
    aspect-ratio: 4 / 3;
    width: auto;
    object-fit: cover;
    border-radius: 0.3cqi;
}

.cp-node-text {
    display: grid;
    gap: 0.4cqi;
    min-width: 0;
}

.cp-node b {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-node em {
    justify-self: start;
    padding: 0.15cqi 0.5cqi;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.25cqi;
    font: 500 1.35cqi/1.2 'JetBrains Mono', ui-monospace, monospace;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(209, 213, 219, 0.75);
}

.cp-node-check {
    margin-left: auto;
    margin-right: 0.6cqi;
    font-size: 1.6cqi;
    color: #fff;
    opacity: 0;
}

.cp-node--compose,
.cp-node--out {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 1cqi;
    padding: 1.2cqi;
}

.cp-node-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1cqi;
}

.cp-node-note {
    font-size: 1.6cqi;
    color: rgba(209, 213, 219, 0.75);
}

.cp-node-note--mono {
    font: 500 1.35cqi/1.2 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.04em;
}

.cp-compose-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4cqi;
    height: 0.9cqi;
}

.cp-compose-seg {
    border-radius: 0.15cqi;
    background: rgba(255, 255, 255, 0.85);
}

.cp-node-shot {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.3cqi;
    background: #0f1418;
}

.cp-node-shot img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

/* Flat-top hex ports, just outside the node edges */
.cp-port {
    position: absolute;
    width: 1.3cqi;
    height: 1.15cqi;
    transform: translate(-50%, -50%);
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: rgba(255, 255, 255, 0.55);
}

/* The loop. Base state above is the finished board (checks shown below). */
.cp-node-check { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
    .cp-board .cp-node-check,
    .cp-board .cp-compose-seg,
    .cp-board .cp-node-shot img,
    .cp-board .cp-board-pulse,
    .cp-board .cp-node--compose {
        animation-duration: 9s;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
        animation-fill-mode: both;
    }

    .cp-board:not(.is-playing) * {
        animation-play-state: paused;
    }

    .cp-board-pulse--0 { animation-name: cpPulse0; }
    .cp-node--0 .cp-node-check { animation-name: cpCheck0; }
    .cp-board-pulse--1 { animation-name: cpPulse1; }
    .cp-node--1 .cp-node-check { animation-name: cpCheck1; }
    .cp-board-pulse--2 { animation-name: cpPulse2; }
    .cp-node--2 .cp-node-check { animation-name: cpCheck2; }
    .cp-board-pulse--3 { animation-name: cpPulse3; }
    .cp-node--3 .cp-node-check { animation-name: cpCheck3; }
    .cp-board-pulse--4 { animation-name: cpPulse4; }
    .cp-node--4 .cp-node-check { animation-name: cpCheck4; }
    .cp-board-pulse--5 { animation-name: cpPulse5; }
    .cp-node--5 .cp-node-check { animation-name: cpCheck5; }
    .cp-board-pulse--6 { animation-name: cpPulse6; }
    .cp-node--6 .cp-node-check { animation-name: cpCheck6; }
    .cp-compose-seg--1 { animation-name: cpSeg1; }
    .cp-compose-seg--2 { animation-name: cpSeg2; }
    .cp-compose-seg--3 { animation-name: cpSeg3; }
    .cp-compose-seg--4 { animation-name: cpSeg4; }
    .cp-compose-seg--5 { animation-name: cpSeg5; }
    .cp-compose-seg--6 { animation-name: cpSeg6; }
    .cp-board-pulse--out { animation-name: cpPulseOut; }
    .cp-node-shot img { animation-name: cpShot; }
    .cp-node--compose { animation-name: cpCompose; }
}

@keyframes cpPulse0 {
    0%, 3.22% { stroke-dashoffset: 26; opacity: 0; }
    3.33% { stroke-dashoffset: 26; opacity: 1; }
    12.22% { stroke-dashoffset: -100; opacity: 1; }
    12.33%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck0 {
    0%, 3.33% { opacity: 0; }
    6.11%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse1 {
    0%, 8.78% { stroke-dashoffset: 26; opacity: 0; }
    8.89% { stroke-dashoffset: 26; opacity: 1; }
    17.78% { stroke-dashoffset: -100; opacity: 1; }
    17.89%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck1 {
    0%, 8.89% { opacity: 0; }
    11.67%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse2 {
    0%, 14.33% { stroke-dashoffset: 26; opacity: 0; }
    14.44% { stroke-dashoffset: 26; opacity: 1; }
    23.33% { stroke-dashoffset: -100; opacity: 1; }
    23.44%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck2 {
    0%, 14.44% { opacity: 0; }
    17.22%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse3 {
    0%, 19.89% { stroke-dashoffset: 26; opacity: 0; }
    20% { stroke-dashoffset: 26; opacity: 1; }
    28.89% { stroke-dashoffset: -100; opacity: 1; }
    29%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck3 {
    0%, 20% { opacity: 0; }
    22.78%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse4 {
    0%, 25.44% { stroke-dashoffset: 26; opacity: 0; }
    25.56% { stroke-dashoffset: 26; opacity: 1; }
    34.44% { stroke-dashoffset: -100; opacity: 1; }
    34.56%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck4 {
    0%, 25.56% { opacity: 0; }
    28.33%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse5 {
    0%, 31% { stroke-dashoffset: 26; opacity: 0; }
    31.11% { stroke-dashoffset: 26; opacity: 1; }
    40% { stroke-dashoffset: -100; opacity: 1; }
    40.11%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck5 {
    0%, 31.11% { opacity: 0; }
    33.89%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpPulse6 {
    0%, 36.56% { stroke-dashoffset: 26; opacity: 0; }
    36.67% { stroke-dashoffset: 26; opacity: 1; }
    45.56% { stroke-dashoffset: -100; opacity: 1; }
    45.67%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpCheck6 {
    0%, 36.67% { opacity: 0; }
    39.44%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0; }
}
@keyframes cpSeg1 {
    0%, 17.78% { opacity: 0.12; }
    19.44%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpSeg2 {
    0%, 23.33% { opacity: 0.12; }
    25%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpSeg3 {
    0%, 28.89% { opacity: 0.12; }
    30.56%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpSeg4 {
    0%, 34.44% { opacity: 0.12; }
    36.11%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpSeg5 {
    0%, 40% { opacity: 0.12; }
    41.67%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpSeg6 {
    0%, 45.56% { opacity: 0.12; }
    47.22%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpPulseOut {
    0%, 47.67% { stroke-dashoffset: 26; opacity: 0; }
    47.78% { stroke-dashoffset: 26; opacity: 1; }
    56.67% { stroke-dashoffset: -100; opacity: 1; }
    56.78%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes cpShot {
    0%, 56.67% { opacity: 0.12; }
    63.33%, 93.33% { opacity: 1; }
    97.78%, 100% { opacity: 0.12; }
}
@keyframes cpCompose {
    0%, 3.33% { border-color: rgba(255, 255, 255, 0.12); }
    6.67%, 93.33% { border-color: rgba(255, 255, 255, 0.5); }
    97.78%, 100% { border-color: rgba(255, 255, 255, 0.12); }
}
