/* ==========================================================================
   VISIONFI HOLIDAY THEME — "Scout checks it twice"
   usage: <link rel="stylesheet" href="/assets/visionfi-holiday.css">
          <script src="/assets/visionfi-holiday.js"></script>   (in <head>)

   Shared by scoutnotebook.com and visionfi.ai. Nothing here applies until
   visionfi-holiday.js puts `holiday` on <html>, which it does only inside the
   season window it defines (or with ?holiday=on). Out of season the only rule
   that bites is `.holiday-only { display: none }`, so the markup can stay in
   the pages year-round.

   AUTHORED HERE: shared/visionfi-holiday.css. The copies under public/assets/
   and public/scout/assets/ are generated — run scripts/sync-shared-css.sh.

   Palette is the logo's: Scout orange leads, the scarf's green and the hat's
   red stay small, cream for highlights.
   ========================================================================== */

:root {
    --holiday-red: #c8202f;
    --holiday-green: #1f6b3a;
    --holiday-gold: #f2b705;
    --holiday-cream: #fbf3e0;
}

.holiday-only { display: none; }
html.holiday .holiday-only { display: revert; }

/* ---- Brand mark ---------------------------------------------------------
   The Santa-hat mark is taller than it is wide; contain it in the same box
   and let it run a little larger so the face doesn't shrink under the hat. */
html.holiday .brandmark { object-fit: contain; width: 40px; height: 40px; margin-top: -6px; }
@media (max-width: 860px) {
    html.holiday .brandmark { width: 32px; height: 32px; margin-top: -4px; }
}

