/* ══ FLOPPY · shell ═══════════════════════════════════════════════════════
   Room, disk caddy, CRT monitor housing, disk drive.
   The screen's *contents* live in crt.css.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Room */
  --room-0: #0a0b09;
  --room-1: #121410;
  --room-2: #1a1d18;

  /* Aged plastic hardware */
  --case-hi: #d7d0bd;
  --case:    #c2baa5;
  --case-lo: #9d9682;
  --case-dk: #6f6a5b;
  --case-ln: #4e4a3f;

  /* Phosphor */
  --p-green: #7cfc9b;
  --p-dim:   #3ea75c;
  --p-amber: #ffb454;
  --p-glow:  rgba(124, 252, 155, .35);

  --screen-bg: #08110a;

  --ink:      #e8e4d6;
  --ink-dim:  #9a958a;

  --radius: 4px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas,
          'DejaVu Sans Mono', monospace;

  --tray-w: 340px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--mono);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--room-2) 0%, var(--room-1) 45%, var(--room-0) 100%);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint dust so the flat background does not band on large screens */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--p-green); color: #000; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

.room {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(.75rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Top bar ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem .25rem 1rem;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: .55rem; }
.brand-mark {
  color: var(--p-green);
  align-self: center;
  display: flex;
  filter: drop-shadow(0 0 6px var(--p-glow));
}
.brand-name {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--ink);
}
.brand-sub { font-size: .7rem; letter-spacing: .18em; color: var(--ink-dim); }

.topbar-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.topbar-links a {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-dim);
  border: 1px solid #2b2f28;
  background: #14170f;
  padding: .42rem .7rem;
  border-radius: var(--radius);
  transition: color .15s, border-color .15s, background .15s;
}
.topbar-links a:hover, .topbar-links a:focus-visible {
  color: var(--p-green); border-color: var(--p-dim); background: #182015;
}

/* ── Workstation grid ────────────────────────────────────────────────── */

.workstation {
  display: grid;
  grid-template-columns: var(--tray-w) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
  flex: 1;
}

/* ── Disk caddy ──────────────────────────────────────────────────────── */

.caddy { position: sticky; top: 1rem; }

.caddy-head { padding: 0 .25rem .6rem; }
.caddy-title {
  margin: 0;
  font-size: .78rem; letter-spacing: .22em; font-weight: 700;
  color: var(--p-green);
  text-shadow: 0 0 10px var(--p-glow);
}
.caddy-hint {
  margin: .3rem 0 0;
  font-size: .7rem;
  color: var(--ink-dim);
  letter-spacing: .06em;
}

