/* ============================================================================
   Class Doodle: "the classroom wall"
   Construction paper pinned to a warm wall. Crayon primaries, chunky rounded
   shapes, hand-drawn wobble. Fredoka (display) + Nunito (body), both self
   hosted latin subsets so nothing is fetched from a third party at runtime.
   House rules: no left-border accents (cards are symmetric filled paper), no
   em/en dashes, print styles strip all decoration.
   ========================================================================== */
@font-face { font-family: 'Fredoka'; src: url(/fonts/fredoka.woff2) format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(/fonts/nunito.woff2) format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap; }

:root {
  /* the crayon box: six colours that cycle across cards and tabs */
  --c1: #e8453c;  /* crayon red     */
  --c2: #f7a325;  /* marigold       */
  --c3: #f6c945;  /* sunshine       */
  --c4: #3fa66a;  /* grass          */
  --c5: #2e8fd0;  /* sky            */
  --c6: #8b5cc7;  /* grape          */

  --ink:        #2f2a26;   /* warm near black, body text          */
  --ink-soft:   #6b6058;
  --ink-faint:  #97897d;
  --paper:      #fffdf7;   /* card surface                        */
  --wall:       #fdf4e3;   /* the wall behind everything          */
  --wall-deep:  #f7e7cd;
  --line:       #e9d9bd;

  --shadow:      0 3px 0 rgba(47,42,38,.13), 0 10px 22px rgba(47,42,38,.09);
  --shadow-lift: 0 5px 0 rgba(47,42,38,.16), 0 18px 34px rgba(47,42,38,.15);

  /* hand-drawn wobble: deliberately unequal corners */
  --wobble:  22px 26px 20px 28px / 26px 20px 28px 22px;
  --wobble2: 28px 20px 26px 22px / 20px 28px 22px 26px;

  --font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.65;
  background-color: var(--wall);
  /* paper grain + a faint ruled feel, pure CSS so there is no extra request */
  background-image:
    radial-gradient(rgba(47,42,38,.045) 1px, transparent 1px),
    radial-gradient(rgba(47,42,38,.03) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15;
  color: var(--ink); margin: 0 0 .5em; letter-spacing: -.005em; }
a { color: #b4372f; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
label:focus-visible, summary:focus-visible {
  outline: 3px solid var(--c5); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- header: a paper banner taped to the wall ---------------------- */
.site-header { background: var(--paper); border-bottom: 3px solid var(--line); position: relative; }
/* the rainbow tape strip: decoration only, hidden from assistive tech */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--c1) 0 60px, var(--c2) 60px 120px, var(--c3) 120px 180px,
    var(--c4) 180px 240px, var(--c5) 240px 300px, var(--c6) 300px 360px);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; flex: none; box-shadow: var(--shadow);
  transition: transform .18s ease; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
/* "Class" stays ink, "Doodle" takes the crayon red. The colour play lives in the squiggle
   underneath so the wordmark itself keeps full text contrast. */
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; display: block;
  letter-spacing: -.02em; line-height: 1.05; position: relative; padding-bottom: 7px; }
.brand-name b { font-weight: 700; color: var(--c1); }
.brand-squiggle { position: absolute; left: 0; bottom: -1px; width: 100%; height: 8px;
  overflow: visible; pointer-events: none; }
.brand-tagline { display: block; margin-top: 3px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700; }
.header-nav { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 500; }
.header-nav > a, .drop-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
  border-radius: 999px; text-decoration: none; color: var(--ink); cursor: pointer; }
.header-nav > a:hover, .drop-toggle:hover { background: var(--wall-deep); }
.nav-cta { background: var(--c1); color: #fff !important; font-weight: 600;
  box-shadow: 0 3px 0 #b4372f; }
.nav-cta:hover { background: #d43a32; }
.nav-drop { position: relative; }
.drop-open { position: absolute; opacity: 0; pointer-events: none; }
.drop-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  min-width: 230px; background: var(--paper); border: 3px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lift); padding: 8px; }
.drop-open:checked ~ .drop-panel { display: block; }
.drop-panel a { display: block; padding: 9px 13px; border-radius: 12px; text-decoration: none;
  color: var(--ink); }
.drop-panel a:hover { background: var(--wall-deep); }
.nav-caret { flex: none; }
/* the mobile menu toggle: the checkbox itself must never paint (it was rendering as a
   visible box in the header), the burger label appears only on narrow screens */
.nav-open { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  clip-path: inset(50%); }
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 10px; cursor: pointer;
  border-radius: 12px; }
