/* Crayon Bandits: the app's own brand (Theme.swift) and fonts */
/* fonts ship with the site (SIL Open Font License, see /fonts): no third-party requests */
@font-face { font-family: "Titan One"; src: url("/fonts/TitanOne-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("/fonts/Baloo2-Variable.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("/fonts/GochiHand-Regular.woff2") format("woff2"); font-display: swap; }
:root {
  --hivis: #FFD400;     /* Hi-Vis Yellow, the crayon-box ground */
  --ink: #111111;       /* the app's line-art ink */
  --paper: #FFFFFF;     /* the coloring page */
  --orange: #FF6A13;    /* Bandit Orange */
  --blue: #1E6FD9;
  --cream: #FFF4E0;     /* the app's sheet color, for long reading */
  --line: 4px;
  --display: "Titan One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Baloo 2", system-ui, -apple-system, sans-serif;
  --hand: "Gochi Hand", "Comic Sans MS", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hivis); color: var(--ink); font: 400 1.125rem/1.55 var(--body); }
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 16px; }
.bar .home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.bar .home img { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink); }
.bar .home span { font: 1.25rem/1 var(--display); }
.bar nav { display: flex; gap: 6px; }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 3px solid transparent; }
.bar nav a:hover { border-color: var(--ink); color: var(--ink); }
.bar nav a[aria-current="page"] { background: var(--ink); color: var(--hivis); }

/* hero: the live coloring page */
.hero { max-width: 1320px; margin: 0 auto; padding: 12px 16px 40px; display: grid; gap: 40px;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; min-height: calc(100vh - 80px); }
.hero .logo { width: min(100%, 600px); display: block; margin-left: -6px; }
.hero h1 { font: clamp(2.4rem, 4.6vw, 4.4rem)/1.02 var(--display); margin: 20px 0 16px; letter-spacing: 0.005em; }
.hero p.lead { font-size: clamp(1.2rem, 1.6vw, 1.45rem); max-width: 32ch; margin: 0 0 20px; }
.note { font: clamp(1.5rem, 2vw, 2rem)/1.2 var(--hand); transform: rotate(-3deg); display: inline-block; margin: 8px 0 0; }

.easel { position: relative; }
.sheet { background: var(--paper); border: var(--line) solid var(--ink); border-radius: 18px;
  box-shadow: 10px 10px 0 var(--ink); padding: 14px; transform: rotate(1.2deg); }
.sheet .canvas-wrap { position: relative; aspect-ratio: 1100 / 850; }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; cursor: crosshair; }
.sheet canvas.lines { pointer-events: none; mix-blend-mode: multiply; }
.box { display: flex; flex-wrap: wrap; gap: 2px 3px; margin-top: 16px; align-items: flex-end; }
.crayon { width: 38px; height: 92px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: flex-end;
  transition: transform .12s ease; }
