@font-face {
  font-family: Veljmies;
  src: url("veljmies-sans-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #1e2d4e;
  color: #fff;
  font: 16px/1.5 Arial, Helvetica, sans-serif;
  --muted: #c1cbdc;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 0.25em; }
a:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
h1, h2, .camera-name { font-family: Veljmies, Arial, sans-serif; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1.08; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 1.5rem; }
p { margin: 0; }
[hidden] { display: none !important; }

.hub, .watch { width: min(100% - 80px, 1440px); margin: 0 auto; padding: 64px 0 72px; }
.hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.hub-heading .hub-title { flex: 1; margin-bottom: 0; }
.weather-brief { display: flex; align-items: center; gap: 10px; flex: none; font-family: Veljmies, Arial, sans-serif; font-size: 1.5rem; white-space: nowrap; }
.weather-brief img { width: 32px; height: 32px; }
.hub-title { display: flex; align-items: center; gap: 28px; min-width: 0; min-height: 44px; margin-bottom: 24px; text-decoration: none; }
.brand-title { font-family: Veljmies, Arial, sans-serif; font-weight: 700; font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1.08; }
.hub-title:hover .flag { opacity: 0.85; }
.hub-intro { color: var(--muted); margin-bottom: 40px; }
.flag { width: 104px; height: auto; flex: 0 0 auto; }
#site-notice { color: var(--muted); margin-bottom: 32px; }
#site-notice:empty { display: none; }
.camera-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
.camera-grid > .camera-link:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.camera-link { display: block; text-decoration: none; min-width: 0; }
.preview { display: grid; place-items: center; position: relative; aspect-ratio: 16 / 9; background: #15223d; overflow: hidden; }
.preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-placeholder { padding: 24px; color: var(--muted); text-align: center; font-size: 0.875rem; }
.camera-caption { display: block; padding-top: 16px; }
.camera-name { display: block; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.15; overflow-wrap: anywhere; }
.camera-link:hover .camera-name { text-decoration: underline; text-underline-offset: 0.15em; }
.preview-time { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 8px; }
.preview-time:empty { display: none; }

.weather { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 28px; padding: 16px 0; margin-bottom: 32px; border-block: 1px solid #ffffff30; }
.weather-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.weather-summary h2 { font-size: 0.9375rem; margin: 0 0 6px; }
.weather-summary img { width: 40px; height: 40px; flex: none; }
.weather-readings { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.weather-temperature { font-family: Veljmies, Arial, sans-serif; font-size: 1.875rem; line-height: 1.1; white-space: nowrap; }
.weather-feels-like { color: var(--muted); font-size: 0.8125rem; }
.weather-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; align-self: center; margin: 0; }
.weather-details dt { color: var(--muted); font-size: 0.75rem; }
.weather-details dd { margin: 2px 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.weather-unavailable { align-self: center; color: var(--muted); font-size: 0.875rem; }
.weather-source { grid-column: 1 / -1; color: var(--muted); font-size: 0.75rem; }
.hub > .weather { margin-top: 40px; margin-bottom: 0; }

.camera-page .watch { height: 100dvh; padding: 24px 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px; }
.camera-page .hub-title { margin-bottom: 0; }
.watch h1 { font-size: clamp(1.125rem, 2vw, 2rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; min-height: 0; }
.watch-video { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr); }
.watch-sidebar { height: 100%; min-height: 0; overflow-y: auto; padding: 6px; margin: -6px; }
.watch-sidebar .weather { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 16px 0 0; padding: 0; border: 0; }
.watch-sidebar .weather-details { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.watch-sidebar .weather-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.watch-sidebar .weather-details dd { text-align: right; }
.camera-switcher[hidden] + .weather { margin-top: 0; }
.video-stage { container-type: size; min-width: 0; min-height: 0; display: flex; justify-content: center; align-items: flex-start; }
.video-stage .player-shell { flex: none; width: min(100cqw, calc(100cqh * 16 / 9)); min-height: min(200px, 100cqh); }
.player-shell { position: relative; aspect-ratio: 16 / 9; background: #0c1425; display: grid; place-items: center; overflow: hidden; }
#youtube-player, .player-shell iframe { width: 100%; height: 100%; border: 0; }
div#youtube-player:empty { display: none; }
#player-message { padding: 24px; text-align: center; color: var(--muted); max-width: 560px; }
#player-message:empty { display: none; }
.camera-switcher { display: flex; flex-direction: column; }
.camera-switcher h2 { font-size: 1.125rem; margin-bottom: 12px; }
.camera-switcher .camera-link { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid #ffffff30; }
.camera-switcher .camera-link:first-child { padding-top: 0; }
.camera-switcher .camera-caption { padding: 0; }
.camera-switcher .camera-name { font-size: 1rem; }
.camera-switcher .preview-time { display: none; }
.camera-switcher .preview-placeholder { font-size: 0; padding: 0; }

.embed { width: 100%; height: 100dvh; background: #0c1425; overflow: hidden; }
.embed .player-shell { width: 100%; height: 100%; aspect-ratio: auto; }

@media (max-width: 1023px) {
  .weather { grid-template-columns: minmax(0, 1fr); }
  .watch-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, max(200px, (100vw - 80px) * 9 / 16)) minmax(0, 1fr); gap: 24px; }
  .camera-switcher [data-camera-list] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 639px) {
  .hub, .watch { width: calc(100% - 40px); padding: 32px 0 48px; }
  .camera-page .watch { padding: 16px 0; gap: 12px; }
  .hub-heading { margin-bottom: 20px; }
  .weather-brief { display: none; }
  .hub > .weather { margin-top: 32px; }
  .hub-title { gap: 16px; }
  .hub-title .brand-title { width: min-content; font-size: clamp(1.5rem, 6.5vw, 2rem); overflow-wrap: normal; }
  .hub-intro { margin-bottom: 32px; }
  .weather { gap: 12px; }
  .hub .weather-details { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hub .weather-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .hub .weather-details dd { text-align: right; }
  .flag { width: 64px; }
  .camera-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .watch h1 { font-size: clamp(1rem, 4vw, 1.25rem); }
  .watch-layout { grid-template-rows: minmax(0, max(200px, (100vw - 40px) * 9 / 16)) minmax(0, 1fr); gap: 20px; }
  .camera-switcher [data-camera-list] { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (min-width: 640px) and (max-height: 600px) {
  .camera-page .watch { padding: 16px 0; gap: 12px; }
  .watch h1 { font-size: 1.5rem; }
  .watch-layout { grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: minmax(0, 1fr); }
  .camera-switcher [data-camera-list] { display: block; }
  .camera-switcher .camera-name { font-size: 1rem; }
}
