/* Seasonal themes for the pages that use site.css. Turned on by season.js (the setting lives
   there), which sets <html data-season="...">. Every rule here is scoped to one season, so when
   no season is active none of this applies and the site looks exactly as site.css says.
   A theme mostly overrides the colour tokens from site.css :root, then adds a few decorations.
   Decorations are pseudo-elements: pointer-events:none, no text for screen readers, and still
   when the visitor prefers reduced motion. */


/* ================================ Halloween ================================ */

html[data-season="halloween"]{
  color-scheme:dark;
  --bg:#1b1530; --ink:#f4ecff; --muted:#c9bce3; --card:#2a2148; --line:#3d3166;
  --red:#ff9a3d;                                 /* eyebrow text */
  --gold:#ff8a1f; --gold-d:#a8480a;              /* "Play" buttons and the selected chip: pumpkin */
  --edge:#5a4892; --shadow:rgba(0,0,0,.45); --focus:#ffd25e; --play-ink:#2a1200;
  --tag-bg:#3e2f66; --tag-ink:#ffd9b0; --chip-hover:#372b5c; --chip-count-bg:rgba(255,255,255,.14);
  --hw-orange:#ff8a1f; --hw-purple:#9b5cff; --hw-glow:rgba(255,138,31,.35);
  --bar-bg:#0f0a1f; --bar-ink:#f4ecff; --bar-accent:#ff8a1f;   /* bookmark bar: night sky, pumpkin headline */
  --new-bg:#9b5cff; --new-ink:#fff;                            /* NEW ribbon: purple, so it stands apart from the orange buttons */
}

/* The selected chip turns pumpkin-orange, so it needs dark text like the Play button. */
html[data-season="halloween"] .chip[aria-pressed="true"]{color:var(--play-ink)}
html[data-season="halloween"] .chip[aria-pressed="true"] .chip-count{background:rgba(42,18,0,.15)}

/* Cards glow faintly orange when hovered. */
html[data-season="halloween"] .card:hover{box-shadow:0 9px 0 var(--shadow), 0 0 26px var(--hw-glow)}
@media (max-width:599px){
  html[data-season="halloween"] .card:hover{box-shadow:0 4px 0 var(--shadow)}
}

/* A small jack-o'-lantern before the eyebrow line (the 404 page's "Missed the target!").
   The second content line gives it empty alt text where supported, so it is not read aloud. */
html[data-season="halloween"] .eyebrow::before{content:"🎃 "; content:"🎃 " / ""}

