@font-face {
  font-family: Caveat;
  src: url('/fonts/Caveat.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f8f6ed;
  --ink: #303e34;
  --muted: #34473a;
  --gold: #a47716;
  --gold-dark: #80550a;
  --line: rgba(126, 111, 75, .24);
  --gutter: clamp(22px, 4vw, 50px);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 28px; background: var(--paper); }
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  color: var(--ink);
  font: 400 24px/1.5 Caveat, cursive;
  -webkit-font-smoothing: antialiased;
}

/* The film is clear in the opening; a paper wash helps the story read below. */
.story-film-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: var(--paper);
}
.story-film-background video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.story-film-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(248, 246, 237, .72);
  opacity: 1;
  transition: opacity .4s ease;
}
html.js:not(.is-scrolled) .story-film-background::after { opacity: 0; }

img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.05; }
p + p { margin-top: 1em; }
.welcome-copy, .section, .quote-break, .site-footer, .main-nav {
  text-shadow: 0 1px 2px rgba(248, 246, 237, .8), 0 0 12px rgba(248, 246, 237, .9);
}
.wrap { width: min(1120px, calc(100% - var(--gutter) - var(--gutter))); margin-inline: auto; }
.section { padding-block: clamp(100px, 10vw, 150px); border-top: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 16px; background: #fff; color: #111; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
a:focus-visible, button:focus-visible, summary:focus-visible, video:focus-visible { outline: 3px solid #a47716; outline-offset: 4px; }

/* Two unobtrusive icon controls keep the film free of overlay text. */
.film-controls {
  position: fixed;
  z-index: 20;
  right: var(--gutter);
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 38px));
  display: flex;
  align-items: center;
  gap: 9px;
}
.film-controls[hidden] { display: none; }
.film-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(30, 79, 111, .16);
  border-radius: 50%;
  background: rgba(248, 246, 237, .88);
  color: #1d557a;
  box-shadow: 0 2px 14px rgba(35, 55, 55, .12);
  font-size: 0;
  cursor: pointer;
}
.film-controls button::before { content: ''; display: block; }
#film-pause[aria-label="Pause background film"]::before { width: 13px; height: 15px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
#film-pause[aria-label="Play background film"]::before { width: 0; height: 0; margin-left: 3px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid currentColor; }
#film-sound::before { width: 30px; height: 30px; background: url('/assets/film-speaker.svg') center / contain no-repeat; }
#film-sound[aria-pressed="false"] { animation: speaker-pulse 2.8s ease-out infinite; }
@keyframes speaker-pulse {
  0%, 100% { box-shadow: 0 2px 14px rgba(35, 55, 55, .12), 0 0 0 0 rgba(55, 126, 174, .28); }
  55% { box-shadow: 0 2px 14px rgba(35, 55, 55, .12), 0 0 0 9px rgba(55, 126, 174, 0); }
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248, 246, 237, .83), rgba(248, 246, 237, 0));
}
.header-inner {
  width: min(1360px, calc(100% - var(--gutter) - var(--gutter)));
  min-height: 104px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}
