@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --crayon-red: #e63946;
    --crayon-yellow: #ffd60a;
    --crayon-blue: #1d4ed8;
    --crayon-green: #06a77d;
    --crayon-purple: #7b2cbf;
    --crayon-pink: #ff5d8f;
    --ink: #18181b;
    --ink-soft: #4b5563;
    --paper: #ffffff;
    --cream: #fffaf0;
    --line: #1a1a1a;
    --border: #e5e7eb;
    --shadow: 0 4px 0 var(--line);
    --shadow-lg: 0 8px 0 var(--line);
    --radius: 18px;
    --maxw: 1200px;
}

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

html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 .6em;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }

p { margin: 0 0 1em; }
a { color: var(--crayon-blue); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--crayon-red); }
ul, ol { padding-left: 1.2em; }
img { max-width: 100%; height: auto; display: block; }

.container { width: min(100%, var(--maxw)); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5em; padding: .8em 1.4em;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1rem;
    text-decoration: none;
    border: 3px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn--primary { background: var(--crayon-yellow); color: var(--ink); }
.btn--ghost   { background: var(--paper); color: var(--ink); }
.btn--red     { background: var(--crayon-red); color: #fff; }
.btn--blue    { background: var(--crayon-blue); color: #fff; }

/* ---------- header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: 3px solid var(--line);
}
.site-header__row {
    display: flex; align-items: center; gap: 24px;
    padding: 14px 20px;
    flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: var(--crayon-yellow);
    border: 3px solid var(--line);
    border-radius: 12px;
    color: var(--line);
    box-shadow: 3px 3px 0 var(--line);
}
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.4rem; }
.brand__sub { font-size: .8rem; color: var(--ink-soft); letter-spacing: .1em; text-transform: uppercase; }
.nav { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; align-items: center; }
.nav a {
    color: var(--ink); text-decoration: none; font-weight: 700;
    padding: .35em .6em; border-radius: 8px;
}
.nav a:hover { background: var(--crayon-yellow); color: var(--ink); }

/* search bar */
.search {
    display: flex; align-items: center; gap: 0;
    border: 3px solid var(--line);
    border-radius: 999px;
    padding: 4px 4px 4px 16px;
    background: var(--paper);
    box-shadow: 2px 2px 0 var(--line);
    min-width: 240px;
}
.search input {
    border: 0; outline: 0; flex: 1; background: transparent;
    font: inherit; font-size: .95rem; padding: .5em 0;
}
.search button {
    border: 0; cursor: pointer;
    background: var(--crayon-red); color: #fff;
    font-family: 'Fredoka', sans-serif; font-weight: 600;
    padding: .55em 1.1em; border-radius: 999px;
}
.search button:hover { background: var(--crayon-blue); }

/* ---------- hero ---------- */
.hero {
    background: linear-gradient(180deg, #fffbe6 0%, #fff 100%);
    border-bottom: 3px solid var(--line);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; top: -60px; right: -60px;
    width: 220px; height: 220px; background: var(--crayon-yellow);
    border: 3px solid var(--line); border-radius: 50%;
    z-index: 0;
}
.hero::after {
    content: ""; position: absolute; bottom: -60px; left: -40px;
    width: 160px; height: 160px; background: var(--crayon-red);
    border: 3px solid var(--line); border-radius: 50%;
    z-index: 0;
}
.hero__row {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
    padding: 56px 20px;
    position: relative; z-index: 1;
}
.hero__copy h1 { margin-top: 0; }
.hero h1 .hl-red { color: var(--crayon-red); }
.hero h1 .hl-blue { color: var(--crayon-blue); }
.hero h1 .hl-yellow { background: var(--crayon-yellow); padding: 0 .15em; border-radius: 8px; }
.eyebrow {
    display: inline-block; font-size: .85rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink); background: #fff;
    border: 3px solid var(--line); border-radius: 999px;
    padding: .35em .9em;
    margin-bottom: 16px;
    box-shadow: 2px 2px 0 var(--line);
}
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.hero__search { margin: 14px 0 22px; max-width: 560px; }
.hero__stats { list-style: none; padding: 0; margin: 18px 0 0; display: flex; gap: 28px; flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-family: 'Fredoka', sans-serif; font-size: 1.8rem; color: var(--crayon-blue); }
.hero__stats span { color: var(--ink-soft); font-size: .85rem; }
.hero__art {
    position: relative;
}
.hero__art img {
    border: 4px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 8px 8px 0 var(--line);
}
.hero__crayons {
    position: absolute; bottom: -8px; left: -8px;
    display: flex; gap: 6px;
}
.crayon {
    width: 14px; height: 70px;
    border: 2px solid var(--line);
    border-radius: 4px;
    box-shadow: 2px 2px 0 var(--line);
}
.crayon--red { background: var(--crayon-red); }
.crayon--yellow { background: var(--crayon-yellow); }
.crayon--blue { background: var(--crayon-blue); }
.crayon--green { background: var(--crayon-green); }
.crayon--purple { background: var(--crayon-purple); }
.crayon--pink { background: var(--crayon-pink); }

@media (max-width: 800px) {
    .hero__row { grid-template-columns: 1fr; padding: 36px 16px; }
}

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section--alt { background: var(--cream); border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section__title { margin-bottom: 24px; }

/* ---------- category grid ---------- */
.cat-group { margin-bottom: 40px; }
.cat-group__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.cat-group__head h3 { margin: 0; font-size: 1.4rem; }
.cat-group__head span { color: var(--ink-soft); font-size: .9rem; }
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.cat-card {
    display: block; text-decoration: none; color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.cat-card:hover { transform: translate(-2px, -4px); box-shadow: 6px 8px 0 var(--line); color: var(--ink); }
.cat-card__icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--cat-color, var(--crayon-yellow));
    color: #fff;
    border: 3px solid var(--line);
    border-radius: 14px;
    margin-bottom: 14px;
    box-shadow: 2px 2px 0 var(--line);
}
.cat-card__icon svg { width: 32px; height: 32px; }
.cat-card__title { margin: 0 0 4px; font-size: 1.15rem; }
.cat-card__count { margin: 0; font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.cat-card__desc { margin: 8px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- card grid (pages) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.card {
    display: block;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translate(-2px, -4px); box-shadow: 6px 8px 0 var(--line); color: var(--ink); }
.card__thumb {
    aspect-ratio: 1/1;
    background: #fff;
    border-bottom: 3px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.card__thumb img { width: 88%; height: 88%; object-fit: contain; }
.card__body { padding: 12px 14px; }
.card__title { font-size: 1rem; margin: 0 0 4px; line-height: 1.3; }
.card__cat { font-size: .8rem; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- page head + breadcrumbs ---------- */
.page-head {
    background: linear-gradient(180deg, var(--cream) 0%, #fff 100%);
    border-bottom: 3px solid var(--line);
    padding: 36px 0 28px;
    border-top: 4px solid var(--cat-color, var(--crayon-yellow));
}
.page-head h1 { margin: 8px 0; }
.crumbs { font-size: .9rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--crayon-red); }

/* ---------- prose article ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.5em; }
.prose h3 { margin-top: 1.4em; }
.prose ul li { margin-bottom: .4em; }

/* ---------- two col layout ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.two-col--sidebar { grid-template-columns: 1fr 320px; }
@media (max-width: 900px) { .two-col, .two-col--sidebar { grid-template-columns: 1fr; } }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar__card {
    background: #fff;
    border: 3px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.sidebar__card h3 { margin: 0 0 8px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--crayon-blue); }
.sidebar__card ul { list-style: none; padding: 0; margin: 0; }
.sidebar__card li { padding: 4px 0; font-size: .95rem; }
.sidebar__card a { color: var(--ink); }

/* recommended block (used in sidebar + footer) */
.recommended {
    background: var(--cream);
    border: 3px dashed var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.recommended h3 {
    font-size: 1rem; text-transform: uppercase; letter-spacing: .06em;
    margin: 0 0 12px; color: var(--ink);
    display: flex; align-items: center; gap: 8px;
}
.recommended h3::before { content: "★"; color: var(--crayon-red); }
.recommended ol { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.recommended ol li {
    counter-increment: r;
    padding: 8px 0 8px 28px;
    border-bottom: 1px dashed #d1d5db;
    position: relative;
}
.recommended ol li::before {
    content: counter(r);
    position: absolute; left: 0; top: 8px;
    font-family: 'Fredoka', sans-serif; font-weight: 700;
    color: var(--crayon-red);
}
.recommended ol li:last-child { border-bottom: 0; }
.recommended a {
    color: var(--ink); text-decoration: none; font-weight: 700;
    display: block;
}
.recommended a:hover { color: var(--crayon-red); text-decoration: underline; }
.recommended .rec-blurb {
    display: block;
    color: var(--ink-soft); font-weight: 400; font-size: .85rem;
    margin-top: 2px;
}

/* tags */
.tag {
    display: inline-block;
    background: var(--crayon-yellow);
    color: var(--ink);
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 1px 10px;
    font-size: .78rem;
    margin: 2px 4px 2px 0;
    font-weight: 700;
}

/* page art frame */
.page-art__frame {
    background: #fff;
    border: 3px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
}
.page-art__frame img { width: 100%; max-width: 600px; margin: 0 auto; }
.page-art__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }

/* steps list */
.steps { padding-left: 1.4em; }
.steps li { margin-bottom: .8em; }
.steps strong { color: var(--crayon-blue); }

/* search results */
.search-result { padding: 14px 0; border-bottom: 2px dashed var(--border); }
.search-result h3 { margin: 0 0 4px; }
.search-result h3 a { color: var(--ink); text-decoration: none; }
.search-result h3 a:hover { color: var(--crayon-red); }
.search-result__meta { font-size: .85rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
    background: #1a1a1a;
    color: #f3f4f6;
    padding: 56px 0 24px;
    border-top: 5px solid var(--crayon-yellow);
}
.site-footer h4 { color: #fff; margin-bottom: 14px; }
.site-footer a { color: #f3f4f6; }
.site-footer a:hover { color: var(--crayon-yellow); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.site-footer__brand { font-family: 'Fredoka', sans-serif; font-size: 1.4rem; font-weight: 700; color: #fff; margin: 0 0 8px; }
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
.site-footer__rec {
    background: #2a2a2a;
    border: 2px dashed #4b5563;
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 28px;
}
.site-footer__rec h4 { margin: 0 0 12px; color: var(--crayon-yellow); display: flex; align-items: center; gap: 8px; }
.site-footer__rec h4::before { content: "✦"; color: var(--crayon-red); }
.site-footer__rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.site-footer__rec-grid a,
.site-footer__rec-grid .rec-item {
    display: block;
    color: #f3f4f6;
    text-decoration: none;
    padding: 10px 12px;
    background: #1f1f1f;
    border-radius: 10px;
    border: 1px solid #3a3a3a;
    font-weight: 700;
    font-size: .95rem;
}
.site-footer__rec-grid a:hover { background: #333; color: var(--crayon-yellow); border-color: var(--crayon-yellow); }
.site-footer__rec-grid .rec-blurb { display: block; color: #9ca3af; font-weight: 400; font-size: .8rem; margin-top: 2px; }
.site-footer__copy { color: #9ca3af; font-size: .85rem; padding-top: 18px; border-top: 1px solid #2a2a2a; }

/* inline link slot in articles */
.inline-rec {
    display: inline-block;
    background: #fff8e7;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: .9rem;
    margin: 0 2px;
}
.inline-rec a { color: var(--crayon-blue); text-decoration: underline; }

/* print */
@media print {
    .site-header, .site-footer, .sidebar, .page-art__actions, .crumbs, .recommended, .nav, .hero__cta { display: none !important; }
    body { background: #fff; }
    .page-art__frame { border: 0; box-shadow: none; padding: 0; }
}
