/* ------------------------------------------------------------ fonts (self-hosted, see fonts/LICENSE.md) */

@font-face { font-family: 'Pixelify Sans'; font-weight: 500; font-display: swap; src: url(fonts/pixelify-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Pixelify Sans'; font-weight: 600; font-display: swap; src: url(fonts/pixelify-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Pixelify Sans'; font-weight: 700; font-display: swap; src: url(fonts/pixelify-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Silkscreen'; font-weight: 400; font-display: swap; src: url(fonts/silkscreen-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); }

/* ------------------------------------------------------------ tokens
   Colours are pulled from the art: Count Duckula's night purple for the ground,
   beak orange for actions, the lime of the punk hair for small highlights. */

:root {
  --bg: #12101c;
  --bg-2: #1a1727;
  --bg-3: #231f34;
  --line: #342d4a;
  --line-2: #4b416a;
  --text: #f6efe3;
  --text-2: #dcd4e6;
  --muted: #9f96b6;
  --faint: #6d6589;
  --accent: #ff9a3c;
  --accent-hi: #ffb466;
  --accent-ink: #231204;
  --lime: #bff24f;
  --purple: #a35bd6;
  --danger: #ff7a6b;

  --pixel: 'Pixelify Sans', 'Inter', system-ui, sans-serif;
  --label: 'Silkscreen', ui-monospace, monospace;
  --body: 'Inter', system-ui, sans-serif;

  --side: 228px;
  /* A 3px border with the corners knocked out: the pixel-art "rounded" corner. */
  --notch: 0 -3px 0 0 var(--line-2), 0 3px 0 0 var(--line-2), -3px 0 0 0 var(--line-2), 3px 0 0 0 var(--line-2);
  --notch-clip: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background-color: var(--bg);
  /* Faint pixel grid with a purple moon-glow at the top. */
  background-image:
    radial-gradient(ellipse 900px 520px at 70% -120px, rgba(163, 91, 214, .22), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  background-attachment: fixed, scroll, scroll;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------ sidebar */

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  background: rgba(18, 16, 28, .92);
  border-right: 3px solid var(--line);
  z-index: 20;
}
.mark {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.mark span { color: var(--accent); }
.side nav { margin-top: 36px; display: flex; flex-direction: column; gap: 4px; }
.side nav a, .side nav .soon {
  font-family: var(--pixel);
  font-weight: 500;
  font-size: 17px;
  padding: 10px 12px;
  color: var(--muted);
}
.side nav a { position: relative; transition: color .12s, background .12s; }
.side nav a:hover { color: var(--text); background: var(--bg-3); }
.side nav a.active { color: var(--text); background: var(--bg-3); box-shadow: inset 4px 0 0 var(--accent); }
.side nav .soon { color: var(--faint); cursor: default; }
.side nav .soon small {
  font-family: var(--label);
  font-size: 9px;
  margin-left: 6px;
  padding: 2px 5px;
  color: var(--bg);
  background: var(--faint);
  vertical-align: 2px;
}
.side .xlink {
  margin-top: auto;
  color: var(--muted);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.side .xlink svg { width: 16px; height: 16px; display: block; }
.side .xlink:hover { color: var(--text); background: var(--bg-3); }

.main { margin-left: var(--side); min-width: 0; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 36px; min-width: 0; }

/* ------------------------------------------------------------ type */

h1 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 96px);
  letter-spacing: -0.01em;
  line-height: 0.95;
  text-shadow: 4px 4px 0 rgba(163, 91, 214, .45);
}
.lede {
  margin-top: 18px;
  font-family: var(--pixel);
  font-weight: 500;
  font-size: 26px;
  color: var(--lime);
}
.prose { padding: 10px 0 10px; max-width: 640px; }
.prose h2, .page-title {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  margin: 18px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* A little pixel block marks each section. */
.prose h2::before {
  content: '';
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--purple);
}
.page-title { margin-top: 0; }
.prose p { color: var(--text-2); font-size: 17px; line-height: 1.7; margin-bottom: 12px; }
.prose a, .note a, .closed a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.prose a:hover, .note a:hover, .closed a:hover { color: var(--accent-hi); }
.prose .warn {
  margin-top: 4px;
  padding: 12px 14px;
  background: rgba(255, 154, 60, .07);
  box-shadow: inset 4px 0 0 var(--accent);
  color: var(--text-2);
}

.page { padding-top: 56px; padding-bottom: 72px; min-width: 0; }
.sub { color: var(--muted); margin-bottom: 22px; max-width: 560px; line-height: 1.55; font-size: 16px; }
.section-head {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  margin: 8px 0 14px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: 12px 18px 14px;
  font-family: var(--label);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  clip-path: var(--notch-clip);
  /* Dark band along the bottom and right gives the chunky 8-bit button depth. */
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .28), inset 3px 3px 0 rgba(255, 255, 255, .25);
  transition: background .12s, transform .06s;
}
.btn:hover:not(:disabled) { background: var(--accent-hi); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .25); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--text); }
.btn.ghost {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: inset 0 0 0 3px var(--line-2);
}
.btn.ghost:hover:not(:disabled) { background: var(--line); }
.btn.big { width: 100%; padding: 16px 18px 18px; font-size: 15px; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }

/* ------------------------------------------------------------ home */

.hero {
  padding: 80px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-art { display: flex; align-items: flex-end; padding-right: 10px; }
.hero-art img {
  width: 124px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  image-rendering: pixelated;
  border: 3px solid var(--line-2);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .55);
  transition: transform .2s ease;
  background: var(--bg-2);
}
.hero-art img:nth-child(1) { transform: rotate(-6deg) translateY(8px); position: relative; z-index: 1; }
.hero-art img:nth-child(2) { width: 156px; margin: 0 -18px; position: relative; z-index: 2; border-color: var(--accent); box-shadow: 8px 8px 0 rgba(0, 0, 0, .55); }
.hero-art img:nth-child(3) { transform: rotate(6deg) translateY(8px); }
.hero-art:hover img:nth-child(1) { transform: rotate(-9deg) translate(-8px, 4px); }
.hero-art:hover img:nth-child(2) { transform: translateY(-6px); }
.hero-art:hover img:nth-child(3) { transform: rotate(9deg) translate(8px, 4px); }

.nums {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 56px;
  margin: 48px 0 36px;
  padding-top: 26px;
  /* Dotted pixel divider. */
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px) top / 100% 3px no-repeat;
}
.nums b {
  display: block;
  font-family: var(--label);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.1;
}
.nums span, .stages span {
  font-family: var(--label);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 18px;
  margin: 8px 3px 18px;
}
.stages div {
  background: var(--bg-2);
  box-shadow: var(--notch);
  padding: 14px 20px;
  min-width: 0;
}
.stages div:first-child { box-shadow: 0 -3px 0 0 var(--accent), 0 3px 0 0 var(--accent), -3px 0 0 0 var(--accent), 3px 0 0 0 var(--accent); }
.stages b { display: block; font-family: var(--label); font-size: 26px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 6px; }

