.robokit-track {
    --kit-top: 5.5rem;
    grid-column: 1 / -1;
    min-width: 0;
}
.robokit-track.is-scroll-assembly .robokit-reveal {
    position: sticky;
    top: var(--kit-top);
}
.robokit-track.is-scroll-assembly .robokit-runway { height: clamp(19rem, 65svh, 38rem); }

.robokit-reveal {
    --ink: #182b72;
    --accent: #223dcc;
    --paper: #f4f2e9;
    display: grid;
    gap: .65rem;
    margin: 0;
    min-width: 0;
    padding: clamp(.65rem, 1.5vw, 1.25rem);
    border: 1px solid #d6d6d0;
    border-radius: 1.3rem;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 1.2rem 3rem #101e4c26;
}
.robokit-header { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.robokit-header p { margin: 0 0 .2rem; color: #505b7c; font-size: .72rem; font-weight: 650; }
.robokit-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.05rem, 4.7vw, 2.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.055em;
}
.robokit-header a {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex: none;
    min-height: 44px;
    padding: .45rem .9rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: .85rem;
    font-weight: 750;
    text-decoration: none;
    transition: background .2s ease;
}
.robokit-header a:hover { background: #142696; }
.robokit-reveal :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.robokit-frame {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: clamp(14rem, calc(100svh - var(--kit-top) - 12rem), 30rem);
    overflow: hidden;
    border-radius: .75rem;
    background: #e2e6f3;
}
.robokit-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 43%; }
.robokit-image[hidden] { display: none; }
.robokit-assembly {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 42%, #fcfbf8 8%, #e2e5ee 100%);
    perspective: 780px;
}
.robokit-camera {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: translateZ(var(--camera-depth, 0px))
        rotateZ(var(--camera-roll, 0deg))
        rotateY(var(--camera-turn, 0deg))
        rotateX(var(--camera-tilt, 0deg));
}

.robokit-tray {
    position: absolute;
    inset: 14% 29% 12%;
    display: grid;
    grid-template: auto 1fr 1fr / 1fr 1fr;
    gap: .32rem;
    padding: .6rem;
    border: 1px solid #a0aeff;
    border-radius: clamp(.8rem, 1.6vw, 1.4rem);
    background: linear-gradient(145deg, #3b52d8, #151e74 72%, #151b57);
    box-shadow: 0 .45rem 0 #17245c, 0 .65rem 0 #8c9ae0, 0 1.3rem 2rem #162e7870, inset 0 0 0 2px #ffffff28;
}
.robokit-tray-label {
    display: flex;
    justify-content: space-between;
    gap: .35rem;
    grid-column: 1 / -1;
    color: #dae2ff;
    padding: 0 .25rem .15rem;
    font: 700 clamp(.54rem, 1.3vw, .72rem)/1.2 ui-monospace, monospace;
    letter-spacing: .1em;
}
.robokit-tray i { border: 1px solid #8497ee70; border-radius: .5rem; background: #0a184f; box-shadow: inset 0 .25rem .7rem #060b2e; }

.robokit-piece {
    position: absolute;
    width: min(var(--size), calc(var(--scene-height, 400px) * var(--size-ratio, .46)));
    left: var(--anchor-x);
    top: var(--anchor-y);
    transform: translate3d(var(--piece-x, 0px), var(--piece-y, 0px), var(--piece-z, 4px))
        translate(-50%, -50%) rotateZ(var(--piece-roll, 0deg));
    filter: drop-shadow(0 .35rem .28rem #040d38a6);
}
.robokit-piece img { display: block; width: 100%; height: auto; }
.robokit-piece-controller { --size: 18%; --anchor-x: 40%; --anchor-y: 38%; }
.robokit-piece-board { --size: 18.5%; --anchor-x: 60%; --anchor-y: 37%; }
.robokit-piece-sensor { --size: 12%; --size-ratio: .31; --anchor-x: 40%; --anchor-y: 68%; }
.robokit-piece-wires { --size: 12%; --size-ratio: .31; --anchor-x: 60%; --anchor-y: 67%; }
.robokit-piece-controller img { clip-path: polygon(2% 61%, 4% 50%, 13% 46%, 15% 39%, 51% 16%, 53% 17%, 53% 30%, 66% 26%, 68% 23%, 76% 24%, 82% 36%, 85% 41%, 94% 35%, 97% 40%, 96% 49%, 74% 71%, 46% 84%, 27% 74%, 14% 73%, 3% 66%); }
.robokit-piece-board img { clip-path: polygon(5% 35%, 41% 15%, 97% 51%, 95% 60%, 63% 88%, 58% 86%, 6% 43%); }
.robokit-piece-sensor img { clip-path: polygon(2% 54%, 11% 45%, 17% 39%, 27% 37%, 47% 26%, 60% 10%, 71% 8%, 83% 11%, 92% 19%, 94% 34%, 96% 42%, 72% 61%, 74% 71%, 69% 74%, 63% 69%, 62% 73%, 64% 79%, 59% 81%, 55% 74%, 24% 90%, 20% 87%); }
.robokit-piece-wires img { clip-path: polygon(0 0, 43% 0, 53% 17%, 61% 28%, 69% 33%, 77% 29%, 93% 46%, 92% 53%, 76% 61%, 62% 68%, 32% 79%, 21% 85%, 12% 74%, 8% 66%, 0 48%); }

.robokit-status {
    position: absolute;
    z-index: 3;
    left: .7rem;
    bottom: .65rem;
    padding: .3rem .58rem;
    border: 1px solid #fff9;
    border-radius: 999px;
    background: #f6f5eff2;
    color: #26386e;
    font-size: .68rem;
    font-weight: 650;
}
.robokit-scroll-guide:not([hidden]) { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .75rem; color: #36477b; font-size: .75rem; font-weight: 650; }
.robokit-meter { height: 3px; border-radius: 3px; background: #cbd3ef; overflow: hidden; }
.robokit-meter i { display: block; width: 100%; height: 100%; transform: scaleX(var(--kit-progress, 0)); transform-origin: left; background: var(--accent); }
.robokit-caption { min-height: 2.5em; margin: 0; color: #3d496e; font-size: .84rem; line-height: 1.35; }
.robokit-controls:not([hidden]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.robokit-controls button {
    min-width: 0;
    min-height: 44px;
    padding: .3rem .1rem;
    border: 1px solid #b4bddb;
    border-radius: .55rem;
    color: var(--ink);
    background: transparent;
    font-size: clamp(.68rem, 1.5vw, .85rem);
    font-weight: 700;
    cursor: pointer;
}
.robokit-controls button[aria-pressed="true"] { border-color: var(--accent); color: #fff; background: var(--accent); }
.robokit-controls button:hover:not([aria-pressed="true"]) { background: #e2e7fa; border-color: var(--accent); }
.robokit-intro { grid-column: 1 / -1; }
.robotics-launchpad-wide { grid-column: 1 / -1; }
@media (min-width: 768px) {
    .robokit-controls { width: min(100% - 11rem, 52rem); }
    .robotics-launchpad-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; border-radius: 1.15rem; }
    .robotics-launchpad-wide h2 { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
    .robokit-tray { inset: 24% 12% 23%; }
    .robokit-piece-controller { --size: 32%; --anchor-x: 31%; --anchor-y: 44%; }
    .robokit-piece-board { --size: 32%; --anchor-x: 68%; --anchor-y: 43%; }
    .robokit-piece-sensor { --size: 23%; --anchor-x: 31%; --anchor-y: 64%; }
    .robokit-piece-wires { --size: 23%; --anchor-x: 68%; --anchor-y: 64%; }
    .robokit-frame { max-height: 26rem; }
}
@media (max-width: 360px) {
    .robokit-header a { padding-inline: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
    .robokit-reveal * { animation: none; transition: none; }
    .robokit-track.is-scroll-assembly .robokit-reveal { position: static; }
    .robokit-track.is-scroll-assembly .robokit-runway { height: 0; }
}
