/* ============================================================
   PEN-DOS — retro stylesheet
   Aesthetic: 90s Macintosh (System 6/7) chrome on a
   Geocities-style single-column page.
   ============================================================ */

/* Locally hosted fonts — no requests to Google Fonts. */
@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Silkscreen";
  src: url("fonts/Silkscreen-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Silkscreen";
  src: url("fonts/Silkscreen-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Chicago Kare";
  src: url("fonts/ChicagoKare-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #000000;
  --paper: #ffffff;
  --teal: #3aa0a2;
  --teal-dark: #14484a;
  --mint: #aef2cf;
  --yellow: #ffe95e;
  --salmon: #ff7f7c;
  --lilac: #b39df0;
  --link: #0000ee;
  --link-visited: #551a8b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* System 7 “scales” desktop pattern, drawn as an SVG tile */
body {
  margin: 0;
  padding: 24px 12px 48px;
  background-color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' fill='%233aa0a2'/%3E%3Cg fill='none' stroke='%2314484a' stroke-width='1.4'%3E%3Cpath d='M0 10 a10 10 0 0 1 20 0'/%3E%3Cpath d='M-10 20 a10 10 0 0 1 20 0'/%3E%3Cpath d='M10 20 a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
  font-family: Geneva, Verdana, "DejaVu Sans", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }

a         { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover   { background: var(--ink); color: var(--paper) !important; text-decoration: none; }

/* ---------- the page column ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 26px 20px 20px;
  border-bottom: 2px solid var(--ink);
  /* subtle 50% dither, like a System 6 desktop */
  background-image: repeating-conic-gradient(#e8e8e8 0% 25%, #ffffff 0% 50%);
  background-size: 4px 4px;
  text-align: center;
}

.mascot { flex: 0 0 auto; }
.mascot-right { transform: scaleX(-1); }

.masthead h1 {
  margin: 0;
  font-family: "VT323", monospace;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 4px 4px 0 var(--mint);
}

.tagline {
  margin: 10px 0 2px;
  font-family: "Silkscreen", monospace;
  font-size: 11px;
}

.subtagline { margin: 0; font-size: 11px; }

/* ---------- nav ---------- */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px 88px;
  border-bottom: 2px solid var(--ink);
}

/* theme switcher, top right of the content window
   (visual style comes from .btn-win95 below) */
.btn-switch {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* System 7 push button */
.btn {
  display: inline-block;
  padding: 5px 16px;
  font-family: Silkscreen, monospace;
  font-size: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:visited { color: var(--ink); }
.btn:hover, .btn:active { background: var(--ink); color: var(--paper) !important; }

/* the “default button” double ring, like [ Find ] */
.btn-default {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
  margin: 0 4px;
}

.btn-small { padding: 3px 10px; font-size: 10px; }

/* ---------- news ticker ---------- */
.ticker {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--mint);
  font-family: Silkscreen, monospace;
  font-size: 11px;
  padding: 4px 0;
}

.ticker-mobile {
  display: none;
  overflow: hidden;
  white-space: nowrap;
}

@keyframes ticker-mobile-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- no-JavaScript notice (shown only via <noscript>) ---------- */
.noscript-notice {
  max-width: 560px;
  margin: 24px auto;
  padding: 16px 20px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
.noscript-notice p { margin: 8px 0; }

/* ---------- generic content section ---------- */
.content { padding: 20px 24px; }

/* Mac window title bar, repurposed as a section heading:
   six pinstripes with the label in a white gap */
.wintitle {
  display: flex;
  align-items: center;
  margin: 0 0 16px;
  border: 1px solid var(--ink);
  padding: 3px 6px;
  background: var(--paper);
  font-family: VT323, monospace;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
}

.wintitle::before,
.wintitle::after {
  content: "";
  flex: 1;
  height: 11px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, var(--paper) 1px 3px);
  margin-top: 1px;
}

.wintitle span { padding: 0 14px; white-space: nowrap; }

/* ---------- help balloon (yellow, from Balloon Help) ---------- */
.balloon {
  position: relative;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

.balloon::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 46px;
  border: 7px solid transparent;
  border-bottom-color: var(--ink);
}

.balloon::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 48px;
  border: 5px solid transparent;
  border-bottom-color: var(--yellow);
}

.balloon p { margin: 6px 0; }

/* ---------- mod list ---------- */
.modlist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ink);
}

.mod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.mod + .mod { border-top: 1px dotted var(--ink); }

.mod:nth-child(even) { background: #f2f2f2; }

.icon { flex: 0 0 32px; height: 32px; }
/* icons may be inline <svg> or an <img> (see the ICONS block in index.html) */
.icon svg,
.icon img { width: 32px; height: 32px; display: block; image-rendering: pixelated; }

.mod-info { flex: 1 1 auto; min-width: 0; }
.mod-name { display: block; font-size: 13px; }
.mod-game { display: block; font-size: 11px; color: #333; }

.tag {
  font-family: "Silkscreen", monospace;
  font-style: normal;
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--ink);
  vertical-align: 2px;
}

.tag-new { background: var(--mint); }
.tag-hot { background: var(--salmon); }

.mod-meta { flex: 0 0 auto; }

/* dithered progress bar, like the About-the-Finder memory bars */
.meter {
  display: inline-block;
  width: 90px;
  height: 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
  vertical-align: middle;
}

.meter > span {
  display: block;
  height: 100%;
  background-image: repeating-conic-gradient(var(--ink) 0% 25%, var(--paper) 0% 50%);
  background-size: 4px 4px;
}

.meter-wide { width: 100%; }

/* Finder-style status strip under the list */
.finder-status {
  display: flex;
  justify-content: space-between;
  margin: 0;
  border: 1px solid var(--ink);
  border-top: 0;
  padding: 3px 12px;
  font-size: 11px;
  background: var(--paper);
}

/* ---------- about ---------- */
.about {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.about-mascot {
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  padding: 6px;
  background: var(--mint);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

.about-text p:first-child { margin-top: 0; }

.stats { display: grid; gap: 6px; }

.stat {
  display: grid;
  grid-template-columns: 190px 1fr 90px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.stat-label { font-weight: bold; }
.stat-val { text-align: right; }

/* ---------- faq ---------- */
.faq { margin: 0; }
.faq dt { font-weight: bold; margin-top: 10px; }
.faq dt::before { content: "▪ "; }
.faq dd { margin: 2px 0 0 18px; }

/* ---------- links ---------- */
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { margin: 5px 0; }

/* ---------- footer ---------- */
.footer {
  position: relative;   /* anchors the QuickTime launcher, bottom right */
  border-top: 2px solid var(--ink);
  padding: 18px 24px 22px;
  text-align: center;
  background-image: repeating-conic-gradient(#e8e8e8 0% 25%, #ffffff 0% 50%);
  background-size: 4px 4px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* 88×31 web buttons, drawn in CSS */
.badge {
  width: 88px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: "Silkscreen", monospace;
  font-size: 8px;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
}

.badge-teal   { background: var(--teal);   color: var(--paper); }
.badge-yellow { background: var(--yellow); }
.badge-purple { background: var(--lilac); }

.badge-images { margin-top: -4px; }
.web-button { display: block; flex: 0 0 88px; width: 88px; height: 31px; }

.counter-row { margin: 8px 0; font-size: 12px; }

/* odometer-style hit counter */
.counter {
  display: inline-flex;
  gap: 2px;
  padding: 2px 3px;
  background: var(--ink);
  border: 1px solid var(--ink);
  vertical-align: -4px;
}

.counter span {
  display: inline-block;
  width: 14px;
  padding: 1px 0;
  background: #111;
  color: #7dffa0;
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  text-align: center;
  border: 1px solid #333;
}

.fineprint { margin: 4px 0; font-size: 10px; color: #333; }
.fineprint a { color: var(--link); }

/* ---------- display panel (desktop only) ---------- */
.sidepanel {
  display: none;
  position: absolute;
  top: 202px; /* aligned with the navbar */
  left: calc(50% + 376px);
  width: 178px;
  padding: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}

.sidepanel-title { margin-bottom: 14px; font-size: 14px; padding: 2px 4px; }

.sidepanel-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

/* the switch button, dressed as a Windows 95 push button */
.btn-win95 {
  display: block;
  padding: 8px 10px;
  font-family: Tahoma, "MS Sans Serif", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  color: #000 !important;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 #0a0a0a,
    inset  1px  1px 0 #ffffff,
    inset -2px -2px 0 #808080,
    inset  2px  2px 0 #dfdfdf;
}

.btn-win95:hover { background: #c0c0c0; }

.btn-win95:active {
  box-shadow:
    inset -1px -1px 0 #ffffff,
    inset  1px  1px 0 #0a0a0a,
    inset -2px -2px 0 #dfdfdf,
    inset  2px  2px 0 #808080;
  padding: 9px 9px 7px 11px;
}

/* footer dark mode button: only where the side panel is hidden */
.footer-darkrow { margin: 12px 0 8px; }

@media (min-width: 1120px) {
  .sidepanel { display: block; }
  .navbar .btn-switch { display: none; }
  .footer-darkrow { display: none; }
}

/* ---------- dark mode (After Dark edition) ---------- */
.dark {
  --ink: #e6e6e6;
  --paper: #161616;
  --link: #9db8ff;
  --link-visited: #cfa9ee;
}

.dark body {
  background-color: #0d3233;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' fill='%230d3233'/%3E%3Cg fill='none' stroke='%23051d1e' stroke-width='1.4'%3E%3Cpath d='M0 10 a10 10 0 0 1 20 0'/%3E%3Cpath d='M-10 20 a10 10 0 0 1 20 0'/%3E%3Cpath d='M10 20 a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
}

.dark .masthead,
.dark .footer {
  background-image: repeating-conic-gradient(#202020 0% 25%, #161616 0% 50%);
}

.dark .mascot { filter: invert(1); }
/* 1-bit black/white icons read correctly when inverted in the dark theme.
   If you ever use a COLOUR icon here, add class="noinvert" to its <img>. */
.dark .icon svg,
.dark .icon img { filter: invert(1); }
.dark .icon img.noinvert { filter: none; }

.dark .mod:nth-child(even) { background: #202020; }
.dark .mod-game { color: #b0b0b0; }
.dark .fineprint { color: #b0b0b0; }

.dark .balloon { color: #000; }
.dark .tag { color: #000; }
.dark .badge-yellow, .dark .badge-purple { color: #000; }

/* ============================================================
   EASTER EGG — QuickTime™ launcher + fake System 7 windows
   ============================================================ */

/* the little control-panel icon in the footer's bottom right corner */
.qt-launcher {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  padding: 2px;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 0;
}
.qt-launcher svg,
.qt-launcher img { width: 100%; height: 100%; image-rendering: pixelated; }
.qt-launcher [hidden] { display: none; }
.qt-launcher:hover, .qt-launcher:focus { border-color: var(--ink); }
/* only the drawn 1-bit fallback inverts in dark mode; a real colour
   icon is left alone */
.dark .qt-launcher svg { filter: invert(1); }

/* ---------- generic System 7 window ---------- */
.macwin {
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  font-size: 11px;
  color: var(--ink);
  user-select: none;
}
.macwin[hidden] { display: none; }

.macwin-title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--ink);
  cursor: move;
  touch-action: none;      /* so dragging works on touch screens */
}

.macwin-stripes {
  flex: 1;
  height: 11px;
  background: repeating-linear-gradient(to bottom,
              var(--ink) 0 1px, var(--paper) 1px 3px);
}

.macwin-name {
  padding: 0 8px;
  font-weight: bold;
  white-space: nowrap;
}

.macwin-box {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
}
.macwin-close:active { background: var(--ink); }
.macwin-zoom { position: relative; cursor: default; }
.macwin-zoom::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 5px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ---------- the "QuickTime Movies" folder ---------- */
.qt-folder { width: 316px; }

.qt-infobar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 8px 3px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.qt-body { display: flex; }

.qt-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 2px;
  padding: 12px 6px;
  min-height: 150px;
  align-content: start;
}

.qt-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.qt-item-icon { line-height: 0; }
.qt-item-icon svg { width: 32px; height: 32px; image-rendering: pixelated; }
.qt-item-label {
  padding: 0 3px;
  text-align: center;
  line-height: 1.25;
  max-width: 90px;
}
.qt-item:hover .qt-item-label,
.qt-item:focus .qt-item-label { background: var(--ink); color: var(--paper); }

/* fake scroll bars, dithered like the real thing */
.qt-sb { display: flex; background: var(--paper); }
.qt-sb b {
  flex: 1;
  background-image: repeating-conic-gradient(var(--ink) 0% 25%, var(--paper) 0% 50%);
  background-size: 2px 2px;
}
.qt-sb i { flex: 0 0 12px; background: var(--paper); }
.qt-sb-v {
  flex: 0 0 13px;
  flex-direction: column;
  border-left: 1px solid var(--ink);
}
.qt-sb-v i { flex: 0 0 12px; border-bottom: 1px solid var(--ink); }
.qt-sb-h {
  flex: 0 0 13px;
  height: 13px;
  border-top: 1px solid var(--ink);
}
.qt-sb-h i { border-right: 1px solid var(--ink); }

/* ---------- the movie player ----------
   ==========================================================

   ========================================================== */
.qt-player {
  --qt-width: 330px;
  --qt-screen-h: 250px;
  width: var(--qt-width);
}

.qt-screen {
  position: relative;
  height: var(--qt-screen-h);
  background-color: #000;
  background-image: repeating-conic-gradient(#1a1a1a 0% 25%, #000 0% 50%);
  background-size: 4px 4px;
  border-bottom: 1px solid var(--ink);
}

/* real video fills the fixed-size screen, letterboxed so nothing is cropped */
.qt-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.qt-video[hidden] { display: none; }


.qt-yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  pointer-events: none;
}
.qt-yt[hidden] { display: none; }


.qt-cover {
  position: absolute;
  inset: 0;
  z-index: 2;                 /* above the iframe, which is added later */
  background-color: #000;
  background-image: repeating-conic-gradient(#1a1a1a 0% 25%, #000 0% 50%);
  background-size: 4px 4px;
  pointer-events: none;
}
.qt-cover[hidden] { display: none; }

.qt-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
}

.qt-cbtn {
  flex: 0 0 auto;
  width: 16px;
  height: 14px;
  padding: 0;
  line-height: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
}
.qt-cbtn svg { width: 100%; height: 100%; }
.qt-cbtn:active { background: #c0c0c0; }
.dark .qt-cbtn svg { filter: invert(1); }

.qt-track {
  position: relative;
  flex: 1;
  height: 14px;
  border: 1px solid var(--ink);
  background-image: repeating-conic-gradient(var(--ink) 0% 25%, var(--paper) 0% 50%);
  background-size: 2px 2px;
}
.qt-thumb {
  position: absolute;
  top: 1px;
  left: 0;
  width: 9px;
  height: 10px;
  background: var(--paper);
  border: 1px solid var(--ink);
}

/* ---------- small screens ---------- */
@media (max-width: 620px) {
  .navbar { padding: 14px 16px; }
  .btn-switch { position: static; transform: none; }
  .ticker-desktop { display: none; }
  .ticker-mobile { display: block; }
  .ticker-mobile-track {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-mobile-scroll 36s linear infinite;
    will-change: transform;
  }
  .masthead { flex-direction: column; gap: 10px; }
  .mascot-right { display: none; }
  .masthead h1 { font-size: 34px; }
  .mod { flex-wrap: wrap; }
  .mod-meta { display: none; }
  .stat { grid-template-columns: 1fr; gap: 2px; }
  .stat-val { text-align: left; }
}
