@font-face {
  font-family: "Handwriting";
  src: url("handwriting.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

:root {
  --paper: #f4f1ea;
  --ink: #1f2c8a;
  --ink-soft: #2a3aa8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  font-family: "Handwriting", "Kalam", "Bradley Hand", "Comic Sans MS", cursive;
  color: var(--ink);
}

body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: url("https://images.photowall.com/products/64222/paper-texture.jpg?h=699&q=85");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 6rem) clamp(1.5rem, 6vw, 4rem);
}

/* the ink — applied to text containers (not the whole .page) so the
   filter leaves the polaroid photo alone. One filter pass per container
   is still much cheaper than one per text element. */
.intro-text,
.page h2,
.page .list,
.page .footer {
  filter: url(#ink);
}

.page h1,
.page h2,
.page .lede,
.page li,
.page .footer {
  text-shadow:
    0.3px 0 0 rgba(31, 44, 138, 0.15),
    -0.3px 0.1px 0 rgba(20, 30, 110, 0.1);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.8rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: rotate(-1deg);
  color: var(--ink);
}

.lede {
  margin: 0 0 3rem;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  transform: rotate(-0.3deg);
}

.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
}

.intro-text {
  flex: 1 1 auto;
  min-width: 0;
}

.polaroid {
  flex: 0 0 auto;
  margin: 0.5rem 0 0;
  padding: 0;
  background: transparent;
  transform: rotate(3.5deg);
  width: clamp(140px, 22vw, 200px);
  line-height: 0;
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(0.15) contrast(1.05)
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35))
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

@media (max-width: 540px) {
  .intro {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .polaroid {
    width: 55%;
    max-width: 220px;
  }
}

h2 {
  margin: 2.8rem 0 1.4rem;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 700;
  transform: rotate(-0.6deg);
  color: var(--ink);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.list li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: start;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.35;
  color: var(--ink);
}

/* hand-drawn imperfection — each row tilts a hair differently
   (cycling so all sections feel hand-written, not just the first) */
.list li:nth-child(5n + 1) {
  transform: rotate(-0.5deg);
}
.list li:nth-child(5n + 2) {
  transform: rotate(0.4deg) translateX(2px);
}
.list li:nth-child(5n + 3) {
  transform: rotate(-0.2deg) translateX(-3px);
}
.list li:nth-child(5n + 4) {
  transform: rotate(0.6deg) translateX(1px);
}
.list li:nth-child(5n + 5) {
  transform: rotate(-0.3deg) translateX(-2px);
}

.list.bullets .num {
  font-size: 1.6em;
  line-height: 0.9;
}

.num {
  font-weight: 700;
  color: var(--ink-soft);
}

.item {
  display: inline-block;
}

.page a,
.page a:visited {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}

.page a:hover {
  text-decoration-style: wavy;
}

.footer {
  margin: 4rem 0 0;
  font-size: 1.1rem;
  opacity: 0.75;
  transform: rotate(-0.5deg);
}

@media (max-width: 540px) {
  .list li {
    grid-template-columns: 2.2rem 1fr;
  }
}
