/* AutoCrit Winter Wonderland – standalone calendar page */

/* ---------- page ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #FAFCFE; color: #182030;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.ww-modal-open { overflow: hidden; }
.ww-page { max-width: 640px; margin: 0 auto; padding: 32px 16px 56px; display: flex; flex-direction: column; gap: 24px; }
.ww-pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ww-pagehead-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ww-logo { width: 130px; height: auto; display: block; margin-bottom: 8px; }
.ww-page-eyebrow { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: #234A8A; }
.ww-page h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 700; color: #182030; }
.ww-lead { margin: 0; font-size: 16px; line-height: 1.6; color: #445066; }
.ww-pagehead-art { flex: 0 0 180px; position: relative; aspect-ratio: 1 / 1; margin: 0 auto; }
.ww-pagehead-art::before { content: ""; position: absolute; inset: 8% 4% 0; border-radius: 50%; background: #DCE8F5; }
.ww-pagehead-art img { position: relative; width: 100%; height: auto; display: block; }
.ww-noscript { grid-column: 1 / -1; padding: 16px; border-radius: 10px; background: #FFF7D6; color: #4A3800; font-size: 14px; line-height: 20px; }
@media (max-width: 480px) {
  .ww-page { padding-top: 24px; gap: 18px; }
  .ww-page h1 { font-size: 27px; }
  .ww-pagehead-art { flex-basis: 140px; }
}


#ww-cal, #ww-cal-modal {
  --ww-ground:#DCE8F5; --ww-label:#234A8A; --ww-head:#182030; --ww-tile:#EEF4FA; --ww-tileLine:#B9CBE3; --ww-tileText:#234A8A;
  --ww-today:#C4161C; --ww-todayText:#FEFFFE; --ww-band:#DCE8F5; --ww-halo:#FEFFFE; --ww-day:#C4161C; --ww-btn:#C4161C; --ww-btnText:#FEFFFE;
  --ww-sans: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ww-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
#ww-cal[data-palette="snowfall"], #ww-cal-modal[data-palette="snowfall"] { --ww-ground:#FAFCFE; --ww-label:#2F5DA8; --ww-tile:#E8F0F8; --ww-tileLine:#C9D8EB; --ww-band:#E8F0F8; }
#ww-cal[data-palette="frost"], #ww-cal-modal[data-palette="frost"] { --ww-ground:#182030; --ww-label:#C9D3E6; --ww-head:#FEFFFE; --ww-tile:#233150; --ww-tileLine:#34446A; --ww-tileText:#C9D3E6; --ww-today:#ED1C24; --ww-band:#182030; --ww-halo:#233150; --ww-day:#ED1C24; --ww-btn:#182030; }
#ww-cal[data-palette="pine"], #ww-cal-modal[data-palette="pine"] { --ww-ground:#0F5736; --ww-label:#DCE8F5; --ww-head:#FEFFFE; --ww-tile:#156A43; --ww-tileLine:#2A7D55; --ww-tileText:#DCE8F5; --ww-today:#FEFFFE; --ww-todayText:#0F5736; --ww-band:#0F5736; --ww-halo:#DCE8F5; --ww-day:#FEFFFE; --ww-btn:#0F5736; }

/* ---------- calendar ---------- */
#ww-cal, #ww-cal * { box-sizing: border-box; }
#ww-cal {
  width: 100%; margin: 0; padding: 28px 24px;
  background: var(--ww-ground); border-radius: 16px;
  font-family: var(--ww-sans); color: var(--ww-head); text-align: left;
  display: flex; flex-direction: column; gap: 18px;
}
#ww-cal [hidden] { display: none !important; }
#ww-cal .ww-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
#ww-cal .ww-eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--ww-label); }
#ww-cal .ww-title { margin: 0; font-size: 21px; line-height: 30px; font-weight: 600; color: var(--ww-head); }
#ww-cal .ww-daycount { font-family: var(--ww-mono); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ww-label); white-space: nowrap; }
#ww-cal .ww-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
#ww-cal .ww-loading { grid-column: 1 / -1; font-size: 14px; line-height: 20px; color: var(--ww-label); padding: 24px 0; }

