/* ==========================================================================
   Holiday.FYi theme: design tokens + shared components (Revamp 3).
   Tokens are copied unchanged from docs/design/revamp/DESIGN.md §3 and the
   approved mockups. Light "Daylight paper" is the default; "Night parade" is the
   fun dark theme. base.html sets data-theme before first paint.
   ========================================================================== */
:root, [data-theme="light"] {
  color-scheme: light;
  /* surfaces + ink */
  --bg: #FFF7EC;          /* warm paper */
  --bg-raised: #FFFFFF;
  --bg-sunken: #FCEBD5;
  --ink: #24163A;         /* deep plum ink: 15.8:1 on --bg */
  --ink-muted: #5C4B70;   /* 7.3:1 on --bg */
  --line: #EBDCC7;
  --line-strong: #D9C4A6;
  /* brand */
  --brand: #D7263D;       /* Holiday red (fills, white text 4.96:1) */
  --on-brand: #FFFFFF;
  --brand-ink: #B0182E;   /* links + red text: 6.55:1 on --bg */
  --sun: #FFC23D;         /* Sunburst (fills, highlights) */
  --on-sun: #24163A;
  --focus: #2A55D6;
  /* observance kinds: solid / on-solid / soft (chip bg) / ink (text) */
  --k-unofficial: #D6337A; --k-unofficial-on: #FFFFFF; --k-unofficial-soft: #F9E2EC; --k-unofficial-ink: #A3195A;
  --k-awareness:  #0E7C72; --k-awareness-on:  #FFFFFF; --k-awareness-soft:  #DDEDEB; --k-awareness-ink:  #0A6158;
  --k-civic:      #2A55D6; --k-civic-on:      #FFFFFF; --k-civic-soft:      #E1E7F9; --k-civic-ink:      #2443A8;
  --k-cultural:   #F2A20C; --k-cultural-on:   #24163A; --k-cultural-soft:   #FDF2DD; --k-cultural-ink:   #875000;
  --k-religious:  #7A45D0; --k-religious-on:  #FFFFFF; --k-religious-soft:  #ECE5F8; --k-religious-ink:  #5E2DB0;
  --k-unclassified:#6B6880;--k-unclassified-on:#FFFFFF;--k-unclassified-soft:#EAEAED;--k-unclassified-ink:#4E4B60;
  /* holiday_type accents */
  --t-holiday: #D7263D; --t-holiday-on: #FFFFFF; --t-holiday-soft: #F9E1E4; --t-holiday-ink: #B0182E;
  --t-week:    #E8620F; --t-week-on:    #24163A; --t-week-soft:    #FCE9DD; --t-week-ink:    #A33F00;
  --t-month:   #2F7A12; --t-month-on:   #FFFFFF; --t-month-soft:   #E2EDDD; --t-month-ink:   #2F6C0E;
  /* elevation */
  --shadow-1: 0 1px 0 rgb(36 22 58 / .05), 0 2px 8px rgb(36 22 58 / .06);
  --shadow-2: 0 2px 0 rgb(36 22 58 / .04), 0 14px 28px -10px rgb(36 22 58 / .22);
  --shadow-pop: 3px 3px 0 var(--ink);
  --page-glow: radial-gradient(1200px 500px at 85% -120px, #FFE3B8 0, transparent 70%),
               radial-gradient(900px 420px at -10% -80px, #FFDCE8 0, transparent 70%);
  /* edges + hard "sticker" shadows (DESIGN.md §5) */
  --edge: var(--ink);
  --pop: var(--ink);
}
[data-theme="dark"] {
  color-scheme: dark;
  /* "Fun dark" = Night Parade: deep saturated indigo-violet, never #000/#111 */
  --bg: #231755;
  --bg-raised: #30206B;
  --bg-sunken: #2A1B60;
  --ink: #FFF3E3;          /* 14.5:1 on --bg */
  --ink-muted: #CDBFF0;    /* 9.3:1 on --bg */
  --line: #4A3A8C;
  --line-strong: #5D4BA6;
  --brand: #FF5C6C;  --on-brand: #231755;  --brand-ink: #FF8E99;
  --sun: #FFC94D;    --on-sun: #231755;    --focus: #8FB0FF;
  --k-unofficial: #FF6FAE; --k-unofficial-on: #231755; --k-unofficial-soft: #5E317A; --k-unofficial-ink: #FFA6CC;
  --k-awareness:  #2ED3C0; --k-awareness-on:  #231755; --k-awareness-soft:  #30477E; --k-awareness-ink:  #8EEBDF;
  --k-civic:      #7C9CFF; --k-civic-on:      #231755; --k-civic-soft:      #413B8C; --k-civic-ink:      #B8CAFF;
  --k-cultural:   #FFB52E; --k-cultural-on:   #231755; --k-cultural-soft:   #5E415E; --k-cultural-ink:   #FFD27A;
  --k-religious:  #B993FF; --k-religious-on:  #231755; --k-religious-soft:  #4E398C; --k-religious-ink:  #D9C6FF;
  --k-unclassified:#A9A3C8;--k-unclassified-on:#231755;--k-unclassified-soft:#4B3D7F;--k-unclassified-ink:#D6D2EA;
  --t-holiday: #FF5C6C; --t-holiday-on: #231755; --t-holiday-soft: #5E2D6B; --t-holiday-ink: #FF8E99;
  --t-week:    #FF8A4C; --t-week-on:    #231755; --t-week-soft:    #57306A; --t-week-ink:    #FFB78F;
  --t-month:   #8BD35A; --t-month-on:   #231755; --t-month-soft:   #2C4A6B; --t-month-ink:   #BDEB9B;
  --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 2px 10px rgb(14 6 48 / .35);
  --shadow-2: 0 1px 0 rgb(255 255 255 / .06) inset, 0 18px 36px -12px rgb(14 6 48 / .7);
  --shadow-pop: 3px 3px 0 var(--k-unofficial);
  --page-glow: radial-gradient(1100px 520px at 90% -140px, rgb(255 111 174 / .30) 0, transparent 70%),
               radial-gradient(900px 480px at -10% -60px, rgb(46 211 192 / .20) 0, transparent 70%),
               radial-gradient(1.4px 1.4px at 20px 30px, rgb(255 243 227 / .55) 50%, transparent 51%),
               radial-gradient(1px 1px at 90px 110px, rgb(255 201 77 / .6) 50%, transparent 51%);
  --edge: var(--line-strong);
  --pop: #160C40;
}
/* No JavaScript: follow the device setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    /* "Fun dark" = Night Parade: deep saturated indigo-violet, never #000/#111 */
    --bg: #231755;
    --bg-raised: #30206B;
    --bg-sunken: #2A1B60;
    --ink: #FFF3E3;          /* 14.5:1 on --bg */
    --ink-muted: #CDBFF0;    /* 9.3:1 on --bg */
    --line: #4A3A8C;
    --line-strong: #5D4BA6;
    --brand: #FF5C6C;  --on-brand: #231755;  --brand-ink: #FF8E99;
    --sun: #FFC94D;    --on-sun: #231755;    --focus: #8FB0FF;
    --k-unofficial: #FF6FAE; --k-unofficial-on: #231755; --k-unofficial-soft: #5E317A; --k-unofficial-ink: #FFA6CC;
    --k-awareness:  #2ED3C0; --k-awareness-on:  #231755; --k-awareness-soft:  #30477E; --k-awareness-ink:  #8EEBDF;
    --k-civic:      #7C9CFF; --k-civic-on:      #231755; --k-civic-soft:      #413B8C; --k-civic-ink:      #B8CAFF;
    --k-cultural:   #FFB52E; --k-cultural-on:   #231755; --k-cultural-soft:   #5E415E; --k-cultural-ink:   #FFD27A;
    --k-religious:  #B993FF; --k-religious-on:  #231755; --k-religious-soft:  #4E398C; --k-religious-ink:  #D9C6FF;
    --k-unclassified:#A9A3C8;--k-unclassified-on:#231755;--k-unclassified-soft:#4B3D7F;--k-unclassified-ink:#D6D2EA;
    --t-holiday: #FF5C6C; --t-holiday-on: #231755; --t-holiday-soft: #5E2D6B; --t-holiday-ink: #FF8E99;
    --t-week:    #FF8A4C; --t-week-on:    #231755; --t-week-soft:    #57306A; --t-week-ink:    #FFB78F;
    --t-month:   #8BD35A; --t-month-on:   #231755; --t-month-soft:   #2C4A6B; --t-month-ink:   #BDEB9B;
    --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 2px 10px rgb(14 6 48 / .35);
    --shadow-2: 0 1px 0 rgb(255 255 255 / .06) inset, 0 18px 36px -12px rgb(14 6 48 / .7);
    --shadow-pop: 3px 3px 0 var(--k-unofficial);
    --page-glow: radial-gradient(1100px 520px at 90% -140px, rgb(255 111 174 / .30) 0, transparent 70%),
                 radial-gradient(900px 480px at -10% -60px, rgb(46 211 192 / .20) 0, transparent 70%),
                 radial-gradient(1.4px 1.4px at 20px 30px, rgb(255 243 227 / .55) 50%, transparent 51%),
                 radial-gradient(1px 1px at 90px 110px, rgb(255 201 77 / .6) 50%, transparent 51%);
    --edge: var(--line-strong);
    --pop: #160C40;
  }
}

