/* ==========================================================================
   Home
   Board (hero) → Components → Scope → Shipped → BOM & sockets.
   The closing circuit lives in section-circuit-cta.css; tokens in index.css.
   ========================================================================== */

/* ================================= BOARD ================================= */

.cwx-board {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    margin-top: calc(-1 * var(--cwx-hdr));
    padding-top: var(--cwx-hdr);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 74% 50%, #10202f 0%, rgba(11, 19, 31, 0) 60%),
        var(--cwx-board);
    color: var(--cwx-silk);
}

.cwx-board__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.cwx-board__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
    align-items: center;
    gap: 40px;
    padding-top: 90px;
    padding-bottom: 120px;
    pointer-events: none;
}
.cwx-board__inner a, .cwx-board__inner button { pointer-events: auto; }

.cwx-board__title { max-width: 12.5em; color: #fff; }

/* The underline under "working software" is a trace with a via at its end. */
.cwx-wire {
    position: relative;
    color: #fff;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background: linear-gradient(var(--cwx-mint), var(--cwx-mint)) 0 92% / 0 3px no-repeat;
    transition: background-size 1.1s var(--cwx-ease) 1.15s;
}
.cwx-wire::after {
    content: '';
    display: inline-block;
    width: .2em;
    height: .2em;
    margin-left: .14em;
    border: 3px solid var(--cwx-mint);
    border-radius: 50%;
    vertical-align: .02em;
    transform: scale(0);
    transition: transform .4s var(--cwx-ease) 2.15s;
}
.cwx-board__title.is-on .cwx-wire,
html:not(.cwx-js) .cwx-wire { background-size: 100% 3px; }
.cwx-board__title.is-on .cwx-wire::after,
html:not(.cwx-js) .cwx-wire::after { transform: scale(1); }

.cwx-board__lead { margin-top: 30px; color: #a9b8c8; }

.cwx-board__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 40px;
}

.cwx-board__recent {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 20px;
    margin: 56px 0 0;
}
.cwx-board__recent .cwx-silk { margin-right: 4px; }
.cwx-board__recent a {
    color: var(--cwx-silk);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid rgba(69, 249, 171, .35);
    transition: border-color .25s, color .25s;
}
.cwx-board__recent a:hover { color: var(--cwx-mint); border-color: var(--cwx-mint); }

/* The chip every trace runs into. --e (0–1) is set by the board script as
   signals arrive, so it glows harder the busier the board is. */
.cwx-chip {
    --e: 0;
    position: relative;
    justify-self: center;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    width: 196px;
    aspect-ratio: 1;
    background: linear-gradient(145deg, #1b2533, #0f1620 70%);
    border: 1px solid #2d3b4e;
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, .5),
        0 30px 60px -20px rgba(0, 0, 0, .8),
        0 0 calc(20px + var(--e) * 70px) rgba(69, 249, 171, calc(.06 + var(--e) * .35));
    opacity: 0;
    transform: scale(.94);
    transition: opacity .8s var(--cwx-ease) .2s, transform 1s var(--cwx-ease) .2s;
}
.cwx-chip.is-on, html:not(.cwx-js) .cwx-chip { opacity: 1; transform: none; }
.cwx-chip::before {
    /* Fine inner bevel */
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(232, 238, 243, .05);
    border-radius: 3px;
}
.cwx-chip__pin1 {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0a0f16;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8);
}
.cwx-chip__die {
    width: 84px;
    height: 84px;
    filter: grayscale(.25) brightness(calc(.75 + var(--e) * .35));
}
.cwx-chip__ref {
    margin-top: 6px;
    font-family: var(--cwx-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2em;
    color: var(--cwx-silk);
}
.cwx-chip__txt {
    font-family: var(--cwx-mono);
    font-size: 9.5px;
    letter-spacing: .16em;
    line-height: 1.5;
    text-align: center;
    text-transform: uppercase;
    color: var(--cwx-mute);
}

/* Fiducials — the alignment marks in a board's corners. */
.cwx-fid {
    position: absolute;
    z-index: 1;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(232, 238, 243, .18);
    pointer-events: none;
}
.cwx-fid::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: rgba(74, 163, 181, .55);
}
.cwx-fid--tl { top: calc(var(--cwx-hdr) + 22px); left: 22px; }
.cwx-fid--br { bottom: 22px; right: 22px; }

