/*
 * CalDiscovery public site styles.
 *
 * Implements the ★ Consolidated direction: B's color world on A's civic
 * structure. Dark-first; the light toggle is top-right and its choice
 * persists site-wide. Where a city has a photo, that photo's extracted
 * palette overrides the tokens below via inline custom properties written
 * by the theme script, so the page wears the city.
 *
 * Token contract: everything visual reads from these, and nothing hardcodes
 * a color except the fixed category system colors:
 *   --bg --surface --ink --mut --edge --accent --city-wash --glow
 *
 * Self-hosted webfont only; this site ships no external CDNs.
 */

/* Outfit, SIL Open Font License 1.1: see OFL-Outfit.txt beside this file.
   Variable weight axis, so one file covers the whole display range. */
@font-face {
  font-family: "Outfit";
  src: url("outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dw: 650;
  --dtrack: 0;
  --radius: 14px;
  --chip-r: 12px;
  --wrap: 1060px;

  /* Quiet base: what a city with no photo wears. Deliberately says nothing
     about the place: the photo is what earns the right to color the page. */
  --bg: #12151A;
  --surface: #1A1F26;
  --ink: #E9EDF2;
  --mut: #97A1AC;
  --edge: #29313A;
  --accent: #8FA6BE;
  --glow: rgba(143, 166, 190, .08);
  --city-wash: radial-gradient(120% 130% at 80% 0%, #232C36 0%, #1A1F26 55%, #12151A 100%);
}

/* Light mode is eggshell, never fluorescent. Neutrals are fixed here; the
   accent stays the city's, deepened for the paper ground by the pipeline. */
:root[data-theme="light"] {
  --bg: #F6F2EC;
  --surface: #FFFDF9;
  --ink: #232A32;
  --mut: #6B7683;
  --edge: #E3DDD2;
  --accent: #4A6076;
  --glow: rgba(74, 96, 118, .06);
  --city-wash: radial-gradient(120% 130% at 80% 0%, #E9E2D4 0%, #F4F0E8 55%, #F6F2EC 100%);
}

/* Category colors are FIXED system colors: they never follow the city theme,
   so a category stays recognizable everywhere on the site. Spaced around the
   hue circle for separation; the five that appear on the approved board keep
   their exact values. */
:root {
  --cat-sports: #DC9A8C;
  --cat-music: #D9B48F;
  --cat-shows: #D3CC85;
  --cat-gaming: #A9CE8A;
  --cat-market: #8FC9A0;
  --cat-community: #7FC6C4;
  --cat-civic: #8AB6D4;
  --cat-tech: #7F98D8;
  --cat-arts: #B9A0DC;
  --cat-transit: #C99AD1;
  --cat-food: #E0A0B8;
  --cat-other: #B4AEB0;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* The glow sits behind everything and carries the city's color. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(90% 55% at 50% -8%, var(--glow), transparent 70%);
  pointer-events: none;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

a { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: var(--dw);
  letter-spacing: var(--dtrack);
  text-wrap: balance;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 22px; top: 10px; z-index: 100;
  background: var(--accent); color: var(--bg);
  padding: 10px 14px; border-radius: 8px; font-weight: 600;
}

/* ---------------------------------------------------------------- masthead */

.site-header { border-bottom: 1px solid var(--edge); }
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px; padding-bottom: 16px; gap: 16px;
}
.brand {
  font-family: var(--display); font-weight: var(--dw);
  font-size: 1.06rem; letter-spacing: var(--dtrack);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--accent); }
.mast-right { display: flex; align-items: center; gap: 10px; position: relative; }

.mode-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--edge); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; font-size: .9rem; cursor: pointer;
  padding: 0; line-height: 1;
}
.mode-toggle:hover { border-color: var(--accent); }

/* First visit only: dismissed forever on first interaction. */
.mode-hint {
  position: absolute; top: 44px; right: 0; white-space: nowrap; z-index: 20;
  background: var(--accent); color: var(--bg);
  font: 600 .72rem/1 var(--body); padding: 8px 11px; border-radius: 6px;
  border: 0; cursor: pointer;
}
.mode-hint::before {
  content: ""; position: absolute; top: -4px; right: 13px;
  width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg);
}
/* Dismissed forever on first interaction: the flag is set in <head>, so a
   returning visitor never sees it flash in and out. */
