/* An ordinary day, at the foot of the main page (js/day.js). A sky that goes from morning to night as the page goes down,
   the texts they send most pinned along it as paper speech bubbles, and under the last of them the painting of the two of them
   under the stars. The page ends there, in the dark, with the letter and the way to the other pages. */
.day { position: relative; margin-top: 40px; overflow: hidden; --night: #171c57; --hill: #1c3a4f; }

/* a paper speech bubble: pink paper for her, blue for him. Used here and in the margins of texts.html. */
.bub { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0; padding: 9px 17px 12px; isolation: isolate; font: 700 22px/1.08 'Caveat', cursive; color: var(--ink); text-align: left; overflow-wrap: anywhere; }
/* shadows go on the paper layer, never on the element that holds the words: a filter on a tilted element blurs its lettering */
.bub::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 19px; background: var(--bub); filter: url(#rough) drop-shadow(var(--lift, 0 4px 4px rgba(var(--shadow), .22))); }
.bub::after { content: ''; position: absolute; z-index: -1; bottom: -7px; width: 18px; height: 16px; background: var(--bub); }
.bub.her { --bub: #fbd5d9; } .bub.her::after { left: 9px; clip-path: polygon(0 100%, 30% 0, 100% 10%); }
.bub.him { --bub: #cddff5; } .bub.him::after { right: 9px; clip-path: polygon(100% 100%, 70% 0, 0 10%); }

.day-sky { position: relative; padding: 70px 18px clamp(120px, 20vw, 300px); }
/* the sky: painted (js/day.js daySketch), as tall as the day and as wide as that asks for (--skyw, set by the page); its top melts out of the page. Under it, the same
   colours as a plain wash, for when the painting is missing. */
.day-sky::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: url('../photos/painted/_season-day.jpg') center / var(--skyw, 100%) 100% no-repeat, linear-gradient(#f7eddc, #fbe6c4 7%, #fbd3b4 15%, #d3e6ea 24%, #a9d6ec 36%, #9fd0ea 47%, #c9ddd8 56%, #f7d99c 63%, #f4ad8c 70%, #d98aa6 77%, #8468a8 84%, #3a3f8f 91%, var(--night));
  -webkit-mask-image: linear-gradient(transparent, #000 250px); mask-image: linear-gradient(transparent, #000 250px); }
.day-sky .chapter { margin-top: 0; }

.beats { list-style: none; max-width: 860px; margin: 46px auto 0; padding: 0; position: relative; }
/* the line the day runs down: dotted, like the line between them in the paintings */
.beats::before { content: ''; position: absolute; left: 50%; top: -18px; bottom: -40px; width: 10px; translate: -50% 0; background: radial-gradient(circle, rgba(255, 250, 240, .95) 3.4px, transparent 4.2px) center top / 10px 26px repeat-y; filter: drop-shadow(0 1px 2px rgba(43, 49, 112, .55)); }
.beat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 15px 0; }
.beat time { justify-self: center; padding: 2px 10px 3px; font: 600 15px/1.2 'Fraunces', serif; letter-spacing: .04em; color: var(--ink); background: var(--card); border-radius: 20px; box-shadow: 0 2px 5px -1px rgba(var(--shadow), .35); white-space: nowrap; }
.beat time small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.side { display: flex; } .side.her { justify-content: flex-end; text-align: right; } .side.him { justify-content: flex-start; }
.beat .bub { font-size: 27px; padding: 9px 22px 13px; --lift: 0 5px 6px rgba(30, 36, 96, .34); } .beat .side.her .bub { rotate: -1.6deg; } .beat .side.him .bub { rotate: 1.4deg; }
.beat .bub.her::after { left: auto; right: 12px; clip-path: polygon(100% 100%, 70% 0, 0 10%); } .beat .bub.him::after { right: auto; left: 12px; clip-path: polygon(0 100%, 30% 0, 100% 10%); }   /* the tails point at the line */
.beat.both .side.him { margin-top: 34px; } .beat.both.his-first .side.him { margin-top: 0; } .beat.both.his-first .side.her { margin-top: 34px; }   /* the answer sits a little lower */
/* the note beside a text: on a slip of paper of its own, so it reads against any part of the sky. (It was written straight on the
   painting at first, ink by day and cream by night, and Eric found it hard to read against the strokes.) */
.aside { position: relative; isolation: isolate; width: fit-content; max-width: 16em; margin: 0; padding: 6px 15px 8px; font: 700 23px/1.1 'Caveat', cursive; color: var(--ink); }
.aside::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 2px; background: #fffaf0; filter: url(#rough) drop-shadow(0 4px 5px rgba(30, 36, 96, .28)); }
.side.her .aside { rotate: .8deg; } .side.him .aside { rotate: -.8deg; }
.beat.both > .aside { grid-column: 1 / -1; justify-self: center; max-width: 24em; margin-top: 14px; text-align: center; rotate: -.5deg; }

/* under the stars: the painting the film ends on, its top melting up into the night of the sky above */
/* --o is how far it reaches up into the sky. The painting must be wholly opaque before the sky above it ends, or the page shows
   through the half-faded painting under the sky's bottom edge as a pale band with a hard line across it. */
.day-night { --o: clamp(90px, 17vw, 260px); position: relative; margin-top: calc(-1 * var(--o)); background: linear-gradient(transparent 55%, var(--hill)); }
.day-night img { display: block; width: 100%; height: clamp(300px, 50vw, 900px); object-fit: cover; object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 calc(var(--o) * .9), #000 86%, transparent); mask-image: linear-gradient(transparent, #000 calc(var(--o) * .9), #000 86%, transparent); }
/* the foot of the page, on the hill: the letter (when there is one), and the stamps */
.day-foot { position: relative; margin-top: -2px; padding: 10px 18px 100px; background: var(--hill); text-align: center; }
.day-foot .envelope { margin: 30px 0 80px; } .day-foot .envelope .hand { color: #fdf3dc; }
.day-foot .more { position: relative; width: fit-content; margin: 30px auto 22px; font-size: 30px; color: #fdf3dc; }
/* "Things we said", as it was, when asked for (index.html?end=said) */
.said-old { max-width: 1040px; margin: 0 auto 120px; }

@media (max-width: 700px) {
  .beats { margin-top: 30px; } .beats::before { display: none; }
  .beat { grid-template-columns: 1fr 1fr; row-gap: 8px; padding: 14px 0; }
  .beat time { grid-column: 1 / -1; grid-row: 1; }
  .beat .side { grid-row: 2; } .beat:not(.both) .side.her { grid-column: 1 / -1; justify-content: center; text-align: center; } .beat:not(.both) .side.him { grid-column: 1 / -1; grid-row: 3; justify-content: center; text-align: center; }
  .beat .bub { font-size: 23px; } .aside { font-size: 20px; max-width: 100%; }
  .beat.both .side.him, .beat.both.his-first .side.her { margin-top: 0; }
}
