@font-face {
  font-family: "jf-openhuninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "jf-openhuninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "jf-openhuninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-chinese-traditional.woff2") format("woff2");
}

@font-face {
  font-family: "Huninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Huninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Huninn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("./fonts/huninn-chinese-traditional.woff2") format("woff2");
}


@font-face {
  font-family: "M PLUS Rounded 1c";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("./fonts/mplus-rounded-latin-900.woff2") format("woff2");
  unicode-range: U+0030-0039;
}

:root {
  --pine: #112e21;
  --pine-2: #133324;
  --cream: #f5f3e7;
  --cream-soft: rgba(245, 243, 231, 0.88);
  --cream-mute: rgba(245, 243, 231, 0.62);
  --gold: #f6c445;
  --gold-dim: rgba(246, 196, 69, 0.42);
  --red: #b92b33;
  --red-dim: rgba(185, 43, 51, 0.42);
  --dot: #d6333f;
  --card: rgba(255, 255, 255, 0.055);
  --card-border: 1px solid rgba(255, 255, 255, 0.18);
  --school: rgba(56, 112, 78, 0.48);
  --school-border: 1px solid rgba(255, 255, 255, 0.2);
  --weekend: rgba(0, 0, 0, 0.22);
  --font: "jf-openhuninn", "Huninn", sans-serif;
  --font-num: "M PLUS Rounded 1c", "jf-openhuninn", "Huninn", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--cream);
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, #1c4a34 0%, transparent 58%),
    radial-gradient(ellipse 70% 45% at 100% 80%, #0c2419 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 90%, #0e2a1d 0%, transparent 50%),
    linear-gradient(180deg, #133324 0%, #112e21 42%, #0e271c 100%);
  background-color: var(--pine);
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.lights {
  position: relative;
  z-index: 4;
  width: 100%;
  line-height: 0;
  pointer-events: none;
}

.lights-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 72px;
  margin-top: -6px;
  overflow: visible;
}

.bulb-cap {
  fill: #2c241c;
  stroke: #1a1510;
  stroke-width: 0.4;
}

.bulb-glass {
  fill: var(--c);
  filter:
    drop-shadow(0 0 5px var(--c))
    drop-shadow(0 0 12px color-mix(in srgb, var(--c) 70%, transparent));
  animation: twinkle var(--dur, 2.4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transform-box: fill-box;
  transform-origin: 50% 0%;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 5px var(--c)) drop-shadow(0 0 12px color-mix(in srgb, var(--c) 75%, transparent)) brightness(1.05); }
  45% { opacity: 0.72; filter: drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 6px color-mix(in srgb, var(--c) 40%, transparent)) brightness(0.82); }
  70% { opacity: 1; filter: drop-shadow(0 0 7px var(--c)) drop-shadow(0 0 16px color-mix(in srgb, var(--c) 85%, transparent)) brightness(1.18); }
}

main {
  position: relative;
  z-index: 5;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 4px 18px 72px;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 64px;
  min-height: calc(100svh - 110px);
}

