/* Nook & Pip: the page's look. */

@font-face { font-family: "Balsamiq Sans"; src: url("fonts/BalsamiqSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Balsamiq Sans"; src: url("fonts/BalsamiqSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("fonts/PatrickHand-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* pip */
  --pip-body: #f6cd4b;
  --pip-belly: #fff6dc;
  --pip-wing-and-tail: #e4b33c;
  --pip-shell: #fdf3e1;
  --pip-blue-specks: #8fbfd8;
  --pip-tan-specks: #d4a979;
  /* nook */
  --nook-body: #62c4b4;
  --nook-belly: #effaf6;
  --nook-wing-and-tail: #3c9c8d;
  /* mom */
  --mom-body: #f29b52;
  --mom-belly: #fff0dc;
  --mom-wing-and-tail: #de7a3c;
  /* dad */
  --dad-body: #6c9fe0;
  --dad-belly: #fbf3e0;
  --dad-wing-and-tail: #4373bd;
  /* everyone */
  --beak: #f0912f;
  --lower-jaw: #e5822b;
  --feet: #e8862e;
  --cheeks: #ff9e9e;
  --outline: #2b2622;
  --paper: #fefbf4;
  /* scene */
  --scene-sky-top: #4a98dc;
  --scene-sky-middle: #93cbf0;
  --scene-sky-light: #d8eefc;
  --scene-sky-low: #c9e6f7;
  --scene-sun: #ffd84d;
  --scene-sun-rays: #e7842f;
  --scene-leaves: #7dbf5e;
  --scene-leaves-dark: #68ab4e;
  --scene-leaves-light: #a9da8c;
  --scene-bark: #a0673f;
  --scene-bark-dark: #7a4a2a;
  --scene-grass: #7cc25d;
  --scene-meadow: #a9d98b;
  --scene-cloud: #ffffff;
  /* page */
  --page-text: #2b2622;
  --page-text-soft: #7a6f63;
  --page-and: #f0912f;
  --page-button: #f0912f;
  --hero-wide: 2560 / 1280;
  --hero-tall: 1170 / 1560;
  --tagline-wide: 2.578vw;
  --tagline-tall: 5.299vw;
}

body { background-image: url("drawings/paper-512.png"); background-image: image-set("drawings/paper-512.webp" type("image/webp") 1x, "drawings/paper-1024.webp" type("image/webp") 2x, "drawings/paper-512.png" type("image/png") 1x); background-size: 512px 512px; }
.edge-grass { background-image: url("drawings/edge-grass-1536.png"); background-image: image-set("drawings/edge-grass-1536.webp" type("image/webp") 1x, "drawings/edge-grass-3072.webp" type("image/webp") 2x, "drawings/edge-grass-1536.png" type("image/png") 1x); background-size: 1536px 110px; height: 110px; }
.edge-branch { background-image: url("drawings/edge-branch-1536.png"); background-image: image-set("drawings/edge-branch-1536.webp" type("image/webp") 1x, "drawings/edge-branch-3072.webp" type("image/webp") 2x, "drawings/edge-branch-1536.png" type("image/png") 1x); background-size: 1536px 110px; height: 110px; }
.edge-clouds { background-image: url("drawings/edge-clouds-1536.png"); background-image: image-set("drawings/edge-clouds-1536.webp" type("image/webp") 1x, "drawings/edge-clouds-3072.webp" type("image/webp") 2x, "drawings/edge-clouds-1536.png" type("image/png") 1x); background-size: 1536px 110px; height: 110px; }
.button { border-image-source: url("drawings/button-640.webp"); border-image-slice: 60 fill; }
.button.light, .motion { border-image-source: url("drawings/button-light-640.webp"); border-image-slice: 60 fill; }
.make-list li, .video { border-image-source: url("drawings/card-720.webp"); border-image-slice: 68 fill; }
.card-pip { border-image-source: url("drawings/card-pip-720.webp"); border-image-slice: 68 fill; }
.card-nook { border-image-source: url("drawings/card-nook-720.webp"); border-image-slice: 68 fill; }
.card-mom { border-image-source: url("drawings/card-mom-720.webp"); border-image-slice: 68 fill; }
.card-dad { border-image-source: url("drawings/card-dad-720.webp"); border-image-slice: 68 fill; }

/* ------------------------------------------------------------------ the page */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-repeat: repeat;
  color: var(--page-text);
  font: 400 22px/1.45 "Patrick Hand", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: "Balsamiq Sans", "Patrick Hand", system-ui, sans-serif; font-weight: 700; line-height: 1.12; }
a { color: inherit; }
p { margin: 0 0 0.7em; }
:focus-visible { outline: 4px dashed var(--page-text); outline-offset: 4px; border-radius: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; z-index: 20; left: 12px; top: -100px; padding: 12px 18px;
  background: var(--paper); border: 3px solid var(--page-text); border-radius: 14px;
  font: 700 20px "Balsamiq Sans", system-ui, sans-serif; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ crayon buttons and cards (border images) */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  border-style: solid; border-width: 0 26px; border-color: transparent;
  border-image-width: 42px 46px; border-image-repeat: stretch;
  min-height: 64px; padding: 0 6px;
  font: 700 22px/1 "Balsamiq Sans", system-ui, sans-serif; color: var(--page-text); text-decoration: none;
  cursor: pointer; background: none; white-space: nowrap;
}
.button.big { min-height: 76px; font-size: clamp(20px, 1.7vw, 32px); border-width: 0 32px; }
.hero .button.big { min-height: clamp(56px, 5.2vw, 88px); }
.button.small { min-height: 52px; font-size: 18px; border-width: 0 20px; }
.play-icon { width: 1.05em; height: 1.05em; flex: none; }

/* ------------------------------------------------------------------ the hero: the treetop scene in layers */

.hero { position: relative; background: var(--scene-sky-low); }
.scene { position: relative; aspect-ratio: var(--hero-wide); overflow: hidden; }
.layer { position: absolute; left: var(--wx); top: var(--wy); width: var(--ww); margin: 0; }
.layer img { display: block; width: 100%; height: auto; }
.lettering { line-height: 0; font-size: 0; }
.hero-words {
  position: absolute; left: var(--wx); top: var(--wy); width: var(--ww);
  display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.4vw, 22px); text-align: center;
}
.tagline {
  margin: 0; font-size: var(--tagline-wide); line-height: 1.1; color: var(--page-text);
  /* a rim of paper, as the banners letter it, so it reads on the sky */
  text-shadow: 0.06em 0 0 var(--paper), -0.06em 0 0 var(--paper), 0 0.06em 0 var(--paper), 0 -0.06em 0 var(--paper),
    0.045em 0.045em 0 var(--paper), -0.045em 0.045em 0 var(--paper), 0.045em -0.045em 0 var(--paper), -0.045em -0.045em 0 var(--paper);
}
@media (max-width: 760px) {
  .tagline { font-size: var(--tagline-tall); }
  .button.big { font-size: clamp(19px, 5vw, 26px); }
}