:root {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* 4px spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  /* radius */
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  /* type scale (fluid) */
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-base: 1.0625rem; --fs-md: 1.25rem; --fs-lg: 1.5rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem);
  --fs-2xl: clamp(2.1rem, 1.3rem + 3.6vw, 3.25rem);
  --fs-3xl: clamp(2.6rem, 1.2rem + 6.4vw, 5.25rem);
  /* motion */
  --ease-out: cubic-bezier(.2,.8,.2,1); --ease-pop: cubic-bezier(.34,1.56,.64,1);
  --dur-1: 120ms; --dur-2: 220ms; --dur-3: 420ms;
  --maxw: 1200px;
}

/* ---------- fonts (self-hosted, OFL; subset to Latin + Latin Extended) ---------- */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background-color: var(--bg); color: var(--ink);
  background-image: var(--page-glow); background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-size: auto, auto, 140px 140px, 170px 170px;
  font: 400 var(--fs-base)/1.6 var(--font-body);
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}
a { color: var(--brand-ink); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-variation-settings: "SOFT" 60, "WONK" 0; line-height: 1.08; margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: var(--fs-3xl); font-weight: 800; font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -.025em; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-md); font-weight: 650; }
p { margin: 0 0 1em; }
mark { background: var(--sun); color: var(--on-sun); border-radius: 3px; padding: 0 .1em; }
::selection { background: color-mix(in srgb, var(--sun) 70%, transparent); color: var(--ink); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s-4); } }
.eyebrow { font: 700 var(--fs-xs)/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 var(--s-2); }
.muted { color: var(--ink-muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: var(--s-3); }
.main { flex: 1; padding: var(--s-5) 0 var(--s-7); }
.main:focus { outline: none; }
.section { margin: var(--s-7) 0; }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 10; padding: var(--s-4) 0 var(--s-2); }
.header-row { display: flex; align-items: center; gap: var(--s-5); }
.wordmark { display: inline-flex; align-items: center; flex: none; line-height: 0; border-radius: 6px; }
.wordmark-img { display: block; height: 32px; width: auto; }
.wordmark-dark { display: none; }
[data-theme="dark"] .wordmark-light { display: none; }
[data-theme="dark"] .wordmark-dark { display: block; }
.main-nav { display: flex; gap: var(--s-1); }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 650; padding: 9px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: var(--r-pill); white-space: nowrap; }
.main-nav a:hover { background: var(--bg-sunken); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-tools { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }
.search-mini { display: flex; align-items: center; gap: 8px; background: var(--bg-raised); border: 2px solid var(--line-strong); border-radius: var(--r-pill); padding: 0 14px; min-height: 42px; min-width: 220px; color: var(--ink-muted); margin: 0; }
.search-mini svg { width: 18px; height: 18px; flex: none; }
.search-mini input { border: 0; background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--ink); width: 100%; min-width: 0; padding: 8px 0; outline: none; }
.search-mini input::placeholder { color: var(--ink-muted); opacity: 1; }
.search-mini:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg-raised); color: var(--ink); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.mobile-search { display: none; }
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r-pill); border: 2px solid var(--line-strong); background: var(--bg-raised); flex: none; }
.no-js .theme-switch { display: none; }
.theme-opt { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-muted); cursor: pointer; }
.theme-opt svg { width: 19px; height: 19px; }
.theme-opt:hover { color: var(--ink); background: var(--bg-sunken); }
.theme-opt[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  .theme-opt[aria-pressed="true"] svg { animation: wobble var(--dur-3) var(--ease-pop) 1; }
}
.staff-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin-top: var(--s-3); padding: 6px var(--s-3); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-sm); }
.staff-nav .eyebrow { margin: 0; }
.staff-nav a { color: var(--ink); font-weight: 650; padding: 4px 2px; }
@media (max-width: 960px) {
  .header-row { flex-wrap: wrap; gap: var(--s-3); }
  .main-nav { order: 3; width: calc(100% + 2 * var(--s-4)); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4); }
  .main-nav::-webkit-scrollbar { display: none; }
  .search-mini { display: none; }
  .mobile-search { display: inline-grid; }
  .wordmark-img { height: 28px; }
}
@media (max-width: 420px) {
  .main-nav a { padding: 9px 11px; }
}
@media (max-width: 380px) {
  .wordmark-img { height: 24px; }
  .theme-opt { width: 34px; height: 34px; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-6); border-top: 2px dashed var(--line-strong); color: var(--ink-muted); font-size: var(--fs-sm); }