#ww-cal .ww-tile {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: none; box-shadow: none; outline-offset: 2px;
  width: 100%; aspect-ratio: 1 / 1; height: auto; min-height: 0; border-radius: 10px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--ww-sans); text-transform: none; letter-spacing: normal; line-height: 1;
}
#ww-cal button.ww-tile { cursor: pointer; transition: transform .15s ease; }
#ww-cal button.ww-tile:hover { transform: translateY(-2px); }
#ww-cal button.ww-tile:focus-visible { outline: 3px solid var(--ww-label); }

#ww-cal .ww-locked { background: var(--ww-tile); border: 1px solid var(--ww-tileLine); }
#ww-cal .ww-locked .ww-n { font-size: clamp(14px, 3.6vw, 22px); line-height: 1.2; font-weight: 600; color: var(--ww-tileText); }

#ww-cal .ww-ready { background: var(--ww-today); color: var(--ww-todayText); }
#ww-cal .ww-ready .ww-n { font-size: clamp(16px, 4.6vw, 28px); line-height: 1.15; font-weight: 700; color: var(--ww-todayText); }
#ww-cal .ww-ready .ww-open { font-size: clamp(8px, 1.8vw, 11px); line-height: 1.3; font-weight: 700; letter-spacing: .08em; color: var(--ww-todayText); }
#ww-cal .ww-ready.ww-missed { opacity: .82; }
#ww-cal .ww-ready.ww-is-today { animation: ww-pulse 2.4s ease-in-out infinite; }

#ww-cal .ww-opened { background: #FEFFFE; }
#ww-cal .ww-opened img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; margin: 0; max-width: none; border: 0; }
#ww-cal .ww-opened.ww-just-opened img { animation: ww-pop .5s cubic-bezier(.2,1.4,.4,1); }
#ww-cal .ww-corner { position: absolute; left: 5px; top: 3px; z-index: 1; font-family: var(--ww-mono); font-size: 11px; line-height: 14px; font-weight: 500; color: #182030; }

#ww-cal .ww-special { background: #FEFFFE; border: 3px solid var(--ww-tileLine); }
#ww-cal .ww-special svg { width: 55%; height: 55%; }

/* test bar (only shows while CONFIG.testMode is true) */
#ww-cal .ww-test {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px;
  background: #FFF7D6; border: 1px dashed #A07A00; color: #4A3800; font-size: 13px; line-height: 18px;
}
#ww-cal .ww-test b { font-weight: 700; }
#ww-cal .ww-test label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: inherit; color: inherit; }
#ww-cal .ww-test select, #ww-cal .ww-test button {
  font: inherit; font-size: 13px; height: 32px; min-height: 0; margin: 0; padding: 0 10px; border-radius: 6px;
  border: 1px solid #A07A00; background: #FFFFFF; color: #4A3800; cursor: pointer; text-transform: none; box-shadow: none; width: auto;
}
#ww-cal .ww-test .ww-status { flex-basis: 100%; font-size: 12px; color: #6B5300; }

@keyframes ww-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(196,22,28,.45); } 50% { box-shadow: 0 0 0 6px rgba(196,22,28,0); } }
@keyframes ww-pop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

@media (max-width: 480px) {
  #ww-cal { padding: 20px 14px; gap: 14px; }
  #ww-cal .ww-grid { gap: 5px; }
  #ww-cal .ww-title { font-size: 18px; line-height: 26px; }
  #ww-cal .ww-corner { font-size: 9px; left: 3px; top: 1px; }
  #ww-cal .ww-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #ww-cal *, #ww-cal-modal * { animation: none !important; transition: none !important; }
}

/* ---------- gift pop-up ---------- */
#ww-cal-modal, #ww-cal-modal * { box-sizing: border-box; }
#ww-cal-modal {
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(24, 32, 48, .55); font-family: var(--ww-sans); text-align: left;
  animation: ww-fade .2s ease;
}
#ww-cal-modal .ww-dialog {
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: #FEFFFE; border-radius: 16px;
  display: flex; flex-direction: column; color: #182030; box-shadow: 0 24px 48px rgba(24, 32, 48, .28);
  animation: ww-rise .28s cubic-bezier(.2,1,.4,1);
}
#ww-cal-modal .ww-band { height: 196px; flex-shrink: 0; background: var(--ww-band); position: relative; overflow: hidden; border-radius: 16px 16px 0 0; }
#ww-cal-modal .ww-band-text { position: absolute; left: 24px; top: 22px; display: flex; flex-direction: column; gap: 2px; z-index: 1; }
#ww-cal-modal .ww-eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--ww-label); }
#ww-cal-modal .ww-bigday { font-size: 64px; line-height: 68px; font-weight: 700; color: var(--ww-day); }
#ww-cal-modal .ww-mono { font-family: var(--ww-mono); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ww-label); }
#ww-cal-modal .ww-halo { position: absolute; right: 4px; top: 28px; width: 210px; height: 210px; border-radius: 50%; background: var(--ww-halo); }
#ww-cal-modal .ww-art { position: absolute; right: -14px; top: 4px; width: 230px; height: 230px; display: block; max-width: none; margin: 0; border: 0; }
#ww-cal-modal .ww-x {
  position: absolute; right: 10px; top: 10px; z-index: 2; width: 44px; height: 44px; min-height: 0; margin: 0; padding: 0;
  border: none; border-radius: 22px; background: #FEFFFE; color: #182030; box-shadow: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#ww-cal-modal .ww-body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 12px; }