:root[data-hint-seen="1"] .mode-hint { display: none; }

/* ------------------------------------------------------------------- hero */

.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 34px;
  align-items: center; padding: 44px 0 38px;
}
.hero h1 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.12; margin: 0 0 14px; }
.hero .sub { color: var(--mut); max-width: 46ch; margin: 0 0 22px; }

.skyline { width: 100%; color: var(--accent); opacity: .9; }
/* The moon gains rays and becomes the sun in light mode. */
.skyline .rays { opacity: 0; transition: opacity .45s; }
:root[data-theme="light"] .skyline .rays { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .skyline .rays { transition: none; } }

/* Behind the skyline, up to three pools of light wearing real city palettes:
   the same accents the city pages derive from their photos. Each pool
   breathes on its own slow cycle; the offsets keep them out of phase so the
   mix never settles. */
.skyart { position: relative; }
.skyart .skyline { position: relative; z-index: 1; display: block; }
.sky-glows { position: absolute; inset: -14% -8%; pointer-events: none; }
.sky-glows i {
  --sg: var(--gd);
  position: absolute; width: 62%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--sg), transparent 72%);
  animation: sky-breathe 11s ease-in-out infinite alternate;
}
:root[data-theme="light"] .sky-glows i { --sg: var(--gl); }
.sky-glows i:nth-child(1) { left: -8%; top: -12%; }
.sky-glows i:nth-child(2) { right: -10%; top: 16%; animation-duration: 15s; animation-delay: -5s; }
.sky-glows i:nth-child(3) { left: 20%; bottom: -18%; animation-duration: 9s; animation-delay: -8s; }
@keyframes sky-breathe {
  from { opacity: .5; transform: scale(.95); }
  to   { opacity: 1;  transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .sky-glows i { animation: none; } }

.clients { display: flex; flex-wrap: wrap; gap: 10px; }
.client {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .82rem/1 var(--body);
  background: var(--surface); border: 1px solid var(--edge); color: var(--ink);
  border-radius: var(--chip-r); padding: 11px 16px; text-decoration: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
}
.client .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .7; }
.client.primary {
  background: var(--accent); border-color: var(--accent); color: var(--bg);
  box-shadow: 0 4px 22px var(--glow);
}
:root[data-theme="light"] .client { box-shadow: 0 8px 30px rgba(50, 45, 35, .10); }

/* The sync beam: a real upcoming event travelling into a phone's calendar.
   Signature element of the approved direction. */
.beam-demo {
  position: relative; display: grid;
  grid-template-columns: 1fr 70px 96px; align-items: center;
  margin-top: 24px;
}
.beam-card {
  background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--chip-r); padding: 12px 14px; font-size: .8rem;
}
.beam-card b { display: block; font-size: .84rem; line-height: 1.3; }
.beam-card span { color: var(--mut); }
.beam-path {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 16px);
}
@media (prefers-reduced-motion: no-preference) {
  .beam-path { animation: beam 1.2s linear infinite; }
  @keyframes beam { to { background-position: 16px 0; } }
}
.phone { border: 2px solid var(--mut); border-radius: 14px; height: 150px; padding: 10px 8px; }
.phone .prow { height: 9px; border-radius: 3px; background: var(--edge); margin-bottom: 6px; }
.phone .prow.new { background: var(--accent); }

/* --------------------------------------------------------------- sections */

.b-label {
  font: 600 .68rem/1 var(--body); letter-spacing: .14em;
  text-transform: uppercase; color: var(--mut); margin: 0 0 14px;
}
section { padding: 30px 0; }
.divider { border-top: 1px solid var(--edge); }

/* ---------------------------------------------------------- city search */