.footer-grid { display: grid; gap: var(--s-5); grid-template-columns: 2fr 1fr 1fr; }
.footer-about p { margin: var(--s-3) 0 0; max-width: 44ch; }
.footer-about .wordmark-img { height: 28px; }
.footer-head { font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 var(--s-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer li a { display: inline-block; padding: 5px 0; }
.site-footer a { color: var(--ink); }
.site-footer .ver { font-family: var(--font-mono); font-size: var(--fs-xs); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- hero ---------- */
.hero { padding: var(--s-5) 0 var(--s-5); overflow-x: clip; }
.hero .hero-title { overflow-wrap: anywhere; }
.hero .hero-title .count { display: inline-block; color: var(--brand-ink); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; rotate: -4deg; }
.hero .lead { font-size: var(--fs-md); color: var(--ink-muted); max-width: 52ch; margin: var(--s-4) 0 var(--s-5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-5); }

/* ---------- section header ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.section-head .eyebrow { margin-bottom: var(--s-1); }
.section-head h2 .squiggle { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 70%, transparent) 62% 92%, transparent 92%); padding: 0 .08em; }
.link-more { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--fs-xs)/1 var(--font-body); letter-spacing: .02em;
  padding: 6px 10px 6px 8px; border-radius: var(--r-pill); background: var(--c-soft); color: var(--c-ink); white-space: nowrap; text-decoration: none; }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c-solid); flex: none; }
.chip.solid { background: var(--c-solid); color: var(--c-on); }
.chip.solid::before { background: currentColor; }
.k-unofficial { --c-solid: var(--k-unofficial); --c-on: var(--k-unofficial-on); --c-soft: var(--k-unofficial-soft); --c-ink: var(--k-unofficial-ink); }
.k-awareness  { --c-solid: var(--k-awareness);  --c-on: var(--k-awareness-on);  --c-soft: var(--k-awareness-soft);  --c-ink: var(--k-awareness-ink); }
.k-civic      { --c-solid: var(--k-civic);      --c-on: var(--k-civic-on);      --c-soft: var(--k-civic-soft);      --c-ink: var(--k-civic-ink); }
.k-cultural   { --c-solid: var(--k-cultural);   --c-on: var(--k-cultural-on);   --c-soft: var(--k-cultural-soft);   --c-ink: var(--k-cultural-ink); }
.k-religious  { --c-solid: var(--k-religious);  --c-on: var(--k-religious-on);  --c-soft: var(--k-religious-soft);  --c-ink: var(--k-religious-ink); }
.k-unclassified { --c-solid: var(--k-unclassified); --c-on: var(--k-unclassified-on); --c-soft: var(--k-unclassified-soft); --c-ink: var(--k-unclassified-ink); }
/* kind glyphs: shape + colour, so colour is never the only signal */
.chip.k-unofficial::before { border-radius: 2px; transform: rotate(20deg); }
.chip.k-awareness::before  { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.chip.k-civic::before      { clip-path: polygon(0 0,100% 0,100% 70%,0 70%); border-radius: 0; height: 11px; }
.chip.k-cultural::before   { transform: rotate(45deg); border-radius: 1px; }
.chip.k-religious::before  { clip-path: polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%); border-radius: 0; width: 11px; height: 11px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 9px; border-radius: var(--r-sm); background: var(--t-soft); color: var(--t-ink); border: 1.5px dashed var(--t-solid); white-space: nowrap; }
.t-week  { --t-solid: var(--t-week);  --t-soft: var(--t-week-soft);  --t-ink: var(--t-week-ink);  --t-on: var(--t-week-on); }
.t-month { --t-solid: var(--t-month); --t-soft: var(--t-month-soft); --t-ink: var(--t-month-ink); --t-on: var(--t-month-on); }
.t-holiday { --t-solid: var(--t-holiday); --t-soft: var(--t-holiday-soft); --t-ink: var(--t-holiday-ink); --t-on: var(--t-holiday-on); }
.type-chip .ticks { display: inline-grid; grid-auto-flow: column; gap: 1.5px; }
.type-chip .ticks i { width: 2.5px; height: 10px; background: var(--t-solid); border-radius: 1px; }
.type-chip .grid { width: 11px; height: 11px; background:
  linear-gradient(var(--t-solid) 0 0) 0 0/3px 3px, linear-gradient(var(--t-solid) 0 0) 4px 0/3px 3px, linear-gradient(var(--t-solid) 0 0) 8px 0/3px 3px,
  linear-gradient(var(--t-solid) 0 0) 0 4px/3px 3px, linear-gradient(var(--t-solid) 0 0) 4px 4px/3px 3px, linear-gradient(var(--t-solid) 0 0) 8px 4px/3px 3px,
  linear-gradient(var(--t-solid) 0 0) 0 8px/3px 3px, linear-gradient(var(--t-solid) 0 0) 4px 8px/3px 3px; background-repeat: no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }

/* ---------- filter pills ---------- */
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin: 0 0 var(--s-4); }
.filter { font: 650 var(--fs-sm)/1 var(--font-body); padding: 0 16px; min-height: 40px; border-radius: var(--r-pill); border: 2px solid var(--line-strong);
  background: var(--bg-raised); color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.filter:hover { border-color: var(--ink); }
.filter[aria-current="true"], .filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter .n { font: 700 11px/1 var(--font-mono); opacity: .8; }
.filter .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c-solid); flex: none; }
@media (max-width: 640px) { .filters.scroll { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--s-4)); margin-right: calc(-1 * var(--s-4)); padding: 2px var(--s-4); scrollbar-width: none; } .filter { flex: none; } }

