/* Dark Castle: 1986 Macintosh, modern manners.
   1-bit black and white, dithered fills, castle red (#932020) as the only colour. */

:root {
  --ink: #000;
  --paper: #fff;
  --red: #932020;
  --red-hi: #a82626;
  --red-lo: #6a1515;
  --menubar-h: 30px;
  --gutter: 16px;
  --shadow: 3px 3px 0 var(--ink);
  --font-pixel: "Tiny5", ui-monospace, monospace;          /* small UI text: menus, title bars, buttons */
  --font-display: "Pixelify Sans", "Tiny5", monospace;   /* big headings (weight 500 keeps the C open) */
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* 1-bit patterns, drawn at 2 CSS px per pattern pixel so they read on any screen */
  --pat-gray: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='4' height='4' fill='%23fff'/%3E%3Crect width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23000'/%3E%3C/svg%3E");
  --pat-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23fff'/%3E%3Crect width='2' height='2' fill='%23000'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%23000'/%3E%3C/svg%3E");
  --pat-bricks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32' shape-rendering='crispEdges'%3E%3Cdefs%3E%3Cpattern id='d' width='4' height='4' patternUnits='userSpaceOnUse'%3E%3Crect width='4' height='4' fill='%23000'/%3E%3Crect width='2' height='2' fill='%23fff'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23fff'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='64' height='32' fill='%23000'/%3E%3Cg fill='url(%23d)'%3E%3Crect x='0' y='2' width='30' height='12'/%3E%3Crect x='32' y='2' width='30' height='12'/%3E%3Crect x='-16' y='18' width='30' height='12'/%3E%3Crect x='16' y='18' width='30' height='12'/%3E%3Crect x='48' y='18' width='30' height='12'/%3E%3C/g%3E%3C/svg%3E");
  --pat-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23932020'/%3E%3Crect width='2' height='2' fill='%23000'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%23000'/%3E%3C/svg%3E");
  --pat-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' shape-rendering='crispEdges'%3E%3Crect width='96' height='96' fill='%23000'/%3E%3Cg fill='%23fff'%3E%3Crect x='10' y='14' width='2' height='2'/%3E%3Crect x='52' y='6' width='2' height='2'/%3E%3Crect x='80' y='30' width='2' height='2'/%3E%3Crect x='30' y='48' width='2' height='2'/%3E%3Crect x='66' y='62' width='2' height='2'/%3E%3Crect x='14' y='80' width='2' height='2'/%3E%3Crect x='88' y='86' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
}

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

html {
  background: var(--ink);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  padding-top: var(--menubar-h);
  overflow-x: clip;
  background: var(--paper) var(--pat-gray);
  color: var(--ink);
  font: 17px/1.6 var(--font-body);
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--red); color: var(--paper); }

:focus-visible {
  outline: 2px dashed var(--red);
  outline-offset: 3px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.legacy-anchor { position: absolute; top: calc(-1 * var(--menubar-h) - 16px); }

.skip-link {
  position: fixed; left: 8px; top: -60px; z-index: 100;
  background: var(--paper); border: 1px solid var(--ink); padding: 8px 12px;
  font-family: var(--font-pixel);
}
.skip-link:focus { top: calc(var(--menubar-h) + 8px); }

.container {
  max-width: 1160px;
  margin: 0 auto;
}

/* ---------- Headings ---------- */

.h-big, .h-med, .wordmark, .card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-synthesis: none;
}

.title, .menu-title, .btn, .desk-icon span,
.finder-strip, .info-rows dt, .dlg-title, .statusline, .note strong,
.steps li::before, .viewer-count, .toast, .splash-box p, .field-label,
.download-meta, figcaption, .info-comments-label, .clock,
.menu-list a, .menu-list button, .menu-head, .thumb, .site-index, .tagline, .info-lock, .mac-modal .btn-close {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none; /* Tiny5 has one weight; never fake a bold */
}

.h-big {
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}
.h-med {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  margin: 0 0 6px;
}
.subtitle { margin: 0 0 24px; font-size: 18px; }

/* ---------- Menu bar ---------- */

