/* guymaking.games: a chalkboard. Chalk texture comes from an SVG filter (#chalk) defined in each page. */

@import url("https://fonts.googleapis.com/css2?family=Mansalva&family=Caveat:wght@500;700&family=Cormorant+Upright:wght@500;600&family=Nunito:wght@400;600;800&display=swap");

:root {
  --board: #1e2622;
  --board-deep: #151b18;
  --frame: #6b4a2f;
  --frame-dark: #4a321f;
  --chalk: #f4f1ea;
  --chalk-dim: rgba(244, 241, 234, 0.62);
  --chalk-faint: rgba(244, 241, 234, 0.16);
  --peach: #ffd9b3;
  --pink: #ffa9b0;
  --yellow: #ffe38f;
  --blue: #a8d8ff;
  --green: #b5ecae;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { background: var(--frame-dark); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  /* smudges + eraser swipes over the slate */
  background:
    radial-gradient(ellipse 60% 40% at 18% 12%, rgba(255, 255, 255, 0.045), transparent 70%),
    radial-gradient(ellipse 50% 30% at 82% 38%, rgba(255, 255, 255, 0.035), transparent 70%),
    radial-gradient(ellipse 70% 35% at 40% 85%, rgba(255, 255, 255, 0.04), transparent 70%),
    linear-gradient(172deg, transparent 30%, rgba(255, 255, 255, 0.025) 31%, transparent 36%),
    linear-gradient(8deg, transparent 62%, rgba(255, 255, 255, 0.02) 63%, transparent 69%),
    radial-gradient(circle at 50% 0%, var(--board) 0%, var(--board-deep) 100%);
  /* the wooden frame */
  border: clamp(10px, 2.2vw, 22px) solid var(--frame);
  border-image: linear-gradient(135deg, #7a5536, #5b3d25 40%, #80593a 60%, #4f3520) 1;
  overflow-x: hidden;
}

/* chalk dust: fine noise over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 50;
}

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline wavy; text-underline-offset: 5px; }

.chalk { filter: url(#chalk); }
.hand { font-family: "Mansalva", cursive; font-weight: 400; letter-spacing: 0.5px; }
.note { font-family: "Caveat", cursive; }
.serif { font-family: "Cormorant Upright", serif; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- nav ---------- */
nav.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 8px;
}
nav.top .logo { font-family: "Mansalva", cursive; font-size: 30px; color: var(--chalk); }
nav.top .logo span { color: var(--peach); }
nav.top ul { list-style: none; display: flex; gap: clamp(14px, 3vw, 28px); margin: 0; padding: 0; }
nav.top ul a { font-family: "Caveat", cursive; font-size: 26px; color: var(--chalk-dim); }
nav.top ul a:hover, nav.top ul a.here { color: var(--chalk); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; align-items: center;
  padding: clamp(30px, 7vw, 70px) 0 30px;
}
.hero h1 { font-size: clamp(46px, 6.6vw, 86px); line-height: 1.08; margin: 0 0 18px; }
.hero h1 .line { display: block; white-space: nowrap; }
.hero h1 .accent { color: var(--peach); }
.hero p.lede { font-size: clamp(19px, 2.2vw, 23px); color: var(--chalk-dim); max-width: 34ch; margin: 0 0 12px; }
.hero .scribble { font-family: "Caveat", cursive; font-size: 30px; color: var(--pink); transform: rotate(-3deg); display: inline-block; }