.wordmark, .main-nav { pointer-events: auto; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; }
.brand-mark { width: 70px; height: 70px; object-fit: contain; }
.brand-name { color: var(--gold); font-size: 46px; font-weight: 700; line-height: 1; white-space: nowrap; }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .brand-name {
    background: linear-gradient(112deg, #a47412 0%, #b57e14 34%, #a47716 55%, #b57e14 78%, #a47412 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.main-nav { display: flex; align-items: center; gap: clamp(20px, 2.4vw, 38px); }
.main-nav a { padding: 12px 0; color: #394b3f; font-size: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.main-nav a:hover { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 6px; }

/* The entire opening is an invisible link: tap anywhere or simply scroll. */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 420px;
}
.splash-enter { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }
.splash-enter:focus-visible { outline-offset: -8px; }
.splash-enter::after {
  content: '';
  position: absolute;
  left: calc(50% - 8px);
  bottom: max(34px, env(safe-area-inset-bottom));
  width: 16px;
  height: 16px;
  border-right: 2px solid rgba(90, 74, 39, .75);
  border-bottom: 2px solid rgba(90, 74, 39, .75);
  transform: rotate(45deg);
}

.welcome { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: clamp(60px, 10vw, 130px); padding-block: clamp(110px, 12vw, 170px); }
.welcome-art img { width: 100%; max-height: 330px; object-fit: contain; }
.welcome-copy { max-width: 610px; }
.welcome h2 { color: var(--gold); font-size: clamp(55px, 5.6vw, 78px); line-height: 1.02; }
.welcome-copy > p:not(.byline) { margin-top: 25px; color: var(--muted); font-size: 25px; line-height: 1.42; }
.welcome .byline { margin-top: 18px; color: #526055; font-size: 20px; }

.section-label { margin-bottom: 16px; color: #79591d; font-size: 16px; font-weight: 700; letter-spacing: .12em; }
.section h2 { color: var(--gold); font-size: clamp(50px, 4.8vw, 68px); }
.story { display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(70px, 11vw, 155px); }
.book-cover { display: flex; justify-content: center; }
.book-cover a { display: block; width: min(355px, 100%); }
.book-cover img { width: 100%; height: auto; box-shadow: 0 12px 30px rgba(62, 70, 52, .13); }
.story-copy { max-width: 510px; }
.story-copy > p:not(.section-label) { margin-top: 24px; color: var(--muted); font-size: 25px; line-height: 1.5; }
.book-link { display: inline-block; margin-top: 28px; padding-block: 5px; color: var(--gold-dark); font-size: 25px; font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.book-link:hover { color: #573900; }
.book-link span { margin-left: 6px; }
.book-format { display: block; margin-top: 3px; color: #526055; font-size: 18px; }

/* A message from the book is given room to breathe between chapters. */
.quote-break { padding: 65px 20px 135px; text-align: center; }
.quote-break blockquote { max-width: 800px; margin-inline: auto; color: #75551b; font-size: clamp(38px, 4.5vw, 58px); line-height: 1.25; font-weight: 500; }

.section-intro { text-align: center; }
.section-intro > p:last-child { max-width: 620px; margin: 20px auto 0; color: var(--muted); font-size: 25px; }
.friend-pair { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10%; max-width: 950px; margin: 65px auto 0; }
.friend { text-align: center; }
.friend-image { height: 260px; display: flex; justify-content: center; align-items: center; }
.friend-image img { width: 100%; height: 100%; object-fit: contain; }
.friend h3, .animal-intro h3 { color: var(--gold-dark); font-size: 38px; }
.friend p { max-width: 340px; margin: 12px auto 0; color: var(--muted); font-size: 23px; }
.animal-intro { max-width: 660px; margin: 115px auto 0; text-align: center; }
.animal-intro p { margin-top: 16px; color: var(--muted); font-size: 24px; }
.animal-scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 55px; }
.animal-scenes img { width: 100%; height: 190px; object-fit: contain; }
.animal-scenes figcaption { margin-top: 14px; text-align: center; color: #75551b; font-size: 24px; font-weight: 600; }
.animal-scenes figcaption span { color: #536252; font-weight: 400; }

.film, .sketches { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: clamp(55px, 8vw, 110px); }
.film-copy > p:not(.section-label), .sketch-copy > p:not(.section-label) { margin-top: 22px; color: var(--muted); font-size: 25px; }
.film-copy .film-note { font-size: 19px !important; }
.video-area video { width: 100%; aspect-ratio: 5 / 3; object-fit: contain; background: #eeeade; }
.film-transcript, .original-animation { margin-top: 16px; color: #435347; font-size: 20px; }
.original-animation-note { margin: 12px 0; }
.original-animation video { margin-top: 10px; }
summary { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.transcript-copy { padding-top: 10px; }
.transcript-copy p { margin-top: .7em; }
.sketches { grid-template-columns: 1.2fr .8fr; }
.sketches figure { grid-column: 1; grid-row: 1; }
.sketch-copy { grid-column: 2; grid-row: 1; }
.sketches img { width: 100%; height: auto; }

.site-footer { border-top: 1px solid var(--line); }
.footer-content { display: grid; grid-template-columns: 1fr 1fr; gap: 12%; padding-block: 100px 70px; }
.author-note h2 { color: var(--gold); font-size: 42px; }
.author-note p { max-width: 520px; margin-top: 16px; color: var(--muted); font-size: 22px; }
.footer-more p:not(.section-label) { color: #435347; font-size: 21px; margin-top: 10px; }
.footer-more a, .footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }
.cross-mark { width: 40px; height: 40px; margin-top: 20px; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 24px 100px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; color: #4b5d4e; font-size: 18px; }
.footer-bottom details { max-width: 570px; }
.footer-bottom details p { margin-top: 10px; font-size: 19px; line-height: 1.4; }
.studio-credit { display: inline-flex; align-items: center; gap: 6px; }
.studio-credit img { width: 21px; height: 21px; }

@media (max-width: 950px) {
  .header-inner { gap: 18px; }
  .brand-name { font-size: 38px; }
  .brand-mark { width: 62px; height: 62px; }
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 18px; }
}

@media (max-width: 760px) {
  .section { padding-block: 82px; }
  .header-inner { min-height: 0; display: block; padding: 8px 0 15px; }
  .wordmark { gap: 4px; }
  .brand-mark { width: 52px; height: 52px; }
  .brand-name { font-size: clamp(31px, 8.9vw, 39px); }
  .main-nav { justify-content: space-between; gap: 8px; }
  .main-nav a { padding: 7px 0; font-size: clamp(16px, 4.6vw, 19px); }
  .welcome { grid-template-columns: 1fr; gap: 28px; padding-block: 85px 100px; }
  .welcome-art img { max-height: 220px; }
  .welcome h2 { font-size: clamp(46px, 10.4vw, 64px); }
  .welcome-copy > p:not(.byline) { margin-top: 18px; font-size: 22px; }
  .welcome .byline { margin-top: 15px; font-size: 19px; }
  .story, .film, .sketches { grid-template-columns: 1fr; gap: 38px; }
  .book-cover a { width: min(290px, 78%); }
  .section h2 { font-size: clamp(46px, 10vw, 62px); }
  .story-copy > p:not(.section-label), .film-copy > p:not(.section-label), .sketch-copy > p:not(.section-label) { font-size: 23px; }
  .quote-break { padding: 35px 0 100px; }
  .quote-break blockquote { font-size: clamp(34px, 8.5vw, 48px); }
  .section-intro > p:last-child { font-size: 23px; }
  .friend-pair { gap: 18px; margin-top: 40px; }
  .friend-image { height: 175px; }
  .friend h3, .animal-intro h3 { font-size: 32px; }
  .friend p { font-size: 20px; }
  .animal-intro { margin-top: 75px; }
  .animal-intro p { font-size: 22px; }
  .animal-scenes { gap: 10px; margin-top: 35px; }
  .animal-scenes img { height: 110px; }
  .animal-scenes figcaption { font-size: 19px; line-height: 1.15; }
  .animal-scenes figcaption span { display: block; }
  .sketches figure, .sketch-copy { grid-column: auto; grid-row: auto; }
  .footer-content { grid-template-columns: 1fr; gap: 40px; padding-block: 70px 55px; }
  .footer-bottom { flex-direction: column; padding-bottom: 100px; }
}

@media (max-width: 370px) {
  .brand-mark { width: 46px; height: 46px; }
  .brand-name { font-size: clamp(27px, 9.7vw, 31px); }
  .main-nav { flex-wrap: wrap; gap: 0 4px; }
  .main-nav a { font-size: 15px; }
  .welcome h2 { font-size: 42px; }
  .friend-image { height: 145px; }
  .animal-scenes img { height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-film-background::after { transition: none; }
  #film-sound[aria-pressed="false"] { animation: none; }
}
