/* =========================================================================
   Reading quests. Each season sets its own colours; everything else shares
   the site's hero, torn edges, cards and buttons (content.css).
   ========================================================================= */

[data-season] {
  --q-from: #212771; --q-to: #bf3765; --q-accent: #bf3765; --q-accent-ink: #9c2a50;
  --q-soft: #fbe9ef; --q-bar: linear-gradient(90deg, #bf3765, #ffc93c); --q-overlay: 0.82;
}
[data-season="summer"] {
  --q-from: #0b5f8a; --q-to: #14a3b8; --q-accent: #0e8fa3; --q-accent-ink: #0a6a79;
  --q-soft: #e3f6f8; --q-bar: linear-gradient(90deg, #14a3b8, #ffc93c);
}
[data-season="halloween"] {
  --q-from: #241344; --q-to: #c2410c; --q-accent: #d9540f; --q-accent-ink: #a13c07;
  --q-soft: #fdeee2; --q-bar: linear-gradient(90deg, #6b2fa3, #f97316);
}
[data-season="christmas"] {
  --q-from: #1b2a6b; --q-to: #b3202f; --q-accent: #b3202f; --q-accent-ink: #8f1824;
  --q-soft: #fbe7e9; --q-bar: linear-gradient(90deg, #1f7a45, #d13a3a);
}
[data-season="easter"] {
  --q-from: #5b3bb5; --q-to: #e0679a; --q-accent: #7c4ddb; --q-accent-ink: #5b35a8;
  --q-soft: #f1ebfd; --q-bar: linear-gradient(90deg, #8b6cf0, #f59ac0);
}

