/* ============================================================
   theme.css — a HyperCard stack loaded onto a Windows 95 desktop
   · Win95 outside: teal desktop, grey bevelled windows, navy title
     bars, a taskbar with a Start menu (the talk's sections).
   · HyperCard inside: 1-bit cards, a black-and-white menu bar
     (File Edit Go Tools Objects), pinstriped card windows,
     rounded balloons and buttons, the Message box for narration.
   Geometry (stage px): card hole x 32–1248, y 60–548 · Message box
   y 562–678 · taskbar y 684–720. engine.css stays untouched.
   ============================================================ */

:root {
  --desk: #008080;
  --face: #c0c0c0; --lite: #dfdfdf; --shade: #808080;
  --navy: #000080;
  --bevel-out: inset -2px -2px #000, inset 2px 2px #dfdfdf, inset -4px -4px #808080, inset 4px 4px #fff;
  --bevel-in: inset 2px 2px #808080, inset -2px -2px #fff, inset 4px 4px #000, inset -4px -4px #dfdfdf;
  --ink: #000; --dim: #3c3c3c;
  --accent: #000; --accent-2: #000080; --accent-3: #000;
  --font-display: 'Silkscreen', monospace;
  --font-body: 'Pixelify Sans', monospace;
  --font-ui: 'Pixelify Sans', monospace;
  --fs: 26px;
  --panel-bg: #fff; --panel-edge: #000;
  --console-bg: var(--face); --console-edge: #000;
  --hud-ink: #000;
}

/* ---------------- the desktop around the stack (card rooms only) ---------------- */
#desk, #hc-window { display: none; }
body[data-room="library"] #desk, body[data-room="hypertext"] #desk, body[data-room="workshop"] #desk, body[data-room="classroom"] #desk,
body[data-room="library"] #hc-window, body[data-room="hypertext"] #hc-window, body[data-room="workshop"] #hc-window, body[data-room="classroom"] #hc-window { display: block; }

#desk { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--desk);
  clip-path: polygon(evenodd, 0 0, 1280px 0, 1280px 720px, 0 720px, 0 0, 32px 60px, 1248px 60px, 1248px 548px, 32px 548px, 32px 60px); }

#hc-window { position: absolute; left: 24px; top: 6px; width: 1232px; height: 550px; z-index: 2; pointer-events: none;
  background: var(--face); box-shadow: var(--bevel-out);
  clip-path: polygon(evenodd, 0 0, 1232px 0, 1232px 550px, 0 550px, 0 0, 8px 54px, 1224px 54px, 1224px 542px, 8px 542px, 8px 54px); }
