/* Window: an ambient display for a 1920x1080 TV.
   The page is laid out at a fixed 1920x1080 and scaled to fit by app.js.
   Written for older TV browsers: no flex gap, no aspect-ratio, no inset. */

:root {
  --ink: #eef2f7;
  --ink-2: rgba(238, 242, 247, 0.74);
  --ink-3: rgba(238, 242, 247, 0.5);
  --hair: rgba(238, 242, 247, 0.16);
  --accent: #ffb35c;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'B612', 'Segoe UI', Arial, sans-serif;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  cursor: none;
  background: #0a1324;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  color: var(--ink);
  transition: color 4s ease;
}

p { margin: 0; }

/* Clock block: always on screen, top left. */
.time {
  position: absolute;
  left: 104px;
  top: 64px;
  z-index: 5;
}
.clock {
  font-family: var(--sans);
  font-size: 184px;
  line-height: 1;
  letter-spacing: -6px;
  margin-left: -8px;
}
.date {
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1.2;
  margin-top: 22px;
}
.weather {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.3;
  color: var(--ink-2);
  margin-top: 6px;
}

/* Scenes stack and crossfade. */
.scene {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.scene.on { opacity: 1; }
.scene canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
}

.caption {
  position: absolute;
  left: 104px;
  bottom: 96px;
  width: 1040px;
}
.lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 52px;
  line-height: 1.16;
  letter-spacing: -0.4px;
}
.sub {
  font-family: var(--serif);
  font-size: 33px;
  line-height: 1.36;
  color: var(--ink-2);
  margin-top: 16px;
}
.credit {
  position: absolute;
  right: 104px;
  bottom: 52px;
  font-family: var(--sans);
  font-size: 18px;
  color: var(--ink-3);
}

/* Sky over Valencia */
.flights {
  position: absolute;
  right: 104px;
  bottom: 132px;
  width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}
.flights li {
  padding: 20px 0 18px;
  border-top: 1px solid var(--hair);
}
.flights li:first-child { border-top: 0; }
.flights .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.flights .name { font-size: 28px; font-weight: 700; }
.flights .alt { font-size: 26px; color: var(--ink-2); }
.flights .route {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink-2);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flights li.near .name { color: var(--accent); }

/* Earth */
.disc, .halo {
  position: absolute;
  width: 1040px;
  height: 1040px;
  left: 900px;
  top: 20px;
}
.disc img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s linear;
  -webkit-clip-path: circle(38.4% at 50.2% 50.2%);
  clip-path: circle(38.4% at 50.2% 50.2%);
  filter: brightness(var(--photo, 1));
}
.disc img.show { opacity: 1; }
.halo {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(170, 205, 255, 0.28) 0, rgba(170, 205, 255, 0.12) 40%, rgba(170, 205, 255, 0) 58%);
}
.frame-time {
  position: absolute;
  left: 1420px;
  top: 956px;
  width: 0;
  white-space: nowrap;
  text-align: center;
  font-family: var(--sans);
  font-size: 22px;
  color: var(--ink-3);
}
.frame-time span {
  display: inline-block;
  transform: translateX(-50%);
}
#scene-earth .caption { width: 760px; }

/* Design */
.work {
  position: absolute;
  margin: 0;
  right: 104px;
  top: 96px;
  width: 1040px;
  height: 888px;
  text-align: right;
}
.work img {
  position: absolute;
  right: 0;
  top: 50%;
  max-width: 1040px;
  max-height: 888px;
  transform: translateY(-50%);
  box-shadow: 0 28px 70px rgba(4, 10, 24, 0.35);
  filter: brightness(var(--photo, 1));
  transition: filter 4s ease;
}
.caption.art { width: 600px; }
.caption.art .lead { font-size: 46px; }
.medium {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  line-height: 1.35;
  color: var(--ink-3);
  margin-top: 14px;
}
#scene-design.wide .work {
  left: 104px;
  right: auto;
  top: 404px;
  width: 1712px;
  height: 340px;
}
#scene-design.wide .work img {
  left: 0;
  right: auto;
  top: 0;
  transform: none;
  max-width: 1712px;
  max-height: 340px;
}
#scene-design.wide .caption.art { width: 1400px; bottom: 84px; }
#scene-design.wide .caption.art .lead { font-size: 40px; }

@media (prefers-reduced-motion: reduce) {
  .scene, .disc img { transition-duration: 0.01s; }
}