/* ---------- date badge (tear-off calendar page) ---------- */
.date-badge { --db-band: var(--brand); --db-on: var(--on-brand); display: inline-flex; flex-direction: column; width: 64px; flex: none; text-align: center;
  background: var(--bg-raised); border: 2px solid var(--edge); border-radius: var(--r-md); overflow: hidden; box-shadow: 3px 3px 0 var(--pop); text-decoration: none; color: var(--ink); vertical-align: middle; }
.date-badge .db-m { background: var(--db-band); color: var(--db-on); font: 700 11px/1 var(--font-mono); letter-spacing: .14em; padding: 5px 0 4px; }
.date-badge .db-d { font: 800 28px/1 var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72; padding: 6px 0 2px; }
.date-badge .db-w { font: 700 10px/1 var(--font-mono); letter-spacing: .1em; color: var(--ink-muted); padding: 0 0 6px; }
.date-badge.sm { width: 50px; border-radius: 10px; box-shadow: 2px 2px 0 var(--pop); }
.date-badge.sm .db-d { font-size: 21px; padding: 4px 0 1px; } .date-badge.sm .db-m { font-size: 10px; padding: 4px 0 3px; } .date-badge.sm .db-w { font-size: 9px; padding-bottom: 4px; }
.date-badge.lg { width: 108px; border-radius: var(--r-lg); box-shadow: 5px 5px 0 var(--pop); }
.date-badge.lg .db-m { font-size: 14px; padding: 8px 0 7px; } .date-badge.lg .db-d { font-size: 56px; padding: 10px 0 2px; } .date-badge.lg .db-w { font-size: 12px; padding-bottom: 10px; }
.date-badge.rule .db-d { font-size: 17px; padding: 9px 2px 3px; letter-spacing: -.01em; }
.date-badge.sm.rule .db-d { font-size: 14px; padding: 6px 2px 2px; }
.date-badge.lg.rule .db-d { font-size: 32px; padding: 16px 2px 6px; }
.date-badge.is-week { --db-band: var(--t-week); --db-on: var(--t-week-on); }
.date-badge.is-month { --db-band: var(--t-month); --db-on: var(--t-month-on); }
.date-badge.is-month .db-d { font-size: 22px; padding: 8px 0 3px; }
.date-badge.sm.is-month .db-d { font-size: 16px; padding: 6px 0 2px; }

