/* Kelly's Christmas Advent: values taken from docs/design (390 x 844 screens). */
:root {
  /* Design table (spec, section "Ontwerp") */
  --wine: #2B0B16;          /* background */
  --cream: #FBEFE2;         /* text on dark */
  --muted: #E3C8C0;         /* muted text on dark */
  --gold: #E6BC74;
  --pink: #F4B6C2;
  --berry: #C2274B;
  --cell-wine: #3F1223;     /* locked cells */
  --cell-pine: #1F4A3A;
  --cell-plum: #45204C;
  --paper: #FBEFE2;         /* book paper */
  --paper-text: #2B0B16;
  --paper-heading: #7A1830;

  /* Detail colours from the design screens */
  --gold-hover: #F4D9A6;
  --rule: #8A5560;
  --input-border: #A8727B;
  --input-bg: #3A1020;
  --ornament: #9C1F3F;
  --paper-rule: #C9A9A0;
  --paper-soft: #5C2A33;
  --envelope-line: #D9BFAE;
  --envelope-flap: #F6E3D2;

  --font-title: 'Playfair Display', Georgia, serif;
  --font-script: 'Pinyon Script', cursive;
  --font-body: 'DM Sans', system-ui, sans-serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--wine); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--wine);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

#app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.notice {
  max-width: 430px;
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--wine);
  background: var(--pink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Shared pieces ------------------------------------------------------- */

.kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.pill-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 27px;
  background: var(--gold);
  color: var(--wine);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.pill-button:hover { background: var(--gold-hover); }
.pill-button:disabled { opacity: 0.7; cursor: progress; }

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.divider span { width: 56px; height: 1px; background: var(--paper-rule); }

/* Screen 1: login ------------------------------------------------------ */

.login {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 36px;
}

.sparkle { position: absolute; }
.sparkle-1 { left: 38px; top: 132px; }
.sparkle-2 { right: 52px; top: 96px; }
.sparkle-3 { right: 34px; top: 304px; }
.sparkle-4 { left: 60px; top: 372px; }

.cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 44px;
}
.cover-script {
  font-family: var(--font-script);
  font-size: 84px;
  line-height: 0.9;
  color: var(--gold);
}
.cover-title {
  margin: 6px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 58px;
  line-height: 1;
  color: var(--cream);
}
.cover-advent {
  margin-top: 14px;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.52em;
  padding-left: 0.52em;
  text-transform: uppercase;
  color: var(--pink);
}

.login .divider { margin-top: 36px; }
.login .divider span { width: 72px; background: var(--rule); }

.login-intro {
  margin: 28px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  text-align: center;
}

.login-form {
  margin-top: auto;
  padding-top: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}
.login-form input {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--cream);
  font-size: 17px;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}
.login-form input::placeholder { color: var(--muted); opacity: 0.6; }
.login-error {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pink);
  text-align: center;
}
.login-footnote {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Screen 2: calendar --------------------------------------------------- */

.calendar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 20px 20px;
  /* Fill the screen on a tall phone, so the dust layer (inset: 0) reaches the bottom edge; overflow clips only the dust. */
  flex: 1 0 auto;
  position: relative;
  overflow: hidden;
}

.preview-banner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--wine);
}
.preview-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.preview-leave {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--wine);
  border-radius: 22px;
  background: var(--wine);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.preview-leave:hover { background: var(--cell-wine); }
.preview-banner :focus-visible { outline-color: var(--wine); }

