/* The painted page (index.html): season paintings that soak into the paper, and the small things laid over them.
   The drawing is in js/decor.js. Everything that moves here is slow and small on purpose. */
html { overflow-x: clip; }

/* a season runs the full width of the window; what is inside it keeps the page's column */
.season { margin-inline: calc(50% - 50vw); padding-bottom: 30px; }
.season > .cards, .season > h2.plain { max-width: 1040px; margin-inline: auto; padding-inline: 18px; }
.season > h2.plain { margin-top: 64px; margin-bottom: 26px; }

/* the painting at the head of a season: its top and bottom edges fade into the page */
.scene { position: relative; height: clamp(250px, 36vw, 470px); margin-top: 34px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 13%, #000 76%, transparent 99%); mask-image: linear-gradient(transparent, #000 13%, #000 76%, transparent 99%); }
.scene img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
.scene .drift { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-title { position: absolute; left: max(22px, calc(50% - 500px)); top: 10%; color: var(--card); text-shadow: 0 2px 16px rgba(30,36,96,.55), 0 0 3px rgba(30,36,96,.35); }
.scene-title h2 { margin: 0; font-size: clamp(38px, 5.6vw, 68px); line-height: 1; }
.scene-title h2 span { color: #fbc9cd; }
.scene-title p { margin: 8px 0 0; max-width: 16em; font-family: 'Caveat', cursive; font-size: clamp(21px, 2.5vw, 28px); line-height: 1.1; }
/* no painting yet: just the heading, as before */
.scene.bare { height: auto; margin-top: 64px; -webkit-mask-image: none; mask-image: none; max-width: 1040px; margin-inline: auto; padding-inline: 18px; }
.scene.bare img, .scene.bare .drift { display: none; }
.scene.bare .scene-title { position: static; color: var(--ink); text-shadow: none; }
.scene.bare .scene-title h2 span { color: inherit; } .scene.bare .scene-title h2 { font-size: 36px; }

/* winter: the snow of the painting carries on down the page under the cards, and thins out to paper */
.season.winter { background: linear-gradient(transparent, rgba(224,231,248,.9) 330px, rgba(228,233,247,.55) 72%, transparent); }
.season.winter .cards { padding-top: 8px; }
/* the string of lights, hung where the painting meets the page */
.garland { position: relative; z-index: 1; height: 110px; margin: -92px 0 -6px; pointer-events: none; overflow: hidden; }
.garland svg { display: block; overflow: visible; }
.garland .glow { opacity: .12; filter: blur(5px); animation: bulb 10s ease-in-out infinite; }
@keyframes bulb { 0%, 55%, 100% { opacity: .1; } 75% { opacity: .75; } }

/* touches on a card */
.touch { position: absolute; display: block; pointer-events: none; z-index: 1; }
.touch svg { display: block; width: 100%; overflow: visible; }
.touch.trip { width: 46px; left: -20px; top: -44px; transform: rotate(-7deg); filter: drop-shadow(0 6px 4px rgba(var(--shadow),.22)); animation: float 9s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px) rotate(-4deg); } }
.touch.candle { width: 24px; right: 30px; top: -53px; }
.touch.candle .flame { transform-origin: 12px 20px; animation: flicker 5s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(.9, 1.06) rotate(-4deg); } 70% { transform: scale(1.05, .95) rotate(3deg); } }
.touch.hearts { width: 62px; right: -22px; bottom: -14px; transform: rotate(8deg); }

@media (max-width: 760px) {
  .scene-title { top: 9%; }
  .garland { margin-top: -56px; }
  .touch.trip { left: -8px; } .touch.hearts { right: -8px; }
}

/* day seasons (spring, fall): dark lettering on a light sky */
.scene.day .scene-title { color: var(--ink); text-shadow: 0 0 14px rgba(255,250,240,.9), 0 0 4px rgba(255,250,240,.8); }
.scene.day .scene-title h2 span { color: #d9606e; }
/* each season's ground carries on down the page under its cards, and thins out to paper */
.season.spring { background: linear-gradient(transparent, rgba(214,236,196,.8) 330px, rgba(250,222,229,.6) 60%, transparent); }
.season.summer { background: linear-gradient(transparent, rgba(190,224,198,.85) 330px, rgba(210,232,208,.5) 72%, transparent); }
.season.fall { background: linear-gradient(transparent, rgba(244,218,160,.85) 330px, rgba(247,224,184,.5) 72%, transparent); }
.season:not(.winter) .cards { padding-top: 26px; }

/* the top of the page is the cover of a book: the title in ink on the paper, the hero painting set into it as a plate
   whose edges soak into the page (as in the film). It ends before the seasons start. */
.cover { max-width: 1040px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) 18px 0; text-align: center; }
.cover h1 { font-size: clamp(64px, 14vw, 168px); line-height: .9; }
.cover .sub { margin: 14px 0 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.1; }
/* the thread, the stamps and the slip on the painting are in css/book.css */
/* its edges melt away through a mask, so the page's own grain shows through them. (They used to be a paper-coloured shadow laid over the
   picture; the page has a grain that flat colour lacks, so the picture sat in a faintly paler frame.) */