.top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px; padding: 12px clamp(12px, 3vw, 36px);
}
.top .home { display: block; border-radius: 50%; }
.top .home img { display: block; width: 48px; height: 48px; }
.top .links { display: flex; gap: 8px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.top .links a {
  display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 999px;
  background: rgba(254, 251, 244, 0.88); border: 2px solid rgba(43, 38, 34, 0.35);
  font: 700 18px/1 "Balsamiq Sans", system-ui, sans-serif; text-decoration: none;
}
.top .links a:hover { background: var(--paper); border-color: var(--page-text); }
.top .button.small { margin-left: 4px; }
@media (max-width: 760px) {
  .top .links { display: none; }
  .top .button.small { margin-left: auto; }
}

.motion {
  position: absolute; z-index: 6; right: clamp(10px, 2vw, 24px); bottom: 14px;
  border-style: solid; border-width: 0 16px; border-color: transparent; border-image-width: 21px 23px; border-image-repeat: stretch;
  min-height: 44px; padding: 0 4px; background: none;
  font: 700 15px/1 "Balsamiq Sans", system-ui, sans-serif; color: var(--page-text); cursor: pointer;
}

/* ------------------------------------------------------------------ section edges: strips that repeat across */

.edge { width: 100%; background-repeat: repeat-x; background-position: center top; pointer-events: none; }
.hero .edge-grass { position: absolute; z-index: 4; left: 0; right: 0; bottom: -1px; }
@media (max-width: 760px) {
  /* on a phone the hero is small: its grass is lower, so the branch and the feet on it show */
  .hero .edge-grass { height: 58px; background-size: auto 58px; }
  .motion { min-height: 44px; font-size: 13px; border-width: 0 12px; border-image-width: 18px 20px; right: 8px; bottom: 8px; }
}

/* ------------------------------------------------------------------ sections */

main { display: block; }
section { padding: clamp(30px, 4.5vw, 60px) clamp(16px, 4vw, 48px); }
section > h2, section > .intro, .cards, .make-list, .video-list, .more, .grownups-body { max-width: 1180px; margin-left: auto; margin-right: auto; }
h2 {
  display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 14px);
  margin-top: 0; margin-bottom: 14px; font-size: clamp(30px, 4.4vw, 52px); text-align: center;
}
h2 .sticker { flex: none; }
h2 .sticker img { display: block; width: clamp(36px, 4.4vw, 56px); height: auto; }
.flip img { transform: scaleX(-1); }
.intro { max-width: 36em; margin-bottom: 34px; text-align: center; font-size: 24px; }

