:root {
  color-scheme: light;
  --bg: #eeeaf6;
  --surface: #ffffff;
  --text: #1a1228;
  --muted: #655c78;
  --line: #d2cae4;
  --accent: #3d1a78;
  --accent-bright: #7a45d6;
  --accent-text: #ffffff;
  --pocket: #dfd8ee;
  --focus: #6d3fd1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1920px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1400px) {
  .wrap { padding: 0 40px; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
}

/* Litter: random circles scattered across the empty parts of the page, added by app.js.
   They sit under the content, so app.js works out which one the pointer is over and marks
   it .hot. */

body { position: relative; }
.litter { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.litter i {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  translate: -50% -50%;
  rotate: var(--tilt);
  opacity: var(--fade);
  border-radius: 50%;
  background: var(--type);
  font-size: calc(var(--size) * 0.34);
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s, rotate 0.2s, scale 0.2s;
}
.litter i[hidden] { display: none; }
.litter i.hot { opacity: 1; rotate: 0deg; scale: 1.35; }

/* Name and region of the hovered circle. app.js places it beside the circle, on the side
   away from the nearest screen edge, and sets left, top and translate to match. */
.litter-label {
  position: fixed;
  z-index: 20;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(36, 16, 79, 0.18);
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
  pointer-events: none;
}
.litter-label strong { color: var(--text); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.wordmark { text-decoration: none; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.wordmark strong { color: var(--accent); font-weight: 800; }.btn.nav-discord { flex: none; padding: 6px 14px; font-size: 14px; white-space: nowrap; }

/* Hero */

.hero { padding: 56px 0; }
/* The rules, slot finder and sharing sit in the hero, straight under the headline. */
.hero .columns { margin-top: calc(56px + 2vh); }
.eyebrow { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
h1 { max-width: 820px; margin: 0; font-size: clamp(40px, 8vw, 84px); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; color: var(--accent); text-wrap: balance; }
.lede { max-width: 620px; margin: 16px 0 0; font-size: 19px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.2); }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; pointer-events: none; }

/* The headline on the left, the start buttons on the right; the buttons drop below on narrow screens. */
.hero-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px; }
.hero-head > div:first-child { flex: 1 1 480px; min-width: 0; }
/* binder.png is pre-sized to 800px (binder-2x.png, 1024px, for sharp screens); a browser
   shrinking a much larger drawing blurs its fine lines. It takes no space in the layout and
   sits behind the hero's text and buttons (z-index -1, above the .litter circles, which come
   earlier), centered between them. pointer-events: none keeps everything under it clickable. */
.hero-head { position: relative; }
.hero-art {
  position: absolute;
  z-index: -1;
  left: 55%;
  top: calc(50% + 3vh);
  translate: -50% -50%;
  width: clamp(480px, 50vw, 800px);
  height: auto;
  pointer-events: none;
}
/* On smaller screens it would cover the text, so it joins the flow instead, pushed to the
   right edge (it wraps onto its own line when the headline needs the width). */
@media (max-width: 1000px) {
  .hero-art { position: static; z-index: auto; translate: none; width: clamp(200px, 40vw, 360px); margin-left: auto; }
}
@media (max-width: 700px) {
  .hero-art { width: min(60vw, 300px); }
}
.hero-cta { flex: 0 1 auto; }
.hero-actions { margin-top: 0; }
.hero-cta .aside { margin-top: 12px; }
.btn.start { padding: 14px 36px; font-size: 20px; }
.btn.primary.start { box-shadow: 0 10px 30px rgba(36, 16, 79, 0.35); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .litter i { transition: none; }
}

/* Sections */

.band { padding: 56px 0; border-top: 1px solid var(--line); }
h2 { margin: 0 0 12px; font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.section-lede { max-width: 620px; margin: 0 0 28px; color: var(--muted); }
.aside { max-width: 620px; margin: 24px 0 0; font-size: 15px; color: var(--muted); }

.aside.emphasis { color: var(--text); }
.rules { max-width: 720px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--line); }
.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--pocket);
  font-weight: 800;
  text-align: center;
  line-height: 34px;
}

/* Slot finder */

/* The rules, the slot finder and sharing side by side, stacked on narrow screens. Each column
   is about a third of the page, so the finder stacks its controls. Its page, row and column
   stay left of the binder page, except where the columns are too narrow for both. */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: start; }
.columns .finder-controls { grid-template-columns: minmax(0, 1fr); }
/* Page, row and column on one line, each label with its number to the right: "Page 3 Row 1
   Column 1". The answer gets the wider share of the result so the line fits beside the binder
   page; it still wraps rather than overflow if a column is very narrow. */
.columns .finder-result { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.columns .answer .where { gap: 8px 18px; }
.columns .answer .where div { flex-direction: row; align-items: baseline; gap: 6px; }
.columns .answer .where dt { margin-top: 0; }
.columns .answer .where dd { font-size: 34px; }
@media (min-width: 1001px) and (max-width: 1399px) {
  .columns .finder-result { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .columns { grid-template-columns: minmax(0, 1fr); gap: 48px; }
}
@media (max-width: 700px) {
  .columns .finder-result { grid-template-columns: minmax(0, 1fr); }
}

.finder { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.finder-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.custom-layout { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.custom-layout[hidden] { display: none; }
.field .custom-layout label { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; }
.field .custom-layout input { width: 0; flex: 1; min-width: 56px; }
.custom-layout span { color: var(--muted); }
.combo { position: relative; }
.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li[aria-selected="true"] { background: var(--pocket); }
.suggestions .num { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.type-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.finder-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 24px; }
.answer .who { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.answer .who .num { font-weight: 400; color: var(--muted); }
.answer .where { display: flex; flex-wrap: wrap; gap: 20px 28px; margin: 18px 0 0; }
.answer .where div { display: flex; flex-direction: column-reverse; }
.answer .where dd { margin: 0; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.answer .where dt { margin-top: 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.answer .of { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.answer .none { color: var(--muted); }

/* app.js sets --ratio to the page's width over its height, so any layout from 1x1 to 15x15
   fits within 340px wide and 420px tall. */
.binder-page {
  display: grid;
  gap: 6px;
  width: min(100%, 340px, calc(420px * var(--ratio, 1)));
  aspect-ratio: var(--ratio, 5 / 7);
  margin: 0 auto;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.pocket {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px;
  border-radius: 6px;
  background: var(--pocket);
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
}
.pocket .num { font-variant-numeric: tabular-nums; }
.pocket .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pocket.empty { background: none; border: 1px dashed var(--line); }
.pocket.target { color: var(--text); font-weight: 700; border: 3px solid var(--slot-color, var(--accent)); background: var(--surface); padding: 3px; }

/* 5 or more across or down: tighter spacing, blank pockets, and the highlighted slot filled
   with its type color and its number on a tag that may spill over the tiny pocket. */
.binder-page.dense { gap: 3px; padding: 6px; }
.dense .pocket { padding: 0; border-radius: 3px; }
.dense .pocket.target {
  position: relative;
  z-index: 1;
  justify-content: center;
  align-items: center;
  overflow: visible;
  padding: 0;
  border: none;
  background: var(--slot-color, var(--accent));
}
.dense .pocket.target .num {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .finder-controls, .finder-result { grid-template-columns: 1fr; }
  .answer .where dd { font-size: 44px; }
}

/* Feature lists */

.features { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.features.rows { grid-template-columns: 1fr; max-width: 720px; }
.features li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.features strong { display: block; margin-bottom: 4px; }
.features span { font-size: 15px; color: var(--muted); }

/* Footer */

.site-footer { padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer p { max-width: 760px; margin: 0 0 10px; }