.plate { position: relative; margin: clamp(30px, 5vw, 54px) auto 0; overflow: hidden; border-radius: 10px;
  -webkit-mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-composite: intersect; }
.plate img { width: 100%; }
.plate .petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
main { padding-top: 0; }
#seasons { margin-top: clamp(40px, 7vw, 90px); }

/* the balloon on its string at the side: a knot per season, the balloon rides down it as the page scrolls and can be dragged */
.voyage { position: fixed; z-index: 2; right: max(34px, calc(50vw - 520px - 96px)); top: 16vh; height: 62vh; width: 20px; opacity: 0; pointer-events: none; transition: opacity .8s; }
.voyage.on { opacity: 1; pointer-events: auto; }
.voyage .string { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.knot { position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border: 0; background: none; cursor: pointer; }
.knot::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--dot, var(--soft)); box-shadow: 0 0 0 2px var(--paper); transition: transform .25s; }
.knot.fall { --dot: #d9783f; } .knot.winter { --dot: #8f98d2; } .knot.spring { --dot: #ef8fa8; } .knot.summer { --dot: #4f9f78; }
.knot:hover::before, .knot:focus-visible::before, .knot.here::before { transform: scale(1.5); }
.knot span { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); padding: 0 9px 1px; white-space: nowrap; font-family: 'Caveat', cursive; font-weight: 700; font-size: 19px; color: var(--ink); background: var(--card); box-shadow: 0 4px 10px -4px rgba(var(--shadow),.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
.knot:hover span, .knot:focus-visible span { opacity: 1; }
.rider { position: absolute; left: 50%; width: 96px; margin: -44px 0 0 -48px; text-align: center; cursor: grab; touch-action: none; transition: top 1.2s cubic-bezier(.2,.7,.3,1); }
.voyage.dragging .rider { cursor: grabbing; transition: none; }
.rider i { display: block; width: 50px; margin: 0 auto; transform: rotate(var(--lean, 0deg)); transition: transform 1.6s ease-out; filter: drop-shadow(0 8px 5px rgba(var(--shadow),.2)); }
.rider:hover i { transform: rotate(var(--lean, 0deg)) scale(1.08); }
.rider svg { display: block; width: 100%; overflow: visible; }
.rider span { display: inline-block; margin-top: 2px; padding: 0 7px 1px; border-radius: 10px; font-family: 'Caveat', cursive; font-weight: 700; font-size: 18px; line-height: 1.1; color: var(--soft); background: var(--paper); }
.rider span:empty { display: none; }
@media (max-width: 1300px) { .voyage { display: none; } }

/* Lucky */
.lucky { position: absolute; display: block; z-index: 1; cursor: pointer; filter: drop-shadow(0 3px 2px rgba(var(--shadow),.22)); }
i.lucky img { display: block; width: 100%; height: auto; background: none; }   /* his crayon picture, on clear paper (js/lucky.js) */
.lucky.hop img { animation: hop .55s cubic-bezier(.3,1.4,.6,1); }
@keyframes hop { 40% { transform: translateY(-14px) rotate(-4deg); } 70% { transform: translateY(0) rotate(2deg); } }
.lucky.peek { width: 80px; right: 40px; top: calc(-80px * var(--cut)); }   /* --cut: where the card's edge lies in his picture; his paws come over it */
.polaroid > .art, .polaroid > img, .polaroid > figcaption { position: relative; z-index: 1; }
.lucky.lie { position: relative; display: inline-block; width: 108px; margin-left: 14px; vertical-align: -20px; }
.lucky.peek.hop img { animation-name: peekhop; } @keyframes peekhop { 40% { transform: translateY(-9px); } }

/* the map: a pin's name shows only when it is pointed at or picked */
.pin.spot, .pin.spot.left { transform: translate(-15px, -92%); display: block; }
.pin.spot span { position: absolute; left: 34px; top: 2px; padding: 0 9px 1px; background: var(--card); box-shadow: 0 4px 10px -4px rgba(var(--shadow),.6); text-shadow: none; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.pin.spot.left span { left: auto; right: 34px; transform: translateX(4px); }
.pin.spot span small { font-family: 'Fraunces', serif; font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.pin.spot:hover span, .pin.spot:focus-visible span, .pin.spot.on span { opacity: 1; transform: none; }
.pin.spot:hover, .pin.spot:focus-visible { z-index: 4; } .pin.spot.on { z-index: 3; }
.pin.spot b { position: absolute; left: 18px; top: -7px; margin: 0; min-width: 19px; text-align: center; padding: 1px 5px; }
/* the visits beside it, by year */
.visits .near { margin: 2px 0 0; font-size: 13px; letter-spacing: .04em; color: var(--soft); }
.visits .yr { margin: 16px 0 8px; font-weight: 400; font-style: italic; font-size: 20px; display: flex; align-items: center; gap: 12px; color: var(--soft); }
.visits .yr::after { content: ''; flex: 1; border-top: 2px dashed rgba(var(--shadow),.22); }
.visits .visit { margin-bottom: 8px; padding: 5px; font-size: 21px; } .visits .visit img { width: 66px; height: 46px; }
.visits .extra { display: none; } .visits.all .visit.extra { display: flex; } .visits.all .yr.extra { display: flex; } .visits.all .morev { display: none; }
.morev { border: 0; background: none; cursor: pointer; padding: 6px 0; font-family: 'Caveat', cursive; font-weight: 700; font-size: 24px; color: var(--pink); }
.morev:hover { text-decoration: underline; }

.pin.city { z-index: 2; }

/* The desk under the window, at the foot of a season (js/desks.js): smaller than the season's painting and set into the page, so it
   closes a season without starting another. Sizes inside it are in cqw so the pinned photos stay in step with the picture;
   on a narrow screen the picture keeps a readable size and is panned sideways. */
.season > .sill { position: relative; width: min(100% - 36px, 1100px); margin: 40px auto 0; }
.sill-in { position: relative; container-type: inline-size; }
.sill-in > img { display: block; width: 100%; height: auto; aspect-ratio: 1800 / 620;
  -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent), linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent), linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-composite: intersect; }
/* the odd word written over the painting by the page (the name on the concert tickets), because paint blurs lettering past reading.
   It is made to sit in the paint, not on it: a hand, a soft colour, multiplied into the picture, its edges roughened and a little out of focus */
.sill .inked { position: absolute; translate: -50% -50%; white-space: nowrap; font: 700 clamp(8px, 1.62cqw, 19px)/1 'Caveat', cursive; font-style: normal; letter-spacing: .04em; color: #5d4c86;
  opacity: .8; mix-blend-mode: multiply; filter: url(#crayon) blur(.35px); pointer-events: none; }
/* the season's one-off photos, pinned to the cork board painted on the wall */
.sill .board { position: absolute; box-sizing: border-box; display: flex; align-items: flex-start; justify-content: center; gap: 2.5%; padding: 1cqw .8cqw 0; }
.sill .board .scrap { flex: 0 1 auto; width: auto; min-width: 0; padding: .4cqw .4cqw .5cqw; }
.sill .board .scrap::before, .sill .board .scrap:nth-child(even)::before { top: -.5cqw; left: 50%; width: 1.1cqw; height: 1.1cqw; margin-left: -.55cqw; border-radius: 50%; background: #e0766e; transform: none; box-shadow: 0 2px 3px rgba(60,30,10,.5); }
.sill .board .scrap:nth-child(even)::before { background: #5fb7b9; } .sill .board .scrap:nth-child(3n)::before { background: #f3c94c; }
.sill .board .scrap img { display: block; height: 9.7cqw; width: auto; max-width: 100%; object-fit: cover; }   /* as big as the board allows with two lines of caption under it */
.sill .board .scrap figcaption { width: 0; min-width: 100%; padding-top: .25cqw; font-size: clamp(8px, 1.3cqw, 15px); line-height: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sill .board .scrap small { display: none; margin-top: .1cqw; font-size: clamp(5px, .7cqw, 9px); }
/* pointed at: the print comes forward with its whole caption and its date (two lines of it otherwise, so a long note cannot hang off the board) */
.sill .board .scrap:hover { transform: rotate(0) scale(1.6); z-index: 3; } .sill .board .scrap:hover figcaption { display: block; } .sill .board .scrap:hover small { display: block; }
/* the painting is missing: no desk, and the photos sit in a plain row */
.sill.bare .sill-in > img, .sill.bare .inked { display: none; }
.sill.bare .board { position: static; width: auto !important; height: auto !important; flex-wrap: wrap; gap: 16px; padding: 0; } .sill.bare .board .scrap img { height: 100px; }
@media (max-width: 760px) { .season > .sill { width: 100%; overflow-x: auto; margin-top: 28px; } .sill-in { width: 720px; margin: 0 auto; } }