/* ------------------------------------------------------------ rails & slots */

.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 3px 3px 14px;
  margin: 0 0 28px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-track { background: var(--bg-2); }
.rail::-webkit-scrollbar-thumb { background: var(--line-2); }
.slot {
  flex: 0 0 168px;
  width: 168px;
  height: 210px;
  scroll-snap-align: start;
  border: 3px dashed var(--line);
  background: var(--bg-2);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.samples .slot {
  position: relative;
  overflow: hidden;
  padding: 0;
  align-items: stretch;
  margin: 0;
  border: 3px solid var(--line-2);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.samples .slot:hover { transform: translate(-3px, -3px); border-color: var(--accent); box-shadow: 6px 6px 0 rgba(0, 0, 0, .5); }
.samples .slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}
.samples .slot figcaption, .has-art span {
  font-family: var(--label);
  font-size: 11px;
  color: var(--text);
  background: rgba(18, 16, 28, .82);
  padding: 4px 7px;
}
.samples .slot figcaption { position: absolute; left: 8px; bottom: 8px; }
.samples .empty-sample { display: flex; align-items: flex-end; padding: 12px; }

/* ------------------------------------------------------------ gallery */

.notice {
  max-width: 640px;
  margin: -6px 0 28px;
  padding: 14px 16px;
  background: var(--bg-2);
  box-shadow: inset 4px 0 0 var(--lime);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 14px;
  min-width: 0;
  max-width: 100%;
}
.toolbar h2 { font-family: var(--pixel); font-weight: 600; font-size: 24px; line-height: 1.2; min-width: 0; }
/* Pixelify's digits are hard to read (2 looks like 8), so numbers inside headings use Silkscreen. */
.num { font-family: var(--label); font-weight: 400; font-size: .82em; }

.grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.ph {
  min-width: 0;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  border: 2px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 7px;
  color: var(--faint);
  font-family: var(--label);
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.slot.one, .ph { position: relative; overflow: hidden; cursor: pointer; text-align: left; transition: transform .12s, border-color .12s, box-shadow .12s; }
.slot.one { font-family: var(--label); }
.slot.one span, .ph span { position: relative; z-index: 1; }
.slot.one span { color: var(--accent); font-size: 11px; }
.slot.one img, .ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.has-art { border-style: solid; border-color: var(--line-2); }
.slot.one.has-art { border-color: var(--accent); }
.ph:hover, .slot.one:hover { border-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); }
.ph.hit { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); }

