/* ===== LIBRARY PAGE ===== */

.library-header {
  padding: calc(var(--nav-h) + 80px) 0 56px;
  text-align: center;
}

.library-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.library-desc {
  font-size: 1rem;
  color: var(--text-2);
}

/* ===== STUDIO SECTION ===== */

.studio-section {
  padding: 0 0 140px;
}

.studio-stage {
  display: flex;
  align-items: flex-start;
  gap: 52px;
}

/* ===== LEFT: CRATE ===== */

.studio-crate {
  flex: 1;
  min-width: 0;
}

.crate {
  border-radius: 6px 6px 4px 4px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
}

/* Top rail */
.crate-top-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 10px 24px;
  background: linear-gradient(180deg, #2a2620 0%, #1c1a14 55%, #161410 100%);
  border-bottom: 1px solid #0a0906;
  position: relative;
}
.crate-top-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 52px,
    rgba(255,255,255,0.015) 52px, rgba(255,255,255,0.015) 54px
  );
  pointer-events: none;
}
.crate-top-rail::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.04);
}

.crate-rail-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(200,190,170,0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.crate-rail-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(200,190,170,0.2);
  letter-spacing: 0.1em;
}

/* Crate interior */
.crate-interior {
  display: flex;
  background: linear-gradient(160deg, #181410 0%, #110e0a 60%, #161210 100%);
  padding: 20px 0;
  position: relative;
}
.crate-interior::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0px, transparent 36px,
      rgba(255,255,255,0.018) 36px, rgba(255,255,255,0.018) 37px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 90px,
      rgba(255,255,255,0.012) 90px, rgba(255,255,255,0.012) 91px
    );
  pointer-events: none;
}

.crate-left-wall,
.crate-right-wall {
  width: 20px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #1e1a14, #141008);
  position: relative;
  z-index: 2;
}
.crate-right-wall {
  background: linear-gradient(90deg, #141008, #1e1a14);
}
.crate-left-wall::after,
.crate-right-wall::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 1px;
  background: rgba(0,0,0,0.5);
}
.crate-right-wall::after {
  left: 0; right: auto;
}

/* Scrollable records container */
.crate-records-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}
.crate-records-scroll::-webkit-scrollbar { display: none; }

.crate-records {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  min-width: min-content;
}