.citysearch { padding-bottom: 6px; }
.search {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--edge); background: var(--surface);
  border-radius: var(--chip-r); padding: 0 14px; max-width: 420px;
}
.search:focus-within { border-color: var(--accent); }
.search-icon { color: var(--mut); font-size: 1rem; }
.search input {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font: 16px/1 var(--body); padding: 13px 0; min-width: 0;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--mut); }
.search-note, .search-empty {
  color: var(--mut); font-size: .82rem; margin: 10px 0 0;
}
.search-note u { text-decoration: underline dotted; color: var(--ink); }

/* ------------------------------------------------------------- city cards */

.region h2 { font-size: 1.15rem; margin: 0 0 16px; }
.city-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.city-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--radius); padding: 18px; text-decoration: none;
  color: var(--ink); transition: border-color .18s, transform .18s;
}
.city-card:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .city-card { transition: none; } }
.city-name { font-family: var(--display); font-weight: var(--dw); font-size: 1.1rem; }
.city-meta { color: var(--mut); font-size: .85rem; }

/* ------------------------------------------------------------ city header */

.cityhead {
  display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: end;
  background: var(--city-wash);
  border-radius: var(--radius); border: 1px solid var(--edge);
  padding: 28px; margin-top: 26px;
}
.cityhead h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin: 0; }
.cityhead .meta { color: var(--mut); font-size: .9rem; margin-top: 6px; }

.photo-frame { margin: 0; }
.photo {
  border-radius: var(--radius); aspect-ratio: 16 / 10; width: 100%;
  /* height:auto is load-bearing: the img's width/height attributes are kept
     so the box is reserved before the photo loads, but as presentational
     hints they would otherwise beat aspect-ratio and force a 800px box. */
  height: auto;
  display: block; object-fit: cover;
  border: 1px solid var(--edge); background: var(--surface);
}
.swatches { display: flex; gap: 6px; margin-top: 10px; }
.swatches i { height: 22px; flex: 1; border-radius: 4px; border: 1px solid var(--edge); }
.photo-credit { font: italic .74rem/1.4 var(--body); color: var(--mut); margin-top: 8px; }
.photo-credit a { color: var(--mut); }

/* --------------------------------------------------------- category chips */

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cat {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .8rem/1 var(--body);
  border: 1px solid var(--edge); background: var(--surface); color: var(--ink);
  border-radius: var(--chip-r); padding: 9px 14px; text-decoration: none;
}
.cat i { width: 14px; height: 4px; border-radius: 2px; background: var(--cc, var(--accent)); }
.cat small { color: var(--mut); font-weight: 500; }

/* -------------------------------------------------------- subscribe list */

.cal-list { display: grid; gap: 12px; }
.cal {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px;
  display: grid; gap: 12px;
  grid-template-columns: 1fr auto; align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
}
:root[data-theme="light"] .cal { box-shadow: 0 8px 30px rgba(50, 45, 35, .10); }
.cal-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cal-label i { width: 14px; height: 4px; border-radius: 2px; background: var(--cc, var(--accent)); }
.cal-count { color: var(--mut); font-size: .85rem; }
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-url {
  grid-column: 1 / -1; font: .74rem/1.5 var(--mono); color: var(--mut);
  overflow-wrap: anywhere;
}

/* Each subscribe card can be peeked like the category chips: about six
   upcoming rows, the rest a scroll away, one card open at a time. The
   toggle is injected by calendar.js once the event data is in hand. */
.cal-peek-toggle {
  font: 600 .72rem/1 var(--body); color: var(--mut);
  background: transparent; border: 1px solid var(--edge);
  border-radius: 999px; padding: 6px 11px; cursor: pointer;
}
.cal-peek-toggle:hover { border-color: var(--accent); color: var(--ink); }
.cal-peek-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.cal-peek {
  grid-column: 1 / -1; border-top: 1px solid var(--edge);
  margin: 2px -18px -16px;
}