.calendar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.calendar-script {
  font-family: var(--font-script);
  font-size: 46px;
  line-height: 1;
  color: var(--gold);
}
.calendar-title {
  margin: 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
}
.calendar-date {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.calendar-count {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cell {
  position: relative;
  width: 100%;
  height: 80px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.cell-number {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}

.cell-opened { background: var(--paper); color: var(--paper-heading); }

.cell-available {
  border: 2px solid var(--gold);
  background: var(--berry);
  color: var(--cream);
}
.cell-available .cell-number { font-size: 28px; }
.cell-open-me {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cell-locked { color: var(--muted); }
.cell-locked .cell-number { font-weight: 500; }
.cell-locked .cell-lock { position: absolute; right: 8px; top: 8px; }
.tone-wine { background: var(--cell-wine); }
.tone-pine { background: var(--cell-pine); }
.tone-plum { background: var(--cell-plum); }

/* Bookshelf (under the calendar grid) ----------------------------------------- */

.shelf {
  display: flex;
  flex-direction: column;
}

.shelf-books {
  height: 60px;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 2px;
  align-items: end;
  padding: 0 4px;
}

.spine {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px 2px 0 0;
  background: var(--spine-bg);
  color: var(--spine-ink);
}
.spine-tone-0 { --spine-bg: #C2274B; --spine-ink: #FBEFE2; }
.spine-tone-1 { --spine-bg: #E6BC74; --spine-ink: #2B0B16; }
.spine-tone-2 { --spine-bg: #2F6B55; --spine-ink: #FBEFE2; }
.spine-tone-3 { --spine-bg: #FBEFE2; --spine-ink: #7A1830; }
.spine-tone-4 { --spine-bg: #6A3476; --spine-ink: #FBEFE2; }
.spine-tone-5 { --spine-bg: #F4B6C2; --spine-ink: #2B0B16; }

.spine-gap {
  height: 4px;
  border-radius: 2px;
  background: #4A1A2A;
}

.spine-bands {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.spine-bands span {
  width: 6px;
  height: 1px;
  background: var(--spine-ink);
  opacity: 0.6;
}

.spine-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
}
.spine-mark svg { fill: var(--spine-ink); }

.shelf-board {
  position: relative;
  height: 4px;
  margin-bottom: 2px; /* room for the 2px strip below the board */
  border-radius: 2px;
  background: var(--gold);
}
.shelf-board::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 3px;
  right: 3px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--rule);
}

.shelf-caption {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.shelf-caption-end {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 15px;
  color: var(--gold);
}

.spine-new { animation: spine-drop 450ms cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes spine-drop {
  from { transform: translateY(-18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.shelf-reveal-wait .spine-mark { opacity: 0; }
.shelf-reveal .spine-mark { animation: mark-reveal 500ms ease calc(var(--i) * 70ms) backwards; }
@keyframes mark-reveal {
  from { opacity: 0; transform: scale(1.6); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spine-new,
  .shelf-reveal .spine-mark { animation: none; }
  .shelf-reveal-wait .spine-mark { opacity: 1; }
}

/* Dialog: screens 3 to 6 ------------------------------------------------ */

dialog#door {
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: var(--wine);
  color: var(--cream);
  overflow-y: auto;
  perspective: 1200px;
}
dialog#door::backdrop { background: var(--wine); }

.door {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 20px 24px;
  transform-origin: left center;
}
dialog[open] .door { animation: door-open 400ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes door-open {
  from { transform: rotateY(-70deg) translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  dialog[open] .door { animation: none; }
}

.back-link {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px 0 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.back-link:hover { color: var(--gold-hover); }

/* Book page (note, trope, blurb, chapter) */
.page {
  flex: 1;
  background: var(--paper);
  color: var(--paper-text);
  border-radius: 6px;
  padding: 44px 30px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page .kicker { color: var(--paper-heading); }
.page-title-script {
  margin: 18px 0 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 50px;
  line-height: 1;
  color: var(--ornament);
  text-align: center;
}
.page .divider { margin-top: 26px; }
.page-quote {
  margin: 22px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: 29px;
  line-height: 1.36;
  text-align: center;
}
.page-quote:first-of-type { margin-top: 44px; }
.page-signature {
  margin: 40px 0 0;
  font-size: 15px;
  color: var(--paper-soft);
  text-align: center;
}
.page-number {
  margin: auto 0 0;
  padding-top: 24px;
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--paper-heading);
  text-align: center;
}

/* Ink: the quote and signature of a note write themselves (src/client/ink.ts) */
.ink-pending .page-quote,
.ink-pending .page-signature { visibility: hidden; }
.ink-line {
  display: block;
  white-space: nowrap;
  clip-path: inset(-0.2em 100% -0.2em -0.1em);
  animation: ink-write var(--ink-duration) cubic-bezier(0.3, 0, 0.3, 1) var(--ink-delay) forwards;
}
@keyframes ink-write {
  to { clip-path: inset(-0.2em -0.1em -0.2em -0.1em); }
}
.ink-run .page-signature {
  opacity: 0;
  animation: ink-fade 400ms ease var(--ink-end) forwards;
}
@keyframes ink-fade {
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ink-line,
  .ink-run .page-signature { animation: none; }
  /* The effect is not started with reduced motion; if the setting flips mid-way, nothing may stay hidden. */
  .ink-pending .page-quote,
  .ink-pending .page-signature { visibility: visible; }
  .ink-line { clip-path: none; }
  .ink-run .page-signature { opacity: 1; }
}

/* Chapter variant */
.page-chapter { padding-top: 40px; align-items: stretch; }
.chapter-title {
  margin: 18px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--paper-text);
  text-align: center;
}
.chapter-part {
  margin: 10px 0 0;
  font-family: var(--font-script);
  font-size: 34px;
  line-height: 1;
  color: var(--ornament);
  text-align: center;
}
.page-chapter .divider { margin-top: 22px; }
.chapter-text {
  margin: 16px 0 0;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.62;
}
.chapter-text:first-of-type { margin-top: 30px; }
.drop-cap {
  float: left;
  font-weight: 700;
  font-size: 62px;
  line-height: 0.82;
  padding: 6px 8px 0 0;
  color: var(--ornament);
}
.chapter-footer {
  margin: 30px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 15px;
  color: var(--paper-heading);
  text-align: center;
}

/* Envelope */
.door-envelope { padding-bottom: 32px; }
.envelope {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 0;
}
.envelope-title {
  margin: 18px 0 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  color: var(--pink);
  text-align: center;
}
.envelope-stage { position: relative; margin-top: 12px; max-width: 100%; }
.envelope-art { display: block; max-width: 100%; height: auto; }
.envelope-cta {
  margin: 30px 0 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  text-align: center;
}
.envelope-cta em { font-style: italic; color: var(--gold); }
.envelope-text {
  margin: 18px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.45;
  text-align: center;
}
.envelope-signature {
  margin: 24px 0 0;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

/* Envelope seal (design screens 8 to 10). Every transition hangs off data-state="open"; the sealed values are the start. */
.seal-button {
  position: absolute;
  left: 50%;
  top: 72.3%;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seal-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.seal-hint {
  margin: 34px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}
.seal-note {
  margin: 14px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}
.envelope-title:focus { outline: none; }
.envelope-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.env-seal-left,
.env-seal-right,
.env-seal-press,
.env-seal-ring circle {
  transform-box: fill-box;
  transform-origin: center;
}
.env-flap-closed { transform-box: fill-box; transform-origin: 50% 0; }
.env-flap-open { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.env-card { transform: translateY(92px); }
.env-seal-ring circle { animation: seal-pulse 1.8s ease-in-out infinite; }

.envelope[data-state="open"] .env-seal-press { animation: seal-press 120ms ease-out; }
.envelope[data-state="open"] .env-seal-left {
  transform: translate(-13px, 14px) rotate(-17deg);
  opacity: 0;
  transition: transform 350ms ease-in 120ms, opacity 350ms ease-in 120ms;
}
.envelope[data-state="open"] .env-seal-right {
  transform: translate(14px, 22px) rotate(15deg);
  opacity: 0;
  transition: transform 350ms ease-in 120ms, opacity 350ms ease-in 120ms;
}
.envelope[data-state="open"] .env-seal-ring { opacity: 0; transition: opacity 120ms linear; }
.envelope[data-state="open"] .env-seal-ring circle { animation: none; }
.envelope[data-state="open"] .env-flap-closed { transform: scaleY(0); transition: transform 180ms ease-in 300ms; }
.envelope[data-state="open"] .env-flap-open { transform: scaleY(1); transition: transform 220ms ease-out 480ms; }
.envelope[data-state="open"] .env-card {
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.3, 1.15) 620ms;
}
.envelope-reveal { animation: envelope-reveal 300ms ease-out calc(1000ms + var(--i) * 120ms) both; }

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes seal-press {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes envelope-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.envelope.is-instant *,
.envelope.is-instant *::before,
.envelope.is-instant *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .envelope *,
  .envelope *::before,
  .envelope *::after { transition: none !important; animation: none !important; }
}

/* Locked */
.door-locked {
  align-items: center;
  gap: 0;
  padding: 28px 32px 40px;
}
.lock-badge {
  margin-top: 132px;
  width: 132px;
  height: 132px;
  border-radius: 66px;
  background: var(--cell-plum);
  display: flex;
  align-items: center;
  justify-content: center;
}
.door-locked .kicker { margin-top: 40px; }
.locked-title {
  margin: 16px 0 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.12;
  text-align: center;
}
.locked-message {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.locked-sleeps {
  margin: 28px 0 0;
  padding: 10px 22px;
  border-radius: 22px;
  border: 1px solid var(--gold);
  font-family: var(--font-title);
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
}
.door-locked .pill-button { margin-top: auto; }
.door-locked .locked-spacer { flex: 1; min-height: 32px; }

@media (max-height: 700px) {
  .lock-badge { margin-top: 48px; }
}

/* Splash layer (#splash, inline in index.html): only for the installed app, never in a normal tab. */
#splash {
  display: none;
}

@media (display-mode: standalone) {
  #splash {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--wine);
    opacity: 1;
    transition: opacity 250ms ease;
    /* CSS-only fail-safe for when main.js never runs: hide after 6 s (JS normally removes it at ~1 s). */
    animation: splash-failsafe 1ms 6s forwards;
  }
  #splash svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  #splash.is-hiding {
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes splash-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (display-mode: standalone) and (prefers-reduced-motion: reduce) {
  #splash { transition: none; }
}

/* "Morning notes" card (below the calendar grid) ---------------------------- */

.push-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 24px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--paper-text);
  text-align: center;
}
.push-card[hidden] { display: none; }
.push-card-title {
  margin: 0;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: var(--paper-heading);
}
.push-card-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.push-card-text:focus { outline: none; }
.push-card-error {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ornament);
}
.push-card-error[hidden] { display: none; }
.push-card-button {
  min-width: 44px;
  min-height: 48px;
  padding: 0 24px;
  border: 2px solid var(--berry);
  border-radius: 24px;
  background: var(--berry);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.push-card-button[hidden] { display: none; }
.push-card-button:hover { background: var(--ornament); border-color: var(--ornament); }
.push-card-button:disabled { opacity: 0.7; cursor: progress; }
.push-card-button-quiet {
  background: transparent;
  border-color: var(--paper-heading);
  color: var(--paper-heading);
}
.push-card-button-quiet:hover { background: var(--envelope-flap); border-color: var(--paper-heading); }
.push-card :focus-visible { outline-color: var(--paper-heading); }

/* Gold dust (last child of .calendar; decorative, never takes a tap) ------------- */

.dust { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.dust i {
  position: absolute; top: -8px; left: var(--left);
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--gold); opacity: 0; will-change: transform;
  animation: dust-fall var(--dur) linear var(--delay) infinite;
}
.dust i.cream { background: var(--cream); }
@keyframes dust-fall {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  8%, 92% { opacity: var(--alpha); }
  100% { transform: translate3d(var(--drift), calc(100dvh + 16px), 0); opacity: 0; }
}
body:has(dialog[open]) .dust i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .dust { display: none; } }