.nav-burger span { display: block; width: 24px; height: 3px; background: var(--ink); border-radius: 2px; }

/* ---------- hero: a note pinned slightly askew ---------------------------- */
main.wrap { padding-top: 34px; padding-bottom: 10px; }
.hero { position: relative; background: var(--paper); border: 3px solid var(--line);
  border-radius: var(--wobble); box-shadow: var(--shadow-lift);
  padding: 40px 34px 34px; margin: 16px 0 30px; transform: rotate(-.5deg); }
.hero::before {  /* strip of tape at the top */
  content: ""; position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 120px; height: 26px; background: rgba(246,201,69,.72);
  border-radius: 3px; box-shadow: 0 1px 3px rgba(47,42,38,.13); }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 3.1rem); font-weight: 700; text-align: center;
  margin-bottom: .35em; }
.hero h1 .dot { color: var(--c1); }
.hero .lead { max-width: 660px; margin: 0 auto; text-align: center; font-size: 1.1rem;
  color: var(--ink-soft); }
.hero-icon { display: block; margin: 0 auto 14px; }

/* ---------- the crayon rail: categories as chunky colour tiles ------------ */
.pill-strip { margin: 26px 0 34px; }
.pills { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill { --c: var(--c5);
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px;
  background: var(--paper); color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  border: 3px solid var(--c); border-radius: 999px; box-shadow: 0 3px 0 var(--c);
  transition: transform .13s ease, box-shadow .13s ease; }
.pill:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--c); }
.pill:nth-child(6n+1) { --c: var(--c1); } .pill:nth-child(6n+2) { --c: var(--c2); }
.pill:nth-child(6n+3) { --c: var(--c4); } .pill:nth-child(6n+4) { --c: var(--c5); }
.pill:nth-child(6n+5) { --c: var(--c6); } .pill:nth-child(6n+6) { --c: var(--c3); }
.pill svg { flex: none; }

