/* Nothing left to read: a painted scene for the time of day (break.js). Shared by the app and the home page. */
.break { display: grid; justify-items: center; gap: 6px; text-align: center; }
.break-scene { position: relative; display: block; width: min(100%, 420px); aspect-ratio: 16 / 10; border-radius: 26px; overflow: hidden; background: #e7dcc8; box-shadow: 0 1px 2px #0000000d, 0 18px 40px -18px #1b2a4a40; }
.break-end .break-scene { width: min(100%, 320px); border-radius: 20px; }
.break-done { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.break-kicker { margin: 0; color: var(--ink, #1d1d1f); font-size: 20px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.break-line { max-width: 26em; margin: 0; color: var(--muted, #747781); font-size: 15px; line-height: 1.45; text-wrap: balance; transition: opacity .35s ease, filter .35s ease, transform .45s cubic-bezier(.23, 1, .32, 1); }
.break-line.swap { opacity: 0; filter: blur(4px); transform: translateY(6px); }

/* The moment of being done: the ring and tick draw themselves, a soft halo and a few motes drift off,
   light passes over the scene. About two seconds, once. The words are never hidden for it. */
.break-tick { flex: none; width: 24px; height: 24px; overflow: visible; color: #3f9d6a; }
.break-ring, .break-check { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.break-halo { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.break-motes circle { fill: #e0b45c; opacity: 0; transform-box: fill-box; transform-origin: center; }
.break-scene::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, #fff6dc, #fff6dc00 72%); opacity: 0; pointer-events: none; }
.is-armed .break-ring, .is-armed .break-check { stroke-dashoffset: 1; }
.is-done .break-ring { animation: bs-draw .62s cubic-bezier(.23, 1, .32, 1) forwards; }
.is-done .break-check { animation: bs-draw .36s cubic-bezier(.23, 1, .32, 1) .44s forwards; }
.is-done .break-halo { animation: bs-halo 1.1s cubic-bezier(.23, 1, .32, 1) .5s; }
.is-done .break-motes circle { animation: bs-mote 1.3s cubic-bezier(.23, 1, .32, 1) .52s; }
.is-done .break-motes circle:nth-child(1) { --mx: 0; --my: -9px; }
.is-done .break-motes circle:nth-child(2) { --mx: 8px; --my: -5px; animation-delay: .6s; }
.is-done .break-motes circle:nth-child(3) { --mx: 8px; --my: 5px; animation-delay: .54s; }
.is-done .break-motes circle:nth-child(4) { --mx: 0; --my: 9px; animation-delay: .64s; }
.is-done .break-motes circle:nth-child(5) { --mx: -8px; --my: 5px; animation-delay: .56s; }
.is-done .break-motes circle:nth-child(6) { --mx: -8px; --my: -5px; animation-delay: .62s; }
.is-done .break-scene::after { animation: bs-bloom 1.8s ease-in-out .4s; }
@keyframes bs-draw { to { stroke-dashoffset: 0; } }
@keyframes bs-halo { from { opacity: .35; transform: scale(1); } to { opacity: 0; transform: scale(1.8); } }
@keyframes bs-mote { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--mx), var(--my)) scale(1); } }
@keyframes bs-bloom { 0%, 100% { opacity: 0; } 45% { opacity: .28; } }

/* The layers: an image behind, then whatever moves. The art fades in once it has loaded. */
.bs-stage { position: absolute; inset: 0; display: block; overflow: hidden; isolation: isolate; opacity: 0; transition: opacity .4s ease; }
.bs-stage.is-ready { opacity: 1; }
.bs-stage > svg, .bs-base, .bs-grain { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.bs-base { object-fit: cover; }
.bs-strip { position: absolute; top: 0; left: 0; display: block; width: 200%; height: 100%; background-size: 50% 100%; background-repeat: repeat-x; will-change: transform; }
.bs-grain { background: url("scenes/grain.png") 0 0 / 128px; opacity: .4; pointer-events: none; }
.bs-night { mix-blend-mode: multiply; }

/* A breeze in the leaves and curtains, the fan, a little steam off the mug. */
.bs-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: bs-sway 6.5s ease-in-out infinite; }
.bs-sway.b { animation-duration: 8s; animation-delay: -2.5s; }
.bs-hang { transform-origin: 70px 20px; animation: bs-hang 7s ease-in-out infinite; }
.bs-curtain { animation: bs-curtain 7s ease-in-out infinite; }
.bs-curtain.b { animation-duration: 8.5s; animation-delay: -3s; }
.bs-door { transform-origin: 840px 60px; }
.bs-window-l { transform-origin: 230px 56px; }
.bs-window-c { transform-origin: 570px 56px; }
.bs-blades { transform-box: view-box; transform-origin: 380px 50px; animation: bs-spin 1.9s linear infinite; }
.bs-puff { transform-box: fill-box; transform-origin: center; opacity: 0; animation: bs-rise 6s linear infinite; }
.bs-puff.b { animation-delay: -3s; }

@keyframes bs-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.2deg); } }
@keyframes bs-hang { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }
@keyframes bs-curtain { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(-1.6deg); } }
@keyframes bs-spin { to { transform: rotate(360deg); } }
@keyframes bs-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: .4; } 100% { transform: translateY(-54px) scale(1.7); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .break *, .break-scene { animation: none !important; transition: none !important; }
  .bs-stage { opacity: 1; }
}