.crayon svg { width: 30px; height: 76px; margin: 0 auto; overflow: visible; }
.crayon .tip, .crayon .body { fill: currentColor; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.crayon .wrap { fill: rgba(0,0,0,.16); }
.crayon .rule { stroke: var(--ink); stroke-width: 2.5; fill: none; }
.crayon .shine { stroke: rgba(255,255,255,.55); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.crayon[aria-pressed="true"] { transform: translateY(-12px); }
.crayon[aria-pressed="true"] svg { filter: drop-shadow(0 6px 0 var(--ink)); }
.pick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: thin; }
.who { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 4px 4px;
  border: 3px solid transparent; border-radius: 16px; background: none; cursor: pointer; font: 700 .9rem/1.1 var(--body); color: var(--ink); }
.who img { width: 52px; height: 52px; object-fit: contain; }
.who:hover { border-color: var(--ink); }
.who[aria-pressed="true"] { background: var(--paper); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn { min-height: 48px; padding: 0 20px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper);
  font: 700 1.05rem/1 var(--body); color: var(--ink); cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.go { background: var(--orange); }
.status { font: 1.35rem/1.3 var(--hand); min-height: 1.8em; margin: 10px 0 0; }

/* the crew, on their worlds' colors */
.crew { background: var(--ink); color: var(--paper); padding: 64px 16px 72px; }
.crew .in { max-width: 1400px; margin: 0 auto; }
.crew h2 { font: 2.2rem/1.1 var(--display); color: var(--hivis); margin: 0 0 6px; }
.crew .sub { margin: 0 0 40px; max-width: 52ch; color: #F2EBDD; }
.worlds { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 22px; }
.worlds li { flex: 0 1 236px; background: var(--w); border: var(--line) solid var(--paper); border-radius: 26px; padding: 0 16px 18px;
  margin-top: 96px; text-align: center; color: var(--ink); display: flex; flex-direction: column; align-items: center; }
.worlds li:nth-child(odd) { transform: rotate(-1.5deg); }
.worlds li:nth-child(even) { transform: rotate(1.5deg); }
.worlds img { width: 200px; height: 200px; object-fit: contain; margin: -100px auto 0; display: block; filter: drop-shadow(0 5px 0 rgba(0,0,0,.25)); }
.worlds h3 { font: 2rem/1.05 var(--display); margin: 6px 0 0; }
.worlds .where { font: 700 1.05rem/1.3 var(--body); margin: 2px 0 8px; }
.worlds .quote { font: 1.35rem/1.25 var(--hand); margin: 0 0 12px; flex: 1; }
.hear { min-height: 44px; padding: 0 16px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper);
  font: 700 1rem/1 var(--body); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.hear:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* for grown-ups: a sheet of ruled paper */
.grownups { max-width: 1180px; margin: 0 auto; padding: 72px 16px; display: grid; gap: 32px;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); align-items: start; }
.grownups h2 { font: 2.2rem/1.1 var(--display); margin: 0 0 12px; }
.grownups p { max-width: 46ch; }
.ruled { background: var(--paper) repeating-linear-gradient(to bottom, transparent 0, transparent 47px, #9cc6ef 47px, #9cc6ef 49px);
  border: var(--line) solid var(--ink); border-radius: 14px; padding: 12px 24px 18px 64px; position: relative;
  box-shadow: 10px 10px 0 var(--ink); transform: rotate(-1deg); }
.ruled::before { content: ""; position: absolute; top: 0; bottom: 0; left: 44px; width: 2px; background: #e8626a; }
.ruled ul { list-style: none; margin: 0; padding: 0; }
.ruled li { font: 1.65rem/49px var(--hand); position: relative; }
.ruled li::before { content: "✓"; position: absolute; left: -38px; font: 1.6rem/49px var(--display); color: var(--green, #2FB24C); }

/* reading pages (privacy, support) */
.read { max-width: 820px; margin: 0 auto; padding: 8px 16px 64px; }
.read .doc { background: var(--cream); border: var(--line) solid var(--ink); border-radius: 18px; box-shadow: 10px 10px 0 var(--ink);
  padding: 28px clamp(18px, 4vw, 44px) 36px; }
.read h1 { font: 2.4rem/1.1 var(--display); margin: 4px 0 6px; }
.read h2 { font: 1.45rem/1.2 var(--display); margin: 34px 0 6px; }
.read h3 { font: 700 1.2rem/1.3 var(--body); margin: 26px 0 4px; }
.read p, .read li { max-width: 68ch; }
.read .date { font: 1.3rem/1.2 var(--hand); margin: 0 0 18px; }
.read .short { background: var(--hivis); border: 3px solid var(--ink); border-radius: 14px; padding: 14px 18px; margin: 18px 0 8px; }

footer { background: var(--ink); color: #F2EBDD; }
footer .in { max-width: 1180px; margin: 0 auto; padding: 28px 16px; display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--hivis); display: inline-flex; min-height: 44px; align-items: center; }
footer .who { margin-right: auto; }

@media (max-width: 860px) {
  .hero, .grownups { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 2.1rem; }
  .sheet { transform: none; box-shadow: 6px 6px 0 var(--ink); }
  .ruled { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .crayon { transition: none; }
}

/* finish moment */
.sheet canvas.party { pointer-events: none; }
.loot { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-6deg) scale(.6); opacity: 0;
  font: clamp(2.4rem, 5vw, 4.6rem)/1 var(--display); color: var(--hivis); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink); pointer-events: none; white-space: nowrap; }
.loot.show { animation: loot 2.4s ease-out forwards; }
@keyframes loot { 12% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1.08); }
  25% { transform: translate(-50%, -50%) rotate(-6deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) rotate(-6deg) scale(1); } }
.btn.sound[aria-pressed="true"] { background: var(--hivis); }

/* printing: only the colored page and the logo */
.printable { display: none; }
@media print {
  body > *:not(.printable) { display: none !important; }
  body { background: #fff; }
  .printable { display: block; text-align: center; }
  .printable #printimg { width: 100%; max-height: 82vh; object-fit: contain; }
  .printable .printlogo { width: 46%; margin-top: 12px; }
  .printable p { font: 1rem var(--body); margin: 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loot.show { animation: none; opacity: 1; transform: translate(-50%, -50%) rotate(-6deg); }
}

/* the hero's small print */
.soon { display: inline-block; margin: 22px 0 0; padding: 8px 16px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper);
  font: 700 1rem/1.2 var(--body); box-shadow: 4px 4px 0 var(--ink); }

/* crayon scribbles between sections: the next section's color, drawn like a crayon line */
.scribble { display: block; width: 100%; height: 46px; margin: -2px 0; }
.scribble path { fill: none; stroke-width: 14; stroke-linecap: round; }
.scribble.to-paper { background: linear-gradient(var(--hivis) 50%, var(--cream) 50%); }
.scribble.to-ink { background: linear-gradient(var(--cream) 50%, var(--ink) 50%); }
.scribble.to-hivis { background: linear-gradient(var(--ink) 50%, var(--hivis) 50%); }

/* how it works: real app screens in phones */
.how { background: var(--cream); padding: 64px 16px 80px; }
.how .in { max-width: 1320px; margin: 0 auto; }
.how h2 { font: clamp(2.2rem, 4vw, 3.4rem)/1.05 var(--display); margin: 0 0 36px; text-align: center; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 36px 28px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { counter-increment: step; text-align: center; }
.steps .phone { position: relative; width: min(100%, 250px); margin: 0 auto 18px; border: 8px solid var(--ink); border-radius: 36px;
  overflow: hidden; background: var(--ink); box-shadow: 8px 8px 0 var(--orange); }
.steps .phone img { display: block; width: 100%; height: auto; border-radius: 26px; }
.steps li:nth-child(2) .phone { box-shadow: 8px 8px 0 var(--blue); }
.steps li:nth-child(3) .phone { box-shadow: 8px 8px 0 #2FB24C; }
.steps li:nth-child(4) .phone { box-shadow: 8px 8px 0 #FF4F9A; }
.steps h3 { font: 1.7rem/1.1 var(--display); margin: 0 0 6px; }
.steps h3::before { content: counter(step); display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: 10px;
  border-radius: 50%; background: var(--hivis); border: 3px solid var(--ink); font: 1.4rem/1 var(--display); vertical-align: 3px; }
.steps p { margin: 0 auto; max-width: 28ch; }

/* the last word */
.last { background: var(--orange); border-top: var(--line) solid var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 32px; align-items: center; padding: 56px max(16px, calc((100vw - 1180px) / 2)); }
.last img { width: 220px; }
.last h2 { font: clamp(2rem, 3.6vw, 3rem)/1.05 var(--display); margin: 0 0 10px; }
.last p { font-size: 1.25rem; margin: 0 0 14px; max-width: 46ch; }
.last .btn { display: inline-flex; align-items: center; text-decoration: none; background: var(--hivis); }
.crew h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
.grownups h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
@media (max-width: 860px) {
  .hero { min-height: 0; }
  .last { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
  .last img { width: 160px; }
}
@media (max-width: 520px) {
  .worlds li { flex-basis: 100%; max-width: 320px; }
}
@media (max-width: 640px) {
  .steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 18px; padding: 4px 4px 18px; margin: 0 -16px; padding-left: 16px; }
  .steps li { flex: 0 0 78%; scroll-snap-align: center; }
  .steps .phone { width: 210px; }
}
