@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --bg-elevated: #ffffff;
  --ink: #1c1f24;
  --ink-muted: #4a5568;
  --slate: #3d4a5c;
  --steel: #5b7a9c;
  --line: #d8dde6;
  --line-strong: #b8c2d0;
  --monitor-w: 20rem;
  --speak-up-w: 20rem;
  --header-h: 4.25rem;
  --float-gap: 0.75rem;
  --float-top: calc(var(--header-h) + var(--float-gap));
  --float-margin-bottom: 1.25rem;
  --page-max: 52rem;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --max: 40rem;
  --shadow-float: 0 6px 28px rgba(28, 31, 36, 0.07);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--steel);
}

a:hover {
  color: var(--slate);
}

.font-mono {
  font-family: var(--font-mono);
}

/* —— Live monitor: floating panel (desktop) —— */
.live-monitor--float {
  display: none;
}

.live-monitor__head {
  flex-shrink: 0;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.live-monitor__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.live-monitor__sub {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.live-monitor__viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--bg-elevated);
}

.live-monitor__track {
  display: flex;
  flex-direction: column;
  padding: 0 1.1rem 1rem;
}

.monitor-feed-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.monitor-feed-item:last-child {
  border-bottom: none;
}

.monitor-feed-item__body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.monitor-feed-item__body a {
  color: inherit;
  text-decoration: none;
}

.monitor-feed-item__body a:hover {
  color: var(--steel);
}

.monitor-feed-item__meta {
  margin: 0.45rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.live-monitor--fresh {
  animation: monitor-fresh-pulse 2.4s ease-out;
}

@keyframes monitor-fresh-pulse {
  0% {
    box-shadow: var(--shadow-float), 0 0 0 0 rgba(91, 122, 156, 0.45);
  }
  35% {
    box-shadow: var(--shadow-float), 0 0 0 3px rgba(91, 122, 156, 0.2);
  }
  100% {
    box-shadow: var(--shadow-float), 0 0 0 0 rgba(91, 122, 156, 0);
  }
}

@media (min-width: 1180px) {
  .live-monitor--float {
    position: fixed;
    top: var(--float-top);
    right: 1.25rem;
    left: auto;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: var(--monitor-w);
    max-height: calc(100vh - var(--float-top) - var(--float-margin-bottom));
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-float);
    overflow: hidden;
  }
}

@media (min-width: 1560px) {
  .live-monitor--float {
    right: auto;
    left: calc(50% + var(--page-max) / 2 + 1.5rem);
  }
}

/* —— Speak up: floating panel —— */
.speak-up--float {
  display: none;
}

.speak-up__head {
  flex-shrink: 0;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.speak-up__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.speak-up__viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--bg-elevated);
}

.speak-up__form {
  padding: 1rem 1.1rem 1.15rem;
}

.speak-up__form .form-field {
  margin-bottom: 0.8rem;
}

.speak-up__form .form-field input,
.speak-up__form .form-field select {
  font-size: 0.88rem;
  padding: 0.5rem 0.6rem;
}

.speak-up__form .consent {
  font-size: 0.8rem;
  margin: 0.9rem 0;
}

.speak-up-fab {
  display: none;
}

.speak-up-backdrop {
  display: none;
}

@media (min-width: 1180px) {
  .speak-up--float {
    position: fixed;
    top: var(--float-top);
    left: 1.25rem;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: var(--speak-up-w);
    max-height: calc(100vh - var(--float-top) - var(--float-margin-bottom));
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-float);
    overflow: hidden;
  }
}

@media (min-width: 1560px) {
  .speak-up--float {
    left: calc(50% - var(--page-max) / 2 - var(--speak-up-w) - 1.5rem);
  }
}

@media (max-width: 1179px) {
  .site-main {
    padding-bottom: 5.5rem;
  }

  .speak-up-fab {
    display: block;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1100;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.1rem;
    border: 1px solid var(--slate);
    background: var(--slate);
    color: var(--bg-elevated);
    cursor: pointer;
    box-shadow: var(--shadow-float);
  }

  .speak-up-fab:hover {
    background: var(--ink);
    border-color: var(--ink);
  }

  .speak-up-fab[aria-expanded='true'] {
    background: var(--ink);
    border-color: var(--ink);
  }

  .speak-up--float {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 40rem);
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(28, 31, 36, 0.12);
    transform: translateY(100%);
    transition: transform 0.28s ease;
    pointer-events: none;
    visibility: hidden;
  }

  .speak-up--float.speak-up--open {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  .speak-up-backdrop--visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1099;
    background: rgba(28, 31, 36, 0.32);
  }

  body.speak-up-sheet-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .speak-up--float {
    transition: none;
  }
}