.eyebrow {
  margin: 8px 0 0;
  color: var(--cream-soft);
  font-size: 15px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.headline,
.subhead,
.count-unit {
  -webkit-text-stroke: 0.034em currentColor;
  paint-order: stroke fill;
}

.headline {
  margin: 36px 0 8px;
  color: var(--cream);
  font-size: clamp(28px, 8.4vw, 40px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.count-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  margin: 6px 0 4px;
  line-height: 1;
}

.count-num {
  font-family: var(--font-num);
  color: var(--gold);
  font-size: clamp(92px, 29vw, 136px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.88;
  text-shadow:
    0 2px 0 rgba(17, 46, 33, 0.25),
    0 0 28px rgba(246, 196, 69, 0.35);
}

.count-unit {
  color: var(--cream);
  font-size: clamp(28px, 8.2vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1;
  padding-bottom: 0.08em;
}

.subhead {
  margin: 14px 0 28px;
  color: var(--cream);
  font-size: clamp(28px, 8.4vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--cream);
  font-size: 16px;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 0.028em currentColor;
  paint-order: stroke fill;
}

.pill-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow:
    0 0 0 4px rgba(214, 51, 63, 0.22),
    0 0 14px 2px rgba(214, 51, 63, 0.7);
  flex: 0 0 auto;
  animation: pulse 1.8s ease-in-out infinite;
}

body.is-break .pill-dot {
  background: var(--gold);
  box-shadow:
    0 0 0 4px rgba(246, 196, 69, 0.22),
    0 0 14px 2px rgba(246, 196, 69, 0.7);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.85; }
}

.rules {
  max-width: 28em;
  margin: 28px auto 0;
  color: var(--cream-mute);
  font-size: 14px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.cal-link {
  margin-top: auto;
  padding-top: 36px;
  color: var(--cream-soft);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.06em;
  -webkit-text-stroke: 0.018em currentColor;
  paint-order: stroke fill;
}

.cal-link:hover,
.cal-link:focus-visible {
  color: var(--gold);
}

/* ---------- Calendar ---------- */
.calendar-section {
  padding: 12px 0 24px;
  scroll-margin-top: 12px;
}

.calendar-section h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 400;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 0.034em currentColor;
  paint-order: stroke fill;
}

.cal-intro {
  max-width: 26em;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--cream-mute);
  font-size: 15px;
  line-height: 1.85;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  list-style: none;
  margin: 0 auto 28px;
  padding: 0;
  color: var(--cream-soft);
  font-size: 14px;
  -webkit-text-stroke: 0.018em currentColor;
  paint-order: stroke fill;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1px 2px;
  flex: 0 0 auto;
}

.swatch-school {
  background: var(--school);
  border: var(--school-border);
}

.swatch-num {
  font-family: var(--font-num);
  font-weight: 900;
  color: var(--gold);
  font-size: 10px;
  line-height: 1;
}

.swatch-weekend {
  background: var(--weekend);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.swatch-ceremony {
  background: var(--gold);
}

.swatch-break {
  background: var(--red);
}

.month-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.month-card {
  background: var(--card);
  border: var(--card-border);
  border-radius: 24px;
  padding: 20px 14px 22px;
  overflow: visible;
}

.month-title {
  margin: 0 0 14px 4px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--cream);
  -webkit-text-stroke: 0.03em currentColor;
  paint-order: stroke fill;
}

.dow-row,
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.dow {
  text-align: center;
  color: var(--cream-mute);
  font-size: 13px;
  padding: 0 0 8px;
  letter-spacing: 0.04em;
}

.day-grid {
  margin-top: 2px;
  padding-bottom: 4px;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1.18;
  border-radius: 12px;
  padding: 5px 4px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: visible;
}

.cell.empty {
  visibility: hidden;
  pointer-events: none;
}

.day-num {
  font-size: clamp(10px, 2.7vw, 13px);
  line-height: 1;
  letter-spacing: 0;
  align-self: flex-start;
}

.cell-count {
  font-family: var(--font-num);
  font-weight: 900;
  align-self: flex-end;
  font-size: clamp(16px, 4.6vw, 22px);
  line-height: 0.9;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.cell-label {
  font-size: clamp(8px, 2.15vw, 10px);
  line-height: 1.12;
  text-align: center;
  align-self: stretch;
  margin-top: auto;
  padding: 0 1px 1px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-text-stroke: 0.025em currentColor;
  paint-order: stroke fill;
}

/* School days */
.cell.school {
  background: var(--school);
  border: var(--school-border);
  color: var(--cream);
}

.cell.school.is-past {
  background: rgba(56, 112, 78, 0.28);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(245, 243, 231, 0.55);
}

.cell.school.is-past .cell-count {
  color: var(--gold-dim);
}

/* Weekends */
.cell.weekend {
  background: var(--weekend);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(245, 243, 231, 0.48);
}

/* Holidays / long weekends / winter break */
.cell.holiday,
.cell.long-weekend,
.cell.vacation {
  background: var(--red);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cell.holiday .day-num,
.cell.long-weekend .day-num,
.cell.vacation .day-num,
.cell.holiday .cell-label,
.cell.long-weekend .cell-label,
.cell.vacation .cell-label {
  color: #fff;
}

.cell.overflow {
  background: var(--red-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.cell.overflow .day-num,
.cell.overflow .cell-label {
  color: rgba(255, 255, 255, 0.86);
}

/* Closing ceremony */
.cell.ceremony {
  background: var(--gold);
  border: 1px solid rgba(17, 46, 33, 0.12);
  color: var(--pine);
}

.cell.ceremony .day-num,
.cell.ceremony .cell-label,
.cell.ceremony .cell-count {
  color: var(--pine);
}

.cell.ceremony .cell-count {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 400;
  align-self: flex-end;
  margin-top: -2px;
}

.cell.ceremony .day-num {
  position: relative;
  z-index: 1;
}

.cell.ceremony .cell-count {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-62%);
}

/* Today highlight */
.cell.is-today {
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(185, 43, 51, 0.45);
  z-index: 2;
}

.today-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -52%);
  background: var(--gold);
  color: var(--pine);
  font-size: 10px;
  line-height: 1;
  padding: 3px 8px 4px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(17, 46, 33, 0.25);
  -webkit-text-stroke: 0.03em currentColor;
  paint-order: stroke fill;
}

.cell.is-today .day-num {
  margin-top: 7px;
}

@media (min-width: 1100px) {
  main {
    padding: 8px 28px 80px;
  }

  .hero {
    min-height: calc(100svh - 130px);
    padding-top: 28px;
  }

  .month-grid {
    width: 100%;
    max-width: 1200px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
  }

  .month-card {
    padding: 22px 16px 18px;
  }

  .day-num {
    font-size: 13px;
  }

  .cell-count {
    font-size: 22px;
  }

  .cell-label {
    font-size: 10px;
  }

  .cell.is-today .day-num {
    margin-top: 8px;
  }

  .rules {
    max-width: 42em;
  }

  .cal-intro {
    max-width: 34em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bulb-glass,
  .pill-dot {
    animation: none;
  }
}
