/* page basics */
/* the Events bulbs' bloom by day (css/sections/events.css) animates the lit bulb's radius. Registered here because
   @property is ignored inside a shadow root; a registration in the page applies to shadow roots too. Without it it'd
   jump instead of growing. */
@property --la {
  syntax: "<length>";
  inherits: false;
  initial-value: 3px;
}
:root {
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  margin: 0;
  font:
    14px system-ui,
    sans-serif;
}
img {
  max-width: 100%;
}
/* Photos come as <picture>: an AVIF (about half the size) with the JPEG in <img> for browsers that can't show AVIF.
   display: contents gives the <picture> no box of its own, so the <img> is laid out exactly as if it sat straight in
   its parent: in a flex row or grid it's still the item, and sizes in % still come from the parent. */
picture {
  display: contents;
}
/* the <source> would otherwise become a (blank) flex or grid item of its own, taking a cell or a gap; hiding it
   doesn't stop the browser choosing the AVIF from it */
picture > source {
  display: none;
}
/* a section that's off screen: its looping animations hold still until it comes back (js/pause-offscreen.js) */
.is-offscreen *,
.is-offscreen *::before,
.is-offscreen *::after {
  animation-play-state: paused !important;
}
[hidden] {
  display: none !important;
}

/* Layout: one long homepage in the Mench style. Ivory by day, Lights On navy by night (data-mode on <html>).
   Big backgrounds stay plain; color lives on the small pieces: solid tiles, tags and stickers with black outlines. */
:root {
  --bg: #fffbf0;
  --surface: #ffffff;
  --ink: #1a1714;
  --muted: #5b5045;
  --hair: #e3d8c0;
  --edge: #1a1714;
  --photo: #f5eedd;
  --yellow: #ffd731;
  --on-yellow: #1a1714;
  --blue: #2f8fff;
  --on-blue: #1a1714;
  --red: #db2e27;
  --on-red: #ffffff;
  --green: #1fb36a;
  --on-green: #1a1714;
  --purple: #9542fb;
  --on-purple: #ffffff;
  --main: var(--red);
  --on-main: var(--on-red);
  --tube: #6c5d9c;
  --tube-fill: #150e2b;
  --font-letters:
    "Big Shoulders Display", "Arial Narrow", sans-serif; /* only the five big M E N C H letters in the hero */
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --boing: cubic-bezier(0.25, 3, 0.5, 1);
  --r-btn: 12px;
  --r-card: 14px;
  --r-chip: 10px;
  --line: 3px;
  --hard: 4px 4px 0 var(--edge);
  --gutter: clamp(16px, 4vw, 40px);
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  --t-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --t-h2: clamp(2.3rem, 1.5rem + 3.4vw, 4rem);
}
:root[data-mode="night"] {
  --bg: #14171b;
  --surface: #171030;
  --ink: #f0ebff;
  --muted: #b3a8d6;
  --hair: #33285a;
  --edge: #f0ebff;
  --photo: #120c26;
  --yellow: #ffd731;
  --on-yellow: #0b0717;
  --blue: #4fa6ff;
  --on-blue: #0b0717;
  --red: #ff5b52;
  --on-red: #0b0717;
  --green: #35e08b;
  --on-green: #0b0717;
  --purple: #b977ff;
  --on-purple: #0b0717;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
}
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
h2,
h3 {
  text-wrap: balance;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* sound switches show a speaker with waves while sound is on, a crossed-out one while it's off (js/sound.js).
   Sound is on unless the visitor turned it off, so "not set yet" (before the script runs) counts as on. */
:root:not([data-sound="off"]) .sound-off,
[data-sound="off"] .sound-on {
  display: none;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}

/* ---------- color roles for small pieces ---------- */
.is-y {
  --c: var(--yellow);
  --on-c: var(--on-yellow);
}
.is-b {
  --c: var(--blue);
  --on-c: var(--on-blue);
}
.is-r {
  --c: var(--red);
  --on-c: var(--on-red);
}
.is-g {
  --c: var(--green);
  --on-c: var(--on-green);
}
.is-p {
  --c: var(--purple);
  --on-c: var(--on-purple);
}

/* ---------- buttons: Boing + tilt ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 1.3em;
  border: 2px solid var(--edge);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font: 600 1rem/1.1 var(--font-body);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  --ring: transparent;
  box-shadow:
    0 0 0 0 var(--edge),
    0 0 0 0 var(--ring);
  transition:
    transform 150ms var(--boing),
    box-shadow 150ms var(--boing);
}
.btn:hover,
.btn:focus-visible {
  transform: translate(-4px, -4px) rotate(-2.5deg);
  box-shadow:
    4px 4px 0 0 var(--edge),
    4px 4px 0 0.5px var(--ring);
}
.btn:active {
  transform: scale(0.94);
  box-shadow:
    0 0 0 0 var(--edge),
    0 0 0 0 var(--ring);
}
/* at night, colored buttons get a dark outline and shadow; the shadow is traced with a hairline of white */
[data-mode="night"] .btn:is(.btn--main, .btn--color) {
  --edge: #1a1714;
  --ring: rgba(255, 255, 255, 0.5);
}
.btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
.btn--main {
  background: var(--main);
  color: var(--on-main);
}
.btn--sm {
  min-height: 40px;
  padding: 0 1em;
  font-size: 0.9rem;
}
[data-mode="night"] .btn:not(.btn--main):not(.btn--color) {
  background: var(--bg);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- tiles (solid colored small pieces) and cards (white) ---------- */
.tile {
  background: var(--c);
  color: var(--on-c);
  border: var(--line) solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--hard);
}
[data-mode="night"] .tile {
  border-color: var(--c);
  box-shadow: none;
}
.card {
  background: var(--surface);
  color: var(--ink);
  border: var(--line) solid var(--edge);
  border-radius: var(--r-card);
  box-shadow: var(--hard);
}
[data-mode="night"] .card {
  border: 1.5px solid var(--hair);
  box-shadow: none;
}
a.tile,
a.card {
  text-decoration: none;
  transition:
    transform 150ms var(--boing),
    box-shadow 150ms var(--boing);
}
a.tile:hover,
a.tile:focus-visible {
  transform: translate(-3px, -3px) rotate(-1.5deg);
  box-shadow: 7px 7px 0 var(--edge);
}
a.tile:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 var(--edge);
}
[data-mode="night"] a.tile:hover,
[data-mode="night"] a.tile:focus-visible {
  box-shadow: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.25em 0.85em;
  border: 2px solid var(--edge);
  border-radius: var(--r-chip);
  background: var(--c);
  color: var(--on-c);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.15;
}
button.chip {
  font-family: inherit;
  cursor: pointer;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips > :nth-child(odd) {
  transform: rotate(-2deg);
}
.chips > :nth-child(even) {
  transform: rotate(1.5deg);
}
[data-mode="night"] .chip {
  border-color: var(--c);
}

/* ---------- photo placeholders ---------- */
.photo {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0.5em;
  min-height: 160px;
  max-width: 100%;
  padding: 12px;
  border: var(--line) solid var(--edge);
  border-radius: var(--r-card);
  background-color: var(--photo);
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 30%, transparent) 1.4px, transparent 1.8px);
  background-size: 16px 16px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}
.photo .i {
  width: 18px;
  height: 18px;
}
[data-mode="night"] .photo {
  border: 1.5px solid var(--hair);
}