/* ---------------- hero ---------------- */
.q-hero {
  position: relative; overflow: hidden;
  padding: 80px 24px 110px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--q-from) calc(var(--q-overlay) * 100%), transparent) 0%,
                            color-mix(in srgb, var(--q-to) calc(var(--q-overlay) * 100%), transparent) 100%),
    var(--q-image, none) center / cover no-repeat,
    linear-gradient(180deg, var(--q-from), var(--q-to));
  color: #fff; text-align: center;
}
.q-hero h1 { max-width: 900px; margin: 0 auto; color: #fff; font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 800; line-height: 1.05; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18); }
.q-hero .c-pill { color: var(--q-accent-ink); }
.q-hero__status { margin-top: 18px; }
.q-hero .c-actions { margin-top: 24px; }
.q-btn-light { border-color: #fff; background: #fff; color: var(--q-accent-ink); }
.q-btn-light:hover { background: #fff8e3; border-color: #fff8e3; }
.q-btn-ghost { border-color: rgba(255, 255, 255, 0.85); background: transparent; color: #fff; }
.q-btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.q-hero .c-btn:focus-visible { outline-color: #fff; }

/* floating seasonal icons */
.q-deco { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.q-deco span { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); color: rgba(255, 255, 255, 0.5); animation: q-float 7s ease-in-out var(--d) infinite; }
.q-deco svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes q-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(5deg); } }
@media (max-width: 700px) { .q-deco span:nth-child(n + 4) { display: none; } }

/* status chips */
.q-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #3b3f45; font-size: 0.9rem; font-weight: 800; }
.q-chip--live { background: #fff; color: #2f6b12; }
.q-chip--live i { width: 9px; height: 9px; border-radius: 50%; background: #3fae2a; box-shadow: 0 0 0 0 rgba(63, 174, 42, 0.6); animation: q-live 1.8s ease-out infinite; }
.q-chip--done { background: #fff4d6; color: #7a5400; }
@keyframes q-live { to { box-shadow: 0 0 0 9px rgba(63, 174, 42, 0); } }

/* ---------------- panels, progress ---------------- */
.q-hero { z-index: 1; }
.q-main { z-index: 2; padding-top: 0; }
.q-panel { padding: 30px 34px; border-radius: 26px; background: #fff; box-shadow: 0 14px 34px rgba(33, 39, 113, 0.09); }
.q-panel--progress { position: relative; z-index: 4; margin-top: -64px; }
.q-center-h { margin-top: 64px; text-align: center; }
.q-sub { max-width: 640px; margin: -14px auto 28px; text-align: center; font-size: 1.05rem; line-height: 1.6; }

.q-progress__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; }
.q-progress__label { margin: 0; color: #6b7178; font-weight: 700; }
.q-progress__count { margin: 2px 0 0; color: #2f3437; font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.q-progress__count small { font-size: 0.4em; font-weight: 700; color: #6b7178; }
.q-progress__goal { margin: 0; color: #6b7178; font-weight: 700; }
.q-progress__goal strong { color: var(--q-accent-ink); font-size: 1.5rem; }
.q-progress__next { margin: 26px 0 0; font-size: 1.05rem; }
.q-progress__next strong { color: var(--q-accent-ink); }
.q-progress__updated { margin: 6px 0 0; color: #6b7178; font-size: 0.88rem; }

.q-bar { position: relative; height: 22px; margin: 22px 0 26px; border-radius: 999px; background: #eceef3; }
.q-bar__fill { position: absolute; inset: 0 auto 0 0; width: var(--pct); border-radius: inherit; background: var(--q-bar); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08); }
.q-bar__tick { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #c9cdd8; }
.q-bar__tick.is-done { background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.q-bar__tick span { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); color: #6b7178; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.q-bar__tick:last-child span { transform: translateX(-85%); }
.q-progress--compact .q-bar { height: 12px; margin: 12px 0 22px; }
.q-progress--compact .q-progress__count { font-size: 2rem; }
.q-progress--compact .q-progress__goal strong { font-size: 1.1rem; }

/* animation, set up by quests.js only */
.q-anim .q-bar__fill { width: 0; transition: width 1600ms cubic-bezier(.3, .8, .3, 1) 200ms; }
.q-anim.is-in .q-bar__fill { width: var(--pct); }

/* ---------------- milestones ---------------- */
.q-miles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.q-mile { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 18px 22px; border: 2px dashed #d8dbe4; border-radius: 22px; background: #fff; text-align: center; }
.q-mile__gem { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #eceef3; color: #9aa0ab; }
.q-gem { width: 34px; height: 34px; fill: currentColor; fill-opacity: 0.25; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.q-mile__gems { margin-top: 6px; color: #2f3437; font-size: 1.35rem; font-weight: 800; }
.q-mile__at { color: #6b7178; font-weight: 700; }
.q-mile__label { font-size: 0.92rem; }
.q-mile__state { margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: #eceef3; color: #5a6068; font-size: 0.85rem; font-weight: 800; }
.q-mile.is-unlocked { border: 2px solid var(--q-accent); background: var(--q-soft); }
.q-mile.is-unlocked .q-mile__gem { background: var(--q-accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--q-accent) 35%, transparent); }
.q-mile.is-unlocked .q-gem { fill-opacity: 0.35; }
.q-mile.is-unlocked .q-mile__state { background: #3fae2a; color: #fff; }
.q-anim:not(.is-in) .q-mile.is-unlocked .q-mile__gem { opacity: 0; }
.q-anim.is-in .q-mile.is-unlocked .q-mile__gem { animation: q-pop 600ms cubic-bezier(.3, 1.6, .5, 1) calc(900ms + var(--i) * 180ms) both; }
@keyframes q-pop { from { transform: scale(0.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- countdown + calendar ---------------- */
.q-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; margin-top: 56px; align-items: start; }
.q-count__label { margin: 0 0 16px; color: #2f3437; font-size: 1.25rem; font-weight: 800; }
.q-count__units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.q-count__units span { display: grid; gap: 2px; padding: 14px 6px; border-radius: 16px; background: var(--q-soft); color: #5a6068; font-size: 0.82rem; font-weight: 700; text-align: center; }
.q-count__units b { color: var(--q-accent-ink); font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.q-count--done p { margin: 0 0 6px; }
.q-art { display: block; width: 100%; max-width: 300px; height: auto; margin: 26px auto 0; }

.q-cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 14px; }
.q-cal__month { max-width: 360px; }
.q-cal__name { margin: 0 0 8px; color: #2f3437; font-weight: 800; }
.q-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
/* calendar text colours darkened for WCAG 1.4.3: day letters #9aa0ab (2.6:1) → #646a71,
   days outside the quest #c3c7d0 (1.7:1) → #6b7178, done days white on the darker season
   accent (summer's #0e8fa3 was 3.8:1) */
.q-cal__dow { color: #646a71; font-size: 0.75rem; font-weight: 800; text-align: center; }
.q-cal__day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 9px; font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.q-cal__day--out { color: #6b7178; }
.q-cal__day--ahead { background: var(--q-soft); color: var(--q-accent-ink); }
.q-cal__day--done { background: var(--q-accent-ink); color: #fff; }
.q-cal__day--today { background: #ffc93c; color: #2f3437; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #ffc93c; }
.q-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 16px 0 0; color: #6b7178; font-size: 0.85rem; font-weight: 700; }
.q-legend .q-cal__day { display: inline-block; width: 14px; height: 14px; margin-right: -8px; border-radius: 4px; box-shadow: none; }

/* ---------------- how it works ---------------- */
.q-intro { max-width: 760px; margin: -8px auto 32px; }
.q-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.q-steps li { padding: 26px 24px; border-radius: 22px; background: #fff; box-shadow: 0 10px 26px rgba(33, 39, 113, 0.08); }
.c-sec:not(.c-sec--grey) .q-steps li { background: #f7f7fa; box-shadow: none; }
.q-steps svg { width: 44px; height: 44px; padding: 9px; border-radius: 14px; background: var(--q-soft, #fbe9ef); color: var(--q-accent-ink, #9c2a50); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.q-steps h3 { margin: 14px 0 6px; color: #2f3437; font-size: 1.2rem; font-weight: 800; }
.q-steps h3::before { counter-increment: step; content: counter(step) ". "; color: var(--q-accent-ink, #9c2a50); }
.q-steps p { margin: 0; line-height: 1.6; }
.q-reads { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; }
.q-reads li { padding: 8px 16px; border-radius: 999px; background: var(--q-soft, #fbe9ef); color: var(--q-accent-ink, #9c2a50); font-weight: 800; }
.q-why { max-width: 720px; margin: 30px auto 0; text-align: center; font-size: 1.05rem; line-height: 1.65; }
.q-results { margin-top: 40px; padding: 30px 34px; border: 2px solid #ffc93c; border-radius: 24px; background: #fff8e3; }
.q-results + .q-panel--progress { margin-top: 24px; }

/* ---------------- resources ---------------- */
.q-res { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.q-res a { display: flex; align-items: center; gap: 14px; min-width: 240px; padding: 18px 22px; border-radius: 18px; background: #fff; color: #2f3437; text-decoration: none; box-shadow: 0 10px 26px rgba(33, 39, 113, 0.08); transition: transform 150ms ease; }
.q-res a:hover { transform: translateY(-3px); }
.q-res svg { flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 12px; background: var(--q-accent, #bf3765); color: #fff; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.q-res strong { display: block; }
.q-res small { color: #6b7178; font-weight: 600; }
.q-all { margin: 26px 0 0; text-align: center; }

/* ---------------- index page ---------------- */
.q-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); overflow: hidden; border-radius: 26px; background: #fff; box-shadow: 0 14px 34px rgba(33, 39, 113, 0.09); }
.q-feature__art { position: relative; min-height: 300px; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--q-from) 55%, transparent), color-mix(in srgb, var(--q-to) 55%, transparent)), var(--q-image, none) center / cover, linear-gradient(160deg, var(--q-from), var(--q-to)); }
.q-feature__body { display: grid; align-content: center; justify-items: start; gap: 10px; padding: 34px 38px; }
.q-feature__body h3 { margin: 4px 0 0; font-size: 1.8rem; font-weight: 800; line-height: 1.15; }
.q-feature__body h3 a { color: #2f3437; text-decoration: none; }
.q-feature__body p { margin: 0; line-height: 1.6; }
.q-feature__body .q-progress { width: 100%; }
.q-feature .q-chip { background: var(--q-soft); color: var(--q-accent-ink); }

.q-seasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.q-season { position: relative; display: grid; justify-items: center; gap: 4px; padding: 28px 18px 24px; overflow: hidden; border-radius: 24px; background: linear-gradient(160deg, var(--q-from), var(--q-to)); color: #fff; text-align: center; text-decoration: none; transition: transform 160ms ease; }
a.q-season:hover { transform: translateY(-4px); }
.q-season__icon { width: 58px; height: 58px; margin-bottom: 6px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.q-season__name { font-size: 1.45rem; font-weight: 800; }
.q-season__when { opacity: 0.9; font-weight: 600; }
.q-season__status { margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #2f3437; font-size: 0.85rem; font-weight: 800; }
.q-season:focus-visible { outline: 3px solid #2f3437; outline-offset: 3px; }

.q-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 14px 34px rgba(33, 39, 113, 0.09); }
.q-card__top { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 120px; padding: 16px 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--q-from) 70%, transparent), color-mix(in srgb, var(--q-to) 70%, transparent)), var(--q-image, none) center / cover, linear-gradient(160deg, var(--q-from), var(--q-to)); color: #fff; text-decoration: none; }
.q-card__icon { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.q-card__season { font-weight: 800; }
.q-card__top .q-chip { padding: 4px 10px; font-size: 0.8rem; }
.q-card__body { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px 18px; }
.q-card__body p { margin: 0; line-height: 1.55; }
.q-card__title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.q-card__title a { color: #2f3437; text-decoration: none; }
.q-card__title a:hover { color: var(--q-accent-ink); }
.q-card__dates { color: var(--q-accent-ink); font-weight: 700; }
.q-card__goal { color: #6b7178; font-weight: 700; }

@media (max-width: 960px) {
  .q-seasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-when { grid-template-columns: 1fr; }
  .q-feature { grid-template-columns: 1fr; }
  .q-feature__art { min-height: 180px; }
}
@media (max-width: 600px) {
  .q-hero { padding: 60px 20px 100px; }
  .q-panel { padding: 24px 20px; border-radius: 20px; }
  .q-count__units { gap: 6px; }
  .q-feature__body { padding: 26px 22px; }
  .q-seasons { gap: 12px; }
  .q-season { padding: 22px 12px 18px; }
  .q-season__icon { width: 44px; height: 44px; }
  .q-season__name { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .q-deco span, .q-chip--live i { animation: none; }
  .q-anim .q-bar__fill { transition: none; }
  .q-anim .q-mile.is-unlocked .q-mile__gem { animation: none; opacity: 1; }
}

/* ---------------- plan ahead: every upcoming quest ---------------- */
.q-plan { display: grid; gap: 16px; max-width: 900px; margin: 30px auto 0; padding: 0; list-style: none; }
.q-plan__item { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 18px 22px 18px 18px; border-radius: 22px; background: #fff; box-shadow: 0 14px 34px rgba(33, 39, 113, 0.09); }
.q-plan__badge { display: grid; justify-items: center; align-content: center; gap: 6px; height: 100%; min-height: 112px; padding: 14px 8px; border-radius: 16px; background: linear-gradient(160deg, var(--q-from), var(--q-to)); color: #fff; font-size: 0.85rem; font-weight: 800; text-align: center; }
.q-plan__icon { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.q-plan__body h3 { margin: 4px 0 0; font-size: 1.25rem; line-height: 1.25; }
.q-plan__body h3 a { color: #2f3437; text-decoration: none; }
.q-plan__body h3 a:hover { color: var(--q-accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.q-plan__body p { margin: 6px 0 0; font-size: 0.97rem; line-height: 1.5; }
.q-plan__when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 !important; color: var(--q-accent-ink); }
.q-plan__when span { padding: 3px 10px; border-radius: 999px; background: var(--q-soft); font-size: 0.8rem; font-weight: 800; }
.q-plan__goal { color: #6b7178; }
.q-plan__goal strong { color: #2f3437; }
.q-plan__actions { display: grid; justify-items: stretch; gap: 8px; }
.q-plan__cal { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--q-accent-ink); font-size: 0.9rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.q-plan__cal:hover { background: var(--q-soft); }
.q-calicon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.q-plan__all { margin: 26px 0 0; text-align: center; }
.q-plan__all .c-btn { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .q-plan__item { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .q-plan__badge { grid-auto-flow: column; justify-content: start; min-height: 0; height: auto; padding: 10px 14px; }
  .q-plan__icon { width: 30px; height: 30px; }
  .q-plan__actions { grid-template-columns: 1fr 1fr; }
}

/* what the quest counts, under the progress bar */
.q-counts { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed #e1e3ea; font-size: 0.95rem; line-height: 1.5; }
.q-counts span { display: inline-block; margin-right: 6px; padding: 2px 10px; border-radius: 999px; background: var(--q-soft); color: var(--q-accent-ink); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
