/* ============================================================
   TOMMY 50 – MACHINE CHROME
   Shared across all pages. Every page IS the machine.
   The machine always fills the full viewport (100vw × 100vh).
   ============================================================ */

/* ---- Outer wrap ---- */
.machine-outer {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: linear-gradient(165deg, #0c4a78 0%, #1a6fa8 35%, #2994d4 65%, #4db8e8 100%);
  padding: 0;
  overflow: hidden;
}

/* ---- Sky decorations (sun + drifting clouds) ---- */
.sky-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sky-sun {
  position: absolute;
  top: clamp(16px, 3.5vh, 36px);
  right: clamp(40px, 7vw, 100px);
  width: clamp(36px, 5.5vw, 64px);
  height: clamp(36px, 5.5vw, 64px);
  background: #FFE566;
  box-shadow:
    0 0 0 clamp(5px, .8vw, 10px) rgba(255,229,102,.30),
    0 0 0 clamp(10px,1.6vw, 20px) rgba(255,229,102,.14),
    0 0 clamp(30px,5vw,60px) rgba(255,210,30,.55);
  animation: sun-pulse 5s ease-in-out infinite;
}
@keyframes sun-pulse {
  0%,100% { box-shadow: 0 0 0 clamp(5px,.8vw,10px) rgba(255,229,102,.30), 0 0 0 clamp(10px,1.6vw,20px) rgba(255,229,102,.14), 0 0 clamp(30px,5vw,60px) rgba(255,210,30,.55); }
  50%      { box-shadow: 0 0 0 clamp(7px,1vw,13px) rgba(255,229,102,.40), 0 0 0 clamp(14px,2vw,26px) rgba(255,229,102,.20), 0 0 clamp(50px,7vw,90px) rgba(255,210,30,.70); }
}

/* Shared cloud base */
.sky-cloud {
  position: absolute;
  background: rgba(255,255,255,.88);
  image-rendering: pixelated;
}

/* Cloud 1 — large, slow, mid-height */
.sky-cloud-1 {
  top: 22%;
  width: clamp(60px, 9vw, 120px);
  height: clamp(14px, 2vw, 26px);
  box-shadow:
    clamp(12px,2vw,24px)  calc(clamp(-12px,-2vw,-24px)) 0 rgba(255,255,255,.88),
    clamp(24px,4vw,48px)  calc(clamp(-16px,-2.5vw,-32px)) 0 rgba(255,255,255,.88),
    clamp(36px,6vw,72px)  calc(clamp(-12px,-2vw,-24px)) 0 rgba(255,255,255,.88),
    clamp(48px,8vw,96px)  0 0 rgba(255,255,255,.78),
    clamp(60px,9vw,120px) 0 0 rgba(255,255,255,.65);
  animation: cloud-drift 50s linear infinite;
  animation-delay: -14s;
}

/* Cloud 2 — medium, faster, higher */
.sky-cloud-2 {
  top: 9%;
  width: clamp(40px, 6vw, 80px);
  height: clamp(10px, 1.5vw, 18px);
  box-shadow:
    clamp(8px,1.4vw,18px)  calc(clamp(-8px,-1.4vw,-18px)) 0 rgba(255,255,255,.80),
    clamp(18px,3vw,40px)   calc(clamp(-12px,-2vw,-24px)) 0 rgba(255,255,255,.80),
    clamp(30px,5vw,60px)   calc(clamp(-8px,-1.4vw,-18px)) 0 rgba(255,255,255,.72),
    clamp(40px,6vw,80px)   0 0 rgba(255,255,255,.60);
  animation: cloud-drift 34s linear infinite;
  animation-delay: -28s;
}

/* Cloud 3 — small, medium speed, lower */
.sky-cloud-3 {
  top: 38%;
  width: clamp(28px, 4vw, 56px);
  height: clamp(8px, 1.2vw, 14px);
  box-shadow:
    clamp(8px,1.2vw,16px)  calc(clamp(-8px,-1.2vw,-16px)) 0 rgba(255,255,255,.75),
    clamp(16px,2.5vw,32px) calc(clamp(-10px,-1.6vw,-20px)) 0 rgba(255,255,255,.75),
    clamp(24px,3.8vw,48px) 0 0 rgba(255,255,255,.60),
    clamp(32px,5vw,64px)   0 0 rgba(255,255,255,.45);
  animation: cloud-drift 42s linear infinite;
  animation-delay: -5s;
}

@keyframes cloud-drift {
  from { transform: translateX(-160px); }
  to   { transform: translateX(110vw);  }
}

/* ---- Machine body ---- */
.machine {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: transparent;
  position: relative;
  box-shadow:
    inset 3px 3px 0 rgba(26,58,92,.6),
    inset -3px -3px 0 rgba(6,24,40,.6),
    0 0 80px rgba(0,0,0,.4);
  border: 4px solid #061828;
}

/* ---- Top nameplate ---- */
.machine-nameplate {
  flex-shrink: 0;
  background: #0d2d52;
  border-bottom: clamp(2px, .4vh, 4px) solid #061828;
  padding: clamp(5px, .8vh, 10px) clamp(12px, 2vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.5);
}
.nameplate-brand {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.1vw, 12px);
  color: var(--gold);
  letter-spacing: .12em;
  text-shadow: 1px 1px 0 #5a3a00, 0 0 12px rgba(201,168,76,.4);
}
.nameplate-leds { display: flex; gap: clamp(4px, .6vw, 8px); align-items: center; }
.nled { width: clamp(8px, 1vw, 12px); height: clamp(8px, 1vw, 12px); border: 2px solid rgba(0,0,0,.6); }
.nled-r { background: #900; box-shadow: 0 0 8px #f00; }
.nled-y { background: #660; box-shadow: 0 0 8px #cc0; animation: nled-pulse 2.1s steps(1) infinite; }
.nled-g { background: #060; box-shadow: 0 0 10px #0f0; animation: nled-pulse 1.3s steps(1) infinite; }
@keyframes nled-pulse { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ---- Marquee (flex-shrink so it doesn't grow) ---- */
.marquee-strip { flex-shrink: 0; }

/* ---- Monitor section (fills all remaining space) ---- */
.machine-monitor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: clamp(8px, 1.5vh, 16px) clamp(12px, 2vw, 24px) clamp(6px, 1vh, 12px);
  border-bottom: clamp(3px, .6vh, 6px) solid #061828;
}

/* Thick CRT bezel */
.monitor-bezel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0a1828;
  border: clamp(3px, .5vh, 6px) solid #0a0806;
  box-shadow:
    inset 0 0 0 3px #1e1810,
    inset 0 0 12px rgba(0,0,0,.5),
    4px 4px 0 #000,
    0 0 0 1px #2a1e10;
  padding: clamp(5px, .8vh, 10px);
  position: relative;
}
.monitor-bezel::before,
.monitor-bezel::after {
  content: '✦'; position: absolute;
  font-size: clamp(6px, .8vw, 8px); color: #2a1e10; line-height: 1;
}
.monitor-bezel::before { top: clamp(3px, .5vh, 6px); left: clamp(4px, .6vw, 8px); }
.monitor-bezel::after  { bottom: clamp(3px, .5vh, 6px); right: clamp(4px, .6vw, 8px); }

/* The CRT screen itself */
.crt-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #0c4a78 0%, #1a6fa8 35%, #2994d4 65%, #4db8e8 100%);
  position: relative;
  overflow: hidden;
}

/* Scanlines overlay — disabled */
.crt-screen::before {
  display: none;
}
/* CRT vignette — disabled */
.crt-screen::after {
  display: none;
}

/* Screen content — fills the CRT, scrolls internally */
.screen-content {
  flex: 1;
  min-height: 0;
  position: relative; z-index: 10;
  padding: clamp(12px, 2.5vh, 28px) clamp(14px, 2.5vw, 32px);
  overflow-y: auto;
}

/* ---- Console deck — lives below the viewport (off-canvas) ---- */
/* Positioned absolutely so it doesn't affect the flex layout.          */
/* machine-outer's overflow:hidden clips it out of view.                */
.machine-deck {
  position: absolute;
  top: 100%;           /* immediately below the machine's 100vh boundary */
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 160px 1fr 180px;
  border-top: 3px solid #2a1e10;
  min-height: 150px;
  max-height: 180px;
}
@media(max-width:640px) {
  .machine-deck { grid-template-columns: 80px 1fr 120px; }
}

/* Left: speaker */
.deck-speaker {
  background: #142040;
  border-right: 4px solid #0d0a06;
  padding: 14px 14px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
}
.speaker-label {
  font-family: 'Press Start 2P', monospace; font-size: 6px;
  letter-spacing: .12em; color: rgba(201,168,76,.25); text-transform: uppercase;
  writing-mode: vertical-rl; transform: rotate(180deg);
}
.speaker-grille {
  flex: 1; width: 100%;
  background-image: radial-gradient(circle, #2e2218 1.8px, transparent 1.8px);
  background-size: 9px 9px;
  border: 2px solid #2a1e10;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.8);
}

/* Center: tape drive */
.deck-center {
  background: #1a2e50;
  padding: 14px 20px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
}
.tape-drive {
  width: 100%; background: #0a1828;
  border: 4px solid #2a1e10;
  box-shadow: inset 3px 3px 0 rgba(0,0,0,.8), inset -1px -1px 0 rgba(255,255,255,.03);
  display: flex; flex-direction: column; gap: 0;
}
.tape-drive-label {
  background: #0c1e38; border-bottom: 2px solid #1a3a5a;
  padding: 5px 10px;
  font-family: 'Press Start 2P', monospace; font-size: 6px;
  letter-spacing: .1em; color: rgba(201,168,76,.35); text-align: center;
}
.tape-slot-opening {
  height: 30px; background: #000; margin: 10px 10px;
  border: 3px solid #1a1208;
  box-shadow: inset 4px 4px 0 rgba(0,0,0,.95), inset -1px -1px 0 rgba(255,255,255,.02);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.tape-slot-txt {
  font-family: 'Press Start 2P', monospace; font-size: 6px;
  letter-spacing: .1em; color: rgba(201,168,76,.18);
  animation: slot-blink 1.6s steps(1) infinite;
}
@keyframes slot-blink { 0%,100%{opacity:1} 50%{opacity:0} }
.tape-slot-opening.loaded .tape-slot-txt {
  color: #4ade80; text-shadow: 0 0 6px rgba(74,222,128,.6); animation: none;
}
.drive-leds { display: flex; gap: 8px; padding: 6px 10px 10px; justify-content: center; }
.d-led { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.d-led-dot { width: 8px; height: 8px; border: 2px solid rgba(0,0,0,.5); }
.d-led-lbl {
  font-family: 'Press Start 2P', monospace; font-size: 4px;
  color: rgba(245,237,216,.2); letter-spacing: .05em;
}
.d-pwr  { background: #060; box-shadow: 0 0 5px #0f0; }
.d-rdy  { background: #2a1a00; }
.d-rdy.active { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.d-err  { background: #200; }

/* Right: nav buttons */
.deck-nav {
  background: #142040; border-left: 4px solid #0a1828;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
}
.deck-nav-title {
  font-family: 'Press Start 2P', monospace; font-size: 5px;
  letter-spacing: .12em; color: rgba(201,168,76,.2); text-transform: uppercase;
  margin-bottom: 2px;
}
.nav-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: #0a1828; border: 2px solid #1a3a5a;
  padding: 7px 10px; cursor: pointer; text-decoration: none;
  box-shadow: 2px 2px 0 #000;
  transition: box-shadow .08s, transform .08s;
}
.nav-btn:hover { border-color: var(--gold); box-shadow: 3px 3px 0 #5a3a00; }
.nav-btn:active { transform: translate(2px,2px); box-shadow: 0 0; }
.nav-btn.active { border-color: var(--gold); background: rgba(201,168,76,.08); }
.nav-btn__dot { width: 8px; height: 8px; background: rgba(201,168,76,.3); flex-shrink: 0; }
.nav-btn.active .nav-btn__dot { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.nav-btn__lbl {
  font-family: 'Press Start 2P', monospace; font-size: clamp(6px, 1vw, 8px);
  letter-spacing: .1em; color: rgba(245,237,216,.82); text-transform: uppercase;
}
.nav-btn:hover .nav-btn__lbl { color: var(--gold); }
.nav-btn.active .nav-btn__lbl { color: var(--gold); }

/* ---- Bottom strip ---- */
.machine-bottom {
  flex-shrink: 0;
  background: #0d2440;
  border-top: 2px solid #3a2c14;
  box-shadow: inset 0 1px 0 rgba(201,168,76,.14), inset 0 -1px 0 rgba(0,0,0,.6);
  padding: clamp(4px, .7vh, 9px) clamp(12px, 2vw, 24px);
  display: flex; justify-content: space-between; align-items: center;
}
.machine-serial {
  font-family: 'Press Start 2P', monospace; font-size: clamp(6px, .9vw, 8px);
  letter-spacing: .14em; color: rgba(201,168,76,.85);
  text-shadow: 0 0 10px rgba(201,168,76,.45), 0 1px 0 rgba(0,0,0,.8);
}

/* ============================================================
   SHARED SCREEN ELEMENTS
   ============================================================ */
.scr-header { text-align: center; margin-bottom: clamp(10px, 2.5vh, 24px); }
.scr-badge {
  font-family: 'Press Start 2P', monospace; font-size: clamp(6px, 1vw, 9px);
  letter-spacing: .15em; color: rgba(201,168,76,.85); text-transform: uppercase;
  display: block; margin-bottom: clamp(5px, 1vh, 10px);
}
.scr-title {
  font-family: 'VT323', monospace; font-size: clamp(48px, 10vw, 120px);
  line-height: .88; color: var(--gold); letter-spacing: .04em;
  text-shadow: 3px 3px 0 #5a3a00, 6px 6px 0 #1a0800, 0 0 30px rgba(201,168,76,.35);
}
.scr-divider {
  width: 100%; height: 2px; background: var(--gold); margin: clamp(8px, 2vh, 20px) 0;
  box-shadow: 0 2px 0 #000, 0 0 8px rgba(201,168,76,.3);
}

.px-card {
  background: rgba(20,65,125,.6); border: 2px solid rgba(201,168,76,.22);
  padding: clamp(10px, 2vh, 20px) clamp(10px, 1.5vw, 18px);
  box-shadow: 3px 3px 0 #000;
  display: flex; flex-direction: column; gap: clamp(6px, 1vh, 10px);
}
.px-card__label {
  font-family: 'Press Start 2P', monospace; font-size: clamp(6px, .9vw, 8px);
  letter-spacing: .1em; text-transform: uppercase; color: rgba(201,168,76,.8);
}
.px-card__title {
  font-family: 'VT323', monospace; font-size: clamp(28px, 4.5vw, 48px);
  color: var(--gold); line-height: 1; text-shadow: 2px 2px 0 #5a3a00;
}
.px-card__body {
  font-family: 'Outfit', sans-serif; font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 400; line-height: 1.7; color: rgba(245,237,216,.9);
}
.px-card__body strong { color: var(--cream); font-weight: 600; }

.scr-btn {
  display: inline-block; font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.1vw, 11px); letter-spacing: .1em; text-transform: uppercase;
  padding: clamp(8px, 1.5vh, 14px) clamp(14px, 2vw, 26px);
  cursor: pointer; text-decoration: none;
  box-shadow: 4px 4px 0 #000; transition: background .12s, box-shadow .12s, transform .08s;
  border: 2px solid;
  appearance: none; -webkit-appearance: none;
}
.scr-btn:active { box-shadow: 0 0; transform: translate(4px,4px); }
.scr-btn-gold { background: var(--gold); border-color: #5a3a00; color: #000; }
.scr-btn-gold:hover { box-shadow: 4px 4px 0 #5a3a00; }
.scr-btn-outline { background: transparent; border-color: var(--gold); color: var(--gold); }
.scr-btn-outline:hover { background: rgba(201,168,76,.12); box-shadow: 4px 4px 0 rgba(201,168,76,.3); }