/* ---------- artwork + generated fallback ---------- */
.art { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--c-soft, var(--bg-sunken)); isolation: isolate; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art.r-4x3 { aspect-ratio: 4 / 3; } .art.r-1x1 { aspect-ratio: 1; } .art.r-21x9 { aspect-ratio: 21 / 9; }
.art .art-chip { position: absolute; left: 10px; top: 10px; z-index: 2; box-shadow: 0 2px 0 rgb(0 0 0 / .12); border-radius: var(--r-pill); }
.art .sticker { display: none; }
.art-fallback { background-color: var(--c-soft); }
.art-fallback::before { content: ""; position: absolute; inset: -60px; z-index: -1; opacity: .9; transform: translate(var(--sx, 0px), var(--sy, 0px)); }
.art-fallback.k-unofficial::before { background:
  radial-gradient(circle, var(--sun) 0 5px, transparent 6px) 0 0 / 96px 74px,
  radial-gradient(circle, var(--k-civic) 0 4px, transparent 5px) 30px 40px / 118px 92px,
  radial-gradient(circle, var(--k-awareness) 0 4px, transparent 5px) 64px 12px / 84px 106px,
  radial-gradient(circle, var(--c-solid) 0 6px, transparent 7px) 14px 58px / 132px 88px,
  radial-gradient(circle, var(--k-religious) 0 3px, transparent 4px) 50px 70px / 70px 64px; }
