/* ==========================================================================
   ATLAS0 / ATLAS1 product pages — page-specific styles (prefix .at-)
   Builds on site.css (.demo shells, cards, tables) and product.css (hotspots).
   ========================================================================== */

/* ---------- Shared bits ---------- */
/* Readable floor for inline keys and code in running text */

.at-bar-right { margin-left: auto; }
.at-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.demo__bar .chip .ico, .demo__bar .btn .ico { width: 15px; height: 15px; }
.at-hero .hotspot-img { margin-inline: auto; }
.at-ok { color: var(--ok); }

/* ---------- Hero: text / buy box / product image (image moves up between them on phones) ---------- */
.at-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-areas: 'text media' 'buy media'; column-gap: clamp(32px, 6vw, 88px); align-items: center; }
.at-hero__text { grid-area: text; align-self: end; }
.at-hero__text .spec-pills { margin: 20px 0 0; }
.at-hero__buy { grid-area: buy; align-self: start; margin-top: 26px; }
.at-hero__media { grid-area: media; }
@media (max-width: 960px) {
  .at-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'text' 'media' 'buy'; }
  .at-hero__media { margin: clamp(26px, 6vw, 40px) 0 4px; }
  .at-hero__media .hotspot-img { max-width: min(100%, 520px) !important; }
  .at-hero__buy { margin-top: 18px; }
}
@media (max-width: 600px) {
  .at-hero h1 { font-size: var(--fs-hero); }
  .at-hero .lead { font-size: 1.02rem; }
}

/* ---------- Specs + in-the-box + trust ---------- */
.at-specgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.at-specgrid__side { display: grid; gap: 12px; min-width: 0; }
.at-specgrid .photo-slot { margin: 0; }
.at-gallery .photo-slot { margin: 0; }
@media (max-width: 960px) { .at-specgrid { grid-template-columns: minmax(0, 1fr); } }

@keyframes atBlink { 50% { opacity: 0.2; } }
@keyframes atFlash { 0% { color: var(--cyan-hi); text-shadow: 0 0 30px var(--cyan); } 100% { } }
@keyframes atPulse { 0% { transform: scale(1); } 30% { transform: scale(1.12); text-shadow: 0 0 14px var(--ok); } 100% { transform: scale(1); } }
@keyframes atFlow { from { background-position: 0 0; } to { background-position: 24px 0; } }