.menubar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--menubar-h);
  background: var(--ink); /* the black bezel shows in the rounded top corners */
}
.menubar-inner {
  height: 100%;
  display: flex; align-items: stretch; justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  border-radius: 8px 8px 0 0;
  padding: 0 8px;
}
.menubar-nav { display: flex; }
.menus { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; }
.menu { position: relative; display: flex; }
.menu-title {
  display: flex; align-items: center;
  padding: 0 12px;
  font-size: 16px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
.menu-title:hover, .menu.is-open > .menu-title {
  background: var(--ink); color: var(--paper);
  --icon-paper: var(--ink);
}
.menu-title:focus-visible { outline-offset: -3px; }
.menu-title--icon { padding: 0 10px; }
.menu-castle { width: 16px; height: 17px; display: block; }

.menu-list {
  position: absolute; top: calc(100% + 1px); left: 0; z-index: 2;
  min-width: 280px;
  list-style: none; margin: 0; padding: 4px 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}
.menu-list[hidden] { display: none; }
.menu-list a, .menu-list button {
  display: flex; justify-content: space-between; gap: 24px;
  width: 100%;
  padding: 6px 20px;
  border: 0; background: none;
  font: 16px/1.2 var(--font-pixel);
  color: var(--ink); text-align: left; text-decoration: none;
  cursor: default;
}
.menu-list a:hover, .menu-list button:hover,
.menu-list a:focus-visible, .menu-list button:focus-visible {
  background: var(--ink); color: var(--paper); outline: none;
}
.menu-key { opacity: 0.6; }
.menu-list .sep { border-top: 2px dotted var(--ink); margin: 4px 0; opacity: 0.45; }
.menu-head {
  padding: 8px 20px 4px;
  font: 13px/1 var(--font-pixel); letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.6;
}

.menu--mobile { display: none; }

.menubar-right { display: flex; align-items: center; gap: 4px; }
.clock { font-size: 15px; padding: 0 8px; white-space: nowrap; }

/* ---------- Desktop bands ---------- */

.desk {
  position: relative;
  padding: 56px var(--gutter);
  border-bottom: 1px solid var(--ink);
}
.desk--bricks { background: var(--ink) var(--pat-bricks); padding-top: 40px; padding-bottom: 64px; }
.desk--red { background: var(--red) var(--pat-red); }
.desk--gray { background: var(--paper) var(--pat-light); }
.desk--night { background: var(--ink) var(--pat-night); color: var(--paper); border-bottom: 0; padding-bottom: 40px; }

/* ---------- Hero ---------- */

.hero-head { text-align: center; margin: 0 0 36px; }
.wordmark {
  margin: 0;
  font-size: clamp(52px, 11vw, 120px);
  line-height: 0.95;
  color: var(--paper);
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    3px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink),
    9px 9px 0 var(--red), 11px 11px 0 var(--ink);
  letter-spacing: 0.02em;
}
.tagline {
  display: inline-block;
  margin: 22px 0 0;
  padding: 4px 12px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  font-family: var(--font-pixel);
  font-size: clamp(15px, 2vw, 19px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 28px;
  align-items: start;
}

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}
.welcome-art { display: block; width: 100%; max-width: 380px; margin: 0 auto; }
.lede { font-size: clamp(17px, 1.7vw, 20px); margin: 0 0 24px; }

.statusline {
  display: flex; align-items: center; gap: 10px;
  padding: 10px clamp(16px, 3vw, 28px);
  border-top: 1px solid var(--ink);
  text-decoration: none;
  font-size: 16px;
}
.statusline-icon { width: 32px; height: 32px; flex: none; }
.statusline-go { margin-left: auto; white-space: nowrap; color: var(--red); font-weight: 600; }
.statusline:hover { background: var(--ink); color: var(--paper); --icon-paper: var(--ink); }
.statusline:hover .statusline-go { color: var(--paper); }

/* Desktop icons */
.desk-icons {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  align-self: stretch;
}
.desk-icon {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 112px;
  padding: 0; border: 0; background: none;
  color: var(--ink);
  text-decoration: none;
  cursor: default;
}
.desk-icon svg { width: 64px; height: 64px; display: block; }
.desk-icon span {
  font-size: 14px; line-height: 1.2; text-align: center;
  background: var(--paper);
  padding: 1px 5px;
}
.desk-icon:hover svg, .desk-icon:focus-visible svg { color: var(--paper); --icon-paper: var(--ink); }
.desk-icon:hover span, .desk-icon:focus-visible span { background: var(--ink); color: var(--paper); }
.desk-icon:focus-visible { outline: none; }
.desk-icon--trash { margin-top: auto; }

/* ---------- Windows ---------- */

.window {
  position: relative;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--menubar-h) + 20px);
}
.titlebar {
  position: relative;
  height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
.titlebar::before { /* the System 6 stripes */
  content: "";
  position: absolute; inset: 5px 3px 5px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 2px);
}
.window.is-inactive .titlebar::before { display: none; }
.window.is-inactive .title { opacity: 0.55; }