#hc-window .w95-title, #hc-window .hc-menubar { pointer-events: auto; cursor: default; }
.hc-cardline { position: absolute; left: 8px; top: 54px; width: 1216px; height: 488px; box-shadow: 0 0 0 2px #000; pointer-events: none; }

/* Win95 title bars (stack window, Message box, panels) */
.w95-title, .msg-title { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 6px; background: var(--navy); color: #fff;
  font-family: var(--font-ui); font-size: 17px; letter-spacing: 0.3px; white-space: nowrap; }
.w95-title { position: absolute; left: 4px; top: 4px; right: 4px; }
.w95-title .t, .msg-title .t { text-shadow: 1px 0 0 #fff; }
.w95-title .dash { opacity: 0.8; }
.w95-btns { margin-left: auto; display: flex; gap: 2px; }
.w95-btns i { position: relative; width: 20px; height: 18px; background: var(--face); box-shadow: var(--bevel-out); display: block; }
.w95-btns i.min { margin-right: 0; }
.w95-btns i.min::before { content: ''; position: absolute; left: 5px; bottom: 4px; width: 8px; height: 2px; background: #000; }
.w95-btns i.max::before { content: ''; position: absolute; left: 4px; top: 3px; width: 10px; height: 9px; border: 1px solid #000; border-top-width: 3px; }
.w95-btns i.x { margin-left: 2px; }
.w95-btns i.x::before { content: '\00d7'; position: absolute; inset: 0; text-align: center; font: 20px/17px var(--font-ui); color: #000; }

/* HyperCard menu bar: 1-bit, inverted highlight */
.hc-menubar { position: absolute; left: 8px; right: 8px; top: 30px; height: 24px; background: #fff; border-bottom: 2px solid #000;
  display: flex; align-items: center; padding: 0 6px; font-family: var(--font-ui); }
#verbs { grid-column: auto; display: flex; gap: 0; justify-content: flex-start; font-family: var(--font-ui); font-size: 18px; }
#verbs button { color: #000; padding: 0 12px; height: 22px; line-height: 22px; font: inherit; }
#verbs button.active, #verbs button:hover { color: #fff; background: #000; }
#section-name { margin-left: auto; margin-right: 14px; font-family: var(--font-display); font-size: 11px; letter-spacing: 1px; color: #000; }
#controls { display: flex; gap: 6px; align-items: center; }
#controls button { width: 34px; height: 18px; background: #fff; border: 2px solid #000; border-radius: 8px; color: #000; cursor: pointer; position: relative; }
#controls button:hover { background: #000; }
#controls button:hover .arrow { border-left-color: #fff; border-right-color: #fff; }
.arrow { position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transform: translate(-50%, -50%); }
.arrow.right { border-left: 9px solid #000; }
.arrow.left { border-right: 9px solid #000; }

/* ---------------- the Message box (narration) ---------------- */
body.fullbleed.narration-console #console {
  top: 562px; bottom: auto; left: 24px; width: 1232px; height: 116px; z-index: 30;
  background: var(--face); border: 0; box-shadow: var(--bevel-out); padding: 4px;
  display: flex; flex-direction: column; gap: 0; grid-template-columns: none; }
#speaker { font-family: var(--font-ui); font-size: 16px; color: #fff; padding-top: 0; letter-spacing: 0.5px; }
.msg-title .sep { opacity: 0.75; }
.msg-field { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 4px; background: #fff; box-shadow: var(--bevel-in); padding: 8px 14px 6px; }
#dialogue-text { --dialogue-fs: 25px; height: 100%; color: #000; font-family: var(--font-body); line-height: 1.14; }
#dialogue-text a { color: var(--navy); }
#dialogue-text em { font-style: normal; color: #444; }
#dialogue-text.typing::after { color: #000; }
body.fullbleed[data-room="safe"] #console, body[data-room="safe"] #taskbar, body[data-room="safe"] #start-menu { display: none; }

/* ---------------- taskbar + Start menu ---------------- */
#taskbar { position: absolute; left: 0; top: 684px; width: 1280px; height: 36px; z-index: 40; display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 2px; background: var(--face); box-shadow: inset 0 2px #dfdfdf, inset 0 4px #fff;
  font-family: var(--font-ui); font-size: 17px; color: #000; cursor: default; }
#start-btn { height: 28px; display: flex; align-items: center; gap: 7px; padding: 0 12px 0 7px; background: var(--face); border: 0;
  box-shadow: var(--bevel-out); font: inherit; color: #000; cursor: pointer; text-shadow: 1px 0 0 #000; }
#start-btn.down { box-shadow: var(--bevel-in); }
#tasks { flex: 1 1 auto; display: flex; gap: 6px; min-width: 0; }
.task { height: 28px; min-width: 120px; max-width: 210px; display: flex; align-items: center; gap: 7px; padding: 0 10px; box-shadow: var(--bevel-out);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.new { animation: taskin 0.25s steps(3) both; }
.task.active { box-shadow: var(--bevel-in); background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 4px 4px; text-shadow: 1px 0 0 #000; }
#tray { height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 12px; box-shadow: inset 2px 2px #808080, inset -2px -2px #fff; white-space: nowrap; }
#counter { font-family: var(--font-display); font-size: 12px; letter-spacing: 1px; }
#start-menu { position: absolute; left: 2px; bottom: 34px; width: 430px; z-index: 50; display: none; padding: 4px 4px 4px 42px;
  background: var(--face); box-shadow: var(--bevel-out), 3px 3px 0 rgba(0,0,0,0.4); font-family: var(--font-ui); }
#start-menu.open { display: block; }
#start-menu .banner { position: absolute; left: 4px; top: 4px; bottom: 4px; width: 34px; background: linear-gradient(#000080, #000);
  color: var(--face); writing-mode: vertical-rl; transform: rotate(180deg); font-size: 22px; padding: 10px 0; text-align: left; }
#start-menu .banner span { color: #fff; text-shadow: 1px 0 0 #fff; }
#section-nav { display: flex; flex-direction: column; gap: 0; }
#section-nav button { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; background: transparent; border: 0;
  font-family: var(--font-ui); font-size: 21px; color: #000; text-align: left; letter-spacing: 0; cursor: pointer; }
#section-nav button::before { content: ''; flex: 0 0 auto; width: 20px; height: 24px; background: #fff; border: 2px solid #000;
  box-shadow: 3px 3px 0 #000; clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%); }
#section-nav button:hover, #section-nav button.active { background: var(--navy); color: #fff; border: 0; }
#section-nav button:last-child { margin-top: 6px; box-shadow: inset 0 2px #808080, inset 0 4px #fff; }

/* little 16px icons for the taskbar */
.ico { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; position: relative; }
.ico.stack { background: #fff; border: 2px solid #000; box-shadow: 3px 3px 0 -0px #fff, 3px 3px 0 2px #000; width: 15px; height: 13px; margin: 0 4px 2px 0; }
.ico.web { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7fd8ff, #1060c0 60%, #002060); border: 1px solid #000; }
.ico.dogear { width: 16px; height: 20px; background: #fff; border: 2px solid #000; clip-path: polygon(0 0, 65% 0, 100% 30%, 100% 100%, 0 100%); }
.w95-title .ico.stack { box-shadow: 3px 3px 0 0 #fff, 3px 3px 0 2px #000; }

/* tooltips for hotspots, autoplay badge */
#hover-line { left: 44px; right: auto; bottom: auto; top: 512px; padding: 3px 8px; background: #ffffe1; border: 1px solid #000; color: #000;
  font-family: var(--font-ui); font-size: 18px; text-shadow: none; text-align: left; z-index: 15; }
#hover-line:empty { display: none; }
body:not([data-room="library"]):not([data-room="hypertext"]):not([data-room="workshop"]):not([data-room="classroom"]) #hover-line { top: 520px; }
#badge { top: 16px; right: 16px; font-family: var(--font-ui); font-size: 18px; color: #000; background: #ffffe1; border: 1px solid #000; box-shadow: 3px 3px 0 rgba(0,0,0,0.4); }

/* ---------------- panels: shared ---------------- */
.panel { font-family: var(--font-body); }
.panel h2 { font-family: var(--font-display); color: #000; }
.panel a { color: var(--navy); }
.panel .bar { font-family: var(--font-ui); letter-spacing: 0; }

/* 1-bit card window (System-6 style): pinstriped title, close box */
.panel.frame-card { background: #fff; border: 2px solid #000; border-radius: 0; box-shadow: 5px 5px 0 #000; padding: 0; }
.frame-card .bar { position: relative; justify-content: center; padding: 4px 40px; color: #000; font-size: 16px; border-bottom: 2px solid #000;
  background: repeating-linear-gradient(to bottom, #000 0 2px, #fff 2px 4px) content-box, #fff; }
.frame-card .bar > span:first-child { background: #fff; padding: 0 12px; line-height: 16px; }
.frame-card .bar::before { content: ''; position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; margin-top: -8px; background: #fff; border: 2px solid #000; }
.frame-card .bar a { position: absolute; right: 12px; background: #fff; padding: 0 6px; color: #000; }
.frame-card .screen { background: #fff; }
.frame-card .caption { background: #fff; color: #000; border-top: 2px solid #000; font-size: 18px; }
/* the tool that disappeared: a 1-bit ghost behind a 50% white dither veil */
.panel.ghost .screen::after { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(#fff 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
.panel.ghost .bar > span:first-child { text-decoration: line-through; }

/* HyperCard field: white, black edge, hard shadow */
.panel.frame-field { background: #fff; border: 2px solid #000; box-shadow: 6px 6px 0 #000; }
.panel.sign.frame-field .sign-text { font-family: var(--font-body); color: #000; text-shadow: none; font-size: 1.5em; line-height: 1.2; }
.panel.sign.frame-field .kicker { font-family: var(--font-display); color: #000; }
/* the craft card: a lined field, written in big type */
.panel.sign.craft { text-align: left; padding: 0.4em 1em 0.6em 1.4em; border-width: 3px; box-shadow: 8px 8px 0 #000;
  background: repeating-linear-gradient(to bottom, #fff 0 69px, #000 69px 71px) 0 22px / 100% 71px, #fff; }
.panel.sign.craft::before { content: ''; position: absolute; left: 0.6em; top: 0; bottom: 0; border-left: 2px dotted #000; }
.panel.sign.craft .sign-text { font-size: 2.2em; line-height: 71px; margin-top: 0; }
/* the rubber stamp */
.panel.sign.stamp { transform: rotate(-6deg); background: rgba(255,255,255,0.92); border: 8px double #000; box-shadow: none; padding: 0.35em 0.6em; }
.panel.sign.stamp .sign-text { font-family: var(--font-display); font-size: 1.15em; line-height: 1.25; letter-spacing: 1px; text-transform: uppercase; color: #000; text-shadow: none; margin: 0; }

/* speech balloons: rounded 1-bit, like HyperCard's */
.panel.frame-bubble { background: #fff; border: 3px solid #000; border-radius: 16px; box-shadow: 5px 5px 0 #000; color: #000; }
.frame-bubble .who { font-family: var(--font-display); font-size: 13px; letter-spacing: 1px; color: #000; margin-bottom: 0.45em; }
.frame-bubble blockquote { font-family: var(--font-body); }
.frame-bubble cite { color: #333; font-size: 0.78em; }
.panel.speech .tail { border-top-color: #000; bottom: -17px; }

/* Win95 windows: browser (with a menu row), dialog, title window */
.panel.frame-browser, .panel.frame-dialog, .panel.title.frame-wintitle {
  background: var(--face); border: 0; border-radius: 0; box-shadow: var(--bevel-out), 4px 4px 0 rgba(0,0,0,0.35); color: #000; }
.panel.frame-browser { padding: 4px; }
.frame-browser .bar, .frame-dialog h2, .frame-wintitle::before { background: var(--navy); color: #fff; font-family: var(--font-ui); font-size: 17px;
  padding: 0 4px 0 8px; height: 24px; display: flex; align-items: center; letter-spacing: 0.3px; text-shadow: 1px 0 0 #fff; }
.frame-browser .bar { order: 0; justify-content: flex-start; gap: 10px; }
.frame-browser .bar a { margin-left: auto; color: #fff; text-shadow: none; font-size: 15px; }
.frame-browser .bar::after, .frame-dialog h2::after, .frame-wintitle::after {
  content: ''; flex: 0 0 auto; width: 62px; height: 18px; margin-left: auto;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='18' shape-rendering='crispEdges'%3E%3Cg fill='%23c0c0c0'%3E%3Crect width='20' height='18'/%3E%3Crect x='20' width='20' height='18'/%3E%3Crect x='42' width='20' height='18'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Crect width='19' height='1'/%3E%3Crect width='1' height='17'/%3E%3Crect x='20' width='19' height='1'/%3E%3Crect x='20' width='1' height='17'/%3E%3Crect x='42' width='19' height='1'/%3E%3Crect x='42' width='1' height='17'/%3E%3C/g%3E%3Cg fill='%23000'%3E%3Crect y='17' width='20' height='1'/%3E%3Crect x='19' width='1' height='18'/%3E%3Crect x='20' y='17' width='20' height='1'/%3E%3Crect x='39' width='1' height='18'/%3E%3Crect x='42' y='17' width='20' height='1'/%3E%3Crect x='61' width='1' height='18'/%3E%3Crect x='6' y='11' width='7' height='2'/%3E%3Crect x='25' y='3' width='10' height='9' fill='none' stroke='%23000'/%3E%3Crect x='25' y='3' width='10' height='2'/%3E%3Cpath d='M47 4h2v1h1v1h1v1h1V6h1V5h1V4h2v1h-1v1h-1v1h-1v1h-1v1h1v1h1v1h1v1h1v1h-2v-1h-1v-1h-1v-1h-1v1h-1v1h-1v1h-2v-1h1v-1h1v-1h1V9h-1V8h-1V7h-1V6h-1z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 62px 18px no-repeat; }
.frame-browser::before { content: 'File    Edit    View    Go    Favorites    Help'; order: 1; display: block; white-space: pre;
  font-family: var(--font-ui); font-size: 15px; color: #000; padding: 3px 8px 2px; height: 22px; }
.frame-browser .screen { order: 2; background: #1b1b1f; box-shadow: var(--bevel-in); padding: 4px; }
.frame-browser .caption { order: 3; margin-top: 4px; height: 22px; padding: 1px 8px; font-family: var(--font-ui); font-size: 15px; color: #000;
  background: var(--face); box-shadow: inset 2px 2px #808080, inset -2px -2px #fff; }

/* the closing dialog */
.panel.text.frame-dialog { padding: 4px 4px 20px; }
.frame-dialog h2 { margin: 0 0 18px; line-height: 24px; }
.frame-dialog .body { padding: 4px 26px 0; font-size: 30px; line-height: 1.2; }
.dlg { display: flex; gap: 22px; align-items: flex-start; }
.dlg p + p { margin-top: 0.45em; }
.dlg-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 2px solid #000; position: relative; box-shadow: 3px 3px 0 #808080; }
.dlg-icon::before { content: 'i'; position: absolute; inset: 0; text-align: center; font: 32px/46px var(--font-display); color: var(--navy); }
.dlg-btns { display: flex; justify-content: center; gap: 22px; margin-top: 22px; }
.w95btn { min-width: 150px; padding: 8px 18px; background: var(--face); box-shadow: var(--bevel-out); font-family: var(--font-ui); font-size: 24px; text-align: center; color: #000; }
body[data-step="1"] .w95btn[data-k="1"], body[data-step="2"] .w95btn[data-k="2"], body[data-step="3"] .w95btn[data-k="3"] {
  box-shadow: var(--bevel-out), 0 0 0 3px #000; outline: 2px dotted #000; outline-offset: -9px; text-shadow: 1px 0 0 #000; animation: press 0.4s steps(2) both; }
body[data-step="2"] .w95btn[data-k="1"], body[data-step="3"] .w95btn[data-k="1"], body[data-step="3"] .w95btn[data-k="2"] { text-shadow: 1px 0 0 #000; }

/* the title window */
.panel.title.frame-wintitle { padding: 4px 4px 26px; text-align: left; }
.frame-wintitle::before { content: 'AUTHOR.STK'; margin-bottom: 22px; }
.frame-wintitle::after { position: absolute; right: 8px; top: 7px; }
.frame-wintitle > * { margin-left: 30px; margin-right: 30px; }
.panel.title.frame-wintitle .kicker { font-family: var(--font-display); font-size: 14px; letter-spacing: 2px; color: var(--navy); }
.panel.title.frame-wintitle h1 { font-family: var(--font-ui); font-size: 58px; line-height: 1.04; margin: 0.25em 30px 0.35em; color: #000; text-shadow: 3px 3px 0 #fff; }
.panel.title.frame-wintitle .byline { font-size: 26px; line-height: 1.2; color: #000; border-top: 2px solid #808080; box-shadow: 0 2px #fff inset; padding-top: 14px; }
.panel.title.frame-wintitle .byline strong { color: #000; font-size: 30px; }
.panel.title.frame-wintitle .start { display: inline-block; margin-top: 24px; padding: 10px 18px; background: var(--face); font-family: var(--font-display); font-size: 13px;
  letter-spacing: 1px; color: #000; box-shadow: var(--bevel-out), 0 0 0 2px #000; outline: 2px dotted #000; outline-offset: -8px; animation: none; }

/* the blackboard the Name Machine starts on */
.panel.embed.frame-blackboard { border: 0; background: #000; box-shadow: none; padding: 0; }
.frame-blackboard .bar, .frame-blackboard .caption { display: none; }
.panel.embed.frame-blackboard .screen { background: #000; }

/* HyperCard alert (the stack that can't be found) */
.panel.text.frame-hcalert { background: #fff; border: 2px solid #000; box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 8px #000, 6px 6px 0 #000; padding: 26px 28px 22px; color: #000; }
.hc-alert { display: flex; gap: 20px; align-items: center; font-size: 28px; }
.hc-icon { flex: 0 0 auto; width: 40px; height: 48px; border: 3px solid #000; background: #fff; position: relative; clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%); }
.hc-icon::before { content: '?'; position: absolute; inset: 0; text-align: center; font: 30px/46px var(--font-display); color: #000; }
.hc-btns { display: flex; justify-content: flex-end; gap: 18px; margin-top: 20px; }
.hc-btn { border: 2px solid #000; border-radius: 12px; padding: 4px 18px; font-size: 22px; background: #fff; }
.hc-btn.default { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000; border-radius: 12px; }

/* the screen after shut down */
.panel.text.frame-safe { background: none; border: 0; box-shadow: none; text-align: center; color: #ff8c1a; }
.frame-safe .safe-line { font-family: var(--font-ui); font-size: 1.7em; color: #ff8c1a; }
.frame-safe h2 { font-family: 'Press Start 2P', monospace; font-size: 1.5em; line-height: 1.4; color: #ff8c1a; margin: 1.3em 0 0.8em; }
.frame-safe .safe-link a { font-family: var(--font-ui); font-size: 1.3em; color: #ffcf7a; text-decoration: underline; }

/* ---------------- shut down: the chrome dims with the desktop ---------------- */
body.dim .msg-title { background: #808080; color: #c0c0c0; }
body.dim .msg-title #speaker { color: #c0c0c0; }
body.dim #taskbar::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(#000 0 25%, transparent 0 50%) 0 0 / 8px 8px; }

/* ---------------- loading screen ---------------- */
#preloader { background: var(--desk); }
#preloader .pl-win { width: 520px; background: var(--face); box-shadow: var(--bevel-out); padding: 4px 4px 24px; color: #000; font-family: var(--font-ui); }
#preloader .pl-title { height: 24px; background: var(--navy); color: #fff; font-size: 17px; padding: 2px 8px; animation: none; margin-bottom: 22px; }
#preloader .pl-outer { width: 460px; height: 26px; margin: 0 auto; border: 0; padding: 4px; box-shadow: var(--bevel-in); background: #fff; }
#preload-bar { background: repeating-linear-gradient(90deg, var(--navy) 0 14px, transparent 14px 18px); }
#preload-status { margin: 12px 30px 0; font-family: var(--font-ui); font-size: 16px; color: #000; }

@keyframes taskin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes press { 0% { box-shadow: var(--bevel-in), 0 0 0 3px #000; } 100% { box-shadow: var(--bevel-out), 0 0 0 3px #000; } }
@media (prefers-reduced-motion: reduce) { .task, .w95btn { animation: none !important; } }
