@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka-Bold.woff2") format("woff2"),
       url("fonts/Fredoka-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Regular.woff2") format("woff2"),
       url("fonts/Nunito-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Bold.woff2") format("woff2"),
       url("fonts/Nunito-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("fonts/PermanentMarker-Regular.woff2") format("woff2"),
       url("fonts/PermanentMarker-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4e6c1;
  --ink: #1a1714;
  --navy: #1b365d;
  --teal: #0d6e6a;
  --pink: #c2185b;
  --orange: #c05612;
  --line: rgba(70, 120, 170, 0.22);
  --margin: rgba(196, 64, 64, 0.35);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  min-height: 100svh;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--margin) 0 2px, transparent 2px),
    repeating-linear-gradient(
      to bottom,
      transparent 0 31px,
      var(--line) 31px 32px
    );
  background-size: 100% 100%, 100% 32px;
  background-position: 22px 0, 0 6px;
  background-attachment: fixed;
}

.page {
  position: relative;
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.35rem calc(1.5rem + env(safe-area-inset-bottom));
  padding-left: max(2.65rem, calc(28px + 1rem));
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.star-a, .star-b, .tri-a, .tri-b {
  position: absolute;
}
.star-a {
  top: 1.1rem;
  right: 1.1rem;
  width: 1.15rem;
  height: 1.15rem;
  background: var(--pink);
  transform: rotate(20deg);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.star-b {
  top: auto;
  bottom: 8.5rem;
  left: auto;
  right: 1.1rem;
  width: 0.85rem;
  height: 0.85rem;
  background: var(--teal);
  transform: rotate(-12deg);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.tri-a {
  bottom: 4.6rem;
  right: 0.8rem;
  border-left: 0.55rem solid transparent;
  border-right: 0.55rem solid transparent;
  border-bottom: 0.95rem solid var(--orange);
  transform: rotate(18deg);
}
.tri-b {
  top: 0.85rem;
  right: 2.8rem;
  bottom: auto;
  left: auto;
  border-left: 0.45rem solid transparent;
  border-right: 0.45rem solid transparent;
  border-bottom: 0.8rem solid var(--teal);
  transform: rotate(-22deg);
}
.dot {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--pink);
  bottom: 3.6rem;
  right: 1.8rem;
  left: auto;
}

.kicker {
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: 1.2rem;
  color: var(--pink);
  letter-spacing: 0.02em;
  margin: 0 0 0.7rem;
  transform: rotate(-2.4deg);
  transform-origin: left center;
  width: fit-content;
}

h1 {
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: clamp(2.15rem, 9vw, 3rem);
  line-height: 1.05;
  color: var(--navy);
  margin: 0 0 1.35rem;
  letter-spacing: -0.02em;
}

.lead, .body, .signoff {
  margin: 0 0 1rem;
  max-width: 34rem;
}

.body { margin-bottom: 0.85rem; }

.signoff {
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: 1.35rem;
  color: var(--teal);
  transform: rotate(-1.2deg);
  transform-origin: left center;
  margin-top: 0.6rem;
  margin-bottom: 0;
}

footer {
  margin-top: auto;
  padding-top: 2.4rem;
  font-size: 0.92rem;
  color: #4a4338;
}

@media (min-width: 480px) {
  body {
    background-position: 36px 0, 0 6px;
  }
}
