/* drdirt.earth: Dr. Dirt's educational site. Kid- and teacher-friendly:
   big friendly type, warm garden colours, rounded cards, easy tap targets.
   Fonts: Fredoka (headings) and Nunito (text), with system fallbacks. */
:root {
  --soil: #3b2a1c;
  --soil-2: #6b4c33;
  --ink: #23301f;
  --muted: #5f6b5a;
  --leaf: #2f7d3b;
  --leaf-dark: #1d4f2a;
  --leaf-light: #e4f3d8;
  --sun: #ffc93c;
  --sun-light: #fff3cc;
  --sky: #4aa8de;
  --sky-light: #e2f2fc;
  --berry: #e4525c;
  --berry-light: #fde6e7;
  --grape: #7a5ec8;
  --grape-light: #eee8fb;
  --cream: #fffaf0;
  --paper: #ffffff;
  --line: #eadfc9;
  --radius: 22px;
  --shadow: 0 10px 28px rgba(59, 42, 28, 0.12);
  --head: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --body: 'Nunito', 'Segoe UI', Roboto, Arial, sans-serif;
  /* The print page uses this name. */
  --brand-muted: var(--muted);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
img { max-width: 100%; height: auto; }
a { color: var(--leaf-dark); }
h1, h2, h3, h4 { font-family: var(--head); color: var(--soil); line-height: 1.15; margin: 0 0 0.4em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 720px; }
.center .lead { margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); color: var(--soil); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header and menu ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 250, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 14px; min-height: 68px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--soil); font-family: var(--head); font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.brand img { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--sun); background: #fff; object-fit: cover; }
.brand small { display: block; font-family: var(--body); font-weight: 800; font-size: 0.72rem; color: var(--leaf); letter-spacing: 0.4px; }
.nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav a { text-decoration: none; color: var(--soil); font-weight: 800; font-size: 0.96rem; padding: 9px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--leaf-light); color: var(--leaf-dark); }
.nav a.nav-play { background: var(--leaf); color: #fff; margin-left: 6px; }
.nav a.nav-play:hover { background: var(--leaf-dark); color: #fff; }
.nav a.nav-donate { color: #a3501f; }
.back-btn { flex: none; border: 0; background: var(--leaf-light); color: var(--leaf-dark); border-radius: 999px; padding: 6px 12px; font: 800 0.9rem var(--body); cursor: pointer; }
.back-btn:hover { background: var(--leaf); color: #fff; }
@media (max-width: 420px) { .back-btn { padding: 6px 9px; font-size: 0.82rem; } .brand small { display: none; } }
.nav a.nav-physical { background: var(--sun); color: var(--soil); margin-left: 6px; }
.nav a.nav-physical:hover { background: #f5b82e; color: var(--soil); }
.menu-toggle { display: none; margin-left: auto; border: 0; background: var(--leaf-light); color: var(--leaf-dark); border-radius: 14px; padding: 10px 14px; font: 800 1rem var(--body); cursor: pointer; }
@media (max-width: 1440px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: -16px; right: -16px; top: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 16px; background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .nav a.nav-play, .nav a.nav-physical { margin: 6px 0 0; text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 0;
  background: var(--leaf); color: #fff;
  font: 800 1.05rem var(--body); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--leaf-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--leaf-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--leaf-dark); }
.btn.sun { background: var(--sun); color: var(--soil); box-shadow: 0 4px 0 #d9a21c; }
.btn.sky { background: var(--sky); box-shadow: 0 4px 0 #2f7fae; }
.btn.berry { background: var(--berry); box-shadow: 0 4px 0 #b23a43; }
.btn.grape { background: var(--grape); box-shadow: 0 4px 0 #5a439c; }
.btn.light { background: #fff; color: var(--leaf-dark); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--leaf-light); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 6px; }
.center .btn-row { justify-content: center; }
/* Four buttons in two lines, two by two, on any screen. */
.btn-row.two-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 540px; }
.btn-row.two-lines .btn { padding-left: 12px; padding-right: 12px; text-align: center; line-height: 1.15; }
@media (max-width: 420px) { .btn-row.two-lines { gap: 10px; } .btn-row.two-lines .btn { font-size: 0.92rem; gap: 6px; } }

/* ---------- sections ---------- */
section { padding: 64px 0; }
section.tight { padding: 40px 0; }
.band-leaf { background: var(--leaf-light); }
.band-sun { background: var(--sun-light); }
.band-sky { background: var(--sky-light); }
.band-grape { background: var(--grape-light); }
.band-soil { background: var(--soil); color: #fbeedd; }
.band-soil h2, .band-soil h3 { color: #fff; }
.band-soil .lead { color: #e7d6bd; }
.kicker { display: inline-block; font: 800 0.82rem var(--body); letter-spacing: 1.4px; text-transform: uppercase; color: var(--leaf); background: #fff; border: 2px solid var(--leaf-light); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 48px 0 0; background:
  radial-gradient(circle at 88% 16%, #ffe9a8 0 9%, transparent 9.5%),
  linear-gradient(180deg, #d9effb 0%, var(--cream) 82%); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center; }
.hero h1 span { color: var(--leaf); }
.hero-art { position: relative; text-align: center; }
.hero-art img.hero-dr { width: min(360px, 90%); filter: drop-shadow(0 18px 24px rgba(59, 42, 28, 0.25)); animation: bob 4.5s ease-in-out infinite; }
.hero-hill { display: block; width: 100%; height: 80px; margin-top: -10px; }
.float { position: absolute; font-size: 2rem; animation: drift 7s ease-in-out infinite; }
.page-hero { padding: 48px 0 36px; background: linear-gradient(180deg, #d9effb 0%, var(--cream) 100%); }
.page-hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.page-hero img { width: 190px; filter: drop-shadow(0 12px 16px rgba(59, 42, 28, 0.2)); }
@media (max-width: 720px) { .page-hero .wrap { grid-template-columns: 1fr; text-align: center; } .page-hero img { width: 140px; margin: 0 auto; } .page-hero .btn-row { justify-content: center; } .page-hero .lead { margin: 0 auto 1em; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(8px, -14px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .hero-art img.hero-dr, .float { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; text-align: center; } .hero .btn-row { justify-content: center; } .hero .lead { margin: 0 auto 1em; } .hero-art img.hero-dr { width: 230px; } }

/* ---------- cards ---------- */
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .grid.three, .grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; } }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 2px solid transparent; display: flex; flex-direction: column; }
.card h3 { margin-top: 4px; }
.card p { color: var(--muted); }
.card .btn-row { margin-top: auto; padding-top: 6px; }
.card .art { width: 96px; height: 96px; object-fit: contain; margin-bottom: 6px; }
.card.door { text-align: center; align-items: center; }
.card.door .art { width: 128px; height: 128px; }
.card.door .btn-row { justify-content: center; }
.card.leaf { border-color: var(--leaf-light); }
.card.sun { border-color: #ffe08a; }
.card.sky { border-color: #bfe2f6; }
.card.berry { border-color: #f6c3c6; }
.card.grape { border-color: #d9cdf5; }
.emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; }
.tag { display: inline-block; align-self: flex-start; font: 800 0.75rem var(--body); text-transform: uppercase; letter-spacing: 1px; padding: 3px 10px; border-radius: 999px; background: var(--leaf-light); color: var(--leaf-dark); margin-bottom: 6px; }
.card.door .tag { align-self: center; }
.tag.sun { background: var(--sun-light); color: #8a5a00; }
.tag.sky { background: var(--sky-light); color: #1f5f86; }
.tag.berry { background: var(--berry-light); color: #9b2630; }
.tag.grape { background: var(--grape-light); color: #4b3591; }

/* ---------- lists ---------- */
.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { position: relative; padding-left: 34px; margin-bottom: 10px; }
.checks li::before { content: '\2714'; position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--leaf); color: #fff; font-size: 0.8rem; display: grid; place-items: center; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.steps li { counter-increment: step; background: #fff; border-radius: var(--radius); padding: 22px 18px 18px; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sun); color: var(--soil); font: 700 1.3rem var(--head); margin-bottom: 8px; }
.steps li b { display: block; font-family: var(--head); font-weight: 600; font-size: 1.15rem; color: var(--soil); margin-bottom: 4px; }
@media (max-width: 920px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- split rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 820px) { .split, .split.flip { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }
.photo { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; display: block; max-height: 480px; object-fit: cover; object-position: 50% 35%; }

/* ---------- prescription pad ---------- */
.rx { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 26px 26px 20px 86px; position: relative; border: 2px solid var(--leaf-light);
  background-image: repeating-linear-gradient(transparent 0 33px, #e9f1fb 33px 34px); }
.rx::before { content: 'Rx'; position: absolute; left: 20px; top: 14px; font: italic 700 2.8rem var(--head); color: var(--leaf); }
.rx h3 { margin-bottom: 6px; }
.rx p { margin: 0 0 6px; font-size: 1.05rem; }
.rx .sig { margin-top: 12px; font: italic 600 1.1rem var(--head); color: var(--soil-2); text-align: right; }
.rx .sig img { width: 150px; height: auto; display: inline-block; }

/* ---------- book shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
@media (max-width: 920px) { .shelf { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .shelf { grid-template-columns: repeat(2, 1fr); } }
.shelf a { display: block; text-decoration: none; color: var(--soil); font-weight: 800; font-size: 0.92rem; text-align: center; line-height: 1.3; }
.shelf img { border-radius: 10px; box-shadow: var(--shadow); aspect-ratio: 1224 / 1584; object-fit: cover; width: 100%; margin-bottom: 8px; transition: transform 0.15s ease; background: #fff; }
.shelf a:hover img { transform: translateY(-4px) rotate(-1deg); }

/* ---------- paperbacks ---------- */
.paperbacks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.paperbacks.two { grid-template-columns: repeat(2, 1fr); }
.btn.soon { opacity: 0.7; cursor: default; box-shadow: none; }
.book-paperback-soon { opacity: 0.7; cursor: default; }
@media (max-width: 860px) { .paperbacks, .paperbacks.two { grid-template-columns: 1fr; } }
.paperback { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.paperback img { border-radius: 8px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); }
.paperback h3 { font-size: 1.1rem; margin-bottom: 4px; }
.paperback p { margin: 0 0 8px; font-size: 0.92rem; color: var(--muted); }

/* ---------- downloads ---------- */
.files { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.files a { display: block; position: relative; padding: 10px 14px 10px 46px; border-radius: 14px; background: var(--cream); border: 2px solid var(--line); text-decoration: none; color: var(--soil); font-weight: 800; line-height: 1.3; }
.files a::before { content: '\1F5A8\FE0F'; font-size: 1.2rem; position: absolute; left: 14px; top: 9px; }
.files a:hover { border-color: var(--leaf); background: var(--leaf-light); }
.files small { display: block; font-weight: 600; color: var(--muted); }
.note { background: var(--sun-light); border-left: 6px solid var(--sun); border-radius: 12px; padding: 12px 16px; font-size: 0.97rem; }

/* ---------- forms ---------- */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; max-width: 780px; margin: 0 auto; position: relative; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } .form-card { padding: 20px; } }
label { display: block; font-weight: 800; margin-bottom: 4px; color: var(--soil); }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--cream); font: 1rem var(--body); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); background: #fff; }
fieldset { border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px 6px; margin: 0; }
legend { font-weight: 800; color: var(--soil); padding: 0 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 620px) { .choices { grid-template-columns: 1fr; } }
.choices label { font-weight: 700; display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; }
.choices input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--leaf); }
.form-msg { margin: 12px 0 0; font-weight: 800; }
.form-msg.ok { color: var(--leaf-dark); }
.form-msg.err { color: #a82a33; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
span.label { display: block; font-weight: 800; margin-bottom: 4px; color: var(--soil); }

/* ---------- book readers: css/books-reader.css (the shared reader's own
   layout) and css/books-theme.css (these colours) on books.html ---------- */

/* ---------- soil tests ---------- */
.soil-toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; padding: 0; margin: 16px 0; }
.soil-toc a { display: inline-block; padding: 6px 13px; border-radius: 999px; background: #fff; border: 2px solid var(--leaf-light); color: var(--leaf-dark); text-decoration: none; font-weight: 800; font-size: 0.92rem; }
.soil-test { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 22px 0; scroll-margin-top: 84px; }
.soil-test .kick { margin: 0; font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: #a26e00; }
.soil-test h2 { margin: 2px 0; font-size: 1.8rem; }
.soil-test .lead { font-style: italic; margin-bottom: 8px; }
.soil-test h3 { font-size: 1.1rem; margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 3px solid var(--sun); display: inline-block; }
.soil-test li { margin-bottom: 4px; }
.soil-test dt { font-weight: 800; color: var(--leaf-dark); margin-top: 6px; }
.soil-test dd { margin: 0 0 2px; }
.soil-test .tip { background: var(--leaf-light); border-radius: 12px; padding: 8px 12px; }
.soil-test .safe { background: var(--berry-light); border-radius: 12px; padding: 8px 12px; }
.soil-test .wonder { font-style: italic; color: var(--leaf-dark); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; gap: 0; } }

/* ---------- article pages (privacy) ---------- */
.prose { max-width: 820px; margin: 0 auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }

/* ---------- footer ---------- */
.site-foot { background: var(--soil); color: #e9d9c0; padding: 44px 0 30px; font-size: 0.95rem; }
.site-foot .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.site-foot h4 { color: #fff; font-size: 1.1rem; }
.site-foot a { color: #ffe39b; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot ul { list-style: none; padding: 0; margin: 0; line-height: 2; }
.site-foot .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 16px; font-size: 0.85rem; color: #cbb89c; }
.foot-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.foot-brand img { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--sun); background: #fff; }
.foot-brand b { font: 600 1.4rem var(--head); color: #fff; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* ---------- small helpers ---------- */
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.center .pill-list { justify-content: center; }
.pill-list li { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 0.92rem; }
.pill-list li a { color: var(--leaf-dark); text-decoration: none; }
.pill-list li:has(a):hover { border-color: var(--leaf); background: var(--leaf-light); }
.quote { font: italic 600 1.35rem/1.45 var(--head); color: var(--soil); border-left: 6px solid var(--sun); padding: 6px 0 6px 18px; margin: 18px 0 4px; }
.quote-by { font: 700 1.1rem var(--head); color: var(--leaf-dark); margin: 0 0 18px 24px; }
.center .quote-by { margin-left: 0; }
.muted { color: var(--muted); }
.mt { margin-top: 28px; }
@media print { .site-head, .site-foot, .btn-row { display: none !important; } body { background: #fff; } }