.btn {
  display: inline-flex; align-items: center; font: 600 .8rem/1 var(--body);
  border: 1px solid var(--edge); background: transparent; color: var(--ink);
  border-radius: var(--chip-r); padding: 10px 15px; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ------------------------------------------------------------------ blade */

.blade {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.blade h2 {
  font: 600 .72rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut); margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--edge);
}
.ev {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--edge);
}
.ev:last-child { border-bottom: none; }
.ev time {
  font: .72rem/1.4 var(--mono); color: var(--mut);
  font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column;
}
.ev time .d { color: var(--ink); opacity: .8; }
.ev time .t { white-space: nowrap; }
.ev b { display: block; font-weight: 600; font-size: .88rem; line-height: 1.3; }
.ev i {
  display: inline-block; width: 14px; height: 4px; border-radius: 2px;
  background: var(--cc, var(--accent)); margin-right: 6px; vertical-align: 3px;
}
.ev .loc { font-size: .74rem; color: var(--mut); }

/* --------------------------------------------------------------- calendar */

.calwrap { position: relative; }
.cal-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav b {
  font-family: var(--display); font-weight: var(--dw); font-size: 1.05rem;
  min-width: 11ch;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; padding: 0;
  border: 1px solid var(--edge); background: var(--surface); color: var(--ink);
  cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); }
.views { display: flex; gap: 4px; }
.views button {
  font: 600 .7rem/1 var(--body); padding: 8px 11px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--mut);
  cursor: pointer;
}
.views button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.views button:hover:not([aria-pressed="true"]) { color: var(--ink); }

.cal-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cal-cats .cat { cursor: pointer; opacity: .55; }
.cal-cats .cat[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }

.cal-grid { display: grid; gap: 18px; }
.cal-grid.view-three { grid-template-columns: repeat(3, 1fr); }

.cal-month {
  border: 1px solid var(--edge); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.cal-month-head {
  padding: 11px 14px; border-bottom: 1px solid var(--edge);
  font-family: var(--display); font-weight: var(--dw);
}
.view-month .cal-month-head { display: none; }
.cal-month .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month .dow {
  font: 600 .62rem/1 var(--body); letter-spacing: .08em; color: var(--mut);
  text-transform: uppercase; padding: 8px 0; text-align: center;
  border-bottom: 1px solid var(--edge);
}
.day {
  min-height: 66px; padding: 6px 7px; text-align: left; cursor: pointer;
  border: 0; border-top: 1px solid var(--edge); border-left: 1px solid var(--edge);
  background: transparent; color: inherit; font: inherit;
  display: flex; flex-direction: column; gap: 5px;
}
.day:nth-child(7n + 1) { border-left: none; }
.day:hover { background: var(--glow); }
.day.out { opacity: .38; }
.day.empty { cursor: default; }
.day n {
  font: .72rem/1 var(--mono); color: var(--mut);
  font-variant-numeric: tabular-nums; align-self: flex-start;
}
.day.today n {
  color: var(--bg); background: var(--accent); border-radius: 4px;
  padding: 3px 5px; font-weight: 700;
}
.day .ticks { display: flex; flex-wrap: wrap; gap: 3px; }
.day .ticks i { width: 14px; height: 4px; border-radius: 2px; background: var(--cc); }
.day-count {
  margin-top: auto; align-self: flex-end;
  font: .64rem/1 var(--mono); color: var(--mut); font-variant-numeric: tabular-nums;
}
.day:hover .day-count { color: var(--accent); }
.view-three .day { min-height: 46px; }
.view-three .day .ticks i { width: 9px; height: 3px; }

.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
}
.week-day {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; min-height: 150px;
}
.week-day.today { border-color: var(--accent); }
.week-day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 11px; border-bottom: 1px solid var(--edge);
}
.week-day-head .dow {
  font: 600 .62rem/1 var(--body); letter-spacing: .08em;
  text-transform: uppercase; color: var(--mut);
}
.week-day-head .num { font: .78rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.week-events { padding: 8px; display: grid; gap: 7px; }
.week-events .none { color: var(--mut); font-size: .72rem; margin: 2px; }
.week-ev {
  border-left: 3px solid var(--cc); padding: 4px 7px;
  background: var(--bg); border-radius: 5px;
}
.week-ev time { display: block; font: .66rem/1.3 var(--mono); color: var(--mut); }
.week-ev b { font-size: .74rem; font-weight: 600; line-height: 1.25; }

/* ------------------------------------------------------------------ blade */

/* -------------------------------------------------- category peek foldout */

.cat-foldout {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 16px; overflow: hidden;
}
.foldout-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--edge);
}
.foldout-head h3 {
  margin: 0; font-size: .95rem; display: flex; align-items: center; gap: 9px;
  text-transform: capitalize;
}
.foldout-head h3 i {
  width: 16px; height: 5px; border-radius: 2px; background: var(--cc);
}
/* About six rows in view, the rest reachable by scrolling: enough to judge a
   category without the page turning into a wall of events. */
