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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070b1e;
  color: #fff;
  font-family: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* 1rem = 19.2px on a 1920x1080 screen */
html { font-size: min(1vw, 1.78vh); }
@media (orientation: portrait) {
  html { font-size: min(1.65vw, 1.05vh); }
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- animated background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #070b1e 0%, #111a44 45%, #1d1150 100%);
}
.orb {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
  animation: orb-a 34s ease-in-out infinite alternate;
}
.orb-1 { left: -20vmax; top: -25vmax; background: radial-gradient(circle, rgba(56, 120, 255, .55) 0%, rgba(56, 120, 255, 0) 65%); }
.orb-2 { right: -25vmax; top: -10vmax; background: radial-gradient(circle, rgba(170, 70, 255, .45) 0%, rgba(170, 70, 255, 0) 65%); animation-name: orb-b; animation-duration: 41s; }
.orb-3 { left: 15vmax; bottom: -35vmax; background: radial-gradient(circle, rgba(0, 200, 220, .38) 0%, rgba(0, 200, 220, 0) 65%); animation-name: orb-c; animation-duration: 47s; }
.orb-4 { right: 5vmax; bottom: -30vmax; width: 50vmax; height: 50vmax; background: radial-gradient(circle, rgba(255, 90, 160, .30) 0%, rgba(255, 90, 160, 0) 65%); animation-name: orb-a; animation-duration: 53s; animation-direction: alternate-reverse; }

@keyframes orb-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(18vmax, 10vmax) scale(1.15); }
  100% { transform: translate(6vmax, 22vmax) scale(.9); }
}
@keyframes orb-b {
  0%   { transform: translate(0, 0) scale(1.1); }
  50%  { transform: translate(-20vmax, 14vmax) scale(.9); }
  100% { transform: translate(-8vmax, 26vmax) scale(1.2); }
}
@keyframes orb-c {
  0%   { transform: translate(0, 0) scale(.95); }
  50%  { transform: translate(24vmax, -12vmax) scale(1.2); }
  100% { transform: translate(-10vmax, -20vmax) scale(1); }
}

/* slowly drifting light lines */
.bg-lines {
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 7rem, rgba(255, 255, 255, .025) 7rem, rgba(255, 255, 255, .025) 7.15rem);
  animation: lines 60s linear infinite;
  will-change: transform;
}
@keyframes lines {
  from { transform: translateX(0); }
  to   { transform: translateX(14.6rem); }
}

/* floating particles */
.bg-dots {
  position: absolute;
  inset: 0;
}
.bg-dots i {
  position: absolute;
  bottom: -2vh;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 .6rem rgba(140, 190, 255, .8);
  animation: rise linear infinite;
  will-change: transform, opacity;
}
@keyframes rise {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .6; }
  100% { transform: translateY(-105vh); opacity: 0; }
}

/* tint shown during the forecast */
.bg-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 150, 220, .35) 0%, rgba(20, 60, 140, .15) 55%, rgba(0, 200, 180, .25) 100%);
  opacity: 0;
  transition: opacity 1.6s ease;
}
body.mode-weather .bg-tint { opacity: 1; }

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .45) 100%);
}

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 2.6rem 1.2rem;
}

.clock .time {
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}
.clock .date {
  margin-top: .45rem;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, .72);
  letter-spacing: .02em;
}

.modes {
  display: flex;
  gap: .6rem;
  padding: .4rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}
.modes span {
  padding: .55rem 1.4rem;
  border-radius: 99rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  transition: background .8s ease, color .8s ease;
}
.modes span.on {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.now {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: .7rem 1.6rem .7rem 1rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
  min-height: 6.2rem;
}
.now[hidden] { display: none; }
.now-icon { width: 5.4rem; height: 5.4rem; flex: none; }
.now-icon .wi { width: 100%; height: 100%; }
.now-temp {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}
.now-temp sup { font-size: .45em; font-weight: 600; vertical-align: super; letter-spacing: 0; }
.now-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.now-text { font-size: 1.35rem; font-weight: 600; white-space: nowrap; }
.now-city { font-size: 1rem; color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.now-extra { font-size: .95rem; color: rgba(255, 255, 255, .6); white-space: nowrap; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  margin: .4rem 2.6rem 1.6rem;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(.985);
  transition: opacity 1s ease, transform 1.2s ease, visibility 0s linear 1.2s;
}
.scene.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 1s ease .2s, transform 1.2s ease .2s, visibility 0s;
}

/* ---------- ticker ---------- */
.ticker {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: stretch;
  height: 4.4rem;
  background: rgba(4, 8, 24, .78);
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 2.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .16em;
  background: linear-gradient(90deg, #2453ff, #7b3cff);
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.2rem) 100%, 0 100%);
}
.ticker-label .live {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #4dff9a;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .25; } }

.ticker-viewport {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3rem, #000 calc(100% - 3rem), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 3rem, #000 calc(100% - 3rem), transparent 100%);
}
.ticker-track {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: crawl 60s linear infinite;
}
@keyframes crawl {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tk {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: .7rem;
  padding: 0 2.2rem;
  font-size: 1.45rem;
  border-right: 1px solid rgba(255, 255, 255, .12);
}
.tk-sym { font-weight: 800; letter-spacing: .04em; }
.tk-price { color: rgba(255, 255, 255, .88); font-variant-numeric: tabular-nums; }
.tk-chg { font-weight: 700; font-variant-numeric: tabular-nums; }
.tk.up .tk-chg { color: #3ee68a; }
.tk.down .tk-chg { color: #ff5f6d; }
.tk.flat .tk-chg { color: rgba(255, 255, 255, .5); }

@media (orientation: portrait) {
  .topbar { flex-wrap: wrap; }
  .modes { display: none; }
}
