:root {
  color-scheme: light;
  --ink: #18272b;
  --muted: #617073;
  --surface: #ffffff;
  --surface-alt: #eef5f3;
  --line: #d9e5e1;
  --teal: #0b6b73;
  --teal-dark: #084f55;
  --green: #1f7a4f;
  --gold: #c8922d;
  --red: #a13d4b;
  --shadow: 0 18px 45px rgba(24, 39, 43, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7faf9;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  top: 16px;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.brand,
.header-actions,
.button-row,
.section-heading,
.filter-buttons {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  box-shadow: 0 8px 24px rgba(11, 107, 115, 0.24);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  line-height: 1.05;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.86rem;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  min-height: 270px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 54%, rgba(255, 255, 255, 0.16) 55%),
    url("/assets/champlain-hero.svg") center right / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(28px, 6vw, 54px);
}

.hero-copy h2 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.hero-copy p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-visual {
  position: relative;
  min-height: 220px;
}

.river-line {
  position: absolute;
  inset: auto 0 40px auto;
  width: min(390px, 85%);
  height: 62px;
  border-top: 8px solid rgba(255, 255, 255, 0.8);
  border-radius: 100% 0 0 0;
}

.landmark {
  position: absolute;
  right: 40px;
  bottom: 60px;
  display: grid;
  grid-template-columns: repeat(3, 30px);
  gap: 10px;
}

.landmark span {
  display: block;
  height: 92px;
  border-radius: 5px 5px 0 0;
  background: rgba(255, 255, 255, 0.75);
}

.landmark span:nth-child(2) {
  height: 128px;
  background: rgba(255, 255, 255, 0.92);
}

.category-strip,
.two-column,
.feed-grid {
  display: grid;
  gap: 16px;
}

.category-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}

.category-card,
.panel,
.feed-section,
.feed-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.category-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
}

.category-card h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.category-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.category-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  background: var(--teal);
}

.category-icon.news {
  background: linear-gradient(135deg, var(--teal), #62a8a4);
}

.category-icon.events {
  background: linear-gradient(135deg, var(--green), #94b94b);
}

.category-icon.jobs {
  background: linear-gradient(135deg, var(--red), var(--gold));
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.feed-section {
  padding: clamp(18px, 4vw, 26px);
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.1;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(200, 146, 45, 0.14);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(31, 122, 79, 0.14);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(161, 61, 75, 0.14);
}

.status-line {
  margin-bottom: 16px;
  color: var(--muted);
}

.button-row {
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.filter-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  background: var(--teal);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--teal-dark);
}

.secondary-button,
.filter-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button {
  padding: 0 16px;
}

.secondary-button.compact {
  min-height: 38px;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.preset-grid legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.preset-option,
.custom-preferences label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.preset-option {
  min-height: 56px;
  padding: 10px 12px;
  color: var(--ink);
}

.preset-option:has(input:checked) {
  border-color: rgba(11, 107, 115, 0.55);
  background: #e3f2ef;
}

.preset-option input,
.custom-preferences input {
  accent-color: var(--teal);
}

.custom-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.custom-preferences label {
  min-height: 44px;
  padding: 0 12px;
}

.filter-buttons {
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-button {
  min-height: 38px;
  padding: 0 12px;
}

.filter-button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.feed-section {
  margin-top: 18px;
}

.feed-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feed-card {
  min-height: 200px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card h3 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.feed-card a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.category-badge.events {
  color: var(--green);
}

.category-badge.jobs {
  color: var(--red);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 24px;
}

.ios-dialog {
  width: min(520px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.ios-dialog::backdrop {
  background: rgba(24, 39, 43, 0.48);
}

.ios-dialog form {
  padding: 22px;
}

.install-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
}

.install-steps li + li {
  margin-top: 10px;
}

@media (max-width: 920px) {
  .hero,
  .two-column,
  .feed-grid {
    grid-template-columns: 1fr;
  }

  .category-strip,
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.74) 72%),
      url("/assets/champlain-hero.svg") center bottom / cover no-repeat;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .app-header,
  .section-heading {
    align-items: flex-start;
  }

  .app-header {
    flex-direction: column;
  }

  .header-actions,
  .filter-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .category-strip,
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .feed-section,
  .hero-copy {
    padding: 18px;
  }

  .section-heading {
    flex-direction: column;
  }

  .secondary-button.compact,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .filter-button {
    flex: 1 1 46%;
  }
}