.cwx-board__edge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    max-width: none;
    font-size: 10.5px;
    color: rgba(141, 157, 177, .75);
    pointer-events: none;
}
.cwx-board__hint { color: rgba(69, 249, 171, .7); }

@media (max-width: 900px) {
    .cwx-board { justify-content: flex-start; }
    .cwx-board__inner {
        grid-template-columns: 1fr;
        gap: 56px;
        padding-top: 56px;
        padding-bottom: 96px;
    }
    .cwx-chip { width: 136px; justify-self: start; margin-left: 4px; }
    .cwx-chip__die { width: 58px; height: 58px; }
    .cwx-chip__txt { display: none; }
    .cwx-board__hint { display: none; }
    .cwx-fid--tl { display: none; }
}
@media (max-width: 520px) {
    .cwx-board__edge span:last-child { display: none; }
    .cwx-board__actions .cwx-btn { flex: 1 1 100%; justify-content: center; }
}

/* =============================== COMPONENTS ============================== */

.cwx-parts {
    position: relative;
    padding: 150px 0 140px;
    background: var(--cwx-paper);
    color: var(--cwx-ink);
}

.cwx-parts__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px 64px;
    margin-bottom: 64px;
}
.cwx-parts__intro {
    max-width: 30em;
    margin: 0;
    color: var(--cwx-ink-2);
    font-size: 1.08rem;
}

.cwx-parts__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 40px;
    align-items: stretch;
}

