:root {
  color-scheme: light;
  --paper: #f9f7ef;
  --ink: #342820;
  --blue: #263ca4;
  --blue-dark: #192c87;
  --muted: #675d51;
  --rule: #d5cdbc;
  --serif: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.48; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #3d51bf; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 5; top: -5rem; left: .8rem; background: var(--blue); color: white; padding: .7rem 1rem; }
.skip:focus { top: .6rem; }
.wrap { width: min(77rem, calc(100% - clamp(2.2rem, 8vw, 8rem))); margin-inline: auto; }
.site-head { height: 5.7rem; display: flex; align-items: center; gap: 2.5rem; border-bottom: 1px solid var(--rule); }
.brand, .tiny-brand { font-family: var(--serif); font-weight: bold; letter-spacing: -.075em; line-height: 1; }
.brand { color: var(--blue); display: inline-flex; align-items: center; gap: .68rem; font-size: 2.55rem; padding: .35rem 0; }
.tail-mark { width: .4rem; height: 1.16rem; border-radius: .6rem; background: currentColor; position: relative; transform: rotate(-13deg) translateY(.24rem); margin-inline: .29rem; }
.tail-mark::before, .tail-mark::after { content: ""; position: absolute; background: currentColor; border-radius: .5rem; width: .4rem; height: .92rem; left: 0; top: -.58rem; transform: rotate(-38deg); transform-origin: 50% 90%; }
.tail-mark::after { transform: rotate(38deg); }
.site-head nav { display: flex; align-items: center; gap: 2.05rem; margin-left: auto; }
.site-head nav a { padding: .55rem 0; font-size: .94rem; font-weight: 550; }
.site-head nav a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: .3rem; }
.sound { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.62rem; padding: .35rem .98rem; background: transparent; border: 1px solid #afa692; border-radius: 3rem; color: var(--ink); font-size: .88rem; font-weight: 600; }
.sound:hover, .sound[aria-pressed="true"] { background: #eae9f5; border-color: var(--blue); color: var(--blue); }
.sound-bars { height: 1rem; display: inline-flex; align-items: center; gap: .13rem; }
.sound-bars i { width: 2px; height: .4rem; border-radius: .1rem; background: currentColor; }
.sound-bars i:nth-child(2) { height: .84rem; }
.sound-bars i:last-child { height: .58rem; }
.nursery { display: grid; grid-template-columns: minmax(0,.87fr) minmax(0,1fr); grid-template-areas: "intro photo" "speech photo"; grid-template-rows: auto auto; align-content: center; column-gap: clamp(2.2rem,6vw,7rem); padding: clamp(2.1rem,4.9vw,4.8rem) 0 clamp(3rem,5.5vw,5.3rem); }
.intro { grid-area: intro; align-self: end; padding-top: .5rem; }
.small-title, .generation, .photo-index { font-family: var(--mono); font-size: .79rem; font-weight: 650; letter-spacing: .11em; line-height: 1.3; text-transform: uppercase; }
.small-title { display: block; color: var(--blue); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(5rem,8.8vw,8.7rem); letter-spacing: -.075em; line-height: .85; margin: 1.32rem 0 1.45rem -.055em; }
h1 em { color: var(--blue); font-weight: 500; }
.intro p { max-width: 31ch; font-size: clamp(1.09rem,1.5vw,1.38rem); line-height: 1.43; }
.portrait { grid-area: photo; width: 100%; align-self: center; justify-self: end; }
.pet-stage {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1.1rem;
  background: #f8ac91;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.pet-stage.is-petting { cursor: grabbing; }
.pet-stage img,
#pet-motion-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
#pet-sleepy-image, #pet-happy-image { z-index: 1; opacity: 0; transition: opacity .28s ease; }
.pet-stage[data-mood="sleepy"] #pet-sleepy-image { opacity: 1; }
.pet-stage.is-petting #pet-happy-image, .pet-stage[data-mood="happy"] #pet-happy-image { opacity: 1; }
#pet-motion-canvas { z-index: 2; visibility: hidden; }
.pet-stage.motion-ready #pet-motion-canvas { visibility: visible; }
.generation, .pet-prompt { z-index: 3; position: absolute; pointer-events: none; }
.generation { left: 1.1rem; top: 1.1rem; color: #382515; background: #ffe2c7e8; padding: .43rem .68rem; border-radius: .25rem; font-size: .72rem; }
.pet-prompt { right: .85rem; bottom: .85rem; display: inline-flex; align-items: center; gap: .46rem; padding: .42rem .78rem; border-radius: 2rem; color: white; background: #36241fea; font-weight: 600; font-size: .88rem; transition: opacity .2s ease; }
.pet-stage.is-petting .pet-prompt { opacity: 0; }
.heart { color: #ffc7a9; }
.pet-prompt :is(.touch-hint, .key-hint) { display: none; }
@media (pointer: coarse) {
  .pet-prompt .mouse-hint { display: none; }
  .pet-prompt .touch-hint { display: inline; }
}
.pet-stage:focus-visible .pet-prompt :is(.mouse-hint, .touch-hint) { display: none; }
.pet-stage:focus-visible .pet-prompt .key-hint { display: inline; }
@media (min-width: 52rem) and (max-height: 55rem) {
  .portrait { max-width: max(22rem, calc(100svh - 12.75rem)); }
}
.portrait figcaption { display: flex; gap: .78rem; align-items: baseline; margin-top: .85rem; min-height: 1.7rem; font-size: .94rem; color: var(--muted); }
.photo-index { color: var(--blue); flex-shrink: 0; font-size: .71rem; }
.speech { grid-area: speech; align-self: start; margin-top: clamp(1.55rem,3vw,2.35rem); max-width: 25rem; width: 100%; }
.speech label { display: block; margin-bottom: .55rem; font-weight: 650; }
.word-field { display: flex; gap: .42rem; }
.word-field input { min-width: 0; flex: 1; padding: .67rem .85rem; border-radius: .45rem; border: 1px solid #b9af9f; background: #fffdf8; color: var(--ink); }
.word-field input::placeholder { color: #796f61; }
.word-field button, .vote-row button { background: var(--blue); color: white; font-weight: 650; border: 1px solid var(--blue); border-radius: .45rem; padding: .65rem 1.15rem; }
.word-field button:hover, .vote-row button:hover { background: var(--blue-dark); color: white; }
.word-result { color: var(--muted); font-size: .93rem; }
#word-reply:not(:empty) { margin-top: .65rem; }
.text-button { background: none; border: 0; color: var(--blue); text-decoration: underline; text-underline-offset: .18rem; padding: .35rem 0; font-weight: 600; }
.share-status { display: block; }
.evolution { background: #efeee4; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(2.5rem,4.8vw,4.3rem) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.65rem; }
h2 { font-size: clamp(2.35rem,4.25vw,4.2rem); letter-spacing: -.065em; line-height: 1.03; margin: .65rem 0 0; }
.section-head p { color: var(--muted); text-align: right; max-width: 21rem; }
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem,2vw,1.65rem); }
.branch { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.1fr); background: var(--paper); border: 1px solid #cdc7b9; border-radius: .85rem; overflow: hidden; }
.branch-photo { background: #f2a88a; min-height: 14rem; overflow: hidden; position: relative; }
.branch-photo::before { content: ""; position: absolute; inset: -.75rem; background: center / cover; filter: blur(13px); }
.branch:nth-child(1) .branch-photo::before { background-image: url("/storm.webp"); }
.branch:nth-child(2) .branch-photo::before { background-image: url("/glider.webp"); }
.branch-photo img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.branch-copy { padding: clamp(1.1rem,1.8vw,1.55rem); align-self: center; }
h3 { font-size: clamp(1.5rem,2.25vw,2.2rem); letter-spacing: -.055em; line-height: 1.12; }
.branch-copy p, .entry p { color: var(--muted); margin-top: .52rem; }
.vote-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .75rem; margin-top: 1.05rem; }
.vote-row button { padding: .55rem .8rem; font-size: .9rem; background: transparent; color: var(--blue); }
.vote-row button[aria-pressed="true"] { background: var(--blue); color: white; }
button:disabled { cursor: default; opacity: .6; }
.count { font-size: .82rem; color: var(--muted); }
.poll-status:not(:empty) { font-size: .94rem; margin-top: 1rem; color: var(--muted); }
.book { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1fr); align-items: center; gap: 3rem; padding-block: clamp(2.8rem,5.7vw,5.2rem); }
.book-intro p { color: var(--muted); margin-top: .8rem; }
.entry { display: flex; gap: 1.2rem; align-items: center; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 0; }
.entry img { object-fit: cover; width: 5.5rem; height: 5.5rem; border-radius: .5rem; }
.entry .small-title { margin-bottom: .38rem; }
.entry h3 { font-size: 1.55rem; }
.entry p { margin-top: .28rem; }
.foot { border-top: 1px solid var(--rule); padding-block: 1.4rem; }
.foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.tiny-brand { font-size: 1.65rem; color: var(--blue); }
.foot p { color: var(--muted); font-size: .875rem; }

@media (max-width: 65rem) {
  .site-head { height: 4.9rem; }
  .branch { grid-template-columns: minmax(0,.73fr) minmax(0,1fr); }
  .branch-photo { min-height: 13rem; }
}
@media (max-width: 52rem) {
  .nursery { column-gap: 2rem; }
  h1 { font-size: clamp(4.2rem,9vw,5.7rem); }
  .branch { display: flex; flex-direction: column; }
  .branch-photo { min-height: auto; aspect-ratio: 1.5; }
  .branch-photo img { object-fit: contain; }
  .branch-copy { align-self: stretch; height: 100%; display: flex; flex-direction: column; }
  .branch-copy .vote-row { margin-top: auto; padding-top: 1rem; }
}
@media (max-width: 42rem) {
  .wrap { width: calc(100% - 2.25rem); }
  .site-head { height: 4.2rem; gap: 1rem; }
  .brand { font-size: 2rem; gap: .43rem; }
  .site-head nav { gap: .85rem; }
  .site-head nav a { font-size: .86rem; }
  .sound { min-height: 2.5rem; padding: .3rem .69rem; gap: .4rem; font-size: .82rem; }
  .nursery { grid-template-columns: 1fr; grid-template-areas: "intro" "photo" "speech"; padding: 2rem 0 2.15rem; }
  .intro { padding-top: 0; }
  h1 { font-size: clamp(3.3rem,10.7vw,4.8rem); line-height: 1; margin: .35rem 0 .7rem -.045em; }
  h1 br { display: none; }
  h1 em::before { content: " "; }
  .intro p { font-size: 1.04rem; max-width: 37ch; }
  .portrait { margin-top: 1.28rem; }
  .portrait figcaption { gap: .55rem; font-size: .9rem; }
  .speech { max-width: none; margin-top: 1.1rem; }
  .section-head { display: block; margin-bottom: 1.2rem; }
  .section-head p { margin-top: .6rem; max-width: none; text-align: left; }
  .branches { grid-template-columns: 1fr; gap: .9rem; }
  .branch { display: grid; grid-template-columns: minmax(0,.72fr) minmax(0,1fr); }
  .branch-photo { aspect-ratio: auto; min-height: 10.8rem; }
  .branch-photo img { object-fit: contain; }
  .branch-copy { display: block; padding: 1rem; }
  .branch-copy p { font-size: .94rem; }
  .branch-copy .vote-row { margin-top: .77rem; padding: 0; }
  .book { grid-template-columns: 1fr; gap: 1.1rem; }
  .foot .wrap { align-items: start; }
  .foot p { text-align: right; max-width: 27ch; }
}
@media (max-width: 25rem) {
  .site-head { gap: .73rem; }
  .brand { font-size: 1.8rem; }
  .site-head nav { gap: .7rem; }
  .site-head nav a { font-size: .8rem; }
  .sound-bars { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
