/* GE97 · Commodore 64 exhibit.
 *
 * The design language is the Computer Room's, shared with the Macintosh
 * exhibit next door: the dark ground with its faint centre glow, purple for
 * eyebrows, cyan for links and for the selected state, Georgia for headings
 * and Courier for everything else, hairline rules in #514150. Only the
 * machine itself is different — a browner beige than the Mac's, and the
 * screen carries the C64's own sixteen colours.
 */
*{box-sizing:border-box}
:root{
  color-scheme:dark;
  --purple:#cf58f2; --cyan:#85e8ec; --paper:#f0e9d7;
  --ground:#100d13; --rule:#514150; --dim:#c4b9c3; --dimmer:#9d899b;
  --case:#cfc6ae; --case-hi:#e6dfc6; --case-lo:#a79e86; --case-edge:#8d8471;
  --btn:#241c29; --btn-edge:#70556b; --btn-on:#493046;
  --mono:"Courier New",monospace; --serif:Georgia,serif;
}
body{
  margin:0;background:var(--ground);color:var(--paper);font-family:var(--mono);
  background-image:radial-gradient(ellipse at 50% 45%,#2b2430 0,transparent 60%);
  -webkit-text-size-adjust:100%;
}
button,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;font-family:inherit}
a{color:var(--cyan);text-underline-offset:4px}
button:focus-visible,a:focus-visible,summary:focus-visible,label:focus-visible{outline:2px solid var(--cyan);outline-offset:4px}

/* ---- room furniture, identical to the Macintosh exhibit ---- */
.museum-header{padding:20px max(24px,calc((100% - 1056px)/2));border-bottom:1px solid var(--rule);
  display:flex;align-items:center;gap:18px;font-size:12px;letter-spacing:1px}
