/* SkateCam — the painted harbor is the backdrop; one or two soft rinks sit on the ice. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/playfair-display-600.woff2") format("woff2");
}

:root {
  --cream: #f3e6d0;
  --cream-dim: rgba(243, 230, 208, 0.9);
  --gold: #e8c27a;
  --gold-ink: #6a3a10;
  --ink: #1a2430;
  --ink-soft: #2a3340;
  --ice: #7a96a8;
  --rink-gap: 1rem;
  --page-pad: 0.75rem;
  --chrome: 10.25rem;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ice);
  color: var(--cream);
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
}

body { min-height: 100dvh; }

/* Art is a fixed cover backdrop. Slots live in the page, inside the viewport. */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene picture,
.scene-art {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-art {
  object-fit: cover;
  object-position: center bottom;
  /* Tiny blurred first-paint placeholder shows through until the WebP paints. */
  background-color: var(--ice);
  background-image: url("assets/harbor-desktop-lqip.webp");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

@media (orientation: portrait), (max-width: 720px) {
  .scene-art {
    background-image: url("assets/harbor-portrait-lqip.webp");
  }
}

.snow {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* --- Page chrome and rinks, in document flow --- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.55rem var(--page-pad) 0.5rem;
  margin: 0 auto;
}

/* Mast: narrow centered title so the tower and Coho stay clear. */
.mast {
  text-align: center;
  padding: 0;
  flex: 0 0 auto;
}

.mast h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.45rem, 3.6vw, 2.35rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--cream);
  text-shadow:
    0 1px 0 rgba(40, 20, 10, 0.4),
    0 8px 28px rgba(0, 0, 0, 0.55);
}

.town {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.status-line {
  margin: 0.4rem 0 0;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.lantern {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(12, 10, 16, 0.5);
  backdrop-filter: blur(6px);
}

.lantern-body {
  width: 0.65rem;
  height: 0.95rem;
  background:
    radial-gradient(circle at 50% 40%, #ffe7a0, #e89030 55%, #8a3a10 100%);
  border-radius: 40% 40% 30% 30%;
  box-shadow:
    0 0 10px 3px rgba(255, 170, 60, 0.55),
    0 0 0 1px rgba(80, 40, 10, 0.6);
  animation: lantern-pulse 2.4s ease-in-out infinite;
}

.lantern-glow {
  position: absolute;
  left: -0.25rem;
  top: -0.35rem;
  width: 1.5rem;
  height: 1.7rem;
  background: radial-gradient(circle, rgba(255, 190, 80, 0.45), transparent 70%);
  animation: lantern-pulse 2.4s ease-in-out infinite;
}

.lantern-name,
.lantern-label {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: #ffe9b8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.lantern-name { letter-spacing: 0.08em; }

.lantern.is-dim .lantern-body,
.lantern.is-dim .lantern-glow {
  animation: none;
  opacity: 0.45;
  filter: grayscale(0.4);
}

@keyframes lantern-pulse {
  0%, 100% { opacity: 0.85; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.18); }
}

/* Rinks fill the harbor between the header and the footer. */
.rinks {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: var(--rink-gap);
  min-height: 0;
  margin-top: 0.35rem;
  width: 100%;
}

.slot {
  position: relative;
  flex: 0 0 auto;
  width: min(
    calc((100% - var(--rink-gap)) / 2),
    calc((100dvh - var(--chrome)) * 16 / 9)
  );
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1.5rem;
  isolation: isolate;
  background: rgba(186, 202, 212, 0.28);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  /* Fixed-size soft edge so the fade does not grow with the slot. */
  --fade: 2.5rem;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  -webkit-mask-composite: source-in, source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  mask-composite: intersect;
  box-shadow: 0 0 32px rgba(210, 226, 236, 0.35);
}

/* A single camera takes the whole width, centered. */
[data-count="1"] .slot {
  width: min(100%, 72rem, calc((100dvh - var(--chrome)) * 16 / 9));
}

.slot[hidden],
.lantern[hidden] { display: none; }

[data-count="1"] .lantern-name { display: none; }

.slot .player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 36%, rgba(230, 238, 244, 0.42), rgba(186, 202, 212, 0.28));
}

.card[hidden],
.player[hidden] { display: none; }

.slot[data-state="live"] .card { display: none; }

.card-title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.15rem, 3.2vw, 1.7rem);
  font-weight: 600;
  color: var(--ink);
}

.card-body {
  margin: 0.45rem 0 0;
  max-width: 22rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.fs-btn {
  position: absolute;
  right: 8%;
  bottom: 10%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.fs-btn:hover,
.fs-btn:focus-visible {
  background: rgba(255, 255, 255, 0.6);
  outline: 1px solid var(--gold-ink);
}

/* Footer sits below the rinks, dark ink on a frosted chip. */
.foot {
  flex: 0 0 auto;
  margin: 0.45rem auto 0;
  padding: 0.28rem 0.85rem;
  max-width: 44rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(20, 30, 40, 0.1);
}

.foot p { margin: 0; }

.credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.credit img {
  display: block;
  width: 7.5rem;
  height: auto;
}

.credit:hover,
.credit:focus-visible { outline: 1px solid var(--gold-ink); outline-offset: 2px; border-radius: 4px; }

.notice { margin-top: 0.15rem; font-size: 0.7rem; color: var(--ink-soft); }

/* Portrait / narrow: compact header, landmarks stay visible above
   stacked full-width rinks. */
@media (orientation: portrait), (max-width: 720px) {
  :root { --page-pad: 0.5rem; --rink-gap: 0.7rem; }

  .page {
    min-height: 0;
    padding: 0.35rem var(--page-pad) 0.9rem;
  }

  .mast { order: 1; }
  .rinks { order: 2; }
  .foot { order: 3; }

  .mast h1 { font-size: clamp(1.35rem, 7vw, 1.85rem); }
  .town { margin-top: 0.12rem; }
  .status-line { margin-top: 0.28rem; }

  .rinks {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    /* Just below the tower and Coho; cameras fill the ice. */
    margin-top: 26dvh;
    padding: 0;
  }

  .slot {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }

  .foot {
    margin-top: 0.55rem;
    max-width: 100%;
  }
}

@media (orientation: portrait) and (min-width: 700px) {
  .rinks { margin-top: 15dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .lantern-body,
  .lantern-glow { animation: none; }
  .snow { display: none; }
}

/* embed.html: just the camera, filling the iframe, for other sites. */
body.embed {
  height: 100vh;
  overflow: hidden;
  background: #0d1620;
}

.embed .slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  -webkit-mask-image: none;
  mask-image: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.embed .player { object-fit: contain; }

.embed .card-title { color: var(--cream); }
.embed .card-body { color: var(--cream-dim); }
.embed .card { background: #0d1620; }

.embed .fs-btn { right: 0.6rem; bottom: 0.6rem; }

.embed-tag {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-right: 0.5rem;
  border-radius: 4px;
  background: rgba(12, 10, 16, 0.5);
  color: #ffe9b8;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.embed-tag .lantern { background: none; backdrop-filter: none; }