/* ---------- section headings: a coloured paper tab ------------------------ */
.cat-block { margin: 0 0 44px; }
.sec-h { --c: var(--c5);
  display: inline-flex; align-items: center; gap: 10px; font-size: 1.32rem; font-weight: 700;
  background: var(--c); color: #fff; padding: 9px 20px; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 3px 0 rgba(47,42,38,.18); margin-bottom: 14px; }
.sec-h a { color: #fff; text-decoration: none; }
.sec-h a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cat-block:nth-of-type(6n+1) .sec-h { --c: var(--c1); }
.cat-block:nth-of-type(6n+2) .sec-h { --c: var(--c4); }
.cat-block:nth-of-type(6n+3) .sec-h { --c: var(--c5); }
.cat-block:nth-of-type(6n+4) .sec-h { --c: var(--c6); }
.cat-block:nth-of-type(6n+5) .sec-h { --c: var(--c2); }
.cat-block:nth-of-type(6n+6) .sec-h { --c: #c9902a; }
.sec-note { color: var(--ink-soft); margin: 0 0 18px; max-width: 74ch; }

/* ---------- cards: construction paper, pinned at a slight angle ----------- */
.grid { display: grid; gap: 24px; }
.col-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.sheet-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card, .sheet-card { --c: var(--c5);
  position: relative; display: flex; flex-direction: column; background: var(--paper);
  border: 3px solid var(--line); border-radius: var(--wobble2); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease; }
.card:nth-child(4n+1), .sheet-card:nth-child(4n+1) { transform: rotate(-.7deg); }
.card:nth-child(4n+2), .sheet-card:nth-child(4n+2) { transform: rotate(.5deg); }
.card:nth-child(4n+3), .sheet-card:nth-child(4n+3) { transform: rotate(.8deg); }
.card:nth-child(4n+4), .sheet-card:nth-child(4n+4) { transform: rotate(-.4deg); }
.card:hover, .sheet-card:hover { transform: rotate(0) translateY(-5px); box-shadow: var(--shadow-lift); }
.card:nth-child(6n+1) { --c: var(--c1); } .card:nth-child(6n+2) { --c: var(--c2); }
.card:nth-child(6n+3) { --c: var(--c4); } .card:nth-child(6n+4) { --c: var(--c5); }
.card:nth-child(6n+5) { --c: var(--c6); } .card:nth-child(6n+6) { --c: var(--c3); }
/* the colour band along the top edge is the card's "paper" colour */
.card::before, .sheet-card::before { content: ""; display: block; height: 9px; background: var(--c); }
.card-media, .media-link { display: block; line-height: 0; background: #fff; }
.card-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.sheet-card .card-media img { aspect-ratio: 1 / 1.29; object-fit: contain; padding: 8px; }
.card-body { padding: 15px 17px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; margin: 0; }
.card-desc { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.card-meta { color: var(--ink-faint); font-size: .82rem; font-weight: 700; margin-top: auto; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { background: var(--wall-deep); color: var(--ink-soft); font-size: .74rem; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; }

/* ---------- buttons ------------------------------------------------------- */
.btn-primary, .btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: .97rem;
  padding: 11px 20px; border-radius: 999px; text-decoration: none; border: 0; cursor: pointer;
  background: var(--c1); color: #fff; box-shadow: 0 3px 0 #b4372f;
  transition: transform .12s ease, box-shadow .12s ease; }
.btn-primary:hover, .btn-download:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #b4372f; }
.btn-primary:active, .btn-download:active { transform: translateY(1px); box-shadow: 0 2px 0 #b4372f; }

/* ---------- page hero (category / collection / grade hub) ----------------- */
.page-hero { background: var(--paper); border: 3px solid var(--line); border-radius: var(--wobble);
  box-shadow: var(--shadow); padding: 28px 28px 24px; margin: 8px 0 28px; }
.page-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; }
.page-hero-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-hero .lead { color: var(--ink-soft); margin: 6px 0 0; max-width: 74ch; }
.crumbs { font-size: .88rem; color: var(--ink-faint); margin: 4px 0 14px; font-weight: 700; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .5; margin: 0 6px; }
.byline { color: var(--ink-faint); font-size: .88rem; font-weight: 700; margin: 6px 0 0; }
.byline a { color: var(--ink-soft); }

/* ---------- "how it works": three crayon circles --------------------------- */
.how { background: var(--paper); border: 3px solid var(--line); border-radius: var(--wobble2);
  box-shadow: var(--shadow); padding: 28px; margin: 34px 0; }
.how h2 { text-align: center; font-size: 1.5rem; }
.how ol { list-style: none; counter-reset: step; margin: 20px 0 0; padding: 0;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how li { counter-increment: step; text-align: center; padding-top: 58px; position: relative;
  color: var(--ink-soft); }
.how li::before { content: counter(step); position: absolute; top: 0; left: 50%;
  transform: translateX(-50%); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: 1.28rem; color: #fff; }
.how li:nth-child(1)::before { background: var(--c1); box-shadow: 0 3px 0 #b4372f; }
.how li:nth-child(2)::before { background: var(--c4); box-shadow: 0 3px 0 #2f7d50; }
.how li:nth-child(3)::before { background: var(--c5); box-shadow: 0 3px 0 #226ea2; }
.how-more { text-align: center; margin: 20px 0 0; }

/* ---------- prose blocks --------------------------------------------------- */
.prose, .static-page, .notice { background: var(--paper); border: 3px solid var(--line);
  border-radius: var(--wobble); box-shadow: var(--shadow); padding: 28px; margin: 28px 0; }
.prose h2, .static-page h2 { font-size: 1.42rem; margin-top: 1.1em; }
.prose h2:first-child, .static-page h2:first-child { margin-top: 0; }
.prose p, .static-page p { max-width: 74ch; }
.sp-head { margin-bottom: 10px; } .sp-lead { color: var(--ink-soft); }

/* ---------- share row ------------------------------------------------------ */
.share-sec { margin: 30px 0; text-align: center; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-btn, .pin-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  text-decoration: none; color: #fff; border: 0; cursor: pointer; }
.sb-pin { background: #d0021b; } .sb-fb { background: #3b5998; }
.sb-wa { background: #25a366; } .sb-copy { background: var(--ink-soft); }
.share-pop { display: none; }

/* ---------- forms ---------------------------------------------------------- */
.contact-form { display: grid; gap: 14px; max-width: 560px; }
.contact-form label { font-family: var(--font-display); font-weight: 600; }
.contact-form input, .contact-form textarea { font: inherit; padding: 12px 14px;
  border: 3px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); width: 100%; }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* ---------- footer: the noticeboard ---------------------------------------- */
.site-footer { background: var(--paper); border-top: 3px solid var(--line); margin-top: 46px;
  padding: 34px 0 26px; position: relative; }
.site-footer::before { content: ""; position: absolute; top: -3px; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--c6) 0 60px, var(--c5) 60px 120px, var(--c4) 120px 180px,
    var(--c3) 180px 240px, var(--c2) 240px 300px, var(--c1) 300px 360px); }
.footer-cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.fcol h3 { font-size: 1rem; margin-bottom: .6em; }
.fcol a { display: block; padding: 3px 0; color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.fcol a:hover { color: var(--ink); text-decoration: underline; }
.footer-base { margin-top: 24px; padding-top: 18px; border-top: 2px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--ink-faint); font-size: .88rem; }
.footer-social { display: flex; gap: 10px; }
.social-link { color: var(--ink-soft); }
.lang-current { font-weight: 800; }
.creator-card { display: flex; gap: 16px; align-items: center; background: var(--wall-deep);
  border-radius: var(--wobble2); padding: 16px 18px; margin: 20px 0; }

/* ---------- responsive ------------------------------------------------------ */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero { padding: 32px 20px 26px; transform: none; }
  .hero::before { width: 92px; }
  .header-nav { gap: 2px; font-size: .93rem; }
  .brand-tagline { display: none; }
  .page-hero, .prose, .static-page, .how { padding: 22px 18px; }
  .col-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .card, .sheet-card { transform: none !important; }
}

/* ---------- respect motion preferences -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .brand:hover .brand-mark { transform: none !important; }
  .hero, .card, .sheet-card { transform: none !important; }
}

/* ---------- print: strip every bit of decoration ----------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .share-sec, .pill-strip, .nav-cta, .btn-primary, .btn-download { display: none !important; }
  .hero, .page-hero, .prose, .static-page, .how, .card, .sheet-card {
    box-shadow: none !important; border: 1px solid #999 !important; border-radius: 0 !important;
    transform: none !important; background: #fff !important; }
  .hero::before, .card::before, .sheet-card::before, .site-header::after { display: none !important; }
  .brand-squiggle { display: none !important; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- hero rail: the crayon box lives INSIDE the welcome note --------- */
.hero-rail { margin: 24px auto 0; padding-top: 22px; border-top: 3px dashed var(--line);
  max-width: 900px; }

/* ---------- peg rail: grades hang like name tags on classroom pegs ---------- */
.peg-rail { background: var(--paper); border: 3px solid var(--line); border-radius: var(--wobble);
  box-shadow: var(--shadow); padding: 26px 28px 30px; margin: 34px 0; text-align: center; }
.peg-rail h2 { font-size: 1.42rem; }
.peg-rail .sec-note { margin: 0 auto 22px; }
.pegs { list-style: none; margin: 0; padding: 26px 0 0; display: flex; flex-wrap: wrap; gap: 30px 26px;
  justify-content: center; position: relative; }
.pegs::before {  /* the rail the tags hang from */
  content: ""; position: absolute; top: 6px; left: 4%; right: 4%; height: 5px;
  background: var(--wall-deep); border-radius: 999px; }
.pegs li { position: relative; padding-top: 16px; }
.pegs li::before {  /* the string */
  content: ""; position: absolute; top: -14px; left: 50%; width: 3px; height: 24px;
  background: var(--line); transform: translateX(-50%); }
.pegs a { --c: var(--c5);
  display: inline-block; padding: 11px 20px; background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
  border: 3px solid var(--c); border-radius: 6px 6px 16px 16px; box-shadow: 0 3px 0 var(--c);
  transition: transform .13s ease; }
.pegs li:nth-child(7n+1) a { --c: var(--c1); } .pegs li:nth-child(7n+2) a { --c: var(--c2); }
.pegs li:nth-child(7n+3) a { --c: var(--c3); } .pegs li:nth-child(7n+4) a { --c: var(--c4); }
.pegs li:nth-child(7n+5) a { --c: var(--c5); } .pegs li:nth-child(7n+6) a { --c: var(--c6); }
.pegs li:nth-child(7n+7) a { --c: #c9902a; }
.pegs a:hover { transform: translateY(3px); }
@media (max-width: 860px) { .pegs { gap: 22px 14px; } .peg-rail { padding: 22px 16px 26px; } }
@media (prefers-reduced-motion: reduce) { .pegs a:hover { transform: none; } }
@media print { .peg-rail::before, .pegs::before, .pegs li::before { display: none !important; } }


/* ---------- mobile nav ------------------------------------------------------ */
@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .header-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 2px; background: var(--paper);
    border-bottom: 3px solid var(--line); box-shadow: var(--shadow-lift); padding: 10px 16px 16px; }
  .nav-open:checked ~ .header-nav { display: flex; }
  .header-row { position: relative; }
  .drop-panel { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
  .nav-cta { justify-content: center; margin-top: 6px; }
}
