:root {
  color-scheme: light;
  --background: #f4f7f8;
  --surface: #ffffff;
  --text: #14212a;
  --muted: #53636d;
  --border: #b7c4cb;
  --accent: #075b78;
  --accent-text: #ffffff;
  --focus: #e09f00;
  --shadow: 0 10px 30px rgba(20, 33, 42, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #000000;
  --surface: #101010;
  --text: #ffffff;
  --muted: #dedede;
  --border: #ffffff;
  --accent: #ffffff;
  --accent-text: #000000;
  --focus: #ffdf00;
  --shadow: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 20px;
  line-height: 1.55;
}

a { color: var(--accent); text-underline-offset: 0.2em; }

button, a { -webkit-tap-highlight-color: transparent; }

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-180%);
  padding: 14px 20px;
  background: var(--surface);
  color: var(--text);
  border: 3px solid var(--text);
  font-weight: 700;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 16px max(24px, calc((100vw - 1180px) / 2));
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.theme-button, .filter-button, .button, .camera-button {
  min-height: 56px;
  border: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.theme-button { display: flex; align-items: center; gap: 10px; }

main, .site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.welcome { padding: 56px 0 32px; }
.welcome h1, .section-heading h2, .viewer-heading h2 { margin: 0; }

h1 { font-size: clamp(2.2rem, 6vw, 4.25rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; }
h3 { font-size: 1.35rem; line-height: 1.25; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.intro { max-width: 720px; margin: 18px 0 0; font-size: 1.25rem; }

.viewer-section, .help-card {
  padding: 28px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.viewer-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.viewer-heading p:not(.eyebrow) { margin: 10px 0 0; }

.button.secondary {
  flex: 0 0 auto;
  background: var(--surface);
  color: var(--accent);
}

.viewer-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 14px;
}

.viewer-frame iframe { width: 100%; height: 100%; border: 0; }
.viewer-help { margin: 16px 0 0; color: var(--muted); font-weight: 700; }

.camera-directory { padding: 64px 0 34px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 18px; }
.filter-button { background: var(--surface); color: var(--accent); }
.filter-button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.results-count { margin: 12px 0 22px; color: var(--muted); font-weight: 700; }

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.camera-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 26px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.camera-card h3 { margin: 8px 0; }
.camera-card p { margin: 6px 0; }
.camera-location { color: var(--accent); font-size: 0.9rem; font-weight: 900; text-transform: uppercase; }
.camera-description { flex: 1; color: var(--muted); }
.camera-note { font-size: 0.9rem; }
.camera-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.camera-button { width: 100%; }
.camera-actions .secondary { text-align: center; }
.camera-card[hidden] { display: none; }

.help-card { margin: 28px 0 64px; }
.help-card h2 { margin-top: 0; }
.help-card li { margin-block: 10px; }

.site-footer {
  padding: 36px 0 54px;
  border-top: 2px solid var(--border);
  color: var(--muted);
}

.site-footer p { max-width: 850px; }

@media (max-width: 760px) {
  body { font-size: 18px; }
  .site-header, .viewer-heading { align-items: stretch; flex-direction: column; }
  .theme-button { justify-content: center; }
  main, .site-footer { width: min(100% - 24px, 1180px); }
  .welcome { padding-top: 38px; }
  .viewer-section, .help-card { padding: 20px; }
  .camera-grid { grid-template-columns: 1fr; }
  .camera-actions { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filter-button { width: 100%; }
}

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

@media (forced-colors: active) {
  .brand-mark, .theme-button, .filter-button, .button, .camera-button { forced-color-adjust: none; }
}
