/* Day page: the light moves with the reading. Fixed ground of three stacked frames. */

.day-ground { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--ground); }
.day-ground img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: creep 30s var(--drift) infinite alternate;
}
.day-ground img:not(:first-child) { opacity: 0; }

/* Violet arc in the left margin, clear of the text */
.day-arc {
  position: fixed; left: .2rem; top: 50%; transform: translateY(-50%);
  width: .9rem; height: 9rem; z-index: 20; pointer-events: none; overflow: visible;
}
.day-arc path { fill: none; stroke-width: 3; stroke-linecap: round; }
.day-arc__track { stroke: var(--cream); opacity: .75; }
.day-arc__fill { stroke: var(--violet); stroke-dasharray: 1; stroke-dashoffset: .97; }

/* Everything on the page stands above the ground */
.day-first, .beat { position: relative; z-index: 1; }

/* First screen: sill beside the teacup arch */
.day-first { background: none; }
.day-first .opening__arch .arch { max-height: 30svh; }
.day-first .opening__arch { position: relative; }
@media (min-width: 60rem) {
  .day-first .opening__arch .arch { max-height: 62svh; }
}

/* One beat of the day: a sill and a tucked snapshot, alternating sides */
.beat {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem; row-gap: 1.5rem;
  align-items: center; padding-inline: var(--edge);
  margin-block: clamp(4rem, 16svh, 9rem);
}
.beat > * { grid-column: 1 / -1; }
.beat .sill { max-width: 40rem; }
.beat .snap { justify-self: end; margin-block: 0; }
.beat--flip .snap { justify-self: start; }
.beat .snap img { width: 100%; height: 100%; object-fit: cover; }
.beat .sill a { text-decoration-color: var(--violet); }

@media (max-width: 59.99rem) {
  .beat .snap { width: min(70%, 18rem); margin: 0 0 0 auto; --tilt: 1.5deg !important; }
  .beat--flip .snap { margin: 0 auto 0 0; --tilt: -1.5deg !important; }
  .beat .snap { grid-row: 2; }
  .beat .sill { grid-row: 1; }
}

@media (min-width: 60rem) {
  .beat .sill, .beat--flip .sill { max-width: none; grid-row: 1; }
  .beat .sill { grid-column: 1 / span 7; }
  .beat .snap { grid-row: 1; grid-column: 8 / span 5; margin-left: -2.5rem; width: clamp(14rem, 26vw, 26rem); z-index: 1; }
  .beat--flip .sill { grid-column: 6 / span 7; }
  .beat--flip .snap { grid-column: 1 / span 5; margin-left: 0; margin-right: -2.5rem; justify-self: end; }
  .beat--flip .snap { justify-self: end; }
}

/* Reduced motion: the morning frame only, arc still */
@media (prefers-reduced-motion: reduce) {
  .day-ground img:not(:first-child) { opacity: 0 !important; }
  .day-arc__fill { stroke-dashoffset: .97 !important; }
}