.find input {
  width: 116px;
  background: var(--bg);
  border: 2px solid var(--line-2);
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--label);
  font-size: 13px;
}
.find input::placeholder { color: var(--faint); }
.find input:focus { outline: none; border-color: var(--accent); }

.pager { display: flex; gap: 8px; align-items: center; color: var(--muted); font-family: var(--label); font-size: 12px; flex: 0 0 auto; }
.page > .pager { justify-content: center; margin-top: 20px; }
.pager button {
  background: var(--bg-3);
  color: var(--text);
  border: 0;
  box-shadow: inset 0 0 0 2px var(--line-2);
  padding: 9px 13px;
  cursor: pointer;
  font: inherit;
}
.pager button:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--accent); }
.pager button:disabled { opacity: 0.35; cursor: default; }

/* ------------------------------------------------------------ lightbox + lore */

.lightbox {
  margin: auto;
  background: var(--bg-2);
  color: var(--text);
  border: 0;
  box-shadow: var(--notch), 10px 10px 0 rgba(0, 0, 0, .5);
  padding: 18px;
  width: min(440px, calc(100vw - 32px));
  overflow: visible;
}
.lightbox::backdrop { background: rgba(10, 8, 18, .82); }
.lb-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { color: var(--accent); }
.lb-scroll {
  margin-top: 24px;
  height: min(560px, calc(100vh - 120px));
  overflow: hidden;
}
.lb-scroll.has-lore {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lb-scroll.has-lore::-webkit-scrollbar { display: none; }
.lb-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.lb-art {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  border: 3px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.lb-art img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.lb-cap { margin-top: 12px; font-family: var(--label); font-size: 18px; }
.lb-hint {
  align-self: center;
  margin-top: 6px;
  background: none;
  border: 0;
  color: var(--lime);
  font-family: var(--label);
  font-size: 12px;
  cursor: pointer;
  animation: nudge 1.6s steps(4) infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.lb-lore {
  padding: 22px 4px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px) top / 100% 3px no-repeat;
}
.lb-lore dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.lb-lore dt { font-family: var(--label); color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.lb-lore dd { font-family: var(--pixel); font-weight: 600; font-size: 24px; color: var(--accent); }
.lb-lore h3 { font-family: var(--pixel); font-weight: 600; font-size: 20px; margin-bottom: 10px; color: var(--lime); }
.lb-lore p { color: var(--text-2); line-height: 1.7; font-size: 15px; margin-bottom: 12px; }
.lb-back { margin-top: auto; animation: none; }

/* ------------------------------------------------------------ waddlelist */

.tasks { list-style: none; }
.task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px) bottom / 100% 2px no-repeat;
  max-width: 520px;
  width: 100%;
  min-width: 0;
}
.task-label { font-size: 16px; min-width: 0; flex: 1; }
.task-row .btn { width: 112px; min-width: 0; flex: 0 0 112px; padding-left: 8px; padding-right: 8px; }

.apply {
  max-width: 520px;
  width: 100%;
  margin-top: 28px;
  min-width: 0;
}
.apply label {
  display: block;
  font-family: var(--label);
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0 8px;
}
.apply input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 2px solid var(--line-2);
  color: var(--text);
  padding: 13px 12px;
  font-family: var(--body);
  font-size: 16px;
}
.apply input::placeholder { color: var(--faint); }
.apply input:focus { outline: none; border-color: var(--accent); box-shadow: 3px 3px 0 rgba(255, 154, 60, .3); }
.apply .hint { color: var(--faint); margin-left: 6px; text-transform: none; }
.apply .btn { margin-top: 20px; }

.note { margin-top: 18px; color: var(--muted); font-size: 14px; max-width: 520px; line-height: 1.55; }

/* ------------------------------------------------------------ mint */