.title {
  position: relative;
  max-width: calc(100% - 80px);
  padding: 0 10px;
  background: var(--paper);
  font-size: 15px; line-height: 24px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.closebox {
  position: absolute; left: 10px; top: 50%; z-index: 1;
  width: 15px; height: 15px; margin-top: -7.5px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
  cursor: default;
}
.closebox:active, .closebox[aria-expanded="false"] {
  background:
    linear-gradient(var(--ink), var(--ink)) center / 1px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat,
    var(--paper);
}
.window.is-rolled .window-body,
.window.is-rolled .finder-strip,
.window.is-rolled .statusline { display: none; }

.window-body { padding: clamp(18px, 3.4vw, 40px); }

.stack { display: flex; flex-direction: column; gap: 56px; }
.window--wide { max-width: 1160px; }
.window--l, .window--r { max-width: 1000px; }
.window--r { align-self: flex-end; }

/* Classic modal dialog frame: 1px ink, 2px paper, 3px ink */
.window--dialog {
  max-width: 880px; align-self: center;
  border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 5px var(--ink), var(--shadow);
}
.window--dialog > .window-body { padding: clamp(24px, 4vw, 44px); }

/* ---------- Buttons ---------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; margin-top: 8px; }
.btn-row--end { justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px;
  padding: 6px 20px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px; font-weight: 600; line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--paper); --icon-paper: var(--ink); }
.btn:active { transform: translate(1px, 1px); }
.btn--default { box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--ink); margin: 5px; }
.btn--default:focus-visible { outline-offset: 8px; }
.btn--red { background: var(--red); color: var(--paper); --icon-paper: var(--red); }
.btn--red:hover { background: var(--ink); --icon-paper: var(--ink); }
.btn--small { min-height: 32px; padding: 4px 14px; font-size: 15px; border-radius: 8px; }
.btn--big { min-height: 52px; padding: 8px 28px; font-size: 21px; }
.btn-icon { width: 24px; height: 24px; flex: none; }
.btn--big .btn-icon { width: 32px; height: 32px; }
.btn.btn-loading { opacity: 0.6; cursor: progress; }

/* ---------- Get Info (book) ---------- */

.window--info { max-width: 980px; margin: 0 auto; }
.info {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}
.info-cover { display: block; }
.info-cover img {
  display: block; width: 100%;
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.info-cover:hover img { box-shadow: 6px 6px 0 var(--red); }
.info-name {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.info-name .h-big { margin-bottom: 4px; }
.info-name-icon { width: 48px; height: 48px; }
.info-by { margin: 0; font-style: italic; }
.info-lock {
  grid-column: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font: 14px var(--font-pixel); white-space: nowrap;
  margin-top: 6px;
}
.checkbox {
  width: 14px; height: 14px; border: 1px solid var(--ink); background: var(--paper);
}
.checkbox.is-checked {
  background:
    linear-gradient(45deg, transparent 46%, var(--ink) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--ink) 46% 54%, transparent 54%),
    var(--paper);
}
.info-rows { margin: 0 0 20px; display: grid; gap: 4px; }
.info-rows > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.info-rows dt { font-weight: 700; text-align: right; }
.info-rows dd { margin: 0; }
.info-comments-label { margin: 0 0 6px; font-weight: 700; }
.info-comments-box {
  border: 1px solid var(--ink);
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.08);
}
.info-comments-box p { margin: 0 0 12px; }
.info-comments-box p:last-child { margin: 0; font-style: italic; }

/* ---------- Music ---------- */

.window--music { max-width: 980px; margin: 0 auto; }
.music { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px 28px; align-items: center; }
.music-icon { width: 64px; height: 64px; }
.music-text .h-big { margin-bottom: 6px; }
.music-text p { margin: 0; font-size: 18px; }
.music-btns { margin: 0; justify-content: flex-end; }
.music-player { margin-top: 24px; border: 1px solid var(--ink); box-shadow: var(--shadow); background: var(--ink); }
.music-player[hidden] { display: none; }
.music-player iframe { display: block; width: 100%; height: 352px; border: 0; }
.music-note { margin: 16px 0 0; font-size: 14px; color: #555; }

/* ---------- The Trilogy (Finder) ---------- */

.finder-strip {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px clamp(16px, 3vw, 28px) 5px;
  border-bottom: 3px double var(--ink);
  font-size: 14px;
}
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px;
}
.card {
  display: flex; flex-direction: column; align-items: flex-start;
}
.card-img {
  display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border: 1px solid var(--ink);
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.15; }
.card p { margin: 0 0 16px; flex: 1; }

/* ---------- Read Me ---------- */

.readme {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}
.readme-art { display: block; width: 100%; border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.steps { list-style: none; counter-reset: step; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 17px;
  border-radius: 6px;
}
.note {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px dashed var(--red);
  background: #fbf1f1;
}
.note strong { color: var(--red); }
.play-callout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  margin: 0 0 26px; padding: 16px 18px;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}
.play-callout p { margin: 0; flex: 1 1 260px; }
.steps-intro { margin: 0 0 14px; font-weight: 700; }
.download { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.download-meta { margin: 0; font-size: 14px; line-height: 1.35; }

/* ---------- Game windows ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}
.split-fig { margin: 0; position: sticky; top: calc(var(--menubar-h) + 24px); }
.shot { display: block; width: 100%; border: 1px solid var(--ink); }
figcaption { font-size: 14px; margin-top: 8px; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 16px; }
.prose .btn-row { margin-top: 20px; }

/* ---------- Scrapbook ---------- */

.scrapbook {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px;
}
.thumb {
  display: block; width: 100%;
  padding: 6px 6px 4px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  font: 15px/1.3 var(--font-pixel);
  color: var(--ink);
}
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumb span { display: block; padding-top: 4px; }
.thumb:hover { background: var(--ink); color: var(--paper); }

/* ---------- Contact ---------- */

.contact { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 28px; align-items: start; }
.contact-icon { width: 64px; height: 64px; }
.contact-form .row, .contact-form .dragArea { display: contents; }
.contact-form form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px;
}
.contact-form .col-lg-12, .field--wide { grid-column: 1 / -1; }
.contact-form .h-big { margin-bottom: 0; }
.contact-form .mbr-text { margin: 0 0 4px; }
.contact-form .alert { grid-column: 1 / -1; }
.contact-form [hidden] { display: none; }
.field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.form-control {
  display: block; width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.4 var(--font-body);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.1);
}
.form-control::placeholder { color: #767676; }
.form-control:focus { outline: 2px solid var(--red); outline-offset: 1px; }
textarea.form-control { min-height: 150px; resize: vertical; }
.captcha-note { margin: 12px 0 0; font-size: 13px; color: #555; }
/* The floating reCAPTCHA badge is replaced by .captcha-note, as Google allows. */
.grecaptcha-badge { visibility: hidden; }

/* ---------- Footer ---------- */

.window--alert { margin: 0 auto 40px; max-width: 720px; color: var(--ink); }
.alert-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; align-items: start; }
.alert-row p { margin: 0 0 16px; font-size: 18px; }
.alert-icon { width: 64px; height: 64px; }
.site-index {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  font-family: var(--font-pixel); font-size: 16px;
  margin-bottom: 18px;
}
.site-index a { text-decoration: none; }
.site-index a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.credits { text-align: center; font-size: 14px; margin: 0 auto; max-width: 60ch; color: #ccc; }

/* ---------- Dialogs ---------- */

.dlg {
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: 28px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 5px var(--ink), var(--shadow);
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.35); }
.dlg p { margin: 0 0 14px; }
.dlg-title { font-size: 20px; font-weight: 600; text-align: center; }
.dlg-small { font-size: 15px; }
.dlg .btn-row { margin-top: 12px; }

.disk-anim {
  position: relative; width: 140px; height: 132px; margin: 0 auto 10px;
}
.disk-mask { position: absolute; left: 30px; top: 0; width: 80px; height: 90px; overflow: hidden; }
.disk-floppy { width: 80px; height: 80px; display: block; }
.disk-drive {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
  border: 1px solid var(--ink); border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.disk-slot {
  position: absolute; left: 22px; right: 22px; top: -3px; height: 6px;
  background: var(--ink); border-radius: 3px;
}
.disk-led {
  position: absolute; right: 12px; bottom: 10px; width: 10px; height: 6px;
  border: 1px solid var(--ink); background: var(--paper);
}
.dlg.is-running .disk-floppy { animation: disk-in 1.1s steps(11) forwards; }
.dlg.is-running .disk-led { animation: led 0.25s steps(1) 1s 4; }
.dlg.is-done .disk-floppy { transform: translateY(92px); }
@keyframes disk-in { to { transform: translateY(92px); } }
@keyframes led { 0% { background: var(--red); } 50% { background: var(--paper); } }

.progress {
  height: 16px; border: 1px solid var(--ink); margin: 0 0 18px; padding: 2px;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, var(--paper) 2px 4px);
}
.dlg.is-running .progress span { animation: progress 1.3s steps(20) forwards; }
.dlg.is-done .progress span { width: 100%; background: var(--ink); }
@keyframes progress { to { width: 100%; } }

.dlg--alert { width: min(460px, calc(100vw - 2 * var(--gutter))); }
.dlg--alert .alert-row { grid-template-columns: 48px minmax(0, 1fr); gap: 18px; }
.dlg--alert .alert-icon { width: 48px; height: 51px; }
.dlg--alert p { font-size: 17px; }

.dlg--viewer {
  width: min(860px, calc(100vw - 2 * var(--gutter)));
  padding: 0;
  box-shadow: var(--shadow);
}
.dlg--viewer form { display: contents; }
.viewer-body { padding: 14px; }
.viewer-body img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--ink); border: 1px solid var(--ink); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.viewer-count { font-size: 15px; }

