@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-bold.woff2") format("woff2");
}

@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, p, figure { margin: 0; }
  img, svg { display: block; }
}

@layer base {
  :root {
    --paper: #f4efe5;
    --paper-light: #fffaf0;
    --ink: #293229;
    --muted: #6c716b;
    --green: #3f624d;
    --green-soft: #dce7d8;
    --pink: #b76878;
    --pink-soft: #f0d6db;
    --red: #a94e5c;
    --line: #c9c1b4;
    --content: 76rem;
    font-family: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;
    font-synthesis: none;
  }

  body {
    min-block-size: 100dvh;
    color: var(--ink);
    line-height: 1.55;
    background-color: var(--paper);
    background-image:
      linear-gradient(rgb(63 98 77 / 5%) 1px, transparent 1px),
      linear-gradient(90deg, rgb(63 98 77 / 5%) 1px, transparent 1px);
    background-size: 2rem 2rem;
  }

  a { color: inherit; }
  :focus-visible { outline: 0.2rem solid var(--pink); outline-offset: 0.25rem; }

  h1, h2, h3, .wordmark, .footer-names {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
  }

  h1, h2, h3 { text-wrap: balance; }
}

@layer layout {
  .site-header, .hero, .motif-route, .details, .more-info, .page-shell, .site-footer {
    inline-size: min(100% - 3rem, var(--content));
    margin-inline: auto;
  }

  .site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-block-size: 4.75rem;
    border-block-end: 1px solid var(--line);
  }

  .hero {
    position: relative;
    min-block-size: min(52rem, calc(100dvh - 4.75rem));
    display: grid;
    grid-template-columns: minmax(18rem, 0.82fr) minmax(21rem, 1.18fr);
    align-items: center;
    gap: clamp(3rem, 9vw, 9rem);
    padding-block: clamp(4rem, 8vw, 7rem);
  }

  .motif-route {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
    align-items: center;
    gap: clamp(0.75rem, 2.5vw, 2rem);
    padding-block: 2.5rem;
    border-block: 1px solid var(--line);
  }

  .details { padding-block: clamp(5rem, 11vw, 9rem); }

  .section-heading {
    display: grid;
    grid-template-columns: 0.45fr 1fr;
    align-items: end;
    gap: 2rem;
    margin-block-end: clamp(2.5rem, 6vw, 4.5rem);
  }

  .book-spread {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--paper-light);
    box-shadow: 0 1.5rem 3.5rem rgb(60 49 39 / 13%);
  }

  .book-spread::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 50%;
    inline-size: 1px;
    background: var(--line);
    box-shadow: -0.4rem 0 1rem rgb(60 49 39 / 10%), 0.4rem 0 1rem rgb(60 49 39 / 10%);
  }

  .book-page { min-block-size: 24rem; padding: clamp(2rem, 6vw, 5rem); }

  .more-info {
    position: relative;
    display: grid;
    grid-template-columns: 8rem 1fr 8rem;
    align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    margin-block-end: clamp(5rem, 10vw, 8rem);
    padding: clamp(3rem, 6vw, 5rem);
    background: var(--pink-soft);
    clip-path: polygon(0 3%, 3% 0, 7% 3%, 11% 0, 15% 3%, 19% 0, 23% 3%, 27% 0, 31% 3%, 35% 0, 39% 3%, 43% 0, 47% 3%, 51% 0, 55% 3%, 59% 0, 63% 3%, 67% 0, 71% 3%, 75% 0, 79% 3%, 83% 0, 87% 3%, 91% 0, 95% 3%, 100% 0, 100% 97%, 96% 100%, 92% 97%, 88% 100%, 84% 97%, 80% 100%, 76% 97%, 72% 100%, 68% 97%, 64% 100%, 60% 97%, 56% 100%, 52% 97%, 48% 100%, 44% 97%, 40% 100%, 36% 97%, 32% 100%, 28% 97%, 24% 100%, 20% 97%, 16% 100%, 12% 97%, 8% 100%, 4% 97%, 0 100%);
  }

  .site-footer {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    padding-block: 2rem;
    border-block-start: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
  }

  .legal-page { display: grid; grid-template-rows: auto 1fr auto; }
  .page-shell { display: grid; place-items: start center; padding-block: clamp(4rem, 9vw, 7rem); }
  .page-card { inline-size: min(100%, 48rem); padding: clamp(1.5rem, 5vw, 3.5rem); border: 1px solid var(--line); background: var(--paper-light); box-shadow: 0.8rem 0.8rem 0 var(--green-soft); }
  .page-card section + section { margin-block-start: 2.5rem; padding-block-start: 2.5rem; border-block-start: 1px solid var(--line); }
  .error-page { display: grid; place-items: center; padding: 2rem; }
  .error-content { inline-size: min(100%, 48rem); text-align: center; }
}

