/* site.css - shared by every page of the PeeCee Critters site.
 *
 * The palette is the DEVICE's: #DCE6EC is the LCD's own off-blue and #26343E
 * the ink it writes in, both lifted out of widget.js rather than picked to
 * resemble it. The green is the grass the pet walks on.
 *
 * Silkscreen is a PIXEL face and is used only where the game uses its bitmap
 * font - titles, labels, figures. Running prose stays in a face built for
 * reading: a paragraph of pixel type is a costume, not a design.
 */

:root {
  --ground: #D5E1E8;
  --panel: #EAF1F5;
  --panel-2: #C3D4DD;
  --line: #A5BCC9;
  --line-soft: #BFD1DA;
  --ink: #22303A;
  --ink-2: #54687A;
  --ink-3: #7B8E9C;
  --grass: #4F7A50;
  --hot: #9E3A24;
  --on-hot: #FFF4F0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F171D;
    --panel: #182530;
    --panel-2: #1F2F3B;
    --line: #2C3F4D;
    --line-soft: #24343F;
    --ink: #DCE6EC;
    --ink-2: #93A9B8;
    --ink-3: #6F8494;
    --grass: #79A863;
    --hot: #E06A4A;
    --on-hot: #1A0F0B;
  }
}
:root[data-theme="dark"] {
  --ground: #0F171D;
  --panel: #182530;
  --panel-2: #1F2F3B;
  --line: #2C3F4D;
  --line-soft: #24343F;
  --ink: #DCE6EC;
  --ink-2: #93A9B8;
  --ink-3: #6F8494;
  --grass: #79A863;
  --hot: #E06A4A;
  --on-hot: #1A0F0B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .label, .fig-n, .btn, nav a, .tag {
  font-family: "Silkscreen", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: .01em;
}
.label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
p { max-width: 62ch; }
.lede { color: var(--ink-2); max-width: 60ch; margin: 0 0 26px; font-size: 1.04rem; }

/* ------------------------------- nav ---------------------------------- */

.topbar { border-bottom: 2px solid var(--ink); background: var(--panel); }
.topbar .wrap-wide {
  display: flex; align-items: center; gap: 8px 26px;
  flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px;
}
.topbar .home { font-family: "Silkscreen", monospace; font-size: 16px;
  text-decoration: none; color: var(--ink); margin-right: auto; }
nav { display: flex; gap: 6px 28px; flex-wrap: wrap; }
/* Sized up from 11px: at that size the four rooms of this site read as
   small print beside the wordmark, and they are the whole navigation. */
nav a {
  font-size: 15px; letter-spacing: .06em;
  color: var(--ink-2); text-decoration: none; padding: 8px 0 6px;
  border-bottom: 3px solid transparent;
}
nav a:hover, nav a:focus-visible { color: var(--ink); border-bottom-color: var(--hot); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ------------------------------ buttons ------------------------------- */

.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
  display: inline-block; font-size: 14px; padding: 15px 26px;
  border: 2px solid var(--ink); background: var(--hot); color: var(--on-hot);
  text-decoration: none; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s; cursor: pointer;
}
.btn:hover, .btn:focus-visible { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: var(--panel); color: var(--ink); }
.btn[aria-disabled="true"] {
  background: var(--panel-2); color: var(--ink-3); border-color: var(--line);
  box-shadow: 4px 4px 0 var(--line); cursor: not-allowed;
}
.cta small { color: var(--ink-3); font-size: 13.5px; max-width: 26ch; }

/* ------------------------------ sections ------------------------------ */

section { padding: 62px 0; border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: 0; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.7rem); margin: 10px 0 10px; text-wrap: balance; }
h3 { font-size: 14px; margin: 0 0 8px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 26px 34px; margin-top: 30px; }
.col p { margin: 0; font-size: 15.5px; color: var(--ink-2); max-width: none; }

.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1px; background: var(--line); border: 2px solid var(--ink); margin: 34px 0 0; }
.figs > div { background: var(--panel); padding: 16px 14px; }
.fig-n { font-size: 1.55rem; display: block; line-height: 1.15; }
.figs .label { margin-top: 5px; display: block; }