.art-fallback.k-awareness::before { background: repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--c-solid) 35%, transparent) 22px 30px, transparent 30px 46px, color-mix(in srgb, var(--sun) 45%, transparent) 46px 50px); }
.art-fallback.k-civic::before { background:
  conic-gradient(from 135deg at 50% 0, var(--c-solid) 0 90deg, transparent 0) 0 60px / 34px 18px repeat-x,
  conic-gradient(from 135deg at 50% 0, var(--brand) 0 90deg, transparent 0) 17px 60px / 34px 18px repeat-x,
  repeating-linear-gradient(0deg, transparent 0 18px, color-mix(in srgb, var(--c-solid) 16%, transparent) 18px 28px); }
.art-fallback.k-cultural::before { background:
  linear-gradient(45deg, color-mix(in srgb, var(--c-solid) 30%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--c-solid) 30%, transparent) 75%) 0 0 / 36px 36px,
  linear-gradient(45deg, color-mix(in srgb, var(--brand) 22%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--brand) 22%, transparent) 75%) 18px 18px / 36px 36px; }
.art-fallback.k-religious::before { background: repeating-conic-gradient(from 0deg at 50% 115%, color-mix(in srgb, var(--c-solid) 26%, transparent) 0 5deg, transparent 5deg 15deg); }
.art-fallback.k-unclassified::before { background: radial-gradient(circle, color-mix(in srgb, var(--c-solid) 35%, transparent) 2px, transparent 3px) 0 0 / 18px 18px; }
.art-fallback .sticker { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: var(--rot, -6deg); display: grid; place-items: center; text-align: center;
  width: 42%; aspect-ratio: 1; max-width: 150px; border-radius: 50%; background: var(--bg-raised); color: var(--c-ink); border: 3px solid var(--c-solid);
  box-shadow: 4px 4px 0 var(--c-solid); font: 800 clamp(28px, 7vw, 54px)/1 var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.art-fallback .sticker small { display: block; font: 700 10px/1 var(--font-mono); letter-spacing: .14em; color: var(--ink-muted); margin-top: 4px; }
.art-fallback.compact .sticker { width: 56%; border-width: 2px; box-shadow: 2px 2px 0 var(--c-solid); font-size: 26px; }
.art-fallback.compact .sticker small { display: none; }

/* ---------- holiday card ---------- */
.cards { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--bg-raised); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow-1);
  border: 1.5px solid var(--line); transition: transform var(--dur-2) var(--ease-pop), box-shadow var(--dur-2) var(--ease-out); color: var(--ink); }