/* Bootstrap-modal stand-in used by the Mobirise form script */
.mac-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: var(--gutter);
  background: rgba(0, 0, 0, 0.3);
}
.mac-modal[hidden] { display: none; }
.mac-modal .modal-dialog { width: min(420px, 100%); }
.mac-modal .modal-content {
  background: var(--paper) !important;
  border: 1px solid var(--ink) !important;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 5px var(--ink), var(--shadow) !important;
  padding: 28px;
}
.mac-modal .modal-body { display: flex; flex-direction: column-reverse; gap: 16px; }
.mac-modal .modal-body p { margin: 0; font: 17px/1.5 var(--font-body); text-align: left !important; }
.mac-modal .btn-close {
  align-self: flex-end;
  min-height: 36px; padding: 4px 22px;
  border: 1px solid var(--ink); border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--ink);
  font: 16px var(--font-pixel);
  cursor: pointer;
}
.mac-modal .btn-close::before { content: "OK"; }
.mac-modal .btn-close:hover { background: var(--ink); color: var(--paper); }

/* ---------- Toast, splash, bat, snow ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 10px 16px;
  background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--shadow);
  font-size: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.splash {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--paper) var(--pat-gray);
}
.splash[hidden] { display: none; }
.splash-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 44px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 5px var(--ink), var(--shadow);
}
.splash-icon { width: 60px; height: 64px; }
.splash-box p { margin: 0; font-size: 22px; font-weight: 600; }

.bat {
  position: fixed; left: 0; top: 0; z-index: 45;
  width: 54px; height: 30px;
  cursor: crosshair;
}
.bat svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bat .bat-b { visibility: hidden; }
.bat.is-flapping .bat-a { animation: flap-a 0.32s steps(1) infinite; }
.bat.is-flapping .bat-b { animation: flap-b 0.32s steps(1) infinite; }
@keyframes flap-a { 50% { visibility: hidden; } }
@keyframes flap-b { 0% { visibility: hidden; } 50% { visibility: visible; } }

.snow { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; pointer-events: none; }
.snow[hidden] { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-icons {
    order: -1;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    justify-items: center; gap: 14px 6px;
  }
  .desk-icon { width: 100%; max-width: 104px; }
  .desk-icon svg { width: 48px; height: 48px; }
  .desk-icon--trash { margin-top: 0; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-fig { position: static; max-width: 512px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --gutter: 12px; }
  body { font-size: 16.5px; }
  .menu--desk { display: none; }
  .menu--mobile { display: flex; }
  .menu-list--mobile {
    position: fixed; top: var(--menubar-h); left: 0; right: 0;
    max-height: calc(100vh - var(--menubar-h)); overflow-y: auto;
    border-left: 0; border-right: 0;
    box-shadow: 0 3px 0 var(--ink);
  }
  .menu-list--mobile a, .menu-list--mobile button { padding: 10px 20px; font-size: 17px; }

  .desk { padding-top: 36px; padding-bottom: 36px; }
  .stack { gap: 32px; }
  .welcome, .info, .readme { grid-template-columns: minmax(0, 1fr); }
  .welcome-art { max-width: 260px; }
  .readme-art { max-width: 170px; }
  .desk-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 4px; }
  .desk-icon svg { width: 40px; height: 40px; }
  .desk-icon span { font-size: 13px; }
  .hero-head { margin-bottom: 24px; }
  .info-cover { max-width: 240px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .finder-strip span:nth-child(3) { display: none; }
  .contact, .alert-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .music { grid-template-columns: 48px minmax(0, 1fr); }
  .music-icon { width: 48px; height: 48px; }
  .music-btns { grid-column: 1 / -1; justify-content: flex-start; }
  .contact-icon, .window--alert .alert-icon { width: 48px; height: 48px; }
  .contact-form form { grid-template-columns: minmax(0, 1fr); }
  .scrapbook { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .statusline-go { display: none; }
  .btn-row { gap: 14px 18px; }
  .title { max-width: calc(100% - 64px); }
}

@media (max-width: 380px) {
  .clock:not(.is-festive) { display: none; }
}

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