/* The physical box the disks stand in */
.caddy-box {
  position: relative;
  background: linear-gradient(180deg, #2a2d24 0%, #1c1f18 100%);
  border: 1px solid #3a3e33;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: .7rem .55rem .55rem;
  box-shadow:
    inset 0 14px 22px -14px rgba(0,0,0,.95),
    0 18px 40px -22px rgba(0,0,0,.9);
}

.caddy-rail {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(62dvh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: #4a4f42 transparent;
}
.caddy-rail::-webkit-scrollbar { width: 8px; }
.caddy-rail::-webkit-scrollbar-thumb { background: #4a4f42; border-radius: 4px; }
.caddy-rail:focus-visible {
  outline: 2px solid var(--p-green);
  outline-offset: 3px;
  border-radius: 3px;
}

.rail-group {
  font-size: .62rem; letter-spacing: .2em; color: var(--ink-dim);
  padding: .7rem .3rem .25rem;
  border-bottom: 1px dashed #3a3e33;
  margin-bottom: 3px;
}
.rail-group:first-child { padding-top: .1rem; }

/* ── A single 3.5-inch floppy ────────────────────────────────────────── */

.disk {
  --d: #2f333a;             /* shell colour, overridden per disk */
  --d-lo: #21242a;
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: .5rem .6rem .5rem .5rem;
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 3px;
  color: #f2efe6;
  background: linear-gradient(160deg, var(--d) 0%, var(--d-lo) 100%);
  box-shadow: 0 2px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.13);
  transition: transform .13s ease, box-shadow .13s ease, filter .13s ease;
  transform: translateX(0);
}
.disk:hover { transform: translateX(7px); filter: brightness(1.14); }
.disk:focus-visible { outline: 2px solid var(--p-green); outline-offset: 2px; }
.disk[aria-selected="true"] {
  transform: translateX(14px);
  box-shadow:
    0 2px 0 rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.18),
    -3px 0 0 var(--p-green),
    0 0 18px -2px var(--p-glow);
}

/* The metal shutter and hub, drawn in CSS */
.disk-shutter {
  position: relative;
  width: 30px; height: 30px;
  border-radius: 2px;
  background: linear-gradient(155deg, #e3e6ea, #a9aeb5 55%, #85898f);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
  flex: none;
}
.disk-shutter::before {           /* shutter window */
  content: '';
  position: absolute; left: 4px; top: 5px;
  width: 11px; height: 20px;
  background: linear-gradient(180deg, #4a4e54, #2c2f34);
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4);
}
.disk-shutter::after {            /* notch */
  content: '';
  position: absolute; right: 3px; top: 11px;
  width: 6px; height: 8px;
  background: rgba(0,0,0,.28);
  border-radius: 1px;
}

.disk-label { min-width: 0; }
.disk-name {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disk-meta {
  display: block;
  font-size: .62rem;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}

.disk-badge {
  font-size: .55rem;
  letter-spacing: .12em;
  padding: .16rem .34rem;
  border-radius: 2px;
  background: rgba(0,0,0,.42);
  color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.14);
  flex: none;
}
.disk-badge[data-kind="info"] {
  background: rgba(255,180,84,.2);
  color: #ffd9a3;
  border-color: rgba(255,180,84,.4);
}
.disk-badge[data-kind="hi"] {
  background: rgba(124,252,155,.16);
  color: var(--p-green);
  border-color: rgba(124,252,155,.35);
}

.caddy-foot {
  margin: .6rem .25rem 0;
  font-size: .64rem;
  color: var(--ink-dim);
  letter-spacing: .06em;
}
kbd {
  font: inherit; font-size: .62rem;
  border: 1px solid #3a3e33; border-bottom-width: 2px;
  border-radius: 3px; padding: 0 .3rem;
  background: #191c15; color: var(--ink-dim);
  margin-right: 2px;
}

/* ── Monitor ─────────────────────────────────────────────────────────── */

.rig { display: flex; flex-direction: column; gap: 0; min-width: 0; }

.monitor {
  background: linear-gradient(178deg, var(--case-hi) 0%, var(--case) 38%, var(--case-lo) 100%);
  border-radius: 16px 16px 8px 8px;
  padding: clamp(.8rem, 1.6vw, 1.35rem);
  padding-bottom: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -2px 6px rgba(0,0,0,.25),
    0 30px 60px -30px rgba(0,0,0,.95),
    0 2px 0 rgba(0,0,0,.4);
  border: 1px solid var(--case-dk);
}

.monitor-bezel {
  background: linear-gradient(170deg, #4a4638, #38352b);
  border-radius: 10px;
  padding: clamp(.5rem, 1vw, .8rem);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.75);
}

.monitor-chin {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .3rem .7rem;
}
.plaque {
  font-size: .66rem; letter-spacing: .24em; font-weight: 700;
  color: var(--case-ln);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.chin-spacer { flex: 1; }

.chin-btn {
  font: inherit; font-size: .58rem; letter-spacing: .14em;
  cursor: pointer;
  padding: .3rem .5rem;
  color: var(--case-ln);
  background: linear-gradient(180deg, var(--case-hi), var(--case-lo));
  border: 1px solid var(--case-dk);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 0 rgba(0,0,0,.3);
}
.chin-btn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.4); transform: translateY(1px); }
.chin-btn[aria-pressed="true"] {
  color: #1d3d24;
  background: linear-gradient(180deg, #b9d6a8, #94b585);
}
.chin-btn:focus-visible { outline: 2px solid #2f4a33; outline-offset: 2px; }

.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6dff8f;
  box-shadow: 0 0 8px 1px rgba(109,255,143,.75), inset 0 0 2px rgba(255,255,255,.9);
}

/* ── Drive ───────────────────────────────────────────────────────────── */

.drive {
  margin: .55rem 0 0;
  background: linear-gradient(178deg, var(--case) 0%, var(--case-lo) 60%, var(--case-dk) 100%);
  border: 1px solid var(--case-dk);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 16px 34px -22px rgba(0,0,0,.9);
}
.drive-face {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(.8rem, 1.6vw, 1.35rem);
}

.drive-slot {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(180deg, #201f1a, #35332b);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
  position: relative;
  display: flex; align-items: flex-end;
}

/* The disk sticking out of the slot once one is loaded */
.drive-disk {
  --d: #2f333a;
  width: 100%;
  height: 26px;
  margin: 0 6px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--d), rgba(0,0,0,.4));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 -3px 10px rgba(0,0,0,.5);
  transform: translateY(0);
  transition: transform .32s cubic-bezier(.22,1.2,.36,1);
  display: flex; align-items: center; padding: 0 .6rem;
}
.drive-disk[data-empty="true"] { transform: translateY(30px); }
.drive-disk-label {
  font-size: .62rem; letter-spacing: .16em; font-weight: 600;
  color: rgba(255,255,255,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.drive-side { display: flex; align-items: center; gap: .7rem; }
.drive-led {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4a3a1c;
  transition: background .1s, box-shadow .1s;
}
.drive-led[data-on="true"] {
  background: #ffb454;
  box-shadow: 0 0 9px 1px rgba(255,180,84,.85);
}

.eject {
  width: 34px; height: 26px;
  cursor: pointer;
  display: grid; place-items: center; gap: 2px;
  padding: 4px 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--case-hi), var(--case-lo));
  border: 1px solid var(--case-dk);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 0 rgba(0,0,0,.35);
}
.eject:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.45); }
.eject:focus-visible { outline: 2px solid #2f4a33; outline-offset: 2px; }
.eject-tri {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 7px solid var(--case-ln);
}
.eject-bar { width: 11px; height: 2.5px; background: var(--case-ln); border-radius: 1px; }

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer { padding: 1.5rem .25rem .75rem; }
.footer-legal {
  margin: 0;
  font-size: .64rem;
  line-height: 1.65;
  color: #63605a;
  letter-spacing: .03em;
  max-width: 74ch;
}
.footer-legal a { color: #7d7a72; }

/* ── Mobile jump button ──────────────────────────────────────────────── */

.to-disks {
  display: none;
  position: fixed;
  right: .8rem; bottom: .8rem;
  z-index: 40;
  font: inherit; font-size: .62rem; letter-spacing: .16em;
  padding: .6rem .8rem;
  color: #08110a; background: var(--p-green);
  border: none; border-radius: 4px;
  box-shadow: 0 6px 20px -6px rgba(0,0,0,.9);
  cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 940px) {
  .workstation { grid-template-columns: 1fr; }
  .caddy { position: static; order: 2; }
  .rig { order: 1; }
  .caddy-rail { max-height: none; }
  .to-disks { display: block; }
  .disk:hover { transform: none; }
  .disk[aria-selected="true"] {
    transform: none;
    box-shadow: 0 2px 0 rgba(0,0,0,.5), inset 0 0 0 1px var(--p-green);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* Turnstile container. With `appearance: interaction-only` this draws nothing
   unless a human actually has to click something, but it must sit in normal
   layout — Turnstile will not reliably run inside a container it considers
   hidden, which is why this is not parked off-screen. */
#ts-host {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 60;
}
