:root {
  --bg: #F3F0FF;
  --ink: #2A1F5C;
  --ink-soft: #564C80;
  --grape: #6A48F0;
  --grape-light: #E4DCFF;
  --sun: #FFD23F;
  --bubble: #FF7AB6;
  --sky: #5CC8FF;
  /* Grandstander and Lexend have no Greek, so Greek letters fall through to Playpen Sans and Commissioner. */
  --display: "Grandstander", "Playpen Sans", "Trebuchet MS", sans-serif;
  --body: "Lexend", "Commissioner", system-ui, sans-serif;
}

:lang(el) {
  --display: "Playpen Sans", "Trebuchet MS", sans-serif;
  --body: "Commissioner", system-ui, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; }
p { margin: 0; }

.topbar, main, .footer { width: min(1160px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: 16px; top: 16px; z-index: 2; background: #fff; padding: 8px 16px; border-radius: 8px; }

a:focus-visible, button:focus-visible, .check input:focus-visible { outline: 4px solid var(--sky); outline-offset: 4px; }

/* Header */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 24px 0;
}

.logo { font: 800 2rem/1 var(--display); text-decoration: none; border-radius: 8px; }
.logo span:nth-child(5n+1) { color: var(--grape); }
.logo span:nth-child(5n+2) { color: #E8478F; }
.logo span:nth-child(5n+3) { color: #E08A00; }
.logo span:nth-child(5n+4) { color: #1C9AD6; }
.logo span:nth-child(5n+5) { color: #1FA463; }

.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.topbar nav a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
}
.topbar nav a:hover { background: var(--grape-light); }
.topbar nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.topbar nav { margin-left: auto; }

.lang { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang a { padding: 6px 12px; color: var(--ink); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.lang a:hover { background: var(--grape-light); }
.lang a[aria-current="true"] { background: var(--ink); color: #fff; }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--grape);
  color: #fff;
  font: 600 1.05rem/1 var(--body);
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
}
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.button-light { background: var(--sun); color: var(--ink); }
.button-quiet { background: #fff; color: var(--ink); }

/* Home */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
  padding: 40px 0 24px;
}

.hero h1 { font-size: clamp(2.75rem, 1.4rem + 4.6vw, 5.25rem); letter-spacing: -0.01em; }
.hero p { margin-top: 24px; max-width: 34ch; font-size: 1.25rem; color: var(--ink-soft); }

.hero-board {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 32px;
  padding: 20px;
  box-shadow: 10px 10px 0 var(--sun);
  transform: rotate(1.5deg);
}
.hero-maze { display: block; width: 100%; height: auto; }
.hero-path {
  stroke: var(--bubble);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: solve 4.5s 0.6s cubic-bezier(0.45, 0.05, 0.35, 1) forwards;
}
@keyframes solve { to { stroke-dashoffset: 0; } }

.choices {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px 32px;
  margin-top: 80px;
}

.choice {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 3px solid var(--ink);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.choice h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem); }
.choice p { margin: 12px 0 24px; max-width: 40ch; }
.choice:hover .button { background: var(--ink); color: #fff; }

.choice-app {
  grid-row: span 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px;
  border-radius: 32px;
  background: var(--grape);
  color: #fff;
  box-shadow: 10px 10px 0 var(--ink);
}
.choice-app h2 { font-size: clamp(2.4rem, 1.6rem + 2.4vw, 3.5rem); }
.choice-app p { font-size: 1.2rem; }
.choice-app .button { margin-top: auto; }
.choice-app:hover { transform: translate(-3px, -3px); box-shadow: 13px 13px 0 var(--ink); }
.choice-app:hover .button { background: #fff; color: var(--ink); }

.games {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin: 8px 0 40px;
  padding: 0;
  list-style: none;
}
.games li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 6px;
  border-radius: 20px;
  background: rgb(255 255 255 / 0.14);
  font-size: 0.95rem;
  text-align: center;
}
.games span { font-size: 2rem; line-height: 1; }

.choice-paper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 20px;
  padding: 32px 28px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(0.8deg);
}
.choice-paper.tilt { transform: rotate(-1deg); }
.choice-paper::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  width: 88px;
  height: 26px;
  border-radius: 3px;
  background: rgb(255 210 63 / 0.8);
  transform: translateX(-50%) rotate(-3deg);
}
.choice-paper:hover { transform: rotate(0deg) translate(-2px, -2px); box-shadow: 9px 9px 0 var(--ink); }
.choice-paper .button { padding: 12px 22px; }
.thumb svg { display: block; width: 100%; height: auto; }

/* Makers */

.maker {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  align-items: start;
  gap: 56px;
  padding-top: 24px;
}

.controls { position: sticky; top: 24px; }
.controls-tall { position: static; }
.controls h1 { font-size: clamp(2.4rem, 1.8rem + 2vw, 3.25rem); }
.lede { margin: 12px 0 32px; color: var(--ink-soft); }

fieldset { margin: 0 0 28px; padding: 0; border: 0; }
legend { margin-bottom: 10px; padding: 0; font-weight: 600; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.options-emoji { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.options-three { grid-template-columns: repeat(3, 1fr); }
.options-four { grid-template-columns: repeat(4, 1fr); }
.options-five { grid-template-columns: repeat(5, 1fr); }
.options-wide { grid-template-columns: 1fr; }

.option { position: relative; }
.option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.option > span {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  line-height: 1.3;
}
.option small { color: var(--ink-soft); font-size: 0.85rem; }
.options-emoji .option > span, .options-three .option > span, .options-four .option > span, .options-five .option > span { align-items: center; text-align: center; padding: 10px 4px; }
.emoji { font-size: 1.9rem; line-height: 1.2; }
.sign { font: 800 1.9rem/1.2 var(--display); }
.hint { margin-top: 8px; color: var(--ink-soft); font-size: 0.9rem; }
.option:hover > span { background: var(--grape-light); }
.option input:checked + span { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.option input:focus-visible + span { outline: 4px solid var(--sky); outline-offset: 3px; }

.check { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-weight: 500; cursor: pointer; }
.check small { display: block; color: var(--ink-soft); font-size: 0.85rem; font-weight: 400; }
.check + .actions { margin-top: 32px; }

/* Options that only matter for one kind of drawing sheet. */
.for-howto, .for-differences { display: none; }
.controls:has([name=kind][value=howto]:checked) .for-howto { display: block; }
.controls:has([name=kind][value=differences]:checked) .for-differences { display: flex; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--grape); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.preview { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.sheet {
  width: 100%;
  max-width: 640px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(42 31 92 / 0.12), 0 24px 48px -24px rgb(42 31 92 / 0.45);
}
.sheet svg { display: block; width: 100%; height: auto; }
.sheet-title { font-family: var(--display); font-weight: 800; }
.sheet-sub { font-family: var(--body); }
.sheet-num { font-family: var(--body); font-weight: 500; }
.answer { stroke: #FFB0D3; }

.more { margin-top: 88px; }
.more h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem); margin-bottom: 24px; }

.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.link-card {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}
.link-card:hover { background: var(--grape-light); }
.link-emoji { font-size: 2.4rem; line-height: 1; }
.link-body { display: flex; flex-direction: column; gap: 6px; }
.link-body b { font: 800 1.35rem/1.2 var(--display); }
.link-body small { color: var(--grape); font-weight: 600; }

.links-page { max-width: 880px; padding-top: 24px; }
.links-page h1 { font-size: clamp(2.4rem, 1.8rem + 2vw, 3.25rem); }

.footer { padding: 72px 0 40px; color: var(--ink-soft); font-size: 0.95rem; }

@media (max-width: 860px) {
  .hero, .choices, .maker { grid-template-columns: 1fr; }
  .hero { gap: 40px; padding-top: 16px; }
  .hero-board { transform: rotate(1deg); box-shadow: 7px 7px 0 var(--sun); }
  .choices { margin-top: 56px; }
  .choice-app { grid-row: auto; padding: 32px 28px; }
  .controls { position: static; }
  .maker { gap: 40px; }
}

@media (max-width: 480px) {
  .logo { font-size: 1.7rem; }
  .topbar nav a { padding: 6px 12px; }
  .choice-paper { grid-template-columns: 1fr 84px; padding: 28px 20px; }
  .choice-paper, .choice-paper.tilt { transform: none; }
  .options-emoji { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-path { animation: none; stroke-dashoffset: 0; }
  .choice, .button { transition: none; }
}

@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  .topbar, .footer, .controls, .skip, .more { display: none; }
  .topbar, main, .footer { width: auto; }
  .maker, .preview { display: block; padding: 0; }
  .sheet {
    display: flex;
    justify-content: center;
    max-width: none;
    height: 100vh;
    box-shadow: none;
    break-after: page;
  }
  .sheet:last-child { break-after: auto; }
  .sheet svg { width: auto; height: 100%; max-width: 100%; }
}
