/* Deep Purr site: landing page, /privacy/ and the header/footer of /download/.
   Colours from src/ui/tokens.css; fonts are the game's bundled Pixelify Sans and Nunito. */
@font-face { font-family: 'Pixelify Sans'; font-weight: 600; src: url('/fonts/pixelify-sans-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 600; src: url('/fonts/nunito-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --surface: #FBF1D3; --surface-alt: #F3E2B3; --surface-sunk: #E8D29C;
  --outline: #2A2024; --on-surface: #2A2024; --on-surface-muted: #675445;
  --primary: #E07A7A; --primary-hover: #EA8F8F; --primary-pressed: #C96565; --on-primary: #2A2024;
  --accent: #F2A3B8; --bean: #8A5A30; --on-bean: #FBF1D3;
  --success: #6FAE5A; --warning: #E6B450; --info: #6A93B8; --disabled: #CDBF9E;
  --dot: rgb(138 90 48 / 0.16);
  --discord: #5865F2;
  --font-pixel: 'Pixelify Sans', monospace; --font-body: 'Nunito', system-ui, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #2E2226; --surface-alt: #3C2D31; --surface-sunk: #241A1D; --outline: #120C0E;
    --on-surface: #F6E7C8; --on-surface-muted: #B9A48E; --primary: #F5C66B; --primary-hover: #F8D38A;
    --primary-pressed: #DDAE55; --dot: rgb(246 231 200 / 0.06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--surface-sunk); scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--on-surface); font: 600 17px/1.55 var(--font-body);
  background: var(--surface-sunk) radial-gradient(var(--dot) 1px, transparent 1.5px) 0 0 / 12px 12px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, .pixel { font-family: var(--font-pixel); font-weight: 600; letter-spacing: 0.01em; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.2; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The skip link shows itself when a keyboard user tabs onto it. */
a.sr-only:focus {
  z-index: 40; top: 8px; left: 8px; width: auto; height: auto; padding: 10px 14px; clip: auto; overflow: visible;
  background: var(--surface); color: var(--on-surface); border: 2px solid var(--outline); box-shadow: 3px 3px 0 var(--outline);
  font-weight: 700; text-decoration: none;
}
/* No lone word on the last line of a heading; fewer orphans in body copy. */
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.muted { color: var(--on-surface-muted); }

/* ---- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  font: 600 19px/1 var(--font-pixel); text-decoration: none; color: var(--on-primary); background: var(--primary);
  border: 2px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); cursor: pointer;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out, background-color 120ms ease-out;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:active { background: var(--primary-pressed); transform: translate(3px, 3px); box-shadow: none; }
.btn--quiet { background: var(--surface); color: var(--on-surface); }
.btn--quiet:hover { background: var(--surface-alt); }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 16px; box-shadow: 2px 2px 0 var(--outline); }
.btn[aria-disabled="true"] {
  cursor: not-allowed; background: var(--surface-alt); color: var(--on-surface-muted); box-shadow: none;
  border-style: dashed;
}
.btn[aria-disabled="true"]:active { transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; shape-rendering: crispEdges; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:active { transition: none; transform: none; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--on-surface);
  background: var(--surface); border: 2px solid var(--outline); box-shadow: 2px 2px 0 var(--outline); cursor: pointer;
  text-decoration: none; transition: transform 80ms ease-out, box-shadow 80ms ease-out, background-color 120ms ease-out;
}
.icon-btn:hover { background: var(--surface-alt); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--discord { background: var(--discord); color: #FFFFFF; }
.icon-btn--discord:hover { background: #4752C4; }
.icon-btn--discord svg { width: 24px; height: 18px; }
.icon-btn__at { font: 700 25px/1 var(--font-body); margin-top: -3px; }

/* ---- header */
.site-header {
  position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 2px solid var(--outline);
  font-family: var(--font-body);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; margin-right: auto; }
.brand img { width: 32px; height: 32px; }
.brand span { font: 600 22px/1 var(--font-pixel); }
.site-nav { display: none; gap: 20px; margin-right: 8px; }
.site-nav a { font-weight: 700; text-decoration: none; font-size: 16px; }
.site-nav a:hover { text-decoration: underline; }
.site-header .wrap > .btn { display: none; }
@media (min-width: 900px) { .site-nav { display: flex; } }
@media (min-width: 560px) { .site-header .wrap > .btn { display: inline-flex; } }

/* ---- popover (Discord "coming soon") */
.pop-anchor { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: min(280px, calc(100vw - 32px));
  padding: 14px; background: var(--surface); border: 2px solid var(--outline); box-shadow: 4px 4px 0 var(--outline);
  font-size: 15px; line-height: 1.45; text-align: left;
}
.popover[hidden] { display: none; }
.popover p + p, .popover p + button { margin-top: 10px; }
.popover strong { font: 600 18px/1.2 var(--font-pixel); display: block; margin-bottom: 4px; }
.site-footer .popover { top: auto; bottom: calc(100% + 10px); }

/* ---- footer */
.site-footer { margin-top: 0; background: var(--surface); border-top: 2px solid var(--outline); padding: 32px 0 40px; font-size: 15px; }
.site-footer .wrap { display: grid; gap: 20px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; font-weight: 700; }
.footer-links a { display: inline-block; padding: 12px 0; } /* 44px-tall tap targets */
.footer-icons { display: flex; gap: 12px; margin-left: auto; }
.footer-note { color: var(--on-surface-muted); max-width: 60em; }

/* ---- dialogs (email signup, screenshot lightbox) */
dialog {
  width: min(460px, calc(100vw - 32px)); padding: 24px; color: var(--on-surface); background: var(--surface);
  border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--outline);
}
dialog::backdrop { background: rgb(42 32 36 / 0.55); }
.dialog-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; font: 600 20px/1 var(--font-pixel); }

/* ---- image gallery (site.js builds it; any <a data-zoom="group"> opens it) */
dialog.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; box-shadow: none; color: #F6E7C8; overflow: hidden;
  background: #140E10 radial-gradient(ellipse at 50% 45%, #4A323A, #140E10 70%);
}
dialog.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
dialog.lb::backdrop { background: rgb(20 14 16 / 0.6); }
.lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 6px 16px; }
.lb__count { font: 600 18px/1 var(--font-pixel); letter-spacing: 0.06em; color: #E8D7B5; }
.lb .icon-btn { width: 48px; height: 48px; font: 600 24px/1 var(--font-pixel); color: #2A2024; background: #FBF1D3; border-color: #120C0E; box-shadow: 3px 3px 0 #120C0E; }
.lb .icon-btn:hover { background: #F3E2B3; }
.lb .icon-btn:disabled { opacity: 0.35; cursor: default; }
.lb [hidden] { display: none; }
.lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 4px 8px; overflow: hidden; }
.lb__img {
  display: block; max-width: none; height: auto; background: #E8D29C; border: 2px solid #120C0E;
  image-rendering: pixelated; image-rendering: crisp-edges;
  box-shadow: 6px 6px 0 #120C0E, 0 0 64px rgb(242 163 184 / 0.22), 0 0 140px rgb(230 180 80 / 0.12);
}
.lb__img.is-smooth { image-rendering: auto; }
.lb__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; }
.lb__nav--prev { left: 12px; }
.lb__nav--next { right: 12px; }
.lb__cap { padding: 8px 16px 18px; text-align: center; max-width: 48em; margin: 0 auto; }
.lb__title { display: block; font: 600 20px/1.25 var(--font-pixel); color: #FBF1D3; }
.lb__desc { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; color: #D9C6A8; }
.lb.is-loading .lb__img { opacity: 0.4; }
@media (max-width: 640px) {
  /* Phone: the arrows sit under the picture so they never cover it; swipe works too. */
  .lb__nav { top: auto; bottom: 0; translate: none; position: relative; left: auto; right: auto; }
  .lb__navrow { display: flex; justify-content: center; gap: 16px; padding: 4px 0 12px; }
}
@media (min-width: 641px) { .lb__navrow { display: contents; } }
@media (prefers-reduced-motion: no-preference) {
  dialog.lb[open] { animation: lb-in 160ms ease-out; }
  @keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
  .lb__img { transition: opacity 120ms ease-out; }
}
html.lb-open { overflow: hidden; }

/* ---- signup form */
.signup { display: grid; gap: 12px; }
.signup__row { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input[type="email"] {
  flex: 1 1 220px; min-height: 48px; padding: 0 14px; font: 700 17px var(--font-body); color: var(--on-surface);
  background: var(--surface); border: 2px solid var(--outline); border-radius: 0; box-shadow: inset 2px 2px 0 rgb(42 32 36 / 0.12);
}
.signup input[type="email"]::placeholder { color: var(--on-surface-muted); opacity: 1; }
.signup__consent { font-size: 14px; color: var(--on-surface-muted); }
.signup__status { min-height: 1.5em; font-weight: 700; }
.signup__status[data-kind="ok"] { color: var(--success); }
.signup__status[data-kind="err"] { color: #B2453F; }
@media (prefers-color-scheme: dark) { .signup__status[data-kind="err"] { color: #F09A94; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }


/* Header Discord/@ step aside while the page's signup form or the footer is on screen (site.js). */
.site-header .pop-anchor, .site-header [data-signup] { transition: opacity 160ms ease-out, visibility 160ms; }
.site-header.is-cta-elsewhere .pop-anchor, .site-header.is-cta-elsewhere [data-signup] { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .site-header .pop-anchor, .site-header [data-signup] { transition: none; } }