/* meet the family: everyone on one ground line, at their true sizes */
.cards { list-style: none; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border-style: solid; border-width: 26px; border-color: transparent; border-image-width: 46px; border-image-repeat: stretch;
  padding: 0 4px 6px;
}
.card .who { height: 214px; display: flex; align-items: flex-end; justify-content: center; }
.card .who img { display: block; height: auto; }
.card h3 { margin: 12px 0 0; line-height: 0; }
.card .name { height: 52px; width: auto; }
.card .role { margin: 6px 0 10px; font: 700 15px/1.2 "Balsamiq Sans", system-ui, sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--page-text-soft); }
.card p { font-size: 21px; line-height: 1.35; }
.says {
  position: relative; margin: auto 0 0; padding: 8px 16px; border-radius: 18px;
  background: var(--paper); border: 2.5px solid var(--page-text); font-size: 23px !important;
}
.says::before {
  content: ""; position: absolute; left: 50%; top: -12px; width: 18px; height: 18px; margin-left: -9px;
  background: var(--paper); border-left: 2.5px solid var(--page-text); border-top: 2.5px solid var(--page-text); transform: rotate(45deg);
}

/* what we make */
.edge-clouds { margin-top: clamp(4px, 1vw, 16px); }
.makes { padding-top: clamp(14px, 2.5vw, 30px); }
.make-list { list-style: none; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.make-list li {
  text-align: center; border-style: solid; border-width: 22px; border-color: transparent; border-image-width: 46px; border-image-repeat: stretch;
  padding: 6px 8px 4px;
}
.make-icon { display: inline-block; }
.make-icon img { display: block; width: 150px; height: 150px; }
.make-list h3 { margin: 6px 0 8px; font-size: 28px; }

/* the videos */
.video-list { list-style: none; padding: 0; display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.video {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--page-text);
  border-style: solid; border-width: 18px; border-color: transparent; border-image-width: 46px; border-image-repeat: stretch;
  padding: 4px 6px 8px;
}
.poster { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 3px solid var(--page-text); }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster .play {
  position: absolute; right: 10px; bottom: 10px; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; background: var(--page-button); border: 3px solid var(--page-text); color: var(--page-text);
}
.poster .play-icon { width: 26px; height: 26px; margin-left: 3px; }
.video .kind { margin-top: 12px; font: 700 15px/1.2 "Balsamiq Sans", system-ui, sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--page-text-soft); }
.video .title { margin-top: 4px; font: 700 22px/1.2 "Balsamiq Sans", system-ui, sans-serif; }
.video .length { margin-top: 2px; color: var(--page-text-soft); font-size: 20px; }
.video:hover .title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.more { margin-top: 34px; text-align: center; }

/* for grown-ups */
.edge-branch { margin-top: clamp(4px, 1vw, 16px); }
.grownups { padding-top: clamp(14px, 2.5vw, 30px); }
.grownups-body { display: flex; gap: clamp(20px, 4vw, 44px); align-items: flex-start; max-width: 900px; }
.grownups h2 { justify-content: flex-start; text-align: left; }
.badge { flex: none; }
.badge img { display: block; width: 132px; height: 132px; }
.grownups a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.placeholder { display: inline-block; padding: 0 0.45em; border: 2px dashed var(--page-text-soft); border-radius: 8px; color: var(--page-text-soft); }
@media (max-width: 640px) {
  .grownups-body { flex-direction: column; align-items: center; text-align: center; }
  .grownups h2 { justify-content: center; text-align: center; }
}

/* the footer, on the grass */
.foot { margin-top: clamp(20px, 4vw, 48px); }
.foot-body { background: var(--scene-grass); padding: 8px 16px 36px; text-align: center; }
.foot-logo img { display: block; margin: 0 auto 10px; width: 260px; height: auto; }
.foot a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px; font: 700 21px "Balsamiq Sans", system-ui, sans-serif; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.foot .small { margin: 6px 0 0; font-size: 19px; }

/* ------------------------------------------------------------------ gentle motion: drifting clouds, a wiggle on hover */

@keyframes drift { from { transform: translateX(-1.4vw); } to { transform: translateX(1.4vw); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.cloud { animation: drift 19s ease-in-out infinite alternate; }
.cloud-1 { animation-duration: 24s; animation-delay: -9s; }
.cloud-2 { animation-duration: 29s; animation-delay: -17s; }
@media (hover: hover) {
  .button:hover, .sticker:hover, .make-list li:hover .make-icon, .video:hover .play { animation: wiggle 0.5s ease-in-out; }
}
html.still .cloud { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* phones: the tall hero */
@media (max-width: 760px) { .scene { aspect-ratio: var(--hero-tall); } .layer, .hero-words { left: var(--tx); top: var(--ty); width: var(--tw); } }

/* The contact link, tall enough to tap */
.grownups a[href^="mailto:"] { display: inline-flex; align-items: center; min-height: 44px; }

/* Keep the top bar off the sun */
.top { padding-right: max(clamp(12px, 3vw, 36px), 16vw); }
@media (max-width: 760px) {
  .top { padding-right: clamp(12px, 3vw, 36px); }
  .top .button.small { margin-left: 0; }
}
