/* Fine, I'll go. Light: Bluebird Day. Dark: Night Skiing. */

:root {
  --pink: #ff2e93;
  --yellow: #eaff3a;
  --teal: #00d6c9;
  --green: #38ffb0;
  --violet: #6a2cf0;
  --night: #150a36;

  --bg: #fbfaff;
  --ink: #1c0f45;
  --muted: #5d5285;
  --line: #e4dcfb;
  --soft: #ece6ff;
  --hero: #6a2cf0;
  --hero-ink: #ffffff;
  --hero-sub: #ffffff;
  --title-a: #ffffff;
  --title-b: #eaff3a;
  --ridge-back: #8457f5;
  --time: #5a1fe0;
  --link: #1c0f45;
  --tab-on-bg: #1c0f45;
  --tab-on-ink: #eaff3a;
  --tab-off-line: #1c0f45;
  --on-neon: #1c0f45;
  --focus: #ff2e93;
  --band-1: var(--pink);
  --band-2: var(--yellow);
  --band-3: var(--teal);

  --display: "Kanit", "Arial Narrow", sans-serif;
  --body: "Albert Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #150a36;
  --ink: #f6f2ff;
  --muted: #b9acec;
  --line: #2f1d6b;
  --soft: #271560;
  --hero: #150a36;
  --hero-ink: #f6f2ff;
  --hero-sub: #cfc4f5;
  --title-a: #ff2e93;
  --title-b: #eaff3a;
  --ridge-back: #2a1466;
  --time: #00d6c9;
  --link: #f6f2ff;
  --tab-on-bg: #eaff3a;
  --tab-on-ink: #150a36;
  --tab-off-line: #6b55b8;
  --focus: #eaff3a;
  --band-1: var(--green);
  --band-2: var(--teal);
  --band-3: var(--pink);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--violet) var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--pink); color: #fff; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--yellow); color: #1c0f45; padding: 0.6rem 1rem; font-weight: 700;
}
.skip:focus { top: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero);
  color: var(--hero-ink);
  --bh: clamp(1.9rem, 5.2vw, 3.6rem);
  padding: clamp(1.25rem, 4vw, 2.5rem) 0 clamp(5rem, 12vw, 8.5rem);
}
.hero-art { position: absolute; inset: 0; }
.band {
  position: absolute;
  right: -12%;
  width: min(74%, 62rem);
  height: var(--bh);
  transform: rotate(-24deg);
  transform-origin: 100% 50%;
  clip-path: inset(0);
  animation: sweep 0.9s var(--ease) both;
}
.b1 { background: var(--band-1); top: 4%; }
.b2 { background: var(--band-2); top: calc(4% + var(--bh)); animation-delay: 0.08s; }
.b3 { background: var(--band-3); top: calc(4% + var(--bh) * 2); animation-delay: 0.16s; }
@keyframes sweep { from { clip-path: inset(0 0 0 100%); } }

[data-theme="dark"] .band {
  left: -12%; right: -12%; width: auto;
  height: calc(var(--bh) * 0.72);
  border-radius: 50%;
  transform: rotate(-7deg);
  transform-origin: 50% 50%;
}
[data-theme="dark"] .b1 { top: auto; bottom: calc(var(--aur) + var(--bh) * 1.25); }
[data-theme="dark"] .b2 { top: auto; bottom: calc(var(--aur) + var(--bh) * 0.62); left: 6%; }
[data-theme="dark"] .b3 { top: auto; bottom: var(--aur); left: 24%; }
[data-theme="dark"] .hero { --aur: clamp(1.6rem, 4.5vw, 3.6rem); padding-bottom: clamp(8.5rem, 20vw, 12rem); }

.ridge { position: absolute; left: 0; bottom: -1px; width: 100%; display: block; }
.ridge-back { height: clamp(3.4rem, 9vw, 7rem); fill: var(--ridge-back); }
.ridge-front { height: clamp(2.4rem, 6.5vw, 5rem); fill: var(--bg); }