/* Hero (home page and 404): a glowing moon behind the title on the right, bats on the left. */
html[data-season="halloween"] .hero{position:relative; isolation:isolate}
html[data-season="halloween"] .hero::before,
html[data-season="halloween"] .hero::after{content:""; position:absolute; z-index:-1; pointer-events:none}
html[data-season="halloween"] .hero::before{
  top:14px; right:4%; width:84px; height:84px; border-radius:50%;
  background:
    radial-gradient(circle at 34% 38%, rgba(0,0,0,.08) 0 9px, transparent 10px),
    radial-gradient(circle at 62% 64%, rgba(0,0,0,.07) 0 6px, transparent 7px),
    radial-gradient(circle at 66% 30%, rgba(0,0,0,.06) 0 4px, transparent 5px),
    radial-gradient(circle at 40% 40%, #fff7dc, #f3dc95 70%);
  box-shadow:0 0 30px 6px rgba(255,236,170,.25);
}
html[data-season="halloween"] .hero::after{
  top:22px; left:4%; width:150px; height:90px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath fill='%23514183' d='M32 10c-2 0-3 1-3.5 2.5L27 9l-.5 4C22 9 14 6 4 8c4 2 6 5 6 9 3-2 7-2 9 1 2-2 6-2 8 1 1-3 3-4 5-4s4 1 5 4c2-3 6-3 8-1 2-3 6-3 9-1 0-4 2-7 6-9-10-2-18 1-22.5 5l-.5-4-1.5 3.5C35 11 34 10 32 10z'/%3E%3C/svg%3E") 0 10px/64px 28px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath fill='%23514183' d='M32 10c-2 0-3 1-3.5 2.5L27 9l-.5 4C22 9 14 6 4 8c4 2 6 5 6 9 3-2 7-2 9 1 2-2 6-2 8 1 1-3 3-4 5-4s4 1 5 4c2-3 6-3 8-1 2-3 6-3 9-1 0-4 2-7 6-9-10-2-18 1-22.5 5l-.5-4-1.5 3.5C35 11 34 10 32 10z'/%3E%3C/svg%3E") 82px 0/44px 19px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath fill='%23514183' d='M32 10c-2 0-3 1-3.5 2.5L27 9l-.5 4C22 9 14 6 4 8c4 2 6 5 6 9 3-2 7-2 9 1 2-2 6-2 8 1 1-3 3-4 5-4s4 1 5 4c2-3 6-3 8-1 2-3 6-3 9-1 0-4 2-7 6-9-10-2-18 1-22.5 5l-.5-4-1.5 3.5C35 11 34 10 32 10z'/%3E%3C/svg%3E") 56px 58px/34px 15px no-repeat;
  animation:hw-flutter 3.2s ease-in-out infinite;
}
@keyframes hw-flutter{50%{transform:translate(6px,-6px)}}
/* Hub page: the logo's dark lettering needs a light backing on the dark Halloween background. */
html[data-season="halloween"] .site-logo img{background:#fff3d6; border-radius:14px; padding:4px 10px; box-shadow:0 0 18px rgba(255,138,31,.25)}

/* A spider dangling from the top of the page, at the top right. Wide screens only, where it sits
   in empty space; on narrower screens it would hang over the title. */
html[data-season="halloween"] .wrap{position:relative}
@media (min-width:900px){
  html[data-season="halloween"] .wrap::before{
    content:""; position:absolute; top:-6px; right:20px; width:30px; height:84px; pointer-events:none;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cg stroke='%23c9bce3' stroke-width='1.6' fill='none' stroke-linecap='round'%3E%3Cpath d='M12 11 5 6 2 9M12 13 3 12 1 16M12 15 4 18 3 23M13 16 8 22 8 26M18 11l7-5 3 3M18 13l9-1 2 4M18 15l8 3 1 5M17 16l5 6v4'/%3E%3C/g%3E%3Cellipse cx='15' cy='14' rx='4.5' ry='5' fill='%23c9bce3'/%3E%3Ccircle cx='15' cy='7.5' r='3' fill='%23c9bce3'/%3E%3Ccircle cx='13.8' cy='7' r='.8' fill='%23ff8a1f'/%3E%3Ccircle cx='16.2' cy='7' r='.8' fill='%23ff8a1f'/%3E%3C/svg%3E") 0 100%/30px 26px no-repeat,
      linear-gradient(rgba(201,188,227,.6),rgba(201,188,227,.6)) 50% 0/1px calc(100% - 22px) no-repeat;
    transform-origin:50% 0;
    animation:hw-dangle 6s ease-in-out infinite;
  }
}
@keyframes hw-dangle{0%,100%{height:84px} 50%{height:104px}}

/* A little graveyard just above the footer line. */
html[data-season="halloween"] footer{position:relative; margin-top:96px}
html[data-season="halloween"] footer::before{
  content:""; position:absolute; left:50%; bottom:100%; width:240px; height:44px; margin-left:-120px;
  margin-bottom:2px; pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 44'%3E%3Cg fill='%233d3166'%3E%3Cpath d='M30 44V18a12 12 0 0 1 24 0v26z'/%3E%3Cpath d='M150 44V12a15 15 0 0 1 30 0v32z'/%3E%3Cpath d='M196 44V26h4v-6h4v6h4v4h-4v14z'/%3E%3Cpath d='M78 44V28a9 9 0 0 1 18 0v16z'/%3E%3C/g%3E%3Cg fill='%2357478c'%3E%3Crect x='36' y='22' width='12' height='2' rx='1'/%3E%3Crect x='157' y='16' width='16' height='2' rx='1'/%3E%3Crect x='160' y='21' width='10' height='2' rx='1'/%3E%3C/g%3E%3Cellipse cx='120' cy='36' rx='10' ry='8' fill='%23ff8a1f'/%3E%3Cpath d='M119 28q1-5 4-6' stroke='%235b8a3c' stroke-width='2' fill='none'/%3E%3Cpath d='M115 34l2-2 2 2zM121 34l2-2 2 2zM115 38q5 3 10 0' fill='%232a1200' stroke='%232a1200' stroke-width='1'/%3E%3C/svg%3E") 50% 100%/240px 44px no-repeat;
}

@media (max-width:599px){
  html[data-season="halloween"] .hero::before{top:-4px; right:-4px; width:40px; height:40px; box-shadow:0 0 18px 3px rgba(255,236,170,.2)}
  html[data-season="halloween"] .hero::after{top:6px; left:0; transform:scale(.6); transform-origin:0 0; animation:none}
}

@media (prefers-reduced-motion:reduce){
  html[data-season="halloween"] .hero::after,
  html[data-season="halloween"] .wrap::before{animation:none}
}