/* Crate base */
.crate-base {
  height: 18px;
  background: linear-gradient(180deg, #1e1a14 0%, #0e0c08 100%);
  border-top: 1px solid #080604;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 30px;
}

.crate-foot {
  display: block;
  width: 28px;
  height: 8px;
  background: linear-gradient(180deg, #181410, #0c0a08);
  border-radius: 0 0 4px 4px;
  border: 1px solid #060504;
  border-top: none;
}

.crate-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 10px;
}

/* ===== RECORD CARD ===== */

.cr {
  width: 172px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  /* extra bottom padding so vinyl disc can peek out */
  padding-bottom: 30px;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.cr:hover {
  transform: translateY(-6px);
}

.cr--soon {
  opacity: 0.35;
  cursor: default;
  filter: grayscale(0.5);
}
.cr--soon:hover { transform: none; }

/* ===== VINYL DISC UNDERNEATH ===== */

.cr-disc {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    #090909 0px, #181818 1.8px, #0b0b0b 3.6px
  );
  box-shadow: 0 0 0 1.5px #222, 0 4px 18px rgba(0,0,0,0.65);
  z-index: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* center label with LG signature */
.cr-disc::before {
  content: 'LG';
  position: absolute;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--rc, #7c6dfa);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.25);
  font-family: 'Dancing Script', cursive;
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* spindle hole */
.cr-disc::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #060608;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

/* sleeve lifts on hover to reveal disc */
.cr:hover .cr-inner {
  transform: translateY(-38px);
}

/* When this record is on the turntable */
.cr.cr--on-deck .cr-inner {
  opacity: 0.22;
  pointer-events: none;
}
.cr.cr--on-deck .cr-disc {
  opacity: 0;
  transform: translateX(-50%) scale(0.85);
}
.cr.cr--on-deck::after {
  content: 'on deck';
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rc);
  opacity: 0.5;
  white-space: nowrap;
}

.cr-inner {
  position: relative;
  z-index: 2;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.35s ease;
  background-color: var(--rc, #7c6dfa);
  background-image: linear-gradient(
    135deg,
    rgba(255,255,255,0.14) 0%,
    rgba(255,255,255,0.04) 35%,
    rgba(0,0,0,0.18) 100%
  );
  border-radius: 4px;
  padding: 14px 14px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.13),
    inset 0 1px 0 rgba(255,255,255,0.22),
    2px 4px 16px rgba(0,0,0,0.45);
  position: relative;
  overflow: hidden;
}

/* spine crease on left */
.cr-inner::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: rgba(0,0,0,0.22);
  border-radius: 4px 0 0 4px;
}

/* sheen on hover */
.cr-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.cr:hover .cr-inner::after {
  transform: translateX(120%);
}

.cr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.cr-icon {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.cr-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.cr-badge--active   { border-color: rgba(74,222,128,0.4);  color: #4ade80; background: rgba(74,222,128,0.1); }
.cr-badge--deployed { border-color: rgba(90,156,245,0.4);  color: #a0c8ff; background: rgba(90,156,245,0.1); }
.cr-badge--live     { border-color: rgba(245,158,11,0.4);  color: #fbbf24; background: rgba(245,158,11,0.1); }
.cr-badge--soon     { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.35); background: rgba(0,0,0,0.2); }

.cr-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.cr-desc {
  font-size: 0.66rem;
  color: rgba(255,255,255,0.58);
  line-height: 1.5;
  flex: 1;
}

.cr-stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.53rem;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.08em;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== RIGHT: TURNTABLE ===== */

.studio-deck {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.turntable {
  user-select: none;
}

/* ===== CHASSIS ===== */

.tt-chassis {
  position: relative;
  width: 264px;
  height: 228px;
  background: linear-gradient(145deg, #1c1c26 0%, #111118 60%, #18181f 100%);
  border-radius: 10px;
  border: 1px solid #2a2a3a;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0,0,0,0.7),
    0 6px 20px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3);
  overflow: visible;
}

/* subtle chassis texture */
.tt-chassis::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 3px,
    rgba(255,255,255,0.008) 3px, rgba(255,255,255,0.008) 4px
  );
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

/* ===== PLATTER ZONE ===== */

.tt-platter-zone {
  position: absolute;
  top: 28px;
  left: 14px;
}

.tt-platter {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  position: relative;
  background: #0e0e14;
  border: 2.5px solid #2a2a3c;
  box-shadow:
    0 0 0 1px #111,
    0 4px 20px rgba(0,0,0,0.6),
    inset 0 2px 6px rgba(0,0,0,0.5);
}

/* Felt mat */
.tt-felt {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #2a2a36, #1a1a22);
}

/* Vinyl record on deck */
.tt-vinyl {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    #090909 0px,
    #181818 1.8px,
    #0b0b0b 3.6px
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tt-vinyl.loaded {
  opacity: 1;
}

@keyframes platter-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.tt-platter.spinning .tt-vinyl {
  animation: platter-spin 1.8s linear infinite;
}

/* Center label */
.tt-label {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rc, #7c6dfa);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Dancing Script', cursive;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
}

/* Spindle hole */
.tt-hole {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #060608;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

/* Strobe dots ring */
.tt-strobe {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 4%,   rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.3) 1.2%, transparent 1.2%),
    radial-gradient(circle at 50% 96%,  rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.3) 1.2%, transparent 1.2%),
    radial-gradient(circle at 4%  50%,  rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.3) 1.2%, transparent 1.2%),
    radial-gradient(circle at 96% 50%,  rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.3) 1.2%, transparent 1.2%),
    radial-gradient(circle at 14% 14%,  rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 1%,   transparent 1%),
    radial-gradient(circle at 86% 14%,  rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 1%,   transparent 1%),
    radial-gradient(circle at 14% 86%,  rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 1%,   transparent 1%),
    radial-gradient(circle at 86% 86%,  rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 1%,   transparent 1%);
  pointer-events: none;
}

/* Spindle post */
.tt-spindle {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #888, #444);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ===== TONEARM ===== */
/*
  .tt-tonearm sits at the pivot point.
  .tt-arm-assy rotates with transform-origin: center 24px
    (24px from top = the pivot inside the arm)
  Parked:  rotate(24deg)  — stylus on armrest to the right
  Playing: rotate(-36deg) — stylus over outer record groove
*/

.tt-tonearm {
  position: absolute;
  top: 46px;
  left: 194px;  /* 14px + 154px platter + 26px gap */
  z-index: 5;
}

.tt-pivot-cap {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #e0e0f0, #8888aa);
  border: 1px solid rgba(80,80,112,0.55);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  top: -7px; left: -7px;
  z-index: 2;
}

.tt-arm-assy {
  position: absolute;
  left: -4px;
  top: -24px;
  width: 8px;
  height: 120px;
  transform-origin: center 24px;
  transform: rotate(24deg);
  transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tt-tonearm.playing .tt-arm-assy {
  transform: rotate(-36deg);
}

/* Counterweight shaft (rear, 0-24px) */
.tt-arm-cw {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 24px;
  background: linear-gradient(90deg, #909090, #d8d8e8, #909090);
  border-radius: 3px 3px 0 0;
}
.tt-arm-cw::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #777, #333);
  border: 1px solid #555;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Main shaft (24-103px from assy top) */
.tt-arm-shaft {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 79px;
  background: linear-gradient(90deg, #a0a0b8, #dddde8, #a0a0b8);
}
.tt-arm-shaft::before {
  content: '';
  position: absolute;
  top: 16px; bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 1.5px;
}

/* Headshell (103-120px from assy top) */
.tt-headshell {
  position: absolute;
  top: 103px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 17px;
  background: linear-gradient(180deg, #9090a8, #505068);
  border-radius: 2px 2px 5px 5px;
  border: 1px solid #404058;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.tt-headshell::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 5px;
  background: #b0b0cc;
  border-radius: 0 0 2px 2px;
}

/* ===== ARMREST POST ===== */

.tt-armrest-post {
  position: absolute;
  top: 55px;
  left: 238px;
  width: 9px;
  height: 20px;
  background: radial-gradient(circle at 40% 30%, #888, #444);
  border-radius: 4px 4px 2px 2px;
  border: 1px solid #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.tt-armrest-post::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #aaa, #555);
  border: 1px solid #333;
}

/* ===== CONTROLS ===== */

.tt-controls {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tt-start-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #444456, #1c1c28);
  border: 1.5px solid #3a3a50;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: all 0.15s ease;
}
.tt-start-btn:hover {
  border-color: #5a5a78;
  background: radial-gradient(circle at 38% 35%, #555568, #22222e);
}
.tt-start-btn:active { transform: scale(0.93); }

.tt-start-icon {
  width: 7px; height: 7px;
  background: #666677;
  border-radius: 1px;
  transition: background 0.2s, box-shadow 0.2s;
}

.tt-start-btn.playing .tt-start-icon {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
}

/* Pitch fader */
.tt-pitch-fader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tt-fader-track {
  width: 6px; height: 38px;
  background: #0e0e18;
  border: 1px solid #282838;
  border-radius: 3px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.tt-fader-thumb {
  position: absolute;
  width: 14px; height: 7px;
  background: linear-gradient(180deg, #8888a8, #4a4a68);
  border-radius: 2px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #666688;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.tt-fader-thumb::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 1px;
  background: rgba(255,255,255,0.2);
}

.tt-fader-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.42rem;
  color: #444460;
  letter-spacing: 0.1em;
}

/* Indicator dots */
.tt-indicator-row {
  display: flex;
  gap: 5px;
}

.tt-ind-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #222230;
  border: 1px solid #2a2a40;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
  transition: background 0.3s, box-shadow 0.3s;
}

.tt-ind-dot.lit {
  background: #4ade80;
  border-color: #2a7a40;
  box-shadow: 0 0 6px rgba(74,222,128,0.7), inset 0 1px 2px rgba(255,255,255,0.2);
}

/* Brand */
.tt-brand {
  position: absolute;
  bottom: 10px;
  left: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #2a2a3c;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ===== NOW PLAYING STRIP ===== */

.tt-now-playing {
  width: 264px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
}

.tt-np-idle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.tt-np-arrow {
  display: inline-block;
  animation: nudge-left 1.6s ease-in-out infinite;
}

@keyframes nudge-left {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(-4px); }
}

.tt-np-active {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.tt-np-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-np 1.8s ease-in-out infinite;
}

@keyframes pulse-np {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

.tt-np-info {
  flex: 1;
  min-width: 0;
}

.tt-np-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.tt-np-stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.tt-np-details {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(124,109,250,0.25);
  border-radius: 5px;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  letter-spacing: 0.05em;
}
.tt-np-details:hover {
  background: rgba(124,109,250,0.2);
  border-color: rgba(124,109,250,0.45);
}

/* ===== PANEL OVERLAY ===== */

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ===== DETAIL PANEL ===== */

.book-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 500px;
  max-width: 100vw;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.34, 1.1, 0.64, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.book-panel.open {
  transform: translateX(0);
}

.panel-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 1;
}
.panel-close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-hover);
}

.panel-band {
  height: 5px;
  flex-shrink: 0;
}

/* ===== MODAL RESET INSIDE PANEL ===== */

.book-panel .modal {
  position: static;
  width: 100%;
  height: auto;
  transform: none;
  border-left: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: visible;
  flex: 1;
  padding: 0;
  animation: none !important;
}

.book-panel .modal-close {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 201;
}

.book-panel .modal > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.book-panel .modal-header,
.book-panel .modal-section-label,
.book-panel .modal-pipeline,
.book-panel .modal-branches,
.book-panel .modal-chat-grid,
.book-panel .modal-tech-grid,
.book-panel .modal-role-grid,
.book-panel .modal-footer,
.book-panel .browser-mockup {
  padding-left: 32px;
  padding-right: 32px;
}

.book-panel .modal-header { padding-top: 28px; padding-bottom: 0; }
.book-panel .modal-footer { padding-bottom: 48px; }

/* ===== FOCUS-VISIBLE ===== */
:focus { outline: none; }

.cr:focus-visible {
  outline: 2px solid var(--rc, var(--accent));
  outline-offset: 3px;
  border-radius: 4px;
}

.tt-start-btn:focus-visible,
.panel-close:focus-visible,
.tt-np-details:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 50%;
}

.panel-close:focus-visible,
.tt-np-details:focus-visible {
  border-radius: var(--radius, 8px);
}

/* ===== LIGHT MODE ===== */

[data-theme="light"] .crate-interior {
  background: linear-gradient(160deg, #1a1612 0%, #141008 60%, #181410 100%);
}
[data-theme="light"] .crate-top-rail {
  background: linear-gradient(180deg, #2e2a22 0%, #201e18 55%, #1a1814 100%);
  border-bottom-color: #0c0a08;
}
[data-theme="light"] .crate-left-wall,
[data-theme="light"] .crate-right-wall {
  background: linear-gradient(90deg, #222018, #181410);
}
[data-theme="light"] .crate-base {
  background: linear-gradient(180deg, #222018 0%, #121008 100%);
}
[data-theme="light"] .crate-foot {
  background: linear-gradient(180deg, #1c1a12, #100e0a);
  border-color: #080604;
}
[data-theme="light"] .tt-chassis {
  background: linear-gradient(145deg, #2a2a38, #1c1c28);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
  .studio-stage {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }
  .studio-crate {
    width: 100%;
    max-width: 600px;
  }
  .studio-deck { width: 100%; max-width: 600px; }
}

@media (max-width: 768px) {
  /* Crate: full width, cards slightly smaller */
  .studio-crate { max-width: 100%; }
  .cr { width: 148px; }

  /* Turntable: centered, scaled down slightly to add breathing room */
  .studio-deck {
    width: 100%;
    align-items: center;
  }

  .tt-chassis {
    transform: scale(0.88);
    transform-origin: top center;
  }

  /* Compensate for scale shrink so layout doesn't leave a gap */
  .turntable {
    margin-bottom: -26px;
  }

  .tt-now-playing {
    width: 264px; /* match chassis width */
  }

  /* Detail panel full-width on mobile */
  .book-panel { width: 100vw; }

  /* Sleeve lifts on touch-hold, springs back on release */
  .cr--touch-lift:not(.cr--on-deck) .cr-inner {
    transform: translateY(-38px);
  }
}
