/* TapCrow — one stylesheet for every page. No webfonts, no scripts. */

:root {
  color-scheme: light dark;
  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --text: #1F1A3D;
  --muted: #5A5478;
  --accent: #CC3D1F;
  --accent-deep: #8C2A14;
  --on-accent: #FFFFFF;
  --sun: #FFC93C;
  --line: #1F1A3D;
  --hair: rgba(31, 26, 61, 0.14);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Rounded on Apple devices, bold system sans elsewhere.
     To self-host a rounded font, see README.md, then put its name first here. */
  --font-head: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16132E;
    --surface: #221E42;
    --text: #F4F1FF;
    --muted: #B4AED6;
    --accent: #FF7A59;
    --accent-deep: #B8472D;
    --on-accent: #16132E;
    --sun: #FFD45C;
    --line: #4C4585;
    --hair: rgba(244, 241, 255, 0.14);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font-body);
}

main { flex: 1 0 auto; }

.wrap {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 16px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p, ul, ol { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

/* Brand: crow mark + wordmark (both inline SVG) */
.brand { display: flex; align-items: center; gap: 14px; margin: 0; }
.mark { display: block; flex: none; width: 56px; height: 56px; }
.wordmark { display: block; height: 40px; width: auto; color: var(--text); }
.wordmark path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 40;
  stroke-linejoin: round;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
}
.brand-link .mark { width: 36px; height: 36px; }
.brand-link .wordmark { height: 24px; }

/* Home */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 56px 0 24px;
}
.lede { font-size: 1.125rem; max-width: 34rem; margin: 28px 0 0; }

.section { padding-block: 24px; }
.section h2 { font-size: 1.5rem; }

.games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--line);
  padding: 20px;
}
.card p:last-child { margin-bottom: 0; }

.chip {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.875rem;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 0 var(--accent-deep);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.0625rem;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.btn:hover { text-decoration: underline; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-deep); }

@media (min-width: 40rem) {
  .wrap { padding-inline: 24px; }
  .mark { width: 84px; height: 84px; }
  .wordmark { height: 60px; }
  .hero { padding-top: 88px; }
  /* Decoration only where it can't sit behind the wordmark */
  .hero::before,
  .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
  }
  .hero::before { width: 240px; height: 240px; right: -80px; top: -100px; background: var(--sun); }
  .hero::after { width: 28px; height: 28px; right: 150px; top: 120px; background: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Inner pages */
.topbar { padding-block: 20px 4px; }

.doc { padding-bottom: 8px; }
.doc h1 { font-size: clamp(2rem, 7vw, 2.75rem); margin-top: 16px; }
.doc h2 { font-size: 1.375rem; margin-top: 2.25rem; scroll-margin-top: 16px; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.375rem; }
.meta { color: var(--muted); }

.toc {
  margin: 24px 0 8px;
  padding: 16px 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
}
.toc__title { font-family: var(--font-head); font-weight: 800; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.5rem; columns: 2 13rem; column-gap: 24px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }

mark.todo {
  background: var(--sun);
  color: #1F1A3D;
  padding: 0 4px;
  border-radius: 4px;
}

.notfound { padding-block: 40px 24px; }
.notfound h1 { font-size: clamp(2rem, 8vw, 3rem); }

/* Footer */
.site-footer {
  margin-top: 32px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