.closed, .mint-panel {
  max-width: 520px;
  margin: 3px;
  background: var(--bg-2);
  box-shadow: var(--notch);
  padding: 22px;
}
.closed p { color: var(--text-2); line-height: 1.6; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats dt { font-family: var(--label); color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.stats dd { font-family: var(--label); font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.badge, .wl-tag {
  display: inline-block;
  font-family: var(--label);
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bg-3);
  color: var(--muted);
}
.badge[data-phase="1"], .badge[data-phase="2"], .wl-tag[data-on="true"] { background: var(--lime); color: var(--bg); }
.progress { margin: 22px 0; }
.progress-row { display: flex; justify-content: space-between; font-family: var(--label); font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.track { height: 14px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line-2); padding: 3px; }
/* Segmented, like an old health bar. */
.fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 10px); transition: width .6s steps(12); }
.wallet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 0; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px) top / 100% 2px no-repeat; }
.who { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.buy { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px) top / 100% 2px no-repeat; }
.stepper { display: flex; align-items: center; box-shadow: inset 0 0 0 2px var(--line-2); }
.stepper button {
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--text);
  border: 0;
  font-family: var(--pixel);
  font-size: 22px;
  cursor: pointer;
}
.stepper button:hover:not(:disabled) { color: var(--accent); }
.stepper button:disabled { color: var(--line-2); cursor: default; }
.stepper output { width: 40px; text-align: center; font-family: var(--label); font-size: 18px; }
.total { text-align: right; }
.total span { display: block; font-family: var(--label); color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.total b { font-family: var(--label); font-size: 20px; font-weight: 400; }
#msg[data-kind="err"] { color: var(--danger); }

.reveal { margin-top: 40px; }
.hatchlings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; max-width: 820px; }
.hatch { animation: pop .45s steps(5); }
.hatch .art {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-2);
  border: 3px solid var(--accent);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .5);
}
.hatch .art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.hatch em { display: block; font-style: normal; margin-top: 10px; font-family: var(--label); font-size: 13px; }
.hatch.egg { animation: none; }
.hatch.egg .art {
  border-color: var(--line-2);
  background: radial-gradient(ellipse 34% 40% at 50% 55%, #efe5cf 0 98%, transparent 100%), var(--bg-2);
  animation: wobble 1.1s steps(4) infinite;
}
.hatch.egg em { color: var(--muted); }
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------ shared bits */

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Breathing room under the last section of the home page. */
.wrap:not(.page) > :last-child { margin-bottom: 64px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------ tablet & phone */

@media (max-width: 900px) {
  .side {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "mark x"
      "nav nav";
    align-items: center;
    gap: 8px 12px;
    padding: 14px 20px 12px;
    border-right: 0;
    border-bottom: 3px solid var(--line);
  }
  .mark { grid-area: mark; font-size: 26px; }
  .side nav {
    grid-area: nav;
    margin: 2px 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    width: 100%;
  }
  .side nav a, .side nav .soon {
    text-align: center;
    padding: 9px 2px;
    font-size: 14px;
    min-width: 0;
  }
  .side nav a.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .side nav .soon small { display: none; }
  .side .xlink { grid-area: x; margin: 0; width: 36px; height: 36px; }
  .main { margin-left: 0; width: 100%; max-width: 100%; }
  .wrap { padding: 0 20px; width: 100%; max-width: 100%; }
  .hero { padding: 28px 0 0; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-art { order: -1; justify-content: center; padding: 8px 0 0; }
  .hero-art img { width: 94px; }
  .hero-art img:nth-child(2) { width: 116px; }
  .cta { margin-top: 22px; }
  .lede { font-size: 21px; margin-top: 12px; }
  .nums {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 26px 0 26px;
    padding-top: 18px;
  }
  .nums b { font-size: 26px; }
  .nums span, .stages span { font-size: 10px; }
  .prose, .prose p, .sub, .page-title { max-width: 100%; }
  .prose h2, .page-title { font-size: 30px; }
  .prose p { font-size: 16px; }
  .page { padding-top: 28px; padding-bottom: 48px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .stages div { padding: 12px 10px; }
  .stages b { font-size: 20px; }
  .task-row, .apply, .note, .sub { max-width: none; }
  .rail { scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  .grid { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ph { padding: 6px; }
  .stats dd { font-size: 15px; }
  h1 { font-size: 52px; }
  .slot { flex-basis: calc((100% - 14px) / 2); width: calc((100% - 14px) / 2); height: auto; aspect-ratio: 4 / 5; }
  .toolbar { gap: 8px; }
  .toolbar h2 { font-size: 21px; }
  .pager { gap: 6px; }
  .pager button { padding: 8px 10px; }
  .task-row { padding: 12px 0; }
  .task-label { font-size: 15px; }
  .task-row .btn { width: 100px; flex-basis: 100px; padding: 11px 6px 13px; font-size: 12px; }
  .cta .btn { flex: 1 1 auto; }
}
