/* Disk. The page is a drive: one slot, one disk in it, a panel that reads it, and a tray of the
   rest along the bottom. Nothing scrolls on desktop except the tray, which is a grid child and
   therefore needs min-height:0 or it grows the page instead of scrolling inside its box. */

:root {
  --ink: #050505;
  --panel: #0c0c0c;
  --steel: #141414;
  --line: #1e1e1e;
  --lime: #c8ff00;
  --text: #e8eef0;
  --dim: #7b7b7b;
  --faint: #4a4a4a;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100dvh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.mono { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.dim { color: var(--faint); }

/* ------------------------------------------------------------------------ header --- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
#mark { width: 40px; height: 40px; flex: none; }
#mark svg { width: 100%; height: 100%; display: block; }
h1 { font-size: 21px; font-weight: 300; letter-spacing: 0.38em; text-indent: 0.38em; line-height: 1; }
.meta { color: var(--dim); margin-top: 7px; }
.tag { color: var(--faint); border: 1px solid var(--line); padding: 7px 11px; white-space: nowrap; }
.tag.on { color: var(--lime); border-color: #2c3a00; }

/* -------------------------------------------------------------------------- main --- */
main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }

#bay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0; padding: 26px; border-right: 1px solid var(--line); overflow: hidden;
}

/* The drive itself: a steel bay with a throat cut across it. */
#drive {
  width: min(100%, 620px); background: var(--steel);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: inset 0 1px 0 #262626, 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
#throat {
  position: relative; height: 250px; background: #080808;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
/* The disk rides a carriage so "inserted" and "ejected" are one transform, not two states. */
#carriage {
  position: absolute; left: 50%; bottom: -40px; width: 300px; height: 300px;
  transform: translate(-50%, 0);
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
#carriage.out { transform: translate(-50%, 66px); }
#disk { width: 100%; height: 100%; filter: drop-shadow(0 10px 24px rgba(0,0,0,.7)); }
#disk svg { width: 100%; height: 100%; display: block; }
/* The lip of the slot sits in front of the disk, so it reads as inserted rather than pasted on. */
#lip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 84px;
  background: linear-gradient(180deg, #101010 0%, #171717 40%, #0d0d0d 100%);
  border-top: 1px solid #242424;
}
#lip::after {
  content: ""; position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  width: 330px; height: 13px; border-radius: 7px;
  background: #030303; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
}
#face {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; background: var(--panel);
}
#face .mono { color: var(--dim); }

#controls { display: flex; gap: 10px; padding-top: 26px; }
button {
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text); background: #131313;
  border: 1px solid var(--line); padding: 11px 20px; cursor: pointer; transition: all .15s;
}
button:hover { border-color: #3a4a00; color: var(--lime); }
#btnEject { min-width: 120px; }

/* ------------------------------------------------------------------------- panel --- */
#panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }

.leds { padding: 22px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 13px; }
.led { display: flex; align-items: center; gap: 12px; }
.led .k { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); width: 78px; flex: none; }
.led .dot { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; flex: none; }
.led.on .dot { background: var(--lime); box-shadow: 0 0 10px rgba(200, 255, 0, .7); }
.led .v { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.led.on .v { color: var(--text); }

.readout { padding: 20px 24px; overflow-y: auto; min-height: 0; }
.readout::-webkit-scrollbar { width: 6px; }
.readout::-webkit-scrollbar-thumb { background: var(--line); }
.rid { font-size: 30px; font-weight: 200; letter-spacing: .04em; }
.rsub { margin-top: 5px; color: var(--faint); }
.rows { margin-top: 18px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; gap: 12px; background: var(--panel); padding: 9px 12px; }
.rows dt { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.rows dd { font-family: var(--mono); font-size: 12px; color: var(--text); }
.rows dd.lime { color: var(--lime); }
.note { padding: 16px 24px; border-top: 1px solid var(--line); line-height: 1.7; text-transform: none; letter-spacing: .02em; font-size: 11px; }

/* --------------------------------------------------------------------------- tray --- */
footer { border-top: 1px solid var(--line); display: grid; grid-template-rows: auto auto; }
.trayhead { display: flex; justify-content: space-between; padding: 11px 28px; color: var(--faint); }
#tray {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 28px 20px;
  scrollbar-width: thin;
}
#tray::-webkit-scrollbar { height: 6px; }
#tray::-webkit-scrollbar-thumb { background: var(--line); }
.chip {
  width: 54px; height: 54px; flex: none; cursor: pointer; opacity: .45;
  transition: opacity .15s, transform .15s;
}
.chip:hover { opacity: 1; transform: translateY(-3px); }
.chip.sel { opacity: 1; transform: translateY(-3px); }
.chip svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------------- mobile --- */
@media (max-width: 900px) {
  html, body { height: auto; overflow: auto; overflow-x: hidden; }
  body { display: block; }
  main { display: block; }
  header { padding: 16px 18px; flex-wrap: wrap; row-gap: 12px; }
  .brand { width: 100%; }
  header .tag { width: 100%; text-align: center; }
  h1 { font-size: 18px; }
  #bay { padding: 22px 18px 26px; border-right: 0; display: block; }
  #drive { width: 100%; margin: 0 auto; }
  #throat { height: 215px; }
  #carriage { width: 250px; height: 250px; bottom: -34px; }
  #controls { justify-content: center; padding-top: 18px; }
  #panel { display: block; border-top: 1px solid var(--line); }
  .readout { overflow: visible; }
  .trayhead, #tray { padding-left: 18px; padding-right: 18px; }
}
