/* ---------- Cartridge shelf ---------- */
.kshelf { display: grid; grid-template-columns: repeat(auto-fill, 220px); justify-content: center; gap: 64px 24px; padding: 64px 32px; margin-bottom: 96px; border-radius: 20px; perspective: 1100px;
  background: radial-gradient(70% 60% at 50% 40%, rgba(18, 22, 28, .9), rgba(5, 6, 7, .92) 75%); border: 1px solid var(--rule); }
.kc { display: flex; flex-direction: column; align-items: center; gap: 24px; text-decoration: none; cursor: pointer; }
.kc:focus-visible { outline: none; }
.kc__body { --w: 150px; --h: 186px; --d: 26px; position: relative; display: block; width: var(--w); height: var(--h); transform-style: preserve-3d;
  transform: rotateY(-30deg) rotateX(6deg); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.kc:hover .kc__body, .kc:focus-visible .kc__body { transform: rotateY(-6deg) rotateX(2deg) translateZ(36px) translateY(-8px); }
.kc__face { position: absolute; backface-visibility: hidden; }
.kc__front { inset: 0; transform: translateZ(calc(var(--d) / 2)); border-radius: 10px 10px 6px 6px; padding: 12px 12px 0; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #2c2f34, #191b1e 70%, #141518); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 0 0 1px rgba(0,0,0,.6); }
.kc__front::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 10px 10px 0 0; background: var(--c); opacity: .55; transition: opacity .3s, box-shadow .3s; }
.kc__label { position: relative; display: block; height: 104px; border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 2px 6px rgba(0,0,0,.6) inset; }
.kc__label img { width: 100%; height: 100%; object-fit: cover; }
.kc__label::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.2), transparent 40%); }
.kc__label--ui img { object-position: 30% 40%; transform: scale(1.7); }
.kc__name { position: absolute; left: 8px; bottom: 6px; z-index: 1; font-size: 13px; line-height: 1; font-weight: 700; font-stretch: 118%; text-shadow: 0 1px 8px rgba(0,0,0,.9); color: #fff; }
.kc__brand { display: flex; justify-content: space-between; align-items: center; font-size: 8px; letter-spacing: .3em; color: #6b7179; }
.kc__led { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--c) 20%, #111); transition: background .3s, box-shadow .3s; }
.kc__grip { display: block; margin: auto -12px 0; height: 30px; border-radius: 0 0 6px 6px; background: repeating-linear-gradient(90deg, #0d0e10 0 3px, #1f2226 3px 7px); position: relative; }
.kc__grip::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 46%; height: 8px; transform: translateX(-50%); background: #08090a; border-radius: 3px 3px 0 0; }
.kc__side { top: 0; left: calc(50% - var(--d) / 2); width: var(--d); height: 100%; transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
  background: repeating-linear-gradient(180deg, #121417 0 6px, #1b1e22 6px 8px); border-radius: 4px; }
.kc__top { left: 0; top: calc(50% - var(--d) / 2); width: 100%; height: var(--d); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); background: #24272b; border-radius: 4px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent) inset; }
.kc__body::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -40px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 35%, transparent);
  filter: blur(18px); opacity: .5; transform: translateZ(-30px); transition: opacity .3s; }
.kc:hover .kc__front::before, .kc.is-selected .kc__front::before { opacity: 1; box-shadow: 0 0 16px var(--c), 0 0 4px var(--c); }
.kc:hover .kc__led, .kc.is-selected .kc__led { background: var(--c); box-shadow: 0 0 10px var(--c); }
.kc:hover .kc__body::after, .kc.is-selected .kc__body::after { opacity: 1; }
.kc.is-selected .kc__body { transform: rotateY(0deg) rotateX(0deg) translateY(10px); }
.kc__caption { text-align: center; font-size: 15px; font-weight: 600; color: var(--ink); }
.kc__caption span { display: block; margin-top: 4px; font-family: "JetBrains Mono", monospace; font-weight: 400; font-size: 12px; color: var(--muted); }

/* ---------- Console under the selected row ---------- */
.kconsole { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; margin: -40px 0; transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1), margin .45s; }
.kconsole.is-open { grid-template-rows: 1fr; margin: -16px 0 0; }
.kconsole__inner { overflow: hidden; min-height: 0; }
.console { position: relative; margin: 8px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 22px 22px 56px; border-radius: 22px;
  background: linear-gradient(180deg, #24272c, #121418); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 30px 60px rgba(0,0,0,.7); }
.console__screen { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #020403; box-shadow: 0 0 0 6px #0a0b0d, 0 0 0 7px rgba(255,255,255,.05); }
.console__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.console__screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); pointer-events: none; }
.console.is-swap .console__screen img { animation: kswap .5s ease; }
@keyframes kswap { from { opacity: 0; filter: brightness(2.2) saturate(0); transform: scale(1.03); } to { opacity: 1; filter: none; transform: none; } }
.console__try { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #eafff4; background: rgba(4, 17, 15, .8); border: 1px solid rgba(63, 224, 138, .55); }
.console__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.console__slot { position: absolute; left: 30%; bottom: 20px; width: 34%; height: 14px; border-radius: 4px; background: #050607; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.console__led { position: absolute; right: -22px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--on); box-shadow: 0 0 12px var(--on); }
.console__brand { position: absolute; left: 24px; bottom: 18px; margin: 0; font-size: 10px; letter-spacing: .4em; color: #5d636b; }
.console__name { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 600; font-stretch: 116%; letter-spacing: -.02em; }
.console__line { margin: 12px 0 16px; color: var(--body); line-height: 1.5; }
.console__tags { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.console__tags li { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--muted); }
.console__price { margin: 0 0 20px; display: flex; align-items: baseline; gap: 8px; }
.console__price span { font-size: 22px; font-weight: 600; }
.console__price s { font-size: 13px; color: var(--muted); }
.console__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.console__cta, .console__cart { display: inline-flex; align-items: center; height: 44px; padding: 0 24px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.console__cta { background: var(--ink); color: #0b0b0a; border: 1px solid var(--ink); }
.console__cart { background: var(--button); border: 1px solid var(--rule-strong); }
.console__close { position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(236,233,226,.2); background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.console__close:hover { color: var(--ink); border-color: var(--ink); }

@media (max-width: 760px) {
  .kshelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 8px; padding: 40px 8px; margin-bottom: 64px; }
  .kc__body { --w: 124px; --h: 154px; --d: 22px; }
  .kc__label { height: 82px; }
  .kc__name { font-size: 11px; }
  .console { grid-template-columns: 1fr; gap: 20px; padding: 12px 12px 48px; }
  .console__name { font-size: 26px; }
}
.console__info { padding-right: 36px; }
@media (max-width: 760px) { .console__info { padding-right: 0; } .console__name { padding-right: 40px; } }
@media (max-width: 760px) { .console__slot { left: auto; right: 40px; width: 36%; } }
.kshelf { background: none; border: 0; border-radius: 0; padding-left: 0; padding-right: 0; }
@media (max-width: 760px) { .kshelf { padding-left: 0; padding-right: 0; } }

/* ---------- Background: live spectrum analyzer (replaces the pack ribbons) ---------- */
.abg { position: fixed; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(80% 60% at 50% 0%, #07110e, #000 70%); }
.abg__canvas { width: 100%; height: 100%; display: block; }
.abg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 30% 25%, rgba(0,0,0,.55), transparent 70%); }

/* ---------- Compact first screen: title, cartridges and the open console fit without scrolling ---------- */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; padding-top: 24px; padding-bottom: 0; }
.intro__title { font-size: clamp(40px, 5vw, 64px); }
.intro__lede { margin: 0; max-width: 440px; font-size: 15px; line-height: 22px; }
.kshelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px 24px; padding-top: 32px; padding-bottom: 0; margin-bottom: 72px; }
.kc { width: 160px; gap: 14px; }
.kc__body { --w: 120px; --h: 148px; --d: 22px; }
.kc__label { height: 78px; }
.kc__grip { height: 22px; }
.kc__name { font-size: 11px; }
.kc__caption { font-size: 14px; }
.kconsole { flex: 0 0 100%; margin: -24px 0; }
.kconsole.is-open { margin: 0; }
/* The screen is sized from the window height so the whole console stays on screen. */
.console { grid-template-columns: minmax(0, min(620px, calc((100svh - 400px) * 1.6))) minmax(0, 1fr); gap: 28px; padding: 16px 16px 44px; }
.console__slot { bottom: 15px; }
.console__brand { bottom: 13px; }
.console__name { font-size: 28px; }
.console__line { margin: 8px 0 12px; font-size: 15px; }
.console__tags { margin-bottom: 12px; }
.console__price { margin-bottom: 14px; }
@media (max-width: 760px) {
  .intro { padding-top: 16px; }
  .kshelf { gap: 24px 8px; padding-top: 20px; }
  .kc { width: calc(50% - 8px); }
  .console { grid-template-columns: 1fr; padding: 12px 12px 44px; }
}

/* Short screens (laptops): tighter spacing so the open console still fits. */
@media (min-width: 761px) and (max-height: 760px) {
  .intro { padding-top: 16px; }
  .intro__title { font-size: 48px; }
  .kshelf { padding-top: 16px; row-gap: 16px; }
  .kc { gap: 8px; }
  .kc__caption span { margin-top: 2px; }
  .console { padding: 12px 12px 34px; gap: 24px; }
  .console__slot { bottom: 10px; height: 12px; }
  .console__brand { bottom: 9px; }
  .console__name { font-size: 24px; }
  .console__line { margin: 6px 0 10px; font-size: 14px; line-height: 1.45; }
  .console__tags { display: none; }
  .console__price { margin-bottom: 12px; }
  .console__price span { font-size: 20px; }
  .console__cta, .console__cart { height: 40px; }
}

/* Console sized to its content and centred, not stretched across the page. */
.console { width: fit-content; max-width: 100%; margin: 8px auto;
  grid-template-columns: min(520px, calc((100svh - 400px) * 1.6)) minmax(240px, 320px); }
@media (max-width: 760px) { .console { width: auto; grid-template-columns: 1fr; } }

.abg__canvas { position: absolute; inset: 0; }

/* ---------- Breathing room (8px grid): header → title 48, title → cartridges 64, cartridges → console 32 ---------- */
.intro { padding-top: 48px; }
.kshelf { padding-top: 64px; row-gap: 32px; }
.kc { gap: 16px; }
@media (min-width: 761px) and (max-height: 760px) {
  .intro { padding-top: 40px; }
  .kshelf { padding-top: 56px; row-gap: 24px; }
  .kc { gap: 12px; }
}
@media (max-width: 760px) {
  .intro { padding-top: 32px; }
  .kshelf { padding-top: 40px; row-gap: 24px; }
}
@media (min-width: 761px) and (max-height: 760px) {
  .kshelf { padding-top: 48px; }
  .console__line { display: none; }
  .console__name { margin-bottom: 8px; }
}

/* Gold contacts in the cartridge's connector notch, like a real cartridge edge connector. */
.kc__grip::after { width: 58%; height: 11px; padding: 2px 4px 0; box-sizing: border-box; border-radius: 3px 3px 0 0;
  background:
    linear-gradient(180deg, rgba(255,240,200,.35), transparent 40%) content-box,
    repeating-linear-gradient(90deg, #b9832f 0 1px, #f0cf7c 1px 3px, #c48d38 3px 4px, transparent 4px 6px) content-box,
    #08090a;
  box-shadow: 0 0 6px rgba(216,180,106,.25); }
.kc:hover .kc__grip::after, .kc.is-selected .kc__grip::after { box-shadow: 0 0 10px rgba(240,207,124,.45); }


/* The animated background belongs to the top of the page and scrolls away with it (not fixed to the screen). */
.has-abg { position: relative; }
.has-abg > .abg { position: absolute; left: 0; right: 0; top: calc(-1 * var(--header-h, 64px)); bottom: auto; height: calc(100svh + var(--header-h, 64px));
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
/* The product pages' plugin.css pins (sticky) and dims (opacity .55) this canvas for their own hero; the
   listing keeps its own full-height, full-opacity scene so the top of the bg isn't darkened. */
.has-abg > .abg .abg__canvas { position: absolute; inset: 0; height: 100%; opacity: 1; }