.foldout-list { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.foldout-day h4 {
  position: sticky; top: 0; margin: 0; z-index: 1;
  padding: 7px 16px; background: var(--bg); color: var(--mut);
  font: 600 .62rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--edge);
}
.foldout-list .ev { grid-template-columns: 66px 1fr; padding: 11px 16px; }
.cat-foldout > .btn { margin: 12px 16px 14px; }

/* Location and source each get their own line wherever event rows appear,
   so they never run together as one string. */
.foldout-list .ev .loc, .blade-list .ev .loc,
.foldout-list .ev .src, .blade-list .ev .src { display: block; }
.foldout-list .ev .src, .blade-list .ev .src {
  font-size: .7rem; color: var(--mut); margin-top: 2px;
}
.foldout-list .ev .src a, .blade-list .ev .src a {
  color: var(--accent); text-decoration: none;
}
.foldout-list .ev .src a:hover, .blade-list .ev .src a:hover {
  text-decoration: underline;
}

/* The category swatch beside an event doubles as its legend: hovering or
   tapping it unfurls the category name. Deliberately an inline expansion
   rather than a floating tooltip, because these rows live inside scrolling
   panels where an absolutely positioned bubble gets clipped at the edges. */
.cat-dot {
  display: inline-flex; align-items: center; vertical-align: middle;
  height: 12px; padding: 0; margin-right: 6px;
  border: 0; background: transparent; cursor: pointer;
}
.cat-dot::before {
  content: ""; flex: none;
  width: 14px; height: 4px; border-radius: 2px; background: var(--cc);
}
.cat-pop {
  max-width: 0; overflow: hidden; white-space: nowrap;
  font: 700 .6rem/1 var(--body); letter-spacing: .06em;
  text-transform: uppercase; color: var(--cc);
  transition: max-width .22s ease, margin-left .22s ease;
}
.cat-dot:hover .cat-pop,
.cat-dot:focus-visible .cat-pop,
.cat-dot.shown .cat-pop { max-width: 100px; margin-left: 5px; }
@media (prefers-reduced-motion: reduce) { .cat-pop { transition: none; } }

/* ---------------------------------------------------------------- backlink */

.backlink { margin: 18px 0 0; font-size: .85rem; }
.backlink a { text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

/* Folds out from the left. Off-canvas by default so the calendar keeps the
   full width until the reader asks for the list. */
.blade-panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(400px, 88vw);
  z-index: 60; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--edge);
  transform: translateX(-101%); transition: transform .28s ease;
  box-shadow: 0 0 40px rgba(0, 0, 0, .35);
}
.blade-open .blade-panel { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .blade-panel { transition: none; } }

.blade-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--edge);
}
.blade-head h3 { margin: 0; font-size: .95rem; }
.blade-head p {
  margin: 2px 0 0; font: 600 .64rem/1 var(--body); letter-spacing: .12em;
  text-transform: uppercase; color: var(--mut);
}
.blade-list { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.blade-day h4 {
  position: sticky; top: 0; margin: 0; z-index: 1;
  padding: 8px 16px; background: var(--bg); color: var(--mut);
  font: 600 .64rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--edge);
}
.blade-empty { padding: 20px 16px; color: var(--mut); font-size: .85rem; }
.blade-list .ev { grid-template-columns: 66px 1fr; padding: 11px 16px; }

.blade-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .78rem/1 var(--body); cursor: pointer;
  border: 1px solid var(--edge); background: var(--surface); color: var(--ink);
  border-radius: var(--chip-r); padding: 10px 15px;
}
.blade-toggle:hover { border-color: var(--accent); }
.blade-scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .28s;
}
.blade-open .blade-scrim { opacity: 1; pointer-events: auto; }