.card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-2); }
.card:focus-within { box-shadow: var(--shadow-2); }
.card .art { border-radius: 14px; }
.card .card-body { padding: var(--s-3) var(--s-2) var(--s-2); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.card .meta { display: flex; align-items: center; gap: var(--s-2); font: 700 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
.card h3 { font-size: 1.32rem; font-weight: 700; overflow-wrap: anywhere; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: .08em; }
.card .card-text { color: var(--ink-muted); font-size: var(--fs-sm); line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); padding-top: var(--s-2); border-top: 1.5px dashed var(--line); flex-wrap: wrap; }
.card .card-countries { font-size: var(--fs-xs); color: var(--ink-muted); }
.card .card-countries .more { font: 700 11px/1 var(--font-mono); }
.card.no-art { border-top: 6px solid var(--c-solid); }
.card.no-art .card-body { padding-top: var(--s-2); }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: var(--s-7) var(--s-5); background: var(--bg-raised); border: 2px dashed var(--line-strong); border-radius: var(--r-xl); margin: var(--s-5) 0; }
.empty .empty-art { width: 120px; height: 120px; margin: 0 auto var(--s-4); border-radius: 50%; position: relative; background: var(--bg-sunken); }
.empty .empty-art::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 64px/1 var(--font-display); color: var(--brand-ink); rotate: 10deg; }
.empty .empty-art::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; background:
  radial-gradient(circle at 10% 30%, var(--sun) 0 5px, transparent 6px), radial-gradient(circle at 90% 20%, var(--k-civic) 0 4px, transparent 5px),
  radial-gradient(circle at 85% 85%, var(--k-unofficial) 0 5px, transparent 6px), radial-gradient(circle at 20% 90%, var(--k-awareness) 0 4px, transparent 5px); }
.empty .empty-title { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.empty .empty-message { color: var(--ink-muted); max-width: 48ch; margin: 0 auto var(--s-4); }
.empty .empty-links { justify-content: center; gap: var(--s-2); }

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2) var(--s-3); margin: var(--s-6) 0; }
.pager-pages { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1); margin: 0; padding: 0; }
.pager-num, .pager-step, .pager-gap { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: var(--r-pill); font: 700 var(--fs-sm)/1 var(--font-mono); text-decoration: none; color: var(--ink); }
.pager-num, .pager-step { border: 2px solid var(--line-strong); background: var(--bg-raised); }
.pager-step { display: inline-flex; gap: 6px; font-family: var(--font-body); }
.pager a:hover { border-color: var(--ink); }
.pager-num[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pager-step.is-disabled { color: var(--ink-muted); border-style: dashed; cursor: default; }
.pager-gap { min-width: 24px; padding: 0; color: var(--ink-muted); }
.pager-status { width: 100%; text-align: center; margin: 0; font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 750 var(--fs-sm)/1 var(--font-body); padding: 12px 18px; min-height: 42px; border-radius: var(--r-pill);
  border: 2px solid var(--ink); background: var(--bg-raised); color: var(--ink); text-decoration: none; cursor: pointer; box-shadow: 2px 2px 0 var(--pop);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--pop); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--pop); }
.btn.primary, .btn-primary { background: var(--brand); color: var(--on-brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- motion ---------- */
@keyframes float-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wobble { 0% { rotate: 0deg; } 40% { rotate: -14deg; } 75% { rotate: 8deg; } 100% { rotate: 0deg; } }
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: float-in var(--dur-3) var(--ease-out) both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .card:hover, .btn:hover, .btn:active { transform: none; }
}