/* The board the chips sit on. */
.cwx-pcb {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 88px 64px 48px;
    background:
        radial-gradient(90% 70% at 30% 20%, #16273a, transparent 70%),
        #0e1a27;
    color: var(--cwx-silk);
    clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.cwx-pcb__traces {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.cwx-pcb__traces path {
    fill: none;
    stroke: #22384c;
    stroke-width: 2;
    stroke-linejoin: round;
    transition: stroke .4s;
}
.cwx-pcb__traces path.is-live {
    stroke: var(--cwx-mint);
    stroke-dasharray: 10 14;
    animation: cwx-flow .9s linear infinite;
    filter: drop-shadow(0 0 4px rgba(69, 249, 171, .8));
}
.cwx-pcb__traces circle { fill: #0e1a27; stroke: #36506a; stroke-width: 1.5; }
.cwx-pcb__traces circle.is-live { stroke: var(--cwx-mint); }
@keyframes cwx-flow { to { stroke-dashoffset: -24; } }

.cwx-pcb__chips {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 64px 44px;
}

.cwx-ic {
    position: relative;
    display: block;
    width: 100%;
    padding: 13px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .35s var(--cwx-ease);
}
/* Two rows of legs, top and bottom. */
.cwx-ic::before, .cwx-ic::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    height: 11px;
    background: repeating-linear-gradient(90deg, #6f7f90 0 5px, transparent 5px 13px);
    transition: background .35s;
}
.cwx-ic::before { top: 3px; }
.cwx-ic::after { bottom: 3px; }

.cwx-ic__body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    aspect-ratio: 1.3;
    padding: 14px 14px 13px;
    background: linear-gradient(160deg, #1d2734, #121922);
    border: 1px solid #2c3a4b;
    border-radius: 3px;
    transition: border-color .35s, box-shadow .35s;
}
.cwx-ic__body::before {
    content: '';
    position: absolute;
    top: 11px;
    left: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0a0f16;
}
.cwx-ic__ref {
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    color: var(--cwx-mute);
    transition: color .35s;
}
.cwx-ic__name {
    font-family: var(--cwx-display);
    font-size: clamp(.82rem, 1.05vw, 1rem);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.cwx-ic:hover { transform: translateY(-3px); }
.cwx-ic[aria-selected="true"]::before,
.cwx-ic[aria-selected="true"]::after {
    background: repeating-linear-gradient(90deg, var(--cwx-mint) 0 5px, transparent 5px 13px);
}
.cwx-ic[aria-selected="true"] .cwx-ic__body {
    border-color: rgba(69, 249, 171, .7);
    box-shadow: 0 0 0 1px rgba(69, 249, 171, .25), 0 0 34px rgba(69, 249, 171, .22);
}
.cwx-ic[aria-selected="true"] .cwx-ic__ref { color: var(--cwx-mint); }

.cwx-pcb__conn {
    position: absolute;
    right: 22px;
    top: 50%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transform: translateY(-50%);
}
.cwx-pcb__conn i {
    display: block;
    width: 22px;
    height: 11px;
    background: linear-gradient(90deg, #3f8796, #2a5b67);
}
.cwx-pcb__silk {
    position: absolute;
    left: 48px;
    bottom: 22px;
    font-size: 10px;
    color: #5d6e81;
}

/* Datasheet */
.cwx-ds-wrap { position: relative; display: grid; }
.cwx-ds {
    grid-area: 1 / 1;
    padding: 34px 36px 32px;
    background: #fff;
    border: 1px solid var(--cwx-rule);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.cwx-ds[hidden] { display: none; }
.cwx-ds__top {
    display: flex;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--cwx-ink);
    color: var(--cwx-ink-2);
    font-size: 10.5px;
}
.cwx-ds__name { margin-top: 26px; }
.cwx-ds__desc { margin: 14px 0 0; color: var(--cwx-ink-2); line-height: 1.65; }

/* New sheet: each block prints in turn. */
.cwx-ds.is-printing > * { animation: cwx-print .55s var(--cwx-ease) both; }
.cwx-ds.is-printing > :nth-child(2) { animation-delay: .06s; }
.cwx-ds.is-printing > :nth-child(3) { animation-delay: .12s; }
.cwx-ds.is-printing > :nth-child(4) { animation-delay: .18s; }
.cwx-ds.is-printing > :nth-child(5) { animation-delay: .26s; }
@keyframes cwx-print {
    from { opacity: 0; transform: translateY(8px); clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}

.cwx-pinout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    align-items: stretch;
    margin: 30px 0 28px;
    font-size: 14px;
}
.cwx-pinout__side {
    display: grid;
    align-content: space-evenly;
    gap: 8px;
    margin: 0;
    padding: 12px 0;
    list-style: none;
}
.cwx-pinout__side li {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
    font-weight: 500;
}
.cwx-pinout__side--r li { justify-content: flex-start; }
.cwx-pinout__side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cwx-pinout__side b {
    position: relative;
    flex: none;
    width: 36px;
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--cwx-ink-2);
    text-align: left;
}
.cwx-pinout__side--r b { text-align: right; }
/* The leg between the number and the package. */
.cwx-pinout__side b::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 2px;
    background: var(--cwx-ink);
}
.cwx-pinout__side--r b::after { right: auto; left: 0; }
.cwx-pinout__body {
    position: relative;
    display: grid;
    place-items: center;
    background: var(--cwx-ink);
    border-radius: 3px;
}
.cwx-pinout__body::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 22px;
    height: 16px;
    margin-left: -11px;
    border-radius: 50%;
    background: #fff;
}
.cwx-pinout__body span {
    writing-mode: vertical-rl;
    font-family: var(--cwx-mono);
    font-size: 11px;
    letter-spacing: .24em;
    color: rgba(255, 255, 255, .55);
}

.cwx-ds__apps .cwx-silk { color: var(--cwx-ink-2); font-size: 10.5px; }
.cwx-ds__apps ul { margin: 12px 0 0; padding: 0; list-style: none; }
.cwx-ds__apps li { padding: 0; border-top: 1px solid var(--cwx-rule); }
.cwx-ds__apps a {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    padding: 13px 0;
    color: var(--cwx-ink);
    text-decoration: none;
}
.cwx-ds__apps a strong { font-weight: 600; transition: color .25s; }
.cwx-ds__apps a span { color: var(--cwx-ink-2); font-size: 14px; }
.cwx-ds__apps a::after { content: '\2192'; margin-left: auto; transition: transform .3s var(--cwx-ease); }
.cwx-ds__apps a:hover strong { color: #0a8f6a; }
.cwx-ds__apps a:hover::after { transform: translateX(4px); }
.cwx-ds__plain { display: block; padding: 13px 0; color: var(--cwx-ink-2); font-size: 14px; }

@media (max-width: 1080px) {
    .cwx-parts__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .cwx-parts { padding: 110px 0 100px; }
    .cwx-pcb { padding: 34px 54px 48px 22px; }
    .cwx-pcb__chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 22px; }
    .cwx-pcb__conn { right: 14px; }
    .cwx-pcb__silk { left: 22px; }
    .cwx-ds { padding: 26px 22px 24px; }
    .cwx-pinout { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); font-size: 13px; }
    .cwx-pinout__side b { width: 28px; }
    .cwx-pinout__side b::after { width: 10px; }
}

/* ================================= SCOPE ================================= */

.cwx-scope {
    position: relative;
    background: var(--cwx-board);
    color: var(--cwx-silk);
}
.cwx-scope__pin { padding: 120px 0; }
.cwx-scope__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    grid-template-areas: "head head" "device phases";
    gap: 40px 64px;
    align-items: center;
}
.cwx-scope__head { grid-area: head; }
.cwx-scope__device { grid-area: device; }
.cwx-scope__phases { grid-area: phases; }

.cwx-scope__bezel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(170deg, #263141, #151c26 60%);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.cwx-scope__screen {
    position: relative;
    aspect-ratio: 16 / 10;
    max-height: 58vh;
    border-radius: 6px;
    overflow: hidden;
    background:
        linear-gradient(rgba(69, 249, 171, .09) 1px, transparent 1px) 0 -1px / 100% 12.5%,
        linear-gradient(90deg, rgba(69, 249, 171, .09) 1px, transparent 1px) -1px 0 / 10% 100%,
        radial-gradient(120% 100% at 50% 50%, #062019, #020b08);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), inset 0 0 40px rgba(0, 0, 0, .7);
}
/* Centre axes, a touch brighter. */
.cwx-scope__screen::before, .cwx-scope__screen::after {
    content: '';
    position: absolute;
    background: rgba(69, 249, 171, .2);
    pointer-events: none;
}
.cwx-scope__screen::before { left: 0; right: 0; top: 50%; height: 1px; }
.cwx-scope__screen::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.cwx-scope__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.cwx-scope__osd {
    position: absolute;
    z-index: 1;
    font-family: var(--cwx-mono);
    font-size: 11px;
    letter-spacing: .08em;
    color: rgba(69, 249, 171, .65);
}
.cwx-scope__osd b { color: var(--cwx-mint); font-weight: 600; }
.cwx-scope__osd--tl { top: 12px; left: 14px; }
.cwx-scope__osd--tr { top: 12px; right: 14px; }
.cwx-scope__osd--bl { bottom: 12px; left: 14px; }
.cwx-scope__osd--br { bottom: 12px; right: 14px; }
.cwx-scope__osd--tl b {
    padding: 2px 6px;
    background: var(--cwx-mint);
    color: #031410;
}

.cwx-scope__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.cwx-scope__knob {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #3b4656, #1a222d, #3b4656, #1a222d, #3b4656);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1);
    position: relative;
    transform: rotate(var(--rot, -135deg));
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.cwx-scope__knob.is-turning { cursor: grabbing; }
.cwx-scope__knob:hover { box-shadow: 0 4px 10px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 2px rgba(69, 249, 171, .35); }
.cwx-scope__knob:focus-visible { outline: 2px solid var(--cwx-mint); outline-offset: 3px; }
.cwx-scope__knob::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    width: 2px;
    height: 12px;
    margin-left: -1px;
    background: var(--cwx-mint);
}
.cwx-scope__knob--sm { width: 38px; height: 38px; }
.cwx-scope__keys { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cwx-scope__keys button {
    width: 22px;
    height: 14px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #2a3443;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .4);
    cursor: pointer;
    transition: background .25s, box-shadow .25s;
}
.cwx-scope__keys button:focus-visible { outline: 2px solid var(--cwx-mint); outline-offset: 2px; }
.cwx-scope__keys button.is-on { background: var(--cwx-mint); box-shadow: 0 0 10px rgba(69, 249, 171, .6); }

.cwx-scope__phases { margin: 0; padding: 0; list-style: none; }
.cwx-phase {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--cwx-line);
    opacity: .38;
    transition: opacity .45s;
}
.cwx-phase:last-child { border-bottom: 1px solid var(--cwx-line); }
.cwx-phase.is-on { opacity: 1; }
.cwx-phase__ch {
    align-self: start;
    margin-top: 4px;
    padding: 3px 0;
    border: 1px solid currentColor;
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-align: center;
    color: var(--cwx-mute);
    transition: color .3s, background .3s;
}
.cwx-phase.is-on .cwx-phase__ch { background: var(--cwx-mint); border-color: var(--cwx-mint); color: #031410; }
.cwx-phase__name {
    margin: 0;
    font-family: var(--cwx-display);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -.02em;
}
.cwx-phase__name button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
}
.cwx-phase__name button:hover { color: var(--cwx-mint); }

/* Stage buttons under the scope. Mobile only: on desktop the stage list
   beside the scope does the same job. */
.cwx-scope__tabs { display: none; }
.cwx-phase__sub {
    margin: 4px 0 0;
    font-family: var(--cwx-mono);
    font-size: 12px;
    color: var(--cwx-mint);
}
.cwx-phase__desc {
    display: grid;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    color: var(--cwx-mute);
    font-size: 15px;
    line-height: 1.6;
    transition: max-height .6s var(--cwx-ease), margin .6s var(--cwx-ease);
}
.cwx-phase.is-on .cwx-phase__desc { max-height: 12em; margin-top: 10px; }

@media (max-width: 960px) {
    .cwx-scope__inner {
        grid-template-columns: 1fr;
        grid-template-areas: "head" "device" "phases";
        gap: 26px;
    }
    .cwx-scope__head .cwx-h2 { font-size: clamp(1.6rem, 6.5vw, 2.3rem); }
    .cwx-scope__pin { padding: 80px 0; }
    .cwx-scope__bezel { grid-template-columns: 1fr; gap: 12px; padding: 10px; border-radius: 10px; }
    .cwx-scope__screen { aspect-ratio: 16 / 11; max-height: none; }
    /* The controls drop under the screen as a row. */
    .cwx-scope__panel { flex-direction: row; justify-content: space-around; padding: 4px 6px; }
    .cwx-scope__keys { grid-template-columns: repeat(4, 1fr); gap: 9px; }
    .cwx-scope__keys button { width: 26px; height: 18px; }

    .cwx-scope__tabs {
        display: grid;
        grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
        gap: 6px;
        margin-top: 12px;
    }
    .cwx-scope__tabs button {
        padding: 9px 4px;
        border: 1px solid var(--cwx-line);
        background: transparent;
        color: var(--cwx-mute);
        font-family: var(--cwx-mono);
        font-size: 11px;
        letter-spacing: .04em;
        line-height: 1.2;
        cursor: pointer;
        transition: color .3s, background .3s, border-color .3s;
    }
    .cwx-scope__tabs button.is-on { background: var(--cwx-mint); border-color: var(--cwx-mint); color: #031410; }

    /* All stages share one slot sized to the tallest and cross-fade, so the
       scope above stays put when the stage changes. */
    .cwx-scope__phases { display: grid; }
    .cwx-phase {
        grid-area: 1 / 1;
        border: 0;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity .35s, visibility .35s;
    }
    .cwx-phase.is-on { opacity: 1; visibility: visible; }
    .cwx-phase:last-child { border-bottom: 0; }
    .cwx-phase__desc { max-height: none; margin-top: 10px; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cwx-phase, .cwx-phase__desc, .cwx-scope__knob { transition: none; }
}

/* ================================ SHIPPED ================================ */

.cwx-ship {
    padding: 150px 0 130px;
    background: var(--cwx-navy);
    color: var(--cwx-silk);
}
.cwx-ship__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 28px 64px;
}
.cwx-ship__aside { max-width: 30em; }
.cwx-ship__aside p { margin: 0 0 18px; color: var(--cwx-mute); font-size: 1.05rem; }
.cwx-ship__cmd {
    display: inline-block;
    padding: 9px 14px;
    background: #08101a;
    border-left: 2px solid var(--cwx-mint);
    font-family: var(--cwx-mono);
    font-size: 13px;
    color: var(--cwx-mint);
}

.cwx-log { margin: 64px 0 0; padding: 0; list-style: none; }
.cwx-log__row { padding: 0; }
.cwx-log__link {
    position: relative;
    display: grid;
    grid-template-columns: 56px 190px minmax(0, 1fr) auto 26px;
    grid-template-areas: "g meta title stack go";
    align-items: center;
    gap: 0 26px;
    min-height: 118px;
    padding-right: 10px;
    color: var(--cwx-silk);
    text-decoration: none;
    border-bottom: 1px solid var(--cwx-line);
    transition: background .4s;
}
.cwx-log__row:first-child .cwx-log__link { border-top: 1px solid var(--cwx-line); }
.cwx-log__link:hover, .cwx-log__link:focus-visible {
    background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 14%, transparent), transparent 75%);
}

.cwx-log__graph {
    grid-area: g;
    align-self: stretch;
    width: 56px;
    height: 100%;
    overflow: visible;
}
.cwx-log__graph path {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset .9s var(--cwx-ease);
}
.cwx-log__main { stroke: #3a5068; }
.cwx-log__br { stroke: var(--cwx-steel); }
.cwx-log__row.is-on .cwx-log__graph path,
html:not(.cwx-js) .cwx-log__graph path { stroke-dashoffset: 0; }

.cwx-log__node {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 15px;
    height: 15px;
    margin: -7.5px 0 0 -7.5px;
    border: 2px solid var(--acc);
    border-radius: 50%;
    background: var(--cwx-navy);
    transform: scale(0);
    transition: transform .45s var(--cwx-ease) .45s, background .3s, box-shadow .3s;
}
.cwx-log__row.is-branch .cwx-log__node { left: 40px; }
.cwx-log__row.is-on .cwx-log__node, html:not(.cwx-js) .cwx-log__node { transform: scale(1); }
.cwx-log__row.is-head .cwx-log__node { background: var(--acc); }
.cwx-log__link:hover .cwx-log__node { background: var(--acc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--acc) 25%, transparent); }

.cwx-log__meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.cwx-log__hash { font-family: var(--cwx-mono); font-size: 13px; color: #f0c674; }
.cwx-log__ref {
    padding: 1px 7px;
    border: 1px solid var(--cwx-mint);
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    color: var(--cwx-mint);
}
.cwx-log__kind { font-family: var(--cwx-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cwx-mute); }

.cwx-log__title {
    grid-area: title;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 22px 0;
    transition: transform .45s var(--cwx-ease);
}
.cwx-log__title strong {
    font-family: var(--cwx-display);
    font-size: clamp(1.45rem, 2.5vw, 2.15rem);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.05;
    transition: color .3s;
}
.cwx-log__title em { font-style: normal; color: var(--cwx-mute); }
.cwx-log__link:hover .cwx-log__title { transform: translateX(8px); }
.cwx-log__link:hover .cwx-log__title strong { color: var(--acc); }

.cwx-log__stack {
    grid-area: stack;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 330px;
}
.cwx-log__stack span {
    padding: 4px 8px;
    border: 1px solid var(--cwx-line);
    font-family: var(--cwx-mono);
    font-size: 11px;
    color: var(--cwx-mute);
}
.cwx-log__go {
    grid-area: go;
    width: 22px;
    height: 12px;
    fill: none;
    stroke: var(--cwx-silk);
    stroke-width: 1.8;
    overflow: visible;
    transition: transform .35s var(--cwx-ease), stroke .3s;
}
.cwx-log__link:hover .cwx-log__go { transform: translateX(5px); stroke: var(--acc); }

.cwx-ship__more { margin-top: 48px; }
.cwx-ship__more .cwx-btn--ghost { --panel: var(--cwx-navy); }

@media (max-width: 1100px) {
    .cwx-log__stack { display: none; }
    .cwx-log__link { grid-template-columns: 56px 170px minmax(0, 1fr) 26px; grid-template-areas: "g meta title go"; }
}
@media (max-width: 700px) {
    .cwx-ship { padding: 110px 0 100px; }
    .cwx-log__link {
        grid-template-columns: 56px minmax(0, 1fr) 22px;
        grid-template-areas: "g meta go" "g title go";
        gap: 0 12px;
        padding: 20px 4px 20px 0;
    }
    .cwx-log__meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
    .cwx-log__title { padding: 8px 0 0; }
}

/* ============================== BOM & SOCKETS ============================ */

.cwx-bom {
    padding: 150px 0 140px;
    background: var(--cwx-paper);
    color: var(--cwx-ink);
}
.cwx-bom__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px 64px;
}
.cwx-bom__head p { max-width: 28em; margin: 0; color: var(--cwx-ink-2); font-size: 1.05rem; }

.cwx-bom__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 52px; }
.cwx-bom__filters button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--cwx-rule);
    background: transparent;
    color: var(--cwx-ink);
    font-family: var(--cwx-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s;
}
.cwx-bom__filters small { font-size: 10.5px; color: var(--cwx-ink-2); }
.cwx-bom__filters button:hover { border-color: var(--cwx-ink); }
.cwx-bom__filters button.is-on { background: var(--cwx-ink); border-color: var(--cwx-ink); color: #fff; }
.cwx-bom__filters button.is-on small { color: var(--cwx-mint); }

.cwx-bom__table {
    --rows: 11;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto repeat(var(--rows), auto);
    grid-auto-flow: column;
    column-gap: 56px;
    margin-top: 26px;
}
.cwx-bom__hrow, .cwx-bom__row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 96px 120px;
    gap: 12px;
    align-items: center;
}
.cwx-bom__hrow {
    grid-row: 1;
    grid-column: 1;
    padding: 12px 0;
    border-bottom: 2px solid var(--cwx-ink);
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cwx-ink-2);
}
.cwx-bom__hrow--2 { grid-column: 2; }
.cwx-bom__row {
    padding: 13px 0;
    border-bottom: 1px solid var(--cwx-rule);
    font-size: 15px;
}
.cwx-bom__row[hidden] { display: none; }
.cwx-bom__ref { font-family: var(--cwx-mono); font-size: 12.5px; color: var(--cwx-ink-2); }
.cwx-bom__part { display: flex; align-items: center; gap: 12px; font-weight: 600; }
/* A tiny SMD part in the brand's colour, end caps and all. */
.cwx-bom__part i {
    flex: none;
    width: 20px;
    height: 10px;
    background: var(--c);
    box-shadow: inset 4px 0 0 #b9c2c9, inset -4px 0 0 #b9c2c9;
}
.cwx-bom__pkg { font-family: var(--cwx-mono); font-size: 12px; color: var(--cwx-ink-2); }