/* ---- String of lights under the masthead -------------------------------- */
.holiday-lights {
    position: absolute; left: 0; right: 0; top: 100%; height: 18px;
    display: flex; justify-content: space-between; padding: 0 14px;
    pointer-events: none; overflow: hidden;
}
.holiday-lights::before {
    content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 14px;
    background: radial-gradient(ellipse 24px 9px at 50% 0, transparent 7px,
                rgba(31,107,58,.55) 7.5px, rgba(31,107,58,.55) 8.5px, transparent 9px)
                0 0 / 48px 14px repeat-x;
}
.holiday-bulb {
    position: relative; width: 7px; height: 11px; margin-top: 1px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: var(--bulb); box-shadow: 0 1px 6px 1px var(--bulb);
    animation: holiday-blink 5.4s ease-in-out infinite;
    animation-delay: calc(var(--i) * .18s);
}
.holiday-bulb::before {
    content: ""; position: absolute; left: 1px; right: 1px; top: -3px; height: 3px;
    background: #3b4a3f; border-radius: 1px;
}
.holiday-bulb:nth-child(3n+1) { --bulb: var(--holiday-red); }
.holiday-bulb:nth-child(3n+2) { --bulb: var(--holiday-gold); }
.holiday-bulb:nth-child(3n)   { --bulb: #2fa35a; }
.holiday-bulb:nth-child(even) { margin-top: 4px; }
@keyframes holiday-blink {
    0%, 86%, 100% { opacity: 1; }
    92%           { opacity: .2; box-shadow: none; }
}

/* ---- Hero snow ----------------------------------------------------------
   The canvas is added by the script to any element marked data-holiday-snow,
   and never under prefers-reduced-motion. */
html.holiday [data-holiday-snow] { position: relative; overflow: hidden; }
html.holiday [data-holiday-snow] > .wrap { position: relative; z-index: 1; }
.holiday-snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---- Hero Scout ---------------------------------------------------------
   Sits on the right of the masthead, perched on its branch. The three glows
   are laid over the bulbs on the branch and take turns lighting. */
.holiday-hero {
    position: absolute; right: max(28px, calc((100% - var(--wrap-max)) / 2 + 28px));
    bottom: -6px; width: clamp(190px, 19vw, 250px); margin: 0; z-index: 1;
}
.holiday-hero img { display: block; width: 100%; height: auto;
    filter: drop-shadow(0 10px 18px rgba(26,28,31,.14)); }
.holiday-glow {
    position: absolute; width: 9%; aspect-ratio: 1; border-radius: 50%;
    transform: translate(-50%, -50%); background: var(--bulb);
    filter: blur(7px); opacity: 0; mix-blend-mode: screen;
    animation: holiday-glow 3.6s ease-in-out infinite;
}
.holiday-glow--red    { --bulb: #ff4b55; left: 69.6%; top: 73.6%; animation-delay: 0s; }
.holiday-glow--gold   { --bulb: #ffd23a; left: 81.9%; top: 73.2%; animation-delay: 1.2s; }
.holiday-glow--green  { --bulb: #52e07f; left: 93%;   top: 70.2%; animation-delay: 2.4s; }
@keyframes holiday-glow {
    0%, 40%, 100% { opacity: 0; }
    15%, 25%      { opacity: .95; }
}
html.holiday [data-holiday-hero] > .wrap { padding-right: clamp(210px, 21vw, 280px); }
@media (max-width: 860px) {
    .holiday-hero { width: 128px; bottom: -4px; right: 12px; }
    html.holiday [data-holiday-hero] > .wrap { padding-right: 28px; padding-bottom: 150px; }
}

/* ---- Season's note ------------------------------------------------------ */
html.holiday .holiday-note {
    display: inline-flex; align-items: center; gap: 10px; justify-self: start;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
    color: var(--holiday-green); background: rgba(255,255,255,.72);
    border: 1px solid rgba(31,107,58,.22); border-radius: 999px; padding: 7px 14px 7px 10px;
}
.holiday-note::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--holiday-red); box-shadow: 0 0 0 3px rgba(200,32,47,.15);
}

/* ---- The Nice List -------------------------------------------------------
   A sample file reviewed twice: each row gets a first-pass and a second-pass
   mark, one row after another, once the list scrolls into view. One row is
   on the naughty side, because flagging exceptions is the point. */
.nice-list-band {
    border-bottom: 1px solid var(--color-border);
    background:
        linear-gradient(90deg, rgba(31,107,58,.06) 0 1px, transparent 1px) 0 0 / 18px 18px,
        linear-gradient(rgba(200,32,47,.05) 0 1px, transparent 1px) 0 0 / 18px 18px,
        var(--holiday-cream);
}
.nice-list-band .wrap { padding-top: 72px; padding-bottom: 76px; display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.nice-list-band .eyebrow { color: var(--holiday-green); }
.nice-list-band h2 { max-width: 16ch; margin-bottom: 14px; }
.nice-list-band .lede { max-width: 46ch; }
.nice-list {
    background: #fff; border: 1px solid #eadfc6; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float); padding: 8px 0 0; overflow: hidden;
}
.nice-list__head, .nice-list__row {
    display: grid; grid-template-columns: 1fr 52px 52px; gap: 8px; align-items: center;
    padding: 12px 22px;
}
.nice-list__head {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--color-text-dim); border-bottom: 1px solid var(--color-border);
}
.nice-list__head span:not(:first-child) { text-align: center; }
.nice-list__row { font-size: 14px; color: var(--color-ink); border-bottom: 1px dashed #efe7d3; }
.nice-list__row small { display: block; font-size: 12px; color: var(--color-text-light); margin-top: 2px; }
.nice-list__mark {
    justify-self: center; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; font-weight: 700; line-height: 1;
    background: rgba(31,107,58,.12); color: var(--holiday-green);
    transform: scale(.4); opacity: 0;
    transition: transform .28s cubic-bezier(.3,1.6,.5,1), opacity .2s;
}
.nice-list__mark--2 { transition-delay: calc(var(--i) * .32s + 1.9s); }
.nice-list__mark--1 { transition-delay: calc(var(--i) * .32s); }
.nice-list__row--flag .nice-list__mark { background: rgba(200,32,47,.12); color: var(--holiday-red); }
.nice-list__row--flag strong { color: #a3192a; }
.nice-list__foot {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 22px; background: #fcf8ee;
    font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--color-text-light);
    opacity: 0; transition: opacity .4s 3.8s;
}
.nice-list__foot b { color: var(--holiday-green); }
.nice-list.is-checking .nice-list__mark { transform: none; opacity: 1; }
.nice-list.is-checking .nice-list__foot { opacity: 1; }
@media (max-width: 860px) {
    .nice-list-band .wrap { grid-template-columns: 1fr; gap: 32px; padding-top: 52px; padding-bottom: 56px; }
    .nice-list__head, .nice-list__row { padding: 11px 16px; grid-template-columns: 1fr 40px 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .holiday-bulb, .holiday-glow { animation: none; }
    .holiday-glow { opacity: .55; }
    .nice-list__mark, .nice-list__foot { transition: none; transform: none; opacity: 1; }
}