.doodle { width: 100%; height: auto; overflow: visible; }
.doodle path, .doodle circle, .doodle line, .doodle polyline, .doodle rect, .doodle ellipse {
  fill: none; stroke: var(--chalk); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
}
.doodle .peach { stroke: var(--peach); }
.doodle .pink { stroke: var(--pink); }
.doodle .yellow { stroke: var(--yellow); }
.doodle .blue { stroke: var(--blue); }
.doodle .green { stroke: var(--green); }
.doodle text { fill: var(--chalk); font-family: "Caveat", cursive; font-size: 30px; stroke: none; }
/* draw-in: script.js measures each stroke, hides it with a dash offset, then transitions it into view */
.draw text { animation: fadein 0.8s 1.2s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- sections ---------- */
section { padding: 34px 0; }
h2 { font-family: "Mansalva", cursive; font-weight: 400; font-size: clamp(40px, 6vw, 62px); margin: 0 0 6px; }
h2 + .under { display: block; width: 220px; height: 16px; margin: 0 0 24px; }
h3 { font-family: "Mansalva", cursive; font-weight: 400; font-size: 32px; margin: 0 0 6px; }

.board-box {
  position: relative;
  border: 3px solid var(--chalk-faint);
  border-radius: 14px 22px 16px 20px / 20px 14px 22px 16px;
  padding: clamp(20px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.02);
}

/* the game card: a photo pinned to the board */
.game {
  display: grid; grid-template-columns: 220px 1fr; gap: 34px; align-items: center;
}
.polaroid {
  background: #fffdf8; padding: 14px 14px 46px; border-radius: 4px;
  transform: rotate(-4deg); box-shadow: 8px 14px 30px rgba(0, 0, 0, 0.45);
  position: relative; width: 220px;
}
.polaroid img { display: block; width: 100%; border-radius: 22%; }
.polaroid .cap { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #2b2a33;
  font-family: "Caveat", cursive; font-size: 26px; font-weight: 700; }
.polaroid::before { /* tape */
  content: ""; position: absolute; top: -16px; left: 50%; width: 110px; height: 32px; transform: translateX(-50%) rotate(4deg);
  background: rgba(242, 179, 61, 0.75);
}
.tag { display: inline-block; font-family: "Caveat", cursive; font-size: 24px; padding: 0 12px; border: 2px dashed var(--chalk-faint);
  border-radius: 999px; color: var(--green); margin-right: 8px; }

.btn {
  display: inline-block; font-family: "Mansalva", cursive; font-size: 26px; color: var(--board-deep);
  background: var(--peach); padding: 8px 24px 10px; border-radius: 12px 18px 12px 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); transform: rotate(-1deg); transition: transform 0.15s ease;
}
.btn:hover { transform: rotate(1deg) scale(1.04); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--chalk); border: 3px solid var(--chalk-dim); box-shadow: none; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.fact .big { font-family: "Mansalva", cursive; font-size: 54px; line-height: 1; }
.fact .big.peach { color: var(--peach); } .fact .big.blue { color: var(--blue); } .fact .big.pink { color: var(--pink); }
.fact p { margin: 6px 0 0; color: var(--chalk-dim); }

ul.chalky { list-style: none; padding: 0; margin: 0; }
ul.chalky li { padding-left: 38px; position: relative; margin: 10px 0; }
ul.chalky li::before { content: "✓"; position: absolute; left: 4px; top: -4px; font-family: "Caveat", cursive; font-size: 30px; color: var(--green); }
ul.chalky.x li::before { content: "✗"; color: var(--pink); }

/* ---------- legal / prose pages ---------- */
.prose { max-width: 760px; }
.prose h1 { font-family: "Mansalva", cursive; font-weight: 400; font-size: clamp(46px, 7vw, 72px); margin: 30px 0 4px; }
.prose h2 { font-size: 36px; margin-top: 34px; }
.prose p, .prose li { color: rgba(244, 241, 234, 0.85); }
.prose .meta { font-family: "Caveat", cursive; font-size: 24px; color: var(--peach); }
.prose table { border-collapse: collapse; width: 100%; margin: 14px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 2px dashed var(--chalk-faint); vertical-align: top; }
.prose th { font-family: "Caveat", cursive; font-size: 24px; color: var(--yellow); font-weight: 700; }
details { border-bottom: 2px dashed var(--chalk-faint); padding: 12px 0; }
summary { cursor: pointer; font-family: "Caveat", cursive; font-size: 28px; font-weight: 700; }

/* ---------- footer ---------- */
footer { padding: 40px 0 60px; color: var(--chalk-dim); font-size: 16px; }
footer .tray { height: 18px; margin: 0 0 22px; border-radius: 4px;
  background: linear-gradient(#7a5536, #4f3520); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.12); position: relative; }
footer .tray::after { /* a stick of chalk and an eraser */
  content: ""; position: absolute; left: 12%; top: -9px; width: 70px; height: 12px; border-radius: 6px; background: #f6f3ec;
  box-shadow: 380px 2px 0 -1px #f7c6c9, 520px -2px 0 2px #d9d4c7; }
footer a { color: var(--chalk-dim); }

/* ---------- chalk dust particles (script.js) ---------- */
canvas#dust { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero .doodle-wrap { order: -1; max-width: 360px; margin: 0 auto; }
  .game { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .facts { grid-template-columns: 1fr; }
  nav.top ul a { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .draw text { animation: none; }
  canvas#dust { display: none; }
}