.hero-in { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.hero h1 {
  font: italic 900 clamp(3.25rem, 13vw, 6rem)/0.86 var(--display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--title-a);
}
.hero h1 span { color: var(--title-b); }
.hero p { margin-top: 0.75rem; max-width: 11rem; text-wrap: balance; font-weight: 600; font-size: clamp(0.95rem, 2.4vw, 1.15rem); color: var(--hero-sub); }
.theme {
  flex: none;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border: 2px solid currentColor; border-radius: 50%;
  background: color-mix(in srgb, var(--hero) 70%, transparent);
  color: var(--hero-ink);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.theme:hover { background: var(--yellow); color: #1c0f45; border-color: var(--yellow); }
.theme .i-sun, [data-theme="dark"] .theme .i-moon { display: none; }
[data-theme="dark"] .theme .i-sun { display: block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.6rem; padding: 0.5rem 0.35rem 0; }
.tabs button {
  padding: 0.55rem 1.1rem;
  min-height: 2.75rem;
  border: 2.5px solid var(--tab-off-line);
  background: transparent;
  color: var(--ink);
  transform: skewX(-10deg);
  font: italic 800 1.05rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tabs button span { display: block; transform: skewX(10deg); }
.tabs button:hover { background: var(--soft); }
.tabs button[aria-selected="true"] { background: var(--tab-on-bg); border-color: var(--tab-on-bg); color: var(--tab-on-ink); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3rem; padding-top: 1.25rem; }
#view { min-width: 0; outline: none; padding-bottom: 3rem; }

/* ---------- Search ---------- */
.search { position: relative; margin-bottom: 0.9rem; }
.search svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.9rem 0.5rem 2.6rem;
  border: 2.5px solid var(--tab-off-line); border-radius: 0;
  background: var(--bg); color: var(--ink); caret-color: var(--pink);
  font: 600 1rem/1.2 var(--body);
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.search input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.search input:hover { background: var(--soft); }
.search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 0; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.results { padding-bottom: 1.25rem; font-weight: 600; color: var(--muted); }
.results strong { color: var(--ink); }

/* ---------- Filters ---------- */
.filters-head { display: flex; align-items: center; justify-content: space-between; min-height: 1.75rem; }
.filters h2 { font: 700 0.8125rem/1 var(--body); color: var(--muted); }
.clear {
  border: 0; background: none; padding: 0.25rem 0;
  font-weight: 700; font-size: 0.875rem; color: var(--ink);
  text-decoration: underline; text-underline-offset: 0.18em;
}
.chips {
  display: flex; gap: 0.5rem;
  margin: 0.5rem -1.25rem 0; padding: 0.25rem 1.25rem 0.75rem;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.25rem; padding: 0.3rem 0.85rem;
  border: 0; border-radius: 999px;
  background: var(--soft); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem; white-space: nowrap;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.chip small { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.chip:hover { background: color-mix(in srgb, var(--chip) 35%, var(--soft)); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--chip); color: var(--on-neon); }
.chip[aria-pressed="true"] small { color: var(--on-neon); }
.c0 { --chip: var(--pink); } .c1 { --chip: var(--teal); } .c2 { --chip: var(--yellow); } .c3 { --chip: var(--green); }

/* ---------- Day sections ---------- */
.day + .day { margin-top: 2.5rem; }
.day-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.75rem; padding-bottom: 0.4rem; }
.day-head h2 { font: italic 900 clamp(1.9rem, 7vw, 2.5rem)/1 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.flag {
  display: inline-block; padding: 0.2rem 0.65rem;
  transform: skewX(-10deg);
  background: var(--flag); color: var(--on-neon);
  font: italic 800 0.9375rem/1.2 var(--display); text-transform: uppercase;
}
.f0 { --flag: var(--pink); } .f1 { --flag: var(--teal); } .f2 { --flag: var(--yellow); } .f3 { --flag: var(--green); }
.f4 { --flag: var(--violet); color: #fff; }
.count { font-size: 0.875rem; font-weight: 500; color: var(--muted); }

.ev {
  display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 0 0.9rem;
  padding: 0.85rem 0; border-bottom: 2px solid var(--line);
}
.ev-time { font: italic 800 1.3rem/1.2 var(--display); color: var(--time); text-transform: lowercase; }
.ev-time small { display: block; margin-top: 0.15rem; font: 500 0.8125rem/1.3 var(--body); color: var(--muted); text-transform: none; }
.ev-time.none { font: 600 0.8125rem/1.35 var(--body); color: var(--muted); text-transform: none; padding-top: 0.3rem; }
.ev-title { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; text-wrap: balance; }
.ev-title a { text-decoration: none; }
.ev-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--pink); }
.ev-title svg { display: inline-block; vertical-align: -0.05em; margin-left: 0.3rem; color: var(--muted); }
.ev-where, .ev-note { font-size: 0.9375rem; color: var(--muted); margin-top: 0.15rem; max-width: 60ch; }
.ev-note { color: var(--ink); }
.ev-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; margin-top: 0.4rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.ev-meta li + li::before { content: "/"; margin-right: 0.5rem; opacity: 0.5; }
.ev.over .ev-time, .ev.over .ev-title a, .ev.over .ev-note { color: var(--muted); }
.ev.over .ev-title a { text-decoration: line-through; text-decoration-thickness: 2px; }

.empty { padding: 0.85rem 0 1rem; border-bottom: 2px solid var(--line); color: var(--muted); }
.status { padding: 2rem 0; color: var(--muted); font-weight: 500; }
.status button, .more {
  display: inline-block; margin-top: 0.75rem; padding: 0.5rem 1rem; min-height: 2.75rem;
  border: 2.5px solid var(--ink); background: none; font-weight: 700;
}
.status button:hover, .more:hover { background: var(--soft); }
.more { margin-top: 2rem; }

/* ---------- Calendar ---------- */
.cal { display: grid; gap: 2rem 3rem; }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.cal-nav h2 { flex: 1; font: italic 900 clamp(1.5rem, 6vw, 2rem)/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.cal-nav button {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border: 2.5px solid var(--tab-off-line); background: none; border-radius: 50%;
}
.cal-nav button:hover:not(:disabled) { background: var(--soft); }
.cal-nav button:disabled { opacity: 0.35; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { padding: 0.35rem 0; text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.cell {
  position: relative; aspect-ratio: 1; min-height: 2.75rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  border: 0; border-radius: 10px; background: none; padding: 0;
  font: italic 800 1.15rem/1 var(--display); color: var(--muted);
  transition: background-color 0.15s var(--ease);
}
.cell.has { background: var(--soft); color: var(--ink); }
.cell:hover:not(:disabled) { background: color-mix(in srgb, var(--pink) 28%, var(--soft)); }
.cell:disabled { cursor: default; opacity: 0.55; }
.cell .n {
  font: 700 0.6875rem/1 var(--body); padding: 0.15rem 0.4rem; border-radius: 999px;
  background: var(--pink); color: var(--on-neon);
}
.cell.today { box-shadow: inset 0 0 0 3px var(--pink); }
.cell[aria-pressed="true"] { background: var(--tab-on-bg); color: var(--tab-on-ink); }
.cell[aria-pressed="true"] .n { background: var(--tab-on-ink); color: var(--tab-on-bg); }
.cell.pad { visibility: hidden; }

/* ---------- Footer ---------- */
.foot { padding: 1.5rem 0 3rem; border-top: 2px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.foot p { max-width: 65ch; }
.foot p + p { margin-top: 0.4rem; }
.foot .sample { display: inline-block; padding: 0.15rem 0.6rem; background: var(--yellow); color: #1c0f45; font-weight: 700; transform: skewX(-10deg); }

/* ---------- Wider screens ---------- */
@media (min-width: 40rem) {
  .hero p { max-width: none; }
}

@media (min-width: 60rem) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); padding-top: 2rem; }
  .filters { position: sticky; top: 1.5rem; align-self: start; }
  .chips { flex-wrap: wrap; margin: 0.6rem 0 0; padding: 0; overflow: visible; }
  .ev { grid-template-columns: 6rem minmax(0, 1fr); }
  .cal { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); align-items: start; }
  :root:not([data-theme="dark"]) .band { right: -4%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