/* ----------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--edge); margin-top: 40px; }
.site-footer .wrap {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px;
  align-items: center; color: var(--mut); font-size: .82rem;
  padding-top: 26px; padding-bottom: 46px;
}
.site-footer .donate {
  justify-self: center; text-align: center; font: 600 .82rem/1 var(--body);
  color: var(--ink); border: 1px solid var(--edge); border-radius: var(--chip-r);
  padding: 10px 18px; background: var(--surface); text-decoration: none;
}
.site-footer .req { justify-self: end; text-align: right; line-height: 1.9; }
.site-footer .foot-left { max-width: 34ch; }
.site-footer .foot-left a { display: block; margin-top: 4px; }

/* ------------------------------------------------------------ prose pages */

.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 12px; }
.prose h2 { font-size: 1.15rem; margin: 26px 0 10px; }
.prose .lede { color: var(--mut); font-size: 1.02rem; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin: 7px 0; }
.prose .contact {
  border: 1px solid var(--edge); background: var(--surface);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 22px;
}

.methods, .asks { display: grid; gap: 18px; }
.methods { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.method, .ask {
  border: 1px solid var(--edge); background: var(--surface);
  border-radius: var(--radius); padding: 22px 24px;
}
.method h2, .ask h2 { margin: 0 0 8px; font-size: 1.12rem; }
.method h3, .ask h3 {
  font: 600 .68rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut); margin: 20px 0 8px;
}
.method ul, .ask ul { padding-left: 1.1rem; margin: 0; }
.method li, .ask li { margin: 7px 0; }
.method .tag {
  display: inline-block; font: 600 .64rem/1 var(--body); letter-spacing: .1em;
  text-transform: uppercase; color: var(--bg); background: var(--accent);
  border-radius: 5px; padding: 5px 8px; margin: 0 0 10px;
}
.method .how-to { color: var(--mut); font-size: .88rem; margin-bottom: 0; }
.ask .quiet { color: var(--mut); font-size: .88rem; }
.site-footer u { text-decoration: underline dotted; color: var(--ink); }
.site-footer .gen { grid-column: 1 / -1; text-align: center; font-size: .74rem; opacity: .75; }

/* -------------------------------------------------------- calendar editor */

/* The invitation on the city page: subscribing is the ready-made half,
   the editor is the hands-on half. */
.ed-invite {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--glow); padding: 16px 18px;
  color: var(--ink); text-decoration: none;
}
.ed-invite-text b { display: block; font-weight: 600; }
.ed-invite-text span { color: var(--mut); font-size: .84rem; max-width: 52ch; display: block; }
.ed-invite .btn { pointer-events: none; }

.ed-head { padding: 26px 0 6px; }
.ed-head h1 { margin: 4px 0 10px; }
.ed-head .sub { color: var(--mut); max-width: 62ch; margin: 0; }
.ed-loading { color: var(--mut); padding: 18px 0 30px; }

.ed-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; }
.ed-block {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); padding: 14px 16px;
}
.ed-block .b-label { margin-top: 0; }
.ed-note { color: var(--mut); font-size: .8rem; margin: 0 0 10px; max-width: 52ch; }
.ed-block .cal-cats { margin-bottom: 2px; }

.ed-standalone { margin-top: 10px; font-size: .84rem; }

/* Shown only when a previous session's picks came back. */
.ed-restored {
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--glow); color: var(--ink);
  padding: 11px 15px; font-size: .84rem; margin: 18px 0 0;
}
.ed-linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--accent);
  text-decoration: underline;
}

/* Sources can run long; the panel scrolls rather than pushing the page. */
.ed-source-list { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; }