/* ---------- 1 · Spin → signal → cursor ---------- */
.at-spin__body { display: grid; grid-template-columns: minmax(230px, 0.9fr) 26px minmax(0, 1.25fr) 26px minmax(0, 1.1fr); align-items: stretch; }
.at-pane { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.at-pane__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 600 0.74rem/1 var(--font-body); color: var(--text); }
.at-pane__t { font-weight: 500; text-transform: none; color: var(--dim); }
.at-ballwrap { flex: 1; display: grid; place-items: center; padding: 4px 0; }
.at-ball { width: 100%; max-width: 270px; aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: grab; outline: none; }
.at-ball:active { cursor: grabbing; }
.at-ball:focus-visible { box-shadow: 0 0 0 2px var(--cyan); }
.at-flow { display: grid; place-items: center; }
.at-flow i { position: relative; display: block; width: 16px; height: 2px; background: repeating-linear-gradient(90deg, var(--cyan) 0 6px, transparent 6px 12px); background-size: 24px 2px; animation: atFlow 0.8s linear infinite; opacity: 0.8; }
.at-flow i::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--cyan); border-right: 0; }
.at-scope { width: 100%; height: 190px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.at-counters > div { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.at-counters b { font-size: 1.2rem; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.at-dir { font: 500 0.72rem var(--font-mono); color: var(--cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-dir.is-neg { color: var(--magenta); }
.at-screen { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; background: radial-gradient(90% 80% at 50% 40%, #0c1c24, #04080b 75%); border: 1px solid var(--line); }
.at-packet { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.at-bits16 { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.at-bits16 span { font: 600 0.72rem var(--font-mono); color: var(--muted); }
.at-bits16 code { font-size: 0.72rem; color: var(--cyan-hi); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.at-bits16 b { min-width: 4ch; text-align: right; color: #fff; font-size: 0.85rem; }
.at-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.at-steps li { position: relative; padding: 18px 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.at-steps__n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font: 700 0.8rem var(--font-mono); }
.at-steps h4 { margin: 12px 0 6px; font-size: 1.05rem; }
.at-steps p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
@media (max-width: 1100px) {
  .at-spin__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .at-pane--ball { grid-column: 1 / -1; }
  .at-pane--ball .at-ball { max-width: 220px; }
  .at-flow { display: none; }
  .at-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .at-steps li:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .at-spin__body { grid-template-columns: 1fr; }
  .at-scope { height: 160px; }
  /* steps become a swipeable row */
  .at-steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter); }
  .at-steps::-webkit-scrollbar { display: none; }
  .at-steps li { scroll-snap-align: start; }
  .at-steps li:last-child { grid-column: auto; }
  .at-steps-hint { display: block !important; }
}
.at-steps-hint { display: none; margin: 10px 0 0; font: 500 0.72rem var(--font-body); color: var(--dim); }

/* ---------- 2 · 8-bit vs 16-bit ---------- */
.at-bits__body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.at-bitpane { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.at-bitpane--16 { border-color: var(--line-2); background: var(--surface-2); }
.at-bitpane__h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-bitpane__h b { font: 600 1.08rem var(--font-display); }
.at-chart { width: 100%; height: 210px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-travel { display: grid; gap: 8px; }
.at-track { position: relative; height: 14px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-track i { position: absolute; top: 2px; bottom: 2px; left: 14%; width: 0; border-radius: var(--r-lg); background: var(--cyan); }
.at-bitpane--8 .at-track i { background: var(--amber); }
.at-track i.is-neg { background: #a33; }
.at-track__o { position: absolute; left: 14%; top: -5px; bottom: -5px; width: 2px; background: var(--surface-2); }
.at-puck { position: absolute; top: 50%; left: 14%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; }

.at-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.at-stats > div { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.at-stats span { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-stats b { font: 600 1.15rem var(--font-display); color: #fff; }
.at-stats b.is-bad { color: var(--bad); }
.at-stats b.is-ok { color: var(--ok); }
.at-proof__img { background: #fff; }
.at-proof__img img { object-fit: contain; height: auto; }
@media (max-width: 860px) { .at-bits__body { grid-template-columns: 1fr; } .at-chart { height: 170px; } }

/* ---------- Gallery ---------- */
.at-gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 14px; }
.at-gallery figure { margin: 0; background: #000; display: flex; flex-direction: column; }
.at-gallery figcaption { flex: 1; }
.at-gallery img { aspect-ratio: 1; height: auto; object-fit: cover; transition: transform 0.8s var(--ease); }

.at-gallery figcaption { position: static; display: block; padding: 12px 16px 16px; border-radius: 0; background: var(--surface); font-size: 0.85rem; color: var(--text-2); border-top: 1px solid var(--line); }
@media (max-width: 960px) { .at-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .at-gallery { grid-template-columns: 1fr; } .at-gallery img { aspect-ratio: 4 / 3; } }

/* ---------- 3 · DIP playground (ATLAS0) ---------- */
.at-dip__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.at-dipsw { display: grid; place-items: center; padding: 22px 16px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-dipsw__plate { position: relative; padding: 32px 18px 16px; border-radius: 12px; background: linear-gradient(180deg, #1c2126, #0c0f12); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.7), 0 18px 40px -16px rgba(0, 0, 0, 0.9); }
.at-dipsw__on { position: absolute; top: 8px; right: 14px; font: 600 0.68rem var(--font-body); color: #fff; }
.at-dipsw__row { display: flex; gap: 6px; }
.at-sw { width: 58px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; border-radius: 8px; }
.at-sw__track { position: relative; width: 30px; height: 64px; border-radius: 5px; background: #040506; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9); }
.at-sw__knob { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 28px; border-radius: 3px; background: linear-gradient(180deg, #f4f7f8, #aab6bb); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); transition: bottom 0.28s var(--ease), background 0.28s, box-shadow 0.28s; }
.at-sw[aria-checked='true'] .at-sw__knob { bottom: 31px; background: linear-gradient(180deg, #d7f6ff, var(--cyan)); box-shadow: 0 0 16px rgba(59, 198, 243, 0.85); }
.at-sw:hover .at-sw__track { border-color: rgba(59, 198, 243, 0.5); }
.at-sw__n { font: 700 0.7rem var(--font-mono); color: var(--muted); }
.at-sw__l { min-height: 2.4em; font: 600 0.66rem/1.2 var(--font-mono); text-align: center; color: var(--dim); letter-spacing: 0.04em; transition: color 0.25s; }
.at-sw__l.is-on { color: var(--cyan); }
.at-id { display: grid; align-content: center; gap: 12px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); min-width: 0; }
.at-id__name { font-size: clamp(1.15rem, 0.9rem + 1.1vw, 1.7rem); font-weight: 600; color: #fff; overflow-wrap: anywhere; transition: opacity 0.3s, filter 0.3s; }
.at-id__name.is-off { opacity: 0.12; filter: blur(3px); }
.at-id__name.is-new { animation: atFlash 0.9s var(--ease); }
.at-id__row { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.at-id__row b { color: #fff; font-weight: 600; }
.at-id__st { display: inline-flex; align-items: center; gap: 8px; font: 500 0.8rem var(--font-mono); color: var(--ok); }
.at-id__st i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.at-id__st.is-boot { color: var(--amber); } .at-id__st.is-boot i { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: atBlink 0.3s infinite; }
.at-id__st.is-off { color: var(--bad); } .at-id__st.is-off i { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: atBlink 0.5s infinite; }
.at-motion { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(150px, 0.7fr) auto minmax(0, 1.5fr); gap: 16px; align-items: center; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
.at-motion__cell { display: grid; gap: 10px; justify-items: center; min-width: 0; width: 100%; }
.at-motion__ball { width: 150px; }
.at-motion__ball canvas { width: 100%; aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: grab; outline: none; }
.at-motion__ball canvas:focus-visible { box-shadow: 0 0 0 2px var(--cyan); }
.at-motion__scr { width: 100%; height: 170px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-motion__lbl { display: flex; gap: 10px; align-items: center; }
.at-motion__lbl b { font-size: 1.25rem; color: var(--cyan); min-width: 2ch; }
.at-motion__mid span { display: inline-block; padding: 7px 14px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); font: 500 0.75rem var(--font-mono); color: var(--text-2); white-space: nowrap; }
@media (max-width: 860px) {
  .at-dip__body { grid-template-columns: 1fr; }
  .at-motion { grid-template-columns: 1fr; justify-items: center; }
  .at-motion__mid span { white-space: normal; text-align: center; }
}
@media (max-width: 480px) { .at-sw { width: 44px; } .at-sw__track { width: 26px; height: 56px; } .at-sw__knob { height: 24px; } .at-sw[aria-checked='true'] .at-sw__knob { bottom: 27px; } .at-sw__l { font-size: 0.6rem; } .at-dipsw__plate { padding-inline: 10px; } .at-dipsw__row { gap: 3px; } }

.at-remap-types { display: grid; gap: 10px; }
.at-remap-types > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.at-remap-types b { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); }
.at-remap-types b .ico { color: var(--cyan); width: 18px; height: 18px; }
.at-remap-types span { font-size: 0.88rem; color: var(--muted); }

/* ---------- 5 · Spinners ---------- */
.at-spn__body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.at-spn__stage { position: relative; aspect-ratio: 460 / 280; }
.at-spn__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.at-spn__ball { position: absolute; left: 58.26%; top: 22.14%; width: 38.26%; aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: grab; outline: none; transition: opacity 0.4s, transform 0.5s var(--ease); }
.at-spn__ball:focus-visible { box-shadow: 0 0 0 2px var(--cyan); }
.at-spn[data-mode='sp'] .at-spn__ball { opacity: 0; transform: scale(0.85); pointer-events: none; }
.at-svg-g { transition: opacity 0.4s; }
.at-spn[data-mode='sp'] [data-g='tb'], .at-spn[data-mode='tb'] [data-g='sp'] { opacity: 0; pointer-events: none; }
.at-svg-board { fill: #10161b; stroke: rgba(143, 224, 255, 0.22); }
.at-svg-t { font: 700 10px var(--font-body); fill: var(--dim); }
.at-svg-term rect { fill: #8f989e; }
.at-svg-term circle { fill: #0b0d0f; }
.at-svg-term text { font: 700 12px var(--font-mono); fill: var(--text-2); }
.at-wu { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 6.5; stroke-linecap: round; }
.at-w { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.at-knob { cursor: grab; outline: none; touch-action: none; }
.at-knob__halo { fill: rgba(59, 198, 243, 0.05); stroke: rgba(59, 198, 243, 0.25); stroke-width: 1; }
.at-knob:hover .at-knob__halo, .at-knob:focus-visible .at-knob__halo { stroke: var(--cyan); stroke-width: 2; }
.at-knob__body { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; }
.at-knob__grip { fill: rgba(255, 255, 255, 0.2); }
.at-knob__dot { fill: var(--cyan); }
.at-knob__cap { fill: #0b0f12; stroke: rgba(255, 255, 255, 0.1); }
.at-svg-k { font: 700 11px var(--font-body); fill: var(--text); }
.at-svg-k2 { font: 500 11px var(--font-mono); fill: var(--cyan); }
.at-spn__screen canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: radial-gradient(90% 80% at 50% 40%, #0c1c24, #04080b 75%); border: 1px solid var(--line); }
.at-spn__legend { display: grid; gap: 6px; margin-top: 12px; font-size: 0.86rem; color: var(--text-2); }
.at-spn__legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
@media (max-width: 860px) { .at-spn__body { grid-template-columns: 1fr; } }

/* ---------- 6 · Speed ---------- */
.at-speed__body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.at-dial { padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); }
.at-dial__big { display: flex; align-items: baseline; gap: 4px; margin: 8px 0 16px; }
.at-dial__big b { font: 600 clamp(2rem, 1.6rem + 1.4vw, 2.75rem)/1 var(--font-mono); letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.at-dial__big span { color: var(--muted); font-size: 1.5rem; }
.at-dial input[type='range'] { width: 100%; height: 8px; margin: 8px 0; -webkit-appearance: none; appearance: none; border-radius: var(--r-lg); background: var(--cyan); outline: none; cursor: pointer; }
.at-dial input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.at-dial input[type='range']::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.at-dial input[type='range']:focus-visible { box-shadow: 0 0 0 3px rgba(59, 198, 243, 0.35); }
.at-dial__scale { display: flex; justify-content: space-between; font: 500 0.72rem var(--font-mono); color: var(--dim); }
.at-runs { display: grid; gap: 18px; min-width: 0; }
.at-run__h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.at-run__h b { color: #fff; font-size: 0.9rem; }
.at-runtrack { position: relative; height: 18px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.at-runtrack i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 0; border-radius: var(--r-lg); }
.at-runtrack__in { background: #8a9ba2; }
.at-runtrack__out { background: var(--cyan); }
.at-runpuck { position: absolute; top: 50%; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -6px; border-radius: 50%; background: #fff; }
.at-carry { display: grid; gap: 8px; }
.at-carry__t th, .at-carry__t td { text-align: right; }
.at-carry__t th:first-child, .at-carry__t td:first-child { text-align: left; }
.at-carry__t tbody th { color: var(--cyan); }
@media (max-width: 860px) { .at-speed__body { grid-template-columns: 1fr; } }

/* ---------- Wiring ---------- */
.at-wiring { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.at-terms { display: grid; gap: 14px; min-width: 0; align-content: start; }
.at-terms .callout { font-size: 0.9rem; }
.at-wires caption { caption-side: top; text-align: left; padding: 0 0 8px; font: 600 var(--fs-xs) var(--font-body); color: var(--text-2); }
.at-wires th:first-child { font-family: var(--font-mono); white-space: nowrap; }
.at-wires td:nth-child(2) { white-space: nowrap; }
.at-wire { display: inline-block; width: 18px; height: 6px; margin-right: 8px; border-radius: 3px; vertical-align: middle; background: var(--w); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.at-wiring__side .media-frame, .at-proof__img { margin: 0; }
.at-wiring__side .media-frame { background: #000; }
.at-wiring__side .media-frame img { aspect-ratio: 4 / 3; }
.at-wiring__side .media-frame.is-contain img { object-fit: contain; }
@media (max-width: 960px) { .at-wiring { grid-template-columns: 1fr; } }

/* ---------- Pairing / Tester ---------- */
.at-cab { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.at-ct__body { display: grid; gap: 10px; }
.at-ct__h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; font: 600 0.72rem var(--font-body); color: var(--text-2); }
.at-ct__h .tiny { letter-spacing: 0.04em; text-transform: none; font-weight: 500; }
.at-ct__ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); }
.at-ct__ok .ico { width: 14px; height: 14px; }
.at-ct__ok.is-pulse { animation: atPulse 1.2s var(--ease); }
.at-ct__slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.at-slot { display: grid; gap: 2px; align-content: start; min-height: 78px; padding: 10px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); opacity: 0.55; min-width: 0; }
.at-slot.is-arcade { opacity: 1; border-style: solid; border-color: color-mix(in srgb, var(--pc) 55%, transparent); background: color-mix(in srgb, var(--pc) 9%, transparent); }
.at-slot .mono { font-weight: 700; color: var(--pc); }
.at-slot b { font: 600 0.95rem var(--font-display); }
.at-slot .dim { font-size: 0.68rem; line-height: 1.3; }
.at-ct__ptrs { display: grid; gap: 8px; }
.at-ptr { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.at-ptr[hidden], .at-ct__alert[hidden] { display: none; }
.at-ptr canvas { width: 100%; height: 46px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.at-ptr__x { color: var(--c); display: grid; place-items: center; }
.at-ptr__x .ico { width: 22px; height: 22px; }
.at-ptr__n { display: grid; min-width: 0; }
.at-ptr__n b { font-size: 0.78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-ct__alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-lg); background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.32); color: var(--text-2); font-size: 0.85rem; }
.at-ct__alert .ico { color: var(--bad); margin-top: 2px; }
.at-usb { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; align-items: center; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.at-usb__pc { display: grid; justify-items: center; gap: 8px; padding: 16px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); text-align: center; font-size: 0.8rem; max-width: 110px; }
.at-usb__pc .ico { width: 28px; height: 28px; color: var(--cyan); }
.at-usb__links { display: grid; gap: 8px; }
.at-usb__dev { position: relative; display: grid; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.at-usb__dev b { font: 600 0.92rem var(--font-display); }
.at-usb__dev span:last-child { font-size: var(--fs-xs); color: var(--muted) }
.at-usb__line { position: absolute; left: -17px; top: 50%; width: 16px; height: 2px; background: var(--cyan); }
.at-usb__dev--atlas { border-color: rgba(59, 198, 243, 0.5); background: rgba(59, 198, 243, 0.07); }
.at-usb__dev--atlas b { color: var(--cyan-hi); }
.at-usb__dev--bad { border-style: dashed; border-color: rgba(248, 113, 113, 0.45); }
.at-usb__dev--bad b { text-decoration: line-through; text-decoration-color: var(--bad); color: var(--text-2); }
.at-usb__dev--bad .at-usb__line { background: repeating-linear-gradient(90deg, var(--bad) 0 3px, transparent 3px 6px); box-shadow: none; }
.at-build h3 { font-size: 1.15rem; margin: 8px 0 8px; }
.at-build .chip { height: 30px }
@media (max-width: 1000px) { .at-cab { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .at-ptr { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .at-ptr canvas { grid-column: 1 / -1; grid-row: 2; }
  .at-slot .dim { display: none; }
  .at-slot { min-height: 58px; padding: 8px; }
}

/* ---------- Games ---------- */
.at-games__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.at-game { display: grid; gap: 4px; align-content: start; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform 0.4s var(--ease), border-color 0.3s; }
.at-game:hover { border-color: var(--line-3); }
.at-game h3 { margin: 10px 0 2px; font-size: 1.12rem; }
.at-game p { margin: 0; }
.at-game .small { margin-top: 6px; }
.at-game__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.at-chip { display: inline-block; padding: 2px 7px; border-radius: var(--r-sm); font: 500 var(--fs-xs) var(--font-body); }
.at-chip--tb { color: var(--cyan); background: var(--surface-2); border: 1px solid var(--line-2); }
.at-chip--dial { color: var(--magenta); background: rgba(255, 79, 154, 0.1); border: 1px solid rgba(255, 79, 154, 0.32); }
.at-chip--joy { color: var(--lime); background: rgba(166, 230, 74, 0.1); border: 1px solid rgba(166, 230, 74, 0.3); }
.at-game--cta { border-style: dashed; border-color: var(--line-2); background: var(--surface-2); }
.at-game--cta .link-arrow { margin-top: 10px; }
@media (max-width: 960px) { .at-games__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .at-games__grid { grid-template-columns: 1fr; } }

/* ---------- Settings: terminal window ---------- */
.at-term-win { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg); }
.at-term-win__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.at-term-win__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a333b; }
.at-term-win__bar span { margin-left: 8px; font: 500 0.74rem var(--font-mono); color: var(--muted); }
.at-term-win__body { margin: 0; padding: 18px 20px 20px; font: 500 0.8rem/1.7 var(--font-mono); color: #b9e9f7; white-space: pre; overflow-x: auto; }
.at-term-win__body .c { color: var(--cyan); }
.at-term-win__body .d { color: var(--dim); }
.at-term-win__body .h { color: #fff; font-weight: 600; }
.at-term-win__body b { color: var(--amber); font-weight: 600; }
.at-caret { display: inline-block; width: 8px; height: 1.05em; vertical-align: -3px; background: var(--cyan); animation: atBlink 1s steps(1) infinite; }
/* Settings (Utility first) + the optional terminal + updates */
.at-set { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.at-set__shots { display: grid; gap: 18px; }
.at-set .device-frame figcaption, .at-upd .device-frame figcaption { margin: 10px 4px 2px; }
.at-set figure.device-frame, .at-upd figure.device-frame { margin: 0; }
/* Utility screenshots: hide the app's sidebar so the ATLAS page itself reads larger */
.at-crop { overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 1124 / 890; }
.at-crop img { width: 121%; max-width: none; margin-left: -21%; border-radius: 0; }
.at-crop--bottom { display: flex; align-items: flex-end; aspect-ratio: 1124 / 330; }
.at-crop--top { aspect-ratio: 1124 / 430; }
.at-backup__shot { margin-top: 14px; padding: 6px; border-radius: var(--r-lg); box-shadow: none; }
.at-backup__shot img { border-radius: var(--r); }
.at-termalt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(40px, 6vw, 72px); padding: clamp(20px, 3vw, 32px); border-radius: var(--r-lg); border: 1px dashed var(--line-2); background: var(--surface-2); }
.at-termalt h3 { margin: 6px 0 10px; }
.at-termalt p { margin: 0; }
.at-upd .steps { margin-top: 18px; }
@media (max-width: 960px) { .at-set, .at-termalt { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .at-term-win__body { font-size: 0.66rem; padding: 14px; } }

/* ---------- Compare ---------- */
.at-cmp thead th.is-here { color: var(--cyan); }
.at-cmp[data-here='0'] tbody td:nth-child(2), .at-cmp[data-here='1'] tbody td:nth-child(3) { background: var(--surface-2); }
.at-cmp tbody td { min-width: 150px; }
.at-cmp .price { font-size: 1.3rem; }

/* ---------- Demo bars on phones: drop the small labels, keep the controls tidy ---------- */
@media (max-width: 600px) {
  .at-spin .demo__bar .label, .at-bits .demo__bar .label, .at-ct .demo__bar .label, .at-dip .demo__bar .at-bar-right, .at-sep { display: none; }
  .at-spin .demo__bar, .at-bits .demo__bar, .at-ct .demo__bar, .at-speed .demo__bar, .at-spn .demo__bar, .at-dip .demo__bar { gap: 8px; padding: 12px 14px; }
  .at-spin .demo__bar [data-rate] { flex-basis: 100%; margin: 2px 0 0; font-size: 0.72rem; }
  .at-bits .demo__bar [data-go] { margin-left: auto; }
  .at-stats span { white-space: normal; }
  .at-stats b { font-size: 1.02rem; }
  .demo__caption { font-size: 0.9rem; }
}

/* ---------- Grouped demo controls (16-bit demo) ---------- */
.at-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .at-bits .demo__bar .at-grp .label { display: inline-block; width: 5.2em; margin: 0; white-space: nowrap; }
  .at-bits__bar { row-gap: 10px; }
  .at-bits__bar .at-grp { flex-basis: 100%; }
  .at-bits__bar [data-go] { width: 100%; justify-content: center; margin-left: 0; }
  .at-ct__h .tiny { display: none; }
}

/* ---------- DIP motion row on phones: ball beside screen ---------- */
@media (max-width: 860px) {
  .at-motion { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); grid-template-areas: 'ball scr' 'mid mid'; justify-items: stretch; gap: 12px; padding: 12px; }
  .at-motion > :nth-child(1) { grid-area: ball; }
  .at-motion > :nth-child(2) { grid-area: mid; justify-self: center; }
  .at-motion > :nth-child(3) { grid-area: scr; }
  .at-motion__ball { width: min(130px, 100%); }
  .at-motion__scr { height: 130px; }
}

/* ---------- Tables that stack into label/value cards on phones ---------- */
@media (max-width: 600px) {
  table.at-stack thead { display: none; }
  table.at-stack, table.at-stack tbody { display: block; }
  table.at-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.at-stack tr:last-child { border-bottom: 0; }
  table.at-stack th, table.at-stack td { padding: 0 !important; border: 0 !important; white-space: normal; min-width: 0; }
  table.at-stack tbody th { grid-column: 1 / -1; font-size: 0.92rem; color: #fff; }
  table.at-stack td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 2px; font: 500 0.64rem/1.4 var(--font-body); color: var(--dim); }
  table.at-stack--2 tr { grid-template-columns: minmax(0, 1fr); }
  table.at-stack--2 tbody th { font: 500 0.68rem/1.4 var(--font-body); color: var(--muted); }
  table.at-stack--2 td { font-size: 0.92rem; }

  /* ATLAS0 vs ATLAS1: both boards side by side under each row label */
  .at-cmp table, .at-cmp tbody, .at-cmp thead { display: block; }
  .at-cmp tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .at-cmp tbody tr:last-child { border-bottom: 0; }
  .at-cmp th, .at-cmp td { padding: 0 !important; border: 0 !important; min-width: 0 !important; white-space: normal; background: none !important; font-size: 0.88rem; }
  .at-cmp thead tr { position: static; background: var(--surface-2); }
  .at-cmp thead th:first-child, .at-cmp tbody tr:last-child th { display: none; }
  .at-cmp thead th { font-size: 0.72rem; }
  .at-cmp tbody th { grid-column: 1 / -1; font: 500 0.66rem/1.4 var(--font-body); color: var(--muted); }
  .at-cmp .price { font-size: 1.15rem; }
  .at-cmp .btn { width: 100%; justify-content: center; padding-inline: 10px; }
}

/* ---------- Games: two columns on phones ---------- */
@media (max-width: 520px) {
  .at-games__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .at-game { padding: 14px; border-radius: var(--r-lg); }
  .at-game h3 { font-size: 0.98rem; margin-top: 8px; }
  .at-game .small { font-size: var(--fs-xs); line-height: 1.45; }
}

/* ---------- Related products: product images always fit their frame ---------- */
.at-related .pcard__media img { position: absolute; left: 12%; top: 10%; width: 76%; height: 80%; max-height: none; object-fit: contain; }
@media (max-width: 600px) {
  .at-related { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; --gap: 10px !important; }
  .at-related .pcard { border-radius: var(--r-lg); }
  .at-related .pcard__media { padding: 14px; }
  .at-related .pcard__body { padding: 14px 14px 16px; gap: 4px; }
  .at-related .pcard__title { font-size: 1.02rem; }
  .at-related .pcard__sub { font-size: 0.78rem; }
  .at-related .spec-pills { display: none; }
  .at-related .pcard__foot { padding-top: 8px; }
  .at-related .pcard__foot .link-arrow { font-size: 0; }
  .at-related .pcard__foot .link-arrow::after { font-size: 1rem; }
  .at-related .price { font-size: 1.05rem; }
}

/* ---------- Attract mode: the animated hand (same look as /css/demos.css, which this page doesn't load) ---------- */
.p-hand { position: absolute; left: 0; top: 0; z-index: 20; width: 40px; height: 51px; margin: -3px 0 0 -18px; pointer-events: none; opacity: 0; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
.p-hand.on { opacity: 1; }
.p-hand svg { width: 100%; height: 100%; transform-origin: 45% 5%; transition: transform 0.14s var(--ease); }
.p-hand.down svg { transform: scale(0.88) translateY(3px); }
.p-hand__ring { position: absolute; left: 18px; top: 3px; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; }
.p-hand.down .p-hand__ring { animation: atHandRing 0.6s var(--ease); }
@keyframes atHandRing { 0% { opacity: 1; transform: scale(0.5); } 100% { opacity: 0; transform: scale(4); } }
.demo .chip.is-down, .demo .btn.is-down { transform: scale(0.93); }
.at-sw.is-down .at-sw__track { border-color: var(--cyan); }

/* DIP demo: the firmware date part of the USB name is secondary */
.at-id__name small { font-size: 0.6em; font-weight: 500; color: var(--dim); }

/* ---------- Pairing: Tester + USB map on the left, the plain-text explanation on the right ---------- */
.at-real { margin: clamp(20px, 3vw, 28px) 0 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.at-real a { display: block; cursor: zoom-in; }
.at-real img { display: block; width: 100%; height: auto; }
.at-real figcaption { margin: 8px 12px 10px; }
.at-cab__demo { display: grid; gap: 16px; align-content: start; min-width: 0; }
.at-cab__text .checklist { margin-top: 0; }

/* ---------- CTA band on phones: full-width, evenly stacked buttons ---------- */
@media (max-width: 600px) {
  .cta-band .flex { justify-content: stretch !important; }
  .cta-band .flex .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Spinners demo on phones: keep the SVG labels readable ---------- */
@media (max-width: 600px) {
  .at-svg-term text { font-size: 15px; }
  .at-svg-k { font-size: 14px; letter-spacing: 0.04em; }
  .at-svg-k2 { font-size: 13px; }
  .at-spn__legend { font-size: 0.82rem; }
}


/* ---------- Gallery on phones: a swipe row instead of a tall stack ---------- */
@media (max-width: 560px) {
  .at-gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter); }
  .at-gallery::-webkit-scrollbar { display: none; }
  .at-gallery figure { scroll-snap-align: start; }
  .at-gallery img { aspect-ratio: 1; }
}
.at-gal-hint { display: none; margin: 10px 0 0; font: 500 0.72rem var(--font-body); color: var(--dim); }
@media (max-width: 560px) { .at-gal-hint { display: block; } }

/* ---------- DIP switch: bigger on desktop so it reads as the hero of the section ---------- */
@media (min-width: 861px) {
  .at-dipsw__plate { padding: 38px 22px 18px; }
  .at-dipsw__row { gap: 8px; }
  .at-sw { width: 66px; }
  .at-sw__track { width: 36px; height: 80px; }
  .at-sw__knob { height: 35px; }
  .at-sw[aria-checked='true'] .at-sw__knob { bottom: 40px; }
  .at-sw__l { font-size: 0.7rem; }
}
@media (max-width: 600px) { .at-svg-k { font-size: 16px; } .at-svg-k2 { font-size: 15px; } }

/* ---------- "More detail" folds (details/summary): deeper explainers kept off the main path ---------- */
.at-folds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.at-fold { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); scroll-margin-top: 64px; }
.at-fold[open] { border-color: var(--line-2); }
.at-fold__sum {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'k plus' 't plus' 's plus'; column-gap: 18px; row-gap: 4px; padding: 18px clamp(16px, 2.4vw, 24px);
}
.at-fold__sum::-webkit-details-marker { display: none; }
.at-fold__sum::after { content: '+'; grid-area: plus; align-self: center; font: 400 1.5rem/1 var(--font-body); color: var(--muted); }
.at-fold[open] > .at-fold__sum::after { content: '−'; }
.at-fold__sum:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: var(--r-lg); }
.at-fold__k { grid-area: k; font: 500 var(--fs-xs)/1.3 var(--font-body); color: var(--muted); }
.at-fold__t { grid-area: t; font: 600 clamp(1.05rem, 1.7vw, 1.28rem)/1.3 var(--font-display); color: var(--text); }
.at-fold__s { grid-area: s; font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
.at-fold__sum:hover .at-fold__t { color: #fff; }
.at-fold__body { padding: 4px clamp(16px, 2.6vw, 30px) clamp(22px, 3vw, 34px); border-top: 1px solid var(--line); }
.at-fold__lead { color: var(--text-2); max-width: 80ch; margin: 18px 0 24px; }
.at-fold--term { margin-top: clamp(32px, 5vw, 56px); background: var(--surface-2); border-style: dashed; }
.at-fold--term .at-termalt { margin: 0; border: 0; border-top: 1px dashed var(--line-2); border-radius: 0; background: none; }
@media (prefers-reduced-motion: reduce) { .at-fold__sum::after { transition: none; } }
.at-fold .at-upd { padding-top: 22px; }
@media (max-width: 760px) { .at-fold .at-steps, .at-fold .at-gallery { margin-inline: 0; padding-inline: 0; } }

/* ---------- Hero photo gallery: the labelled board first, then the photos (radio buttons, no script; up to 6 slides) ---------- */
.at-gal { position: relative; min-width: 0; }
.at-gal__r { position: absolute; opacity: 0; pointer-events: none; }
.at-gal__stage > * { display: none; }
.at-gal__stage > figure { margin: 0; background: #000; }
.at-gal__stage > figure img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.at-gal__stage > figure figcaption { position: static; display: block; padding: 10px 14px 12px; border-radius: 0; border-top: 1px solid var(--line); background: var(--surface); font-size: 0.85rem; color: var(--text-2); }
.at-gal__thumbs { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.at-gal__thumbs label { flex: 0 1 76px; height: 56px; border-radius: var(--r); overflow: hidden; border: 2px solid var(--line-2); background: var(--surface-2); cursor: pointer; opacity: 0.7; }
.at-gal__thumbs label:hover { opacity: 1; }
.at-gal__thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.at-gal__thumbs .is-cut img { object-fit: contain; padding: 3px; }
.at-gal__r:nth-of-type(1):checked ~ .at-gal__stage > :nth-child(1) { display: block; }
.at-gal__r:nth-of-type(1):checked ~ .at-gal__thumbs label:nth-child(1) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(1):focus-visible ~ .at-gal__thumbs label:nth-child(1) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
.at-gal__r:nth-of-type(2):checked ~ .at-gal__stage > :nth-child(2) { display: block; }
.at-gal__r:nth-of-type(2):checked ~ .at-gal__thumbs label:nth-child(2) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(2):focus-visible ~ .at-gal__thumbs label:nth-child(2) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
.at-gal__r:nth-of-type(3):checked ~ .at-gal__stage > :nth-child(3) { display: block; }
.at-gal__r:nth-of-type(3):checked ~ .at-gal__thumbs label:nth-child(3) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(3):focus-visible ~ .at-gal__thumbs label:nth-child(3) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
.at-gal__r:nth-of-type(4):checked ~ .at-gal__stage > :nth-child(4) { display: block; }
.at-gal__r:nth-of-type(4):checked ~ .at-gal__thumbs label:nth-child(4) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(4):focus-visible ~ .at-gal__thumbs label:nth-child(4) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
.at-gal__r:nth-of-type(5):checked ~ .at-gal__stage > :nth-child(5) { display: block; }
.at-gal__r:nth-of-type(5):checked ~ .at-gal__thumbs label:nth-child(5) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(5):focus-visible ~ .at-gal__thumbs label:nth-child(5) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
.at-gal__r:nth-of-type(6):checked ~ .at-gal__stage > :nth-child(6) { display: block; }
.at-gal__r:nth-of-type(6):checked ~ .at-gal__thumbs label:nth-child(6) { border-color: var(--cyan); opacity: 1; }
.at-gal__r:nth-of-type(6):focus-visible ~ .at-gal__thumbs label:nth-child(6) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
