/* ============================================================
   Try section: a console with an empty slot + the Note Analyzer
   cartridge. Insert the cartridge and the plugin boots.
   Cartridge visuals reuse the shelf "kc" language.
   ============================================================ */

.rig { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(24px, 6vw, 88px);
  max-width: 1000px; margin: 0 auto; padding: 24px 0 8px; perspective: 1100px; flex-wrap: wrap; }
.rig.is-booting, .rig.is-booted { pointer-events: none; }

/* ---- The console ---- */
.rig__console { flex: 0 1 560px; min-width: 300px; }
.rig__screen { position: relative; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 120% at 50% 20%, #081018, #02060c 70%);
  box-shadow: 0 0 0 6px #0a0f16, 0 0 0 7px rgba(120,170,220,.08), 0 30px 60px rgba(0,0,0,.6); }
.rig__screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120,200,255,.028) 0 1px, transparent 1px 3px); }

/* standby state */
.rig__standby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; transition: opacity .3s; }
.rig__power { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(120,160,200,.35);
  display: grid; place-items: center; color: rgba(150,190,230,.5); position: relative; }
.rig__power::before { content: ""; position: absolute; width: 2px; height: 12px; top: 7px; background: currentColor; border-radius: 2px; }
.rig__power::after { content: ""; position: absolute; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; clip-path: inset(0 0 42% 0); }
.rig__prompt { margin: 2px 0 0; font-weight: 600; font-size: 16px; color: #cfe0f5; }
.rig__sub { margin: 0; font-size: 13px; color: #6f85a6; }

/* boot overlay */
.rig__boot { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center;
  background: radial-gradient(120% 120% at 50% 30%, #07131a, #02070d 75%); }
.rig.is-booting .rig__boot { display: flex; }
.rig.is-booting .rig__standby { opacity: 0; }
.rig__boot__logo { font-family: "JetBrains Mono", monospace; letter-spacing: .34em; font-size: 12px; color: var(--signal); text-transform: uppercase;
  opacity: 0; animation: bootFade .4s ease forwards; }
.rig__boot__name { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 600; letter-spacing: -.02em; color: #eafff4; font-stretch: 112%;
  opacity: 0; animation: bootFade .4s ease .15s forwards; }
.rig__boot__bar { width: min(260px, 70%); height: 3px; border-radius: 3px; overflow: hidden; background: rgba(120,200,255,.14); }
.rig__boot__bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--signal); box-shadow: 0 0 10px var(--signal); }
.rig.is-booting .rig__boot__bar i { animation: bootBar 1.15s cubic-bezier(.4,.1,.2,1) .1s forwards; }
.rig__boot__status { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .12em; color: #7fa7cc; text-transform: uppercase;
  opacity: 0; animation: bootFade .4s ease .3s forwards; }
@keyframes bootFade { to { opacity: 1; } }
@keyframes bootBar { 0% { width: 0; } 55% { width: 62%; } 100% { width: 100%; } }

/* deck + slot */
.rig__deck { position: relative; display: flex; align-items: center; gap: 14px; height: 40px; margin: 10px auto 0; padding: 0 18px; max-width: 86%;
  border-radius: 10px; background: linear-gradient(180deg, #1b2129, #0e1218); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 10px 20px rgba(0,0,0,.4); }
.rig__brand { font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .4em; color: #4e5a6b; }
.rig__slot { flex: 1; height: 12px; border-radius: 4px; background: #04070b; box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 2px 6px rgba(0,0,0,.8) inset;
  transition: box-shadow .3s; }
.rig.is-target .rig__slot { box-shadow: 0 0 0 1px var(--signal), 0 0 16px rgba(var(--signal-rgb),.45), 0 2px 6px rgba(0,0,0,.8) inset; }
.rig__led { width: 9px; height: 9px; border-radius: 50%; background: #1a2230; box-shadow: 0 0 0 1px rgba(0,0,0,.5) inset; transition: background .3s, box-shadow .3s; }
.rig.is-booting .rig__led, .rig.is-booted .rig__led { background: var(--signal); box-shadow: 0 0 12px var(--signal); }

/* ---- The cartridge (reused kc language) ---- */
.rig__cart { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: grab; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 0; touch-action: none; transition: transform .5s cubic-bezier(.3,.8,.2,1), opacity .4s; }
.rig__cart:active { cursor: grabbing; }
.rig__cart:focus-visible { outline: 2px solid var(--signal); outline-offset: 10px; border-radius: 12px; }
.kc__body { --w: 130px; --h: 160px; --d: 24px; position: relative; display: block; width: var(--w); height: var(--h); transform-style: preserve-3d;
  transform: rotateY(-28deg) rotateX(6deg); transition: transform .5s cubic-bezier(.3,.8,.2,1); }
.rig__cart:hover .kc__body { transform: rotateY(-8deg) rotateX(2deg) translateZ(30px) translateY(-6px); }
.rig.is-dragging .rig__cart .kc__body { transform: rotateY(-6deg) rotateX(2deg); }
.rig.is-inserting .rig__cart .kc__body { transform: rotateY(0deg) rotateX(0deg); }
.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; }
.rig__cart:hover .kc__front::before { opacity: 1; box-shadow: 0 0 16px var(--c), 0 0 4px var(--c); }
.kc__label { position: relative; display: block; height: 94px; 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__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; }
.rig__cart:hover .kc__led { background: var(--c); box-shadow: 0 0 10px var(--c); }
.kc__grip { display: block; margin: auto -12px 0; height: 26px; 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: 58%; height: 11px; padding: 2px 4px 0; box-sizing: border-box; transform: translateX(-50%); 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__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: -34px; 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; }
.rig__cart:hover .kc__body::after { opacity: 1; }
.kc__caption { text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.rig.is-inserting .kc__caption, .rig.is-dragging .kc__caption { opacity: 0; }

/* sinking into the slot */
.rig.is-sunk .rig__cart { opacity: 0; }
.rig.is-sunk .rig__cart .kc__body { transform: rotateY(0) rotateX(0) scaleY(.12) translateY(40px); filter: brightness(.5); }

/* ---- Booted: the plugin takes over ---- */
/* Booted: the plugin fills the whole screen and the whole UI fits with NO scroll.
   The iframe covers the viewport; app.html scales the 1536x1024 window to fit inside it. */
.try__plugin { position: fixed; inset: 0; z-index: 1000; margin: 0; max-width: none;
  background: #02060f; opacity: 0; transition: opacity .35s ease; }
.try__plugin.is-on { opacity: 1; }
.try__plugin[hidden] { display: none; }
.try__plugin .try__frame { margin: 0; max-width: none; width: 100vw; height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
.try__plugin .plugin-frame { width: 100%; height: 100%; aspect-ratio: auto; }
.try__plugin .try__eject { position: fixed; top: 14px; right: 16px; z-index: 1001; margin: 0;
  background: rgba(8,11,18,.85); border: 1px solid rgba(var(--signal-rgb),.5); backdrop-filter: blur(4px); }
.try__plugin .try__eject:hover { background: rgba(14,19,30,.95); }
.try__plugin .try__eject-wrap { margin: 0; }
.try__eject { display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 0; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: rgba(var(--signal-rgb),.08); border: 1px solid rgba(var(--signal-rgb),.4); color: #eef2fb; font-size: 13px; font-weight: 600; }
.try__eject:hover { background: rgba(var(--signal-rgb),.16); }

@media (prefers-reduced-motion: reduce) {
  .rig__cart, .kc__body { transition: none !important; }
  .rig.is-booting .rig__boot__bar i { animation-duration: .3s; }
}

@media (max-width: 760px) {
  .rig { gap: 8px; padding-top: 8px; }
  .rig__console { flex: 1 1 100%; }
  .kc__body { --w: 112px; --h: 138px; --d: 22px; }
  .kc__label { height: 78px; }
}

/* ============================================================
   Buy box: a matte graphite case holding the cartridge, so the
   purchase feels like buying the cartridge itself.
   ============================================================ */
.purchase .buybox { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px);
  max-width: 820px; margin: 0 auto; padding: clamp(22px, 3vw, 36px); border-radius: 22px; text-align: left;
  background: linear-gradient(180deg, #26282d, #191a1e 68%, #141519);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 34px 70px rgba(0,0,0,.55); }
/* The cartridge is alive, like on the plugins shelf: a slow idle float, and it tilts toward you on hover. */
.buybox__cart { display: flex; justify-content: center; perspective: 1000px; animation: cartFloat 5.5s ease-in-out infinite; }
.buybox__cart .kc__body { --w: 138px; --h: 172px; --d: 24px; margin-bottom: 18px;
  transform: rotateY(-24deg) rotateX(7deg); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.buybox__cart:hover .kc__body { transform: rotateY(-6deg) rotateX(2deg) translateZ(34px) translateY(-6px); }
.buybox__cart:hover .kc__body::after { opacity: 1; }
.buybox__cart .kc__front::before { opacity: 1; box-shadow: 0 0 16px var(--c), 0 0 4px var(--c); }
.buybox__cart .kc__led { background: var(--c); box-shadow: 0 0 10px var(--c); }
.buybox__cart .kc__body::after { opacity: .8; }
@keyframes cartFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.buybox__body { min-width: 0; }
.buybox__body h2 { font-size: clamp(26px, 3.2vw, 38px); margin: 0 0 12px; }
.buybox__body .purchase__price { justify-content: flex-start; margin: 0 0 16px; }
.buybox__body .add-to-cart { margin: 0; }
.buybox__body .assurances { margin-top: 22px; text-align: left; gap: 20px; }
.buybox__body .assurances li { padding-top: 16px; }
@media (max-width: 760px) {
  .purchase .buybox { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; padding: 22px 18px 26px; }
  .buybox__body .purchase__price { justify-content: center; }
  .buybox__body .assurances { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .buybox__cart { animation: none; } }