/* Window chips behave like the category chips: exactly one pressed. */
.ed-window { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-window .cat { cursor: pointer; opacity: .55; }
.ed-window .cat[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }

/* The live month preview of the file being built. */
.ed-cal { margin: 0 0 18px; }
.ed-cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ed-cal-nav b {
  font-family: var(--display); font-weight: var(--dw); font-size: 1.05rem;
  min-width: 11ch;
}
.ed-cal-hint { color: var(--mut); font-size: .74rem; margin-left: auto; }
/* A day whose every event was trimmed away: present, but visibly cleared. */
.ed-cal .day.cleared n { opacity: .4; }
.ed-cal .day.open { background: var(--glow); }
.ed-day { margin-top: 12px; margin-bottom: 0; }
.ed-day .foldout-list .ev { grid-template-columns: auto 66px 1fr; cursor: pointer; }
.ed-day .foldout-list .ev input {
  width: 16px; height: 16px; accent-color: var(--accent);
  margin: 0; align-self: center; cursor: pointer;
}
.ed-day .ev.off b, .ed-day .ev.off .loc, .ed-day .ev.off time { opacity: .38; }
.ed-day .ev.off b { text-decoration: line-through; }

/* The full list, under its own heading and separated from the calendar
   above it. Rows are labels, so anywhere on a row toggles its checkbox. */
.ed-all-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; border-top: 1px solid var(--edge);
  margin-top: 26px; padding-top: 18px; margin-bottom: 12px;
}
.ed-all-head h2 { margin: 0; font-size: 1.15rem; }
.ed-all-note { color: var(--mut); font-size: .78rem; }

/* Its own scroll box rather than the whole page: roughly a dozen events in
   view, never taller than the viewport, so the calendar above and the bar
   below stay reachable while scrolling the list. */
.ed-list {
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 18px;
  max-height: min(78vh, 940px); min-height: 320px;
  overflow-y: auto; overscroll-behavior: contain;
}
.ed-list .foldout-day h4 {
  position: sticky; top: 0; margin: 0; z-index: 1;
  padding: 7px 16px; background: var(--bg); color: var(--mut);
  font: 600 .62rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--edge);
}
.ed-list .ev {
  grid-template-columns: auto 66px 1fr; align-items: baseline;
  padding: 11px 16px; cursor: pointer;
}
.ed-list .ev:hover { background: var(--glow); }
.ed-list .ev input {
  width: 16px; height: 16px; accent-color: var(--accent);
  margin: 0; align-self: center; cursor: pointer;
}
.ed-list .ev .loc, .ed-list .ev .src { display: block; }
.ed-list .ev .src { font-size: .7rem; color: var(--mut); margin-top: 2px; }
/* Unchecked rows stay put and stay legible: a dropped event should be
   findable again, not gone. */
.ed-list .ev.off b, .ed-list .ev.off .loc, .ed-list .ev.off time { opacity: .38; }
.ed-list .ev.off b { text-decoration: line-through; }

/* The bar rides above the list's tail so the count and the download are
   always in reach, however deep the reader has scrolled. */
.ed-bar {
  position: sticky; bottom: 12px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); padding: 12px 16px; margin-bottom: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
:root[data-theme="light"] .ed-bar { box-shadow: 0 12px 40px rgba(50, 45, 35, .16); }
.ed-count { font-weight: 600; font-size: .9rem; }
.ed-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-bar-note { color: var(--mut); font-size: .74rem; }

/* ------------------------------------------------------ responsive + a11y */

@media (max-width: 860px) {
  .hero, .cityhead { grid-template-columns: 1fr; }
  .cityhead { padding: 22px; }
  .hero { padding: 30px 0 26px; gap: 24px; }
  .skyline { max-height: 150px; }
  .beam-demo { grid-template-columns: 1fr 44px 82px; }
}

@media (max-width: 620px) {
  .site-footer .wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer .req { justify-self: center; text-align: center; }
  .cal { grid-template-columns: 1fr; }
  .cal-actions { justify-content: flex-start; }
  .ev { grid-template-columns: 78px 1fr; gap: 10px; padding: 12px 14px; }
  .ed-controls { grid-template-columns: 1fr; }
  .ed-list .ev { grid-template-columns: auto 66px 1fr; }
  .ed-bar { bottom: 8px; }
  .wrap { padding: 0 16px; }
}

@media print {
  .mode-toggle, .mode-hint { display: none; }
}