canvas { image-rendering: pixelated; }

/* ------------------------------- footer ------------------------------- */

footer { border-top: 2px solid var(--ink); padding: 34px 0 70px; }
.footrow { display: flex; justify-content: space-between; gap: 18px;
           flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ------------------------------ lightbox ------------------------------ */

/* Clickable images announce themselves. A picture that grows when you click it
   and gives no sign it will is a feature nobody finds. */
.zoom { cursor: zoom-in; }
.shot { position: relative; }
.shot .hint {
  position: absolute; right: 8px; bottom: 8px;
  font-family: "Silkscreen", monospace; font-size: 9px; letter-spacing: .1em;
  background: var(--ink); color: var(--panel); padding: 4px 7px;
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.shot:hover .hint, .shot:focus-within .hint { opacity: .9; }

dialog.lb {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100%; height: 100%; margin: 0;
}
dialog.lb::backdrop { background: rgba(8, 12, 16, .92); }
.lb-inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 3vmin; }
.lb img {
  max-width: 96vw; max-height: 88vh; width: auto; height: auto;
  image-rendering: pixelated; border: 2px solid var(--ink); background: var(--panel);
}
.lb-cap {
  margin-top: 10px; text-align: center; color: #C9D6DF;
  font-family: "Silkscreen", monospace; font-size: 11px; letter-spacing: .1em;
}
.lb-close {
  position: fixed; top: 14px; right: 16px; z-index: 2;
  font-family: "Silkscreen", monospace; font-size: 13px;
  background: var(--panel); color: var(--ink); border: 2px solid var(--ink);
  padding: 8px 13px; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .shot .hint { transition: none; } }

/* --------------------------------- faq -------------------------------- */

.faq { border: 2px solid var(--ink); margin-top: 30px; }
.faq details { border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 15px 18px; font-family: "Silkscreen", monospace;
  font-size: 12px; letter-spacing: .04em; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--hot); }
.faq details[open] summary::before { content: "- "; }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq .a { padding: 14px 18px 18px; color: var(--ink-2); font-size: 15.5px; }
.faq .a p { margin: 0 0 10px; }
.faq .a p:last-child { margin: 0; }

/* -------------------------------- specs ------------------------------- */

/* Plain facts, read as sentences. The .figs grid above is for figures with no
   ceiling - steps, creature counts - and putting "Win" or "Off" in it at
   1.55rem turns a spec sheet into a row of shouted syllables. */
.specs {
  list-style: none; margin: 26px 0 0; padding: 0;
  border: 2px solid var(--ink); background: var(--panel);
}
.specs li {
  display: grid; grid-template-columns: 130px 1fr; gap: 0 18px;
  align-items: baseline;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  font-size: 15.5px;
}
.specs li:last-child { border-bottom: 0; }
.specs li .label { margin: 0; }
@media (max-width: 520px) {
  .specs li { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------------------------- detail panel ---------------------------- */

.openable { cursor: zoom-in; }
.openable:hover { background: var(--panel-2); }
.openable:focus-visible { outline: 3px solid var(--hot); outline-offset: -3px; }

dialog.dt {
  border: 0; padding: 0; background: transparent;
  width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; margin: 0;
}
dialog.dt::backdrop { background: rgba(8, 12, 16, .92); }
.dt-inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 4vmin; }
.dt-card {
  background: var(--panel); border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0,0,0,.4);
  padding: 26px 30px 28px; text-align: center; max-width: 30rem;
}
.dt-cv { width: 256px; height: 256px; max-width: 60vw; image-rendering: pixelated; display: block; margin: 0 auto 14px; }
.dt-title { font-size: 18px; margin: 0 0 6px; }
.dt-sub { font-family: "Silkscreen", monospace; font-size: 11px; letter-spacing: .12em;
          text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.dt-body { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; max-width: 26rem; }
.dt-close {
  position: fixed; top: 14px; right: 16px; z-index: 2;
  font-family: "Silkscreen", monospace; font-size: 13px;
  background: var(--panel); color: var(--ink); border: 2px solid var(--ink);
  padding: 8px 13px; cursor: pointer;
}