.museum-header>a:first-child{font-size:26px;font-weight:bold;color:var(--purple);
  text-decoration:none;text-shadow:2px 2px #521e63}
.museum-header>span{color:#bcabbd}
.museum-header .back-link{margin-left:auto}
main{max-width:1056px;margin:auto;padding:0 28px}

.exhibit-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:45px 0 28px}
.eyebrow{font-size:11px;letter-spacing:2px;color:var(--purple);margin:0 0 15px}
.exhibit-heading h1{font-family:var(--serif);font-size:clamp(36px,6vw,66px);font-weight:normal;
  letter-spacing:-2px;margin:0 0 10px}
.dek{font-size:14px;color:#c2b7bf;margin:0;max-width:52ch}
.year{font-size:49px;color:#9b8194;letter-spacing:-4px;border-left:1px solid #655060;padding-left:25px;flex:none}

/* ---- choosing a program ---- */
.mode-controls{max-width:730px;margin:18px auto 0;display:flex;flex-direction:column;gap:8px}
.mode-controls .group{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.mode-controls .grouplabel{margin:0;width:48px;flex:none;font-size:10px;letter-spacing:2px;color:var(--purple)}
.mode-controls button,.visitor-controls button,.file-label{
  background:var(--btn);color:var(--paper);border:1px solid var(--btn-edge);
  min-height:40px;padding:9px 13px;font:12px var(--mono);letter-spacing:.06em;display:inline-flex;
  align-items:center}
.mode-controls button:hover,.visitor-controls button:hover,.file-label:hover{background:var(--btn-on);border-color:var(--purple)}
.mode-controls button[aria-pressed=true]{border-color:var(--cyan);color:var(--cyan);background:#36283b}
#btn-sound[aria-pressed=true]{border-color:var(--cyan);color:var(--cyan);background:#36283b}
#mode-description{margin:4px 0 0;font-size:11px;line-height:1.6;color:var(--dim)}
#mode-description strong{color:var(--paper)}

/* ---- the machine ---- */
.workbench{padding:25px 20px 0;position:relative}
.workbench:after{content:"";position:absolute;bottom:0;left:3%;right:3%;height:30%;
  border-bottom:1px solid #6b5a4a;background:radial-gradient(ellipse at bottom,#6b5a4a44,transparent 65%);z-index:-1}
.machine{max-width:700px;margin:auto;border-radius:20px 20px 10px 10px;padding:34px 36px 0;
  background:linear-gradient(100deg,var(--case-lo),var(--case-hi) 13%,var(--case) 83%,var(--case-lo));
  box-shadow:inset 3px 2px 2px #f3ecd6,inset -4px -2px 3px #8b8370,16px 19px 35px #0008;
  border:1px solid #bdb49c}
.bezel{background:#3b3630;padding:16px 18px 20px;border-radius:16px 16px 22px 22px;
  box-shadow:inset 2px 5px 9px #14110e,inset -1px -2px 3px #6d655a;border-bottom:2px solid #5d564c}
.screen-viewport{position:relative;background:#000;border-radius:6px;overflow:hidden;display:flex;justify-content:center}
#screen{display:block;width:100%;height:auto;image-rendering:pixelated}
.screen-viewport .overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:14px;background:#0a0a1eee;color:#cfcdf2;text-align:center;padding:24px;font-size:13px}
.screen-viewport .overlay[hidden]{display:none}
.screen-viewport .overlay strong{font-size:22px;letter-spacing:.1em}
.screen-viewport .overlay p{margin:0;line-height:1.6;font-size:12px;color:#b9b7dd}
.screen-viewport .overlay button{padding:10px 18px;border:1px solid #cfcdf2;background:transparent;
  color:#cfcdf2;font:12px var(--mono);letter-spacing:.08em;min-height:40px}
.screen-viewport .overlay button:hover{background:#cfcdf2;color:#12112a}

.case-bottom{display:flex;align-items:center;gap:18px;padding:22px 2px 24px}
.case-badge{display:flex;align-items:center;gap:9px;font-size:13px;letter-spacing:.04em;color:#5f5949}
.palette-mark{width:15px;height:15px;border-radius:50%;flex:none;
  background:conic-gradient(#813338,#edf171,#56ac4d,#75cec8,#706deb,#8e3c97,#813338)}
.case-keys{flex:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(9px,1fr));gap:3px;opacity:.45}
.case-keys span{height:9px;background:var(--case-edge);border-radius:2px}
.machine-foot{height:16px;max-width:620px;width:88%;margin:auto;
  background:linear-gradient(#7f7763,#ada58c);border-radius:0 0 4px 4px;box-shadow:8px 10px 15px #000a}

.status-line{max-width:730px;margin:18px auto 0;font-size:11px;color:var(--dimmer);
  display:flex;gap:18px;flex-wrap:wrap;justify-content:center;letter-spacing:.04em}
.status-line b{font-weight:bold;color:var(--paper)}

/* ---- the screen takes the keyboard ---- */
#screen{outline:none}
#screen:focus-visible,#screen:focus{box-shadow:0 0 0 2px var(--cyan)}

/* ---- type-it-for-me buttons, shown while BASIC is loaded ---- */
.typebar{max-width:730px;margin:16px auto 0;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.typebar[hidden]{display:none}
.typebar .grouplabel{margin:0 4px 0 0;width:38px;flex:none;font-size:10px;letter-spacing:2px;color:var(--purple)}
.typebar button{background:var(--btn);color:var(--cyan);border:1px solid var(--btn-edge);
  min-height:28px;padding:4px 9px;font:11px var(--mono);letter-spacing:.04em}
.typebar button:hover{background:var(--btn-on);border-color:var(--cyan)}
.typebar .hint{flex:1 1 100%;margin:4px 0 0;font-size:10px;line-height:1.6;color:var(--dimmer)}

/* ---- the on-screen joystick ---- */
.gamepad{max-width:730px;margin:20px auto 0;display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.dpad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,40px);gap:4px;flex:none}
.dpad button{background:var(--btn);color:var(--paper);border:1px solid var(--btn-edge);
  font:13px var(--mono);line-height:1;display:grid;place-items:center;padding:0;touch-action:none}
.dpad button[data-joy="0"]{grid-area:1/2}
.dpad button[data-joy="2"]{grid-area:2/1}
.dpad button[data-joy="3"]{grid-area:2/3}
.dpad button[data-joy="1"]{grid-area:3/2}
.gamepad .fire{background:var(--btn);color:var(--paper);border:1px solid var(--btn-edge);
  width:84px;height:84px;border-radius:50%;font:12px var(--mono);letter-spacing:.14em;flex:none;touch-action:none}
.gamepad button:hover{background:var(--btn-on);border-color:var(--purple)}
.gamepad button.pressed{background:#36283b;border-color:var(--cyan);color:var(--cyan)}
#focus-hint{margin:0;flex:1 1 220px;min-width:200px;font-size:11px;line-height:1.7;color:var(--dimmer)}
#focus-hint b{color:var(--paper);font-weight:bold}
#focus-hint.live{color:var(--dim)}
#focus-hint.live::before{content:"\25cf  ";color:var(--cyan)}

/* ---- controls ---- */
.visitor-controls{max-width:730px;margin:24px auto 0;display:flex;flex-wrap:wrap;
  justify-content:space-between;gap:12px}
.launch-controls,.export-controls{display:flex;gap:7px;flex-wrap:wrap}
.interaction-note{max-width:730px;margin:13px auto 0;font-size:11px;color:#bcb0b9;line-height:1.7}

.transcript{max-width:730px;margin:20px auto 0}
.transcript summary{font-size:11px;letter-spacing:.1em;color:var(--dim);cursor:pointer;padding:6px 0}
.transcript pre{background:#0b0a16;border:1px solid #2c2440;color:#a9a7e8;padding:14px;overflow:auto;
  font-family:var(--mono);font-size:12px;line-height:1.5;border-radius:4px;max-height:220px;margin:10px 0 0}

/* ---- the guide: what to click ---- */
.guide{max-width:730px;margin:45px auto 0;border:1px solid var(--rule);
  background:#16121b;padding:22px 24px 24px}
.guide h2{font-family:var(--serif);font-size:22px;font-weight:normal;margin:0 0 14px}
.guide ol{margin:0 0 16px;padding-left:22px;font-size:12px;line-height:1.8;color:var(--dim)}
.guide ol li::marker{color:var(--purple)}
.guide dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:7px 16px;font-size:12px;line-height:1.6}
.guide dt{color:var(--cyan);white-space:nowrap}
.guide dd{margin:0;color:var(--dim)}
.guide dl.cmds dt{color:var(--paper);font-weight:bold}
.guide dl.cmds code{font-family:var(--mono);color:var(--cyan)}
.guide .aside{margin:16px 0 0;font-size:11px;line-height:1.7;color:var(--dimmer)}

/* ---- notes ---- */
.exhibit-notes{display:grid;grid-template-columns:1.05fr 1fr;gap:55px;
  padding:35px 0 0;margin-top:45px;border-top:1px solid var(--rule)}
.exhibit-notes h2{font-family:var(--serif);font-size:25px;font-weight:normal;margin:0 0 15px}
.exhibit-notes p:not(.eyebrow){font-size:12px;line-height:1.8;color:var(--dim);margin:0 0 12px}
.exhibit-notes a,.exhibit-notes code{font-size:12px}
.exhibit-notes code{font-family:var(--mono);color:var(--paper);background:#241c29;padding:1px 4px;border-radius:2px}
.exhibit-notes em{color:#d6cbd4}
.credits{font-size:10px!important;color:#a090a0!important;line-height:1.8!important}

footer{padding:22px 0 35px;margin-top:35px;border-top:1px solid var(--rule);
  display:flex;justify-content:space-between;gap:20px;font-size:10px;letter-spacing:.1em;color:var(--dimmer)}
footer a{color:var(--paper);text-decoration:none}
footer a:hover{text-decoration:underline}
.noscript{color:#fff;background:#611;padding:20px;font-size:12px;line-height:1.7}

/* ---- larger screen ---- */
.workbench.enlarged{position:fixed;inset:0;background:var(--ground);z-index:500;overflow:auto;padding:30px 15px 110px}
.workbench.enlarged .machine{max-width:940px;padding-top:24px}
.workbench.enlarged .case-bottom{padding:12px 2px 14px}
.workbench.enlarged+.status-line{position:fixed;bottom:56px;left:0;right:0;z-index:501;
  background:var(--ground);max-width:none;padding:8px 20px;margin:0}
.workbench.enlarged~.visitor-controls{position:fixed;bottom:0;left:0;right:0;z-index:501;
  background:var(--ground);max-width:none;padding:10px 20px;margin:0;border-top:1px solid var(--btn-edge)}

@media (max-width:700px){
  main{padding:0 16px}
  .museum-header{padding:15px 16px;gap:12px}
  .museum-header>span{font-size:9px}
  .museum-header .back-link{font-size:10px}
  .exhibit-heading{margin:30px 0 10px}
  .year{font-size:32px;padding-left:13px}
  .dek{font-size:11px}
  .eyebrow{font-size:9px;letter-spacing:1px}
  .workbench{padding:20px 0 0}
  .machine{padding:20px 18px 0;border-radius:14px 14px 8px 8px}
  .bezel{padding:11px 11px 14px;border-radius:12px 12px 18px 18px}
  .case-bottom{padding:14px 2px 16px}
  .case-badge{font-size:11px}
  .case-keys{display:none}
  .mode-controls .grouplabel{width:100%}
  .gamepad{gap:14px;justify-content:center}
  .dpad{grid-template-columns:repeat(3,52px);grid-template-rows:repeat(3,46px)}
  .gamepad .fire{width:92px;height:92px}
  #focus-hint{flex:1 1 100%;text-align:center}
  .guide{padding:18px 16px 20px}
  .guide dl{grid-template-columns:1fr;gap:2px 0}
  .guide dt{margin-top:8px}
  .exhibit-notes{grid-template-columns:1fr;gap:26px;padding-top:27px}
  .exhibit-notes h2{font-size:23px}
  footer{flex-direction:column;gap:8px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ---- embedded: the exhibit running as a window inside GE-OS 98 ----
   The museum furniture belongs to the page, not to the machine, so a window
   shows only the machine and the things you press — and it uses the width it
   has, putting the joystick beside the screen rather than under it, so the
   whole thing fits a window short enough to sit on the desktop. */
.embedded .museum-header,
.embedded .exhibit-heading,
.embedded .interaction-note,
.embedded .transcript,
.embedded .guide,
.embedded .exhibit-notes,
.embedded footer,
.embedded .noscript{display:none}
.embedded{background-image:none}
.embedded main{max-width:none;padding:8px 10px 10px;display:grid;gap:6px 12px;
  grid-template-columns:1fr 176px;
  grid-template-areas:"progs progs" "machine pad" "status controls";
  align-items:start}
.embedded .mode-controls{grid-area:progs;max-width:none;margin:0;gap:5px}
.embedded .mode-controls .group{gap:5px}
.embedded .mode-controls .grouplabel{width:38px;font-size:9px;letter-spacing:1px}
.embedded .mode-controls button{min-height:28px;padding:4px 8px;font-size:11px}
.embedded #mode-description{display:none}
.embedded .workbench{grid-area:machine;padding:0}
.embedded .workbench:after{display:none}
.embedded .machine{max-width:350px;margin:0;padding:12px 14px 0;border-radius:12px 12px 6px 6px}
.embedded .bezel{padding:8px 9px 11px;border-radius:9px 9px 13px 13px}
.embedded .case-bottom{padding:8px 2px 9px}
.embedded .case-badge{font-size:10px}
.embedded .case-keys{display:none}
.embedded .machine-foot{height:8px}
.embedded .status-line{grid-area:status;max-width:none;margin:0;font-size:10px;gap:10px;justify-content:flex-start}
.embedded .typebar{display:none}
.embedded .gamepad{grid-area:pad;max-width:none;margin:0;flex-direction:column;align-items:center;gap:8px}
.embedded .dpad{grid-template-columns:repeat(3,34px);grid-template-rows:repeat(3,30px);gap:3px}
.embedded .gamepad .fire{width:58px;height:58px;font-size:10px;letter-spacing:.1em}
.embedded #focus-hint{flex:none;min-width:0;font-size:9px;line-height:1.5;text-align:center}
.embedded .visitor-controls{grid-area:controls;max-width:none;margin:0;gap:5px;justify-content:flex-end}
.embedded .visitor-controls button,.embedded .file-label{min-height:28px;padding:4px 8px;font-size:11px}