@layer components {
  .skip-link { position: fixed; inset-block-start: 0.75rem; inset-inline-start: 0.75rem; z-index: 30; translate: 0 -200%; padding: 0.6rem 0.9rem; background: var(--ink); color: white; }
  .skip-link:focus { translate: 0; }

  .wordmark { font-size: 1.5rem; letter-spacing: 0.08em; text-decoration: none; }
  .wordmark span { color: var(--pink); font-style: italic; }
  .site-header > p { color: var(--green); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.18em; }

  .hero-copy { position: relative; z-index: 5; }
  .eyebrow { margin-block-end: 0.85rem; color: var(--pink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }

  .hero h1 {
    color: var(--green);
    font-size: clamp(4.8rem, 10vw, 8.2rem);
    line-height: 0.78;
    letter-spacing: -0.075em;
  }

  .hero h1 em { color: var(--pink); font-weight: 400; }
  .intro { max-inline-size: 28rem; margin-block-start: 2rem; color: var(--muted); font-size: 1.1rem; }

  .calendar-panel {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    inline-size: min(100%, 30rem);
    margin-block-start: 2rem;
    box-shadow: 0.55rem 0.55rem 0 var(--green-soft);
    rotate: -0.5deg;
  }

  .date-stamp {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem 1.2rem;
    background: var(--pink);
    color: var(--paper-light);
    text-transform: uppercase;
  }

  .date-stamp span { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.18em; }
  .date-stamp strong { margin-block-start: 0.2rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 400; letter-spacing: 0; line-height: 1.1; }

  .calendar-link {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.2rem 1rem;
    min-block-size: 5rem;
    padding: 1rem 1.2rem;
    background: var(--green);
    color: var(--paper-light);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 150ms ease;
  }

  .calendar-link::after { content: "↓"; grid-column: 2; grid-row: 1 / 3; color: var(--pink-soft); font-size: 1.5rem; }
  .calendar-link small { color: var(--green-soft); font-size: 0.66rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; }
  .calendar-link:hover { background: #2f503d; }
  .calendar-note { margin-block-start: 0.75rem; color: var(--muted); font-size: 0.78rem; }

  .photo-note {
    position: relative;
    z-index: 3;
    padding: clamp(0.7rem, 1.5vw, 1.1rem) clamp(0.7rem, 1.5vw, 1.1rem) 3.6rem;
    background: var(--paper-light);
    box-shadow: 0 1.6rem 3rem rgb(60 49 39 / 18%);
    rotate: 2deg;
  }

  .photo-note img {
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
  }
  .photo-note figcaption { position: absolute; inset-block-end: 1.05rem; inset-inline-start: 1.25rem; color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-style: italic; }

  .tape { position: absolute; z-index: 4; inline-size: 6rem; block-size: 1.8rem; background: rgb(220 231 216 / 86%); opacity: 0.9; }
  .tape-top { inset-block-start: -0.75rem; inset-inline-start: 50%; translate: -50% 0; rotate: -3deg; }

  .round-stamp {
    position: absolute;
    inset-block-start: 10%;
    inset-inline-end: -1rem;
    z-index: 5;
    inline-size: 6.5rem;
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    border: 2px solid var(--pink);
    border-radius: 50%;
    color: var(--pink);
    rotate: 10deg;
    text-align: center;
  }

  .round-stamp::before { content: ""; position: absolute; inset: 0.3rem; border: 1px dashed currentcolor; border-radius: inherit; }
  .round-stamp span { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
  .round-stamp small { font-size: 0.65rem; letter-spacing: 0.2em; }

  .motif-emoji,
  .page-motif,
  .more-info-penguin,
  .more-info-otter {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-style: normal;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0.15rem 0.25rem 0 rgb(41 50 41 / 14%));
  }

  .motif-emoji { display: block; font-size: clamp(2.5rem, 5vw, 4rem); }
  .motif-emoji:nth-child(1) { rotate: -6deg; }
  .motif-emoji:nth-child(3) { rotate: 4deg; }
  .motif-emoji:nth-child(5) { rotate: -4deg; }
  .motif-emoji:nth-child(7) { rotate: 6deg; }
  .motif-emoji:nth-child(9) { rotate: -5deg; }
  .motif-route i { border-block-start: 2px dotted var(--line); }

  .section-heading .eyebrow { align-self: start; margin-block-start: 0.7rem; }
  .section-heading h2 { max-inline-size: 14ch; color: var(--green); font-size: clamp(3.2rem, 7vw, 6rem); line-height: 0.95; letter-spacing: -0.05em; }

  .book-page { position: relative; overflow: hidden; }
  .book-page:first-child { background-image: linear-gradient(90deg, transparent 96%, rgb(63 98 77 / 6%)); }
  .book-page:last-child { background-image: linear-gradient(270deg, transparent 96%, rgb(63 98 77 / 6%)); }
  .page-number { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.18em; }
  .page-label { margin-block-start: 3rem; color: var(--pink); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
  .place-page .page-label { color: var(--green); }
  .book-page h3 { max-inline-size: 14ch; margin-block-start: 0.75rem; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
  .date-page h3 { color: var(--pink); }
  .place-page h3 { color: var(--green); }
  .page-motif { position: absolute; inset-inline-end: 2rem; inset-block-end: 1.5rem; font-size: 4.5rem; rotate: -5deg; opacity: 0.72; }
  .place-page .page-motif { rotate: 5deg; }

  .more-info > div { text-align: center; }
  .more-info h2 { color: var(--green); font-size: clamp(3rem, 6vw, 5.2rem); line-height: 0.95; letter-spacing: -0.045em; }
  .more-info > div > p:last-child { max-inline-size: 38rem; margin: 1.5rem auto 0; color: #674e53; }
  .more-info > span { font-size: 6rem; }
  .more-info-penguin { rotate: -7deg; }
  .more-info-otter { rotate: 7deg; }

  .footer-names { margin-block-end: 0.15rem; color: var(--green); font-size: 1.2rem; }
  .legal-links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
  .legal-links a, .back-link { text-underline-offset: 0.2em; }
  .legal-links a:hover, .back-link:hover { color: var(--pink); }
  .back-link { color: var(--muted); font-size: 0.9rem; font-weight: 700; }

  .page-heading { margin-block-end: 3rem; }
  .legal-page h1, .error-content h1 { font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -0.04em; }
  .page-card h2 { margin-block-end: 1rem; color: var(--green); font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.15; }
  .page-card p + p { margin-block-start: 1rem; }
  .page-card address { font-style: normal; }
  .page-card a { color: var(--green); font-weight: 700; text-underline-offset: 0.2em; }
  .error-content > p:not(.eyebrow) { margin-block-start: 1.5rem; color: var(--muted); }
  .error-content .calendar-link { inline-size: min(100%, 20rem); margin: 2rem auto 0; text-align: start; }
}

@layer responsive {
  @media (max-width: 54rem) {
    .site-header, .hero, .motif-route, .details, .more-info, .page-shell, .site-footer { inline-size: min(100% - 2rem, var(--content)); }
    .hero { min-block-size: auto; grid-template-columns: 0.8fr 1.2fr; gap: 2.5rem; padding-block: 4rem 6rem; }
    .hero-copy { grid-column: 1 / -1; }
    .photo-note { grid-column: 2; grid-row: 1; inline-size: min(100%, 25rem); justify-self: end; }
    .hero-copy { grid-row: 2; }
    .round-stamp { inset-block-start: 2rem; inset-inline-end: auto; inset-inline-start: 14%; }
    .section-heading { grid-template-columns: 1fr; gap: 0; }
    .book-page { min-block-size: 21rem; padding: 2.5rem; }
    .more-info { grid-template-columns: 5rem 1fr 5rem; padding-inline: 1.5rem; }
    .more-info > span { font-size: 4.5rem; }
  }

  @media (max-width: 38rem) {
    .site-header > p { letter-spacing: 0.1em; }
    .hero { display: flex; flex-direction: column; align-items: stretch; gap: 3rem; }
    .photo-note {
      order: 1;
      inline-size: min(calc(100% - 2rem), 24rem);
      align-self: center;
      padding-inline: 1rem;
      rotate: 0deg;
    }
    .hero-copy { order: 2; }
    .hero h1 { font-size: clamp(4.2rem, 21vw, 6.2rem); }
    .calendar-panel { grid-template-columns: 1fr; }
    .round-stamp { inset-block-start: 2rem; inset-inline-start: 0; }
    .motif-route { gap: 0.5rem; }
    .motif-emoji { font-size: 2.4rem; }
    .motif-route i { border-width: 1px; }
    .book-spread { grid-template-columns: 1fr; }
    .book-spread::after { display: none; }
    .book-page { min-block-size: 19rem; }
    .book-page + .book-page { border-block-start: 1px solid var(--line); }
    .more-info { inline-size: 100%; grid-template-columns: 1fr; padding: 4rem 1.5rem; clip-path: polygon(0 2%, 5% 0, 10% 2%, 15% 0, 20% 2%, 25% 0, 30% 2%, 35% 0, 40% 2%, 45% 0, 50% 2%, 55% 0, 60% 2%, 65% 0, 70% 2%, 75% 0, 80% 2%, 85% 0, 90% 2%, 95% 0, 100% 2%, 100% 98%, 95% 100%, 90% 98%, 85% 100%, 80% 98%, 75% 100%, 70% 98%, 65% 100%, 60% 98%, 55% 100%, 50% 98%, 45% 100%, 40% 98%, 35% 100%, 30% 98%, 25% 100%, 20% 98%, 15% 100%, 10% 98%, 5% 100%, 0 98%); }
    .more-info > span { position: absolute; font-size: 4rem; }
    .more-info-penguin { inset-block-start: 1.5rem; inset-inline-start: 1rem; }
    .more-info-otter { inset-block-end: 1.5rem; inset-inline-end: 1rem; }
    .site-footer { flex-direction: column; align-items: flex-start; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  }

  @media (prefers-contrast: more) { :root { --line: currentcolor; } }
}
