/* CrowdNote site: monochrome moodboard style.
   Tokens mirror docs/research/product-design.md §8.3 (WCAG AA checked). */

:root {
  --canvas: #DFDEDA;
  --surface: #ECEBE7;
  --raised: #F6F5F2;
  --tile: #9F9A94;
  --tile-strong: #6F6A64;
  --on-tile: #F6F5F2;
  --ink: #0A0A09;
  --ink-2: #4B4945;
  --ink-3: #75726C;
  --hairline: #C8C6C1;
  --hairline-strong: #7A766F;
  --inverse: #0A0A09;
  --on-inverse: #ECEBE7;
  --danger: #9E1B1B;

  --font-display: "Anton", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --measure: 720px;
  --wide: 1080px;
  --r-tile: 2px;
  --r-card: 4px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E0E0D;
    --surface: #1A1918;
    --raised: #252422;
    --tile: #4A4743;
    --tile-strong: #5E5A55;
    --on-tile: #F6F5F2;
    --ink: #EEEDE9;
    --ink-2: #ADABA5;
    --ink-3: #85827C;
    --hairline: #2E2D2A;
    --hairline-strong: #6A6762;
    --inverse: #EEEDE9;
    --on-inverse: #0E0E0D;
    --danger: #FF8A80;
  }
}

:root[data-theme="dark"] {
  --canvas: #0E0E0D;
  --surface: #1A1918;
  --raised: #252422;
  --tile: #4A4743;
  --tile-strong: #5E5A55;
  --on-tile: #F6F5F2;
  --ink: #EEEDE9;
  --ink-2: #ADABA5;
  --ink-3: #85827C;
  --hairline: #2E2D2A;
  --hairline-strong: #6A6762;
  --inverse: #EEEDE9;
  --on-inverse: #0E0E0D;
  --danger: #FF8A80;
}

@media (prefers-contrast: more) {
  :root { --ink-2: #33312E; --hairline: var(--hairline-strong); }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* ---------- Type ---------- */

h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

h1 { font-size: clamp(40px, 9vw, 72px); }
h2 { font-size: clamp(26px, 5vw, 34px); }

h3 {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
  margin: 28px 0 8px;
}

p { margin: 0 0 14px; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-tile);
}

strong { font-weight: 650; }

ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 4px 0; }
li::marker { color: var(--ink-2); }

hr { border: 0; border-top: 1px solid var(--hairline); margin: 32px 0; }

.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--inverse);
  color: var(--on-inverse);
  padding: 8px 12px;
  z-index: 10;
}
.skip-link:focus { left: 8px; }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  padding: 6px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Document pages ---------- */

.doc { padding: 40px 0 56px; }
.doc > h1 { margin-bottom: 12px; }
.doc .meta { color: var(--ink-2); font-size: 15px; margin-bottom: 24px; }
.doc h2 {
  margin: 44px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 16px;
}
.doc h3 { scroll-margin-top: 16px; }

.toc {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 12px 16px;
  margin: 0 0 8px;
}
.toc summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style-position: inside;
}
.toc ol { margin: 10px 0 4px; padding-left: 20px; font-size: 15px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.callout {
  background: var(--surface);
  border-left: 3px solid var(--ink);
  border-radius: var(--r-tile);
  padding: 14px 16px;
  margin: 0 0 18px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 10px 44px;
  min-height: 32px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--inverse);
  color: var(--on-inverse);
  font-family: var(--font-display);
  font-size: 18px;
  border-radius: var(--r-tile);
}

.path { font-weight: 650; }

details.faq {
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
}
details.faq:last-of-type { border-bottom: 1px solid var(--hairline); }
details.faq summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding-top: 8px; }

pre.license {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 480px;
  overflow: auto;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-weight: 650;
  text-decoration: none;
  border-radius: var(--r-card);
}
.button:hover { text-decoration: underline; }
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}

/* ---------- Shared-link page (open.html) ---------- */

[hidden] { display: none !important; }
.open-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 24px; }

/* ---------- Home ---------- */

.hero { padding: 40px 0 48px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 840px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: 56px; }
}
.hero h1 { font-size: clamp(56px, 13vw, 112px); }
.hero .lede { font-size: 20px; color: var(--ink-2); margin: 16px 0 24px; max-width: 30ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 0; list-style: none; }
.pills li {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 4px 10px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 520px;
  width: 100%;
  justify-self: center;
}
.mosaic .t {
  aspect-ratio: 1 / 1;
  border-radius: var(--r-tile);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 1;
  font-size: clamp(18px, 5vw, 30px);
  overflow: hidden;
}
.t.strong { background: var(--tile-strong); color: var(--on-tile); }
.t.plain { background: var(--tile); color: var(--ink); }
.t.ink { background: var(--inverse); color: var(--on-inverse); }
.t.paper { background: var(--raised); color: var(--ink); }
.t.soft { background: var(--surface); color: var(--ink); }
.t .score { font-size: clamp(34px, 9vw, 56px); }
.t .cap {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.band { padding: 48px 0; border-top: 1px solid var(--hairline); }
.band h2 { margin-bottom: 20px; }

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature {
  background: var(--surface);
  border-radius: var(--r-tile);
  padding: 20px;
}
.feature .display { font-size: 26px; margin-bottom: 10px; }
.feature p { color: var(--ink-2); margin: 0; font-size: 16px; }

.cities {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  list-style: none;
  padding: 0;
}
@media (min-width: 720px) { .cities { grid-template-columns: repeat(3, 1fr); } }
/* An odd number of cities: the last tile fills the rest of its row (2 columns: full width; 3 columns: 3 + 2). */
.cities li:last-child:nth-child(odd) { grid-column: span 2; }
.cities li {
  margin: 0;
  background: var(--tile-strong);
  color: var(--on-tile);
  border-radius: var(--r-tile);
  padding: 28px 14px;
  text-align: center;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.05;
}

.two-col { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; gap: 48px; } }
.two-col ul { padding-left: 20px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--ink-2);
}
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; list-style: none; }
.footer-links li { margin: 0; }
.site-footer p { margin: 0 0 8px; }

@media print {
  .site-header, .site-footer, .toc, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .doc h2 { break-after: avoid; }
}