/* —— Mobile ticker —— */
.live-monitor--ticker {
  display: none;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.live-monitor--ticker .live-monitor__head {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-bottom: none;
  border-right: 1px solid var(--line);
  vertical-align: middle;
  background: var(--bg);
}

.live-monitor__ticker-wrap {
  display: inline-block;
  vertical-align: middle;
  width: calc(100% - 11rem);
  overflow: hidden;
}

.live-monitor__track--horizontal {
  display: inline-flex;
  flex-direction: row;
  gap: 2rem;
  padding: 0.55rem 1rem;
  white-space: nowrap;
  animation: monitor-scroll-horizontal 90s linear infinite;
}

@keyframes monitor-scroll-horizontal {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.monitor-ticker-item {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
  max-width: 18rem;
  padding-right: 1.5rem;
  border-right: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--ink);
}

.monitor-ticker-item a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
  display: block;
}

.monitor-ticker-item a:hover {
  color: var(--steel);
}

.monitor-ticker-item__meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* —— Main shell —— */
.site-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.site-top {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--bg-elevated);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--line);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand__mark {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  object-fit: contain;
}

.brand__text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

.brand__text > span {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-top: 0.2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
}

.site-nav a:hover {
  color: var(--steel);
}

.site-main {
  flex: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 3rem;
}

.section {
  padding-top: 2.5rem;
  max-width: var(--max);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 0.65rem;
}

.section__label--sentence {
  font-family: var(--font-body);
  font-size: clamp(0.78rem, 1.8vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.45;
  max-width: 42rem;
}

.section__label--sentence a {
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.section__label--sentence a:hover {
  color: var(--ink);
}

.section h2 {
  font-family: var(--font-body);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.85rem;
}

.events__cta {
  margin: 1.25rem 0 0;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.28;
  margin: 0 0 1.1rem;
}

.hero__follow {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.28;
  margin: 0 0 1rem;
  color: var(--ink);
}

.lede {
  font-size: 1.05rem;
  color: var(--slate);
  margin: 1.25rem 0 0;
}

.hamilton-map {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  height: min(52vh, 22rem);
  min-height: 16rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-float);
}

.hamilton-map--error {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.hamilton-map-legend {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-muted);
}

.hamilton-map-legend__swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border: 1px solid var(--line-strong);
}

.hamilton-map-legend__swatch--radius {
  border-radius: 50%;
  background: rgba(28, 31, 36, 0.12);
  border-color: rgba(28, 31, 36, 0.45);
}

.hamilton-map-legend__swatch--site {
  background: rgba(28, 31, 36, 0.45);
  border-color: var(--ink);
}

.hamilton-map-legend__swatch--heat {
  border-radius: 50%;
  background: rgba(199, 54, 54, 0.45);
  border-color: #8f2020;
}

.hamilton-map .leaflet-container {
  font-family: var(--font-body);
}

.hamilton-map .leaflet-control-attribution {
  font-size: 0.58rem;
  background: rgba(255, 255, 255, 0.92);
}

.pillars {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.pillars li {
  font-size: 0.92rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--slate);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 1.2rem 1.3rem;
  margin-top: 1rem;
}

.card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.45rem;
}

.two-col {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label,
.form-field legend {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
}

.form-field .hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.consent {
  font-size: 0.84rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 1.1rem 0;
  color: var(--slate);
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--slate);
  background: var(--slate);
  color: var(--bg-elevated);
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
}

.form-message {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  display: none;
}

.form-message.visible {
  display: block;
}

.form-message.ok {
  background: #eef6ee;
  border-color: #9cb89c;
}

.form-message.err {
  background: #faf0f0;
  border-color: #d4a5a5;
}

.feed-links {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin-top: 0.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.5rem 2.5rem;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.site-footer a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-right: 1rem;
}

@media (max-width: 1179px) {
  body {
    display: flex;
    flex-direction: column;
  }

  .live-monitor--ticker {
    display: block;
  }

  .site-shell {
    flex: 1;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-monitor__track--horizontal {
    animation: none;
  }
}