#ww-cal-modal .ww-kind { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: #545B6B; text-transform: uppercase; }
#ww-cal-modal .ww-gift-title { margin: 0; font-family: var(--ww-sans); font-size: 24px; line-height: 32px; font-weight: 600; color: #182030; }
#ww-cal-modal .ww-gift-text { margin: 0; font-size: 15px; line-height: 24px; color: #545B6B; }
#ww-cal-modal .ww-cta {
  margin-top: 12px; height: 52px; border-radius: 10px; background: var(--ww-btn); color: var(--ww-btnText) !important;
  font-family: var(--ww-sans); font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: none !important;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s ease;
}
#ww-cal-modal .ww-cta:hover { filter: brightness(1.08); }
#ww-cal-modal .ww-back {
  height: 44px; min-height: 0; margin: 0; padding: 0; border: none; background: transparent; box-shadow: none;
  color: #2F5DA8; font-family: var(--ww-sans); font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; text-transform: none;
}
#ww-cal-modal .ww-back:hover { color: #182030; }
#ww-cal-modal button:focus-visible, #ww-cal-modal a:focus-visible { outline: 3px solid #2F5DA8; outline-offset: 2px; }
@keyframes ww-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ww-rise { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 480px) {
  #ww-cal-modal .ww-band { height: 168px; }
  #ww-cal-modal .ww-bigday { font-size: 52px; line-height: 56px; }
  #ww-cal-modal .ww-halo { width: 180px; height: 180px; }
  #ww-cal-modal .ww-art { width: 196px; height: 196px; right: -18px; }
  #ww-cal-modal .ww-body { padding: 20px 20px 22px; }
  #ww-cal-modal .ww-gift-title { font-size: 21px; line-height: 28px; }
}


/* ---------- background scene ---------- */
.ww-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ww-page { position: relative; z-index: 1; padding-bottom: clamp(140px, 18vw, 240px); }
.ww-snow { position: absolute; inset: -320px 0 0 0; background-repeat: repeat; }
.ww-snow-far { background-image: url("../images/snow-far.svg?v=e436ace31c2c"); background-size: 220px 220px; animation: ww-fall-far 26s linear infinite; }
.ww-snow-near { background-image: url("../images/snow-near.svg?v=44f322aadd6e"); background-size: 320px 320px; animation: ww-fall-near 16s linear infinite; }
.ww-hills { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(150px, 22vw, 320px); background: url("../images/winter-hills.svg?v=292cee762f33") center bottom / cover no-repeat; }
@keyframes ww-fall-far { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-40px, 220px, 0); } }
@keyframes ww-fall-near { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(30px, 320px, 0); } }
@media (prefers-reduced-motion: reduce) { .ww-snow { animation: none; } }

.ww-logo-light { display: none; }
#ww-cal { box-shadow: 0 20px 50px rgba(24, 32, 48, .16); }

/* Night: deep winter sky, falling snow, snowy hills */
body.theme-night { background: #0E1A36; }
.theme-night .ww-scene { background: linear-gradient(180deg, #0B1530 0%, #16305F 55%, #2A5296 100%); }
.theme-night .ww-logo-dark { display: none; }
.theme-night .ww-logo-light { display: block; }
.theme-night .ww-page-eyebrow { color: #A9C6EE; }
.theme-night .ww-page h1 { color: #FEFFFE; }
.theme-night .ww-lead { color: #D3DDEE; }
.theme-night .ww-pagehead-art::before { background: #FEFFFE; }
.theme-night #ww-cal { box-shadow: 0 24px 60px rgba(0, 0, 0, .38); }