.cwx-js .cwx-bom__table:not(.is-on) .cwx-bom__row { opacity: 0; }
.cwx-bom__row.is-placing { animation: cwx-place .5s var(--cwx-ease) calc(var(--k, 0) * 32ms) both; }
.cwx-bom__row.is-placing i { animation: cwx-drop .5s var(--cwx-ease) calc(var(--k, 0) * 32ms + 120ms) both; }
@keyframes cwx-place { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes cwx-drop { from { transform: translateY(-14px) scale(1.4); opacity: 0; } to { transform: none; opacity: 1; } }

.cwx-sockets { margin-top: 110px; }
.cwx-sockets__title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 26px;
    font-weight: 500;
    color: var(--cwx-ink-2);
}
.cwx-sockets__title::after { content: ''; flex: 1; height: 1px; background: var(--cwx-rule); }
.cwx-sockets__row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cwx-socket {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1.45;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--cwx-rule);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.cwx-socket.is-dark { background: var(--cwx-navy); }
.cwx-socket img {
    max-width: 82%;
    max-height: 74%;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .72;
    transition: filter .45s, opacity .45s, transform .45s var(--cwx-ease);
}
.cwx-socket:hover img { filter: none; opacity: 1; transform: scale(1.05); }
.cwx-socket__led {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c9d1d6;
    transition: background .3s, box-shadow .3s;
}
.cwx-socket.is-on .cwx-socket__led {
    animation: cwx-led .6s steps(2, jump-none) calc(400ms + var(--i) * 160ms) both;
}
@keyframes cwx-led {
    0% { background: #c9d1d6; box-shadow: none; }
    100% { background: #19c98a; box-shadow: 0 0 8px rgba(25, 201, 138, .8); }
}
.cwx-socket__ref {
    position: absolute;
    left: 14px;
    bottom: 10px;
    font-family: var(--cwx-mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: #8a97a3;
}

@media (max-width: 860px) {
    .cwx-bom__table { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
    .cwx-bom__hrow--2 { display: none; }
    .cwx-sockets__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .cwx-bom { padding: 110px 0 100px; }
    .cwx-bom__hrow, .cwx-bom__row { grid-template-columns: 40px minmax(0, 1fr) 0 96px; gap: 10px; }
    .cwx-bom__row > :nth-child(3), .cwx-bom__hrow > :nth-child(3) { visibility: hidden; }
    .cwx-sockets__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================================= SPINE =================================
   Fixed trace down the left edge with a via per section (built by cwx.js).
   Desktop only — on narrower screens the gutter is too tight for it. */

.cwx-spine {
    position: fixed;
    left: 22px;
    top: 50%;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 26px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .4s;
}
.cwx-spine.is-shown { opacity: 1; }
.cwx-spine::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 5px;
    width: 1px;
    background: rgba(141, 157, 177, .35);
}
.cwx-spine a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.cwx-spine a i {
    flex: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid #6e8197;
    background: var(--cwx-board);
    transition: background .3s, border-color .3s, transform .3s var(--cwx-ease);
}
.cwx-spine a span {
    font-family: var(--cwx-mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cwx-silk);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .3s, transform .3s var(--cwx-ease);
    pointer-events: none;
}
.cwx-spine a:hover span, .cwx-spine a:focus-visible span { opacity: 1; transform: none; }
.cwx-spine a.is-on i { background: var(--cwx-mint); border-color: var(--cwx-mint); transform: scale(1.2); }
.cwx-spine.on-paper a i { background: var(--cwx-paper); border-color: #7c8b9a; }
.cwx-spine.on-paper a.is-on i { background: #0a8f6a; border-color: #0a8f6a; }
.cwx-spine.on-paper a span { color: var(--cwx-ink); }

@media (max-width: 1239px) { .cwx-spine { display: none; } }


/* ================================ ARCADE =================================
   Test point TP1 (templates/home-arcade.php): a probe hook on a test pad,
   leading to /arcade, with today's Daily Board alongside. */

.cwx-tp1 {
    padding: 110px 0;
    background: var(--cwx-board);
    color: var(--cwx-silk);
    border-top: 1px solid var(--cwx-line);
}
.cwx-tp1__grid {
    display: grid;
    grid-template-columns: 170px minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}
.cwx-tp1__pad { display: grid; justify-items: center; gap: 8px; }
.cwx-tp1__pad svg { width: 150px; height: 150px; overflow: visible; }
.cwx-tp1__ring { fill: none; stroke: #c9a227; stroke-width: 6; opacity: .75; }
.cwx-tp1__dot { fill: #c9a227; }
.cwx-tp1__hook, .cwx-tp1__lead { fill: none; stroke-linecap: round; }
.cwx-tp1__hook { stroke: var(--cwx-silk); stroke-width: 4; }
.cwx-tp1__lead { stroke: #ff5a5f; stroke-width: 3; }
.cwx-tp1__pad .cwx-silk { font-size: 10.5px; color: #c9a227; }

/* The probe dips onto the pad when the section is pointed at. */
.cwx-tp1__hook, .cwx-tp1__lead { transition: transform .5s var(--cwx-ease); }
.cwx-tp1:hover .cwx-tp1__hook, .cwx-tp1:hover .cwx-tp1__lead { transform: translateY(8px); }

.cwx-tp1__copy .cwx-h2 { margin-bottom: 20px; }
.cwx-tp1__copy .cwx-lead { margin-bottom: 30px; }

.cwx-tp1__board {
    padding: 22px 24px;
    border: 1px solid var(--cwx-line);
    background: rgba(232, 238, 243, .02);
}
.cwx-tp1__board .cwx-silk { margin: 0 0 12px; color: var(--cwx-mint); }
.cwx-tp1__board ol { list-style: none; margin: 0; padding: 0; }
.cwx-tp1__board li {
    display: grid;
    grid-template-columns: 2.4em 1fr auto;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--cwx-line);
    font-family: var(--cwx-mono);
    font-size: 14px;
}
.cwx-tp1__board li span { color: var(--cwx-mute); }
.cwx-tp1__board li b { font-weight: 600; letter-spacing: .06em; }
.cwx-tp1__board li em { font-style: normal; color: var(--cwx-mint); }
.cwx-tp1__empty { margin: 0; font-size: 14px; color: var(--cwx-mute); }

@media (max-width: 1000px) {
    .cwx-tp1__grid { grid-template-columns: 120px minmax(0, 1fr); }
    .cwx-tp1__pad svg { width: 110px; height: 110px; }
    .cwx-tp1__board { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .cwx-tp1 { padding: 80px 0; }
    .cwx-tp1__grid { grid-template-columns: 1fr; }
    .cwx-tp1__pad { justify-items: start; }
    .cwx-tp1__pad svg { width: 90px; height: 90px; }
}

/* Hero easter egg: a test pad sitting on the board. Probing it opens the arcade. */
.cwx-tp {
    position: absolute;
    left: 7%;
    bottom: 84px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    text-decoration: none;
}
.cwx-tp i {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid rgba(201, 162, 39, .6);
    background: radial-gradient(circle, rgba(201, 162, 39, .85) 0 30%, transparent 32%);
    transition: border-color .3s, transform .3s var(--cwx-ease);
}
.cwx-tp span {
    font-size: 10px;
    color: rgba(201, 162, 39, .75);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .3s, transform .3s var(--cwx-ease);
}
.cwx-tp:hover i, .cwx-tp:focus-visible i { border-color: #c9a227; transform: scale(1.25); }
.cwx-tp:hover span, .cwx-tp:focus-visible span { opacity: 1; transform: none; }
@media (max-width: 900px) { .cwx-tp { left: auto; right: 18px; bottom: 64px; } }
