:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  --page-padding: clamp(1.5rem, 4.2vw, 5.5rem);
  --glass: rgba(15, 20, 23, 0.28);
  --glass-border: rgba(255, 255, 255, 0.18);
  --muted: rgba(255, 255, 255, 0.68);
  --soft: rgba(255, 255, 255, 0.48);
  --background-filter: brightness(0.82) saturate(0.94);
  --veil-top: rgba(5, 9, 11, 0.58);
  --veil-middle: rgba(5, 9, 11, 0.14);
  --veil-bottom: rgba(4, 8, 15, 0.82);
  --theme-accent: #9ecff2;
  --rain-accent: #b4ddf8;
  --simulated-screen-gap: 100px;
}

* {
  box-sizing: border-box;
}

html.cursor-hidden,
html.cursor-hidden * {
  cursor: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #10171b;
}

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

body[data-theme="day"] {
  --glass: rgba(18, 28, 27, 0.22);
  --glass-border: rgba(255, 255, 255, 0.22);
  --muted: rgba(255, 255, 255, 0.76);
  --soft: rgba(255, 255, 255, 0.56);
  --background-filter: brightness(0.96) saturate(1.04);
  --veil-top: rgba(8, 15, 15, 0.48);
  --veil-middle: rgba(8, 15, 15, 0.03);
  --veil-bottom: rgba(8, 14, 14, 0.64);
  --theme-accent: #ffe0a6;
  --rain-accent: #cbeaff;
}

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

.background,
.veil,
.grain {
  position: fixed;
  inset: 0;
}

.background {
  z-index: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.035);
  opacity: 0;
  filter: var(--background-filter);
  transition: opacity 1.4s ease, transform 9s cubic-bezier(0.2, 0.8, 0.2, 1), filter 1.2s ease;
}

.background.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.veil {
  z-index: 1;
  background:
    linear-gradient(180deg, var(--veil-top) 0%, var(--veil-middle) 38%, rgba(5, 9, 11, 0.16) 64%, var(--veil-bottom) 100%),
    linear-gradient(90deg, rgba(5, 9, 11, 0.21), transparent 48%, rgba(5, 9, 11, 0.12));
  transition: background 1.2s ease;
}

.grain {
  z-index: 2;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.screen-height-simulator {
  position: fixed;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--simulated-screen-gap);
  background: #000;
  pointer-events: none;
}

.dashboard {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100% - var(--simulated-screen-gap));
  min-height: 0;
  padding: clamp(1.4rem, 3.8vh, 3rem) var(--page-padding) clamp(1.4rem, 4.8vh, 3.75rem);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(32rem, 45rem);
  align-items: flex-start;
  gap: 2rem;
}

.left-widgets {
  display: grid;
  gap: 0.65rem;
  width: min(100%, 27rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 0.85rem;
  font-size: clamp(0.68rem, 0.9vw, 0.82rem);
  font-weight: 650;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.78);
}

.brand-mark {
  width: 0.52rem;
  height: 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.weather-card {
  display: grid;
  width: 100%;
  padding: 0.78rem 0.9rem 0.78rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.15rem;
  background: var(--glass);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.sun-card,
.transit-card {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.sun-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-radius: 1rem;
}

.sun-time {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
}

.sun-time + .sun-time {
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.sun-time svg {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 1.45rem;
  fill: none;
  stroke: var(--theme-accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.sun-time span,
.transit-heading,
.transit-route span {
  display: block;
  font-size: 0.59rem;
  font-weight: 620;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft);
}

.sun-time time {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.94rem;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
}

.transit-card {
  padding: 0.65rem 0.8rem 0.72rem;
  border-radius: 1.05rem;
}

.transit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
}

.transit-heading a {
  color: var(--soft);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0.02em;
}

.transit-line {
  display: grid;
  grid-template-columns: 2rem minmax(7.8rem, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.35rem 0.25rem;
}

.transit-line + .transit-line {
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.transit-badge {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.58rem;
  font-size: 0.95rem;
  font-weight: 740;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.transit-badge.tram-b {
  background: #e7378b;
}

.transit-badge.bus-5 {
  background: #93368f;
}

.transit-route {
  min-width: 0;
}

.transit-route strong {
  display: block;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 570;
  color: rgba(255, 255, 255, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transit-route span {
  margin-top: 0.12rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.transit-times {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 7.8rem;
}

.transit-time {
  min-width: 3.6rem;
  padding: 0.42rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.58rem;
  font-size: 0.69rem;
  font-weight: 620;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
}

.transit-time:first-child {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.transit-time.is-real-time::before {
  display: inline-block;
  width: 0.32rem;
  height: 0.32rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: #73e2a7;
  box-shadow: 0 0 0.4rem rgba(115, 226, 167, 0.7);
  content: "";
  vertical-align: 0.08rem;
}

.transit-loading {
  width: 3.6rem;
  height: 1.7rem;
  border-radius: 0.58rem;
  background: rgba(255, 255, 255, 0.08);
}

.transit-unavailable {
  font-size: 0.67rem;
  color: var(--soft);
}

.traffic-alerts {
  padding: 0.55rem 0.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.traffic-alerts[hidden] {
  display: none;
}

.traffic-alert {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.48rem;
  min-height: 2rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid rgba(255, 184, 92, 0.2);
  border-radius: 0.55rem;
  background: rgba(116, 55, 19, 0.22);
  animation: traffic-alert-in 320ms ease-out;
}

.traffic-alert-badge {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.38rem;
  font-size: 0.63rem;
  font-weight: 750;
  color: #fff;
}

.traffic-alert-badge.tram-b {
  background: #e7378b;
}

.traffic-alert-badge.bus-5 {
  background: #93368f;
}

.traffic-alert-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.62rem;
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: 0.015em;
  color: rgba(255, 235, 208, 0.92);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.traffic-alert-counter {
  font-size: 0.55rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--soft);
}

@keyframes traffic-alert-in {
  from {
    opacity: 0;
    transform: translateY(0.2rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.weather-current {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.2vw, 1.1rem);
}

.weather-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
}

.weather-icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.weather-main {
  min-width: 0;
  flex: 1;
}

.weather-location,
.weather-reading,
.weather-range,
.weather-range span {
  display: flex;
  align-items: center;
}

.weather-location {
  margin-bottom: 0.15rem;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 630;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.weather-location a {
  color: inherit;
  text-decoration: none;
}

.weather-reading {
  gap: 0.72rem;
}

.weather-reading strong {
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  font-weight: 480;
  line-height: 1;
  letter-spacing: -0.06em;
}

.weather-reading span {
  overflow: hidden;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  color: rgba(255, 255, 255, 0.84);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-range {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.77rem;
}

.weather-range span {
  gap: 0.34rem;
}

.weather-range i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.46);
}

.weather-range .arrow-up {
  color: #ffd5a5;
}

.weather-range b {
  min-width: 2.2rem;
  font-weight: 550;
}

.weather-forecast {
  display: grid;
  grid-template-columns: minmax(8.75rem, 1.15fr) minmax(16rem, 2fr);
  gap: 0.85rem;
  margin-top: 0.72rem;
  padding-top: 0.72rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rain-next-hour {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--rain-accent);
}

.rain-next-hour svg {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 1.45rem;
  fill: rgba(180, 221, 248, 0.12);
  stroke: currentColor;
  stroke-width: 1.45;
}

.rain-next-hour > div {
  min-width: 0;
}

.rain-next-hour span,
.forecast-hour time,
.forecast-rain {
  display: block;
  font-size: 0.61rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.rain-next-hour strong {
  display: block;
  margin-top: 0.13rem;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 570;
  color: rgba(255, 255, 255, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rain-next-hour.is-rainy strong {
  color: var(--rain-accent);
}

.forecast-hours {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-width: 0;
}

.forecast-hour {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 0.18rem 0.35rem;
  min-width: 0;
  padding: 0 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.forecast-hour time {
  color: rgba(255, 255, 255, 0.65);
}

.forecast-temperature {
  font-size: 0.9rem;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
}

.forecast-mini-icon {
  grid-column: 2;
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.8);
}

.forecast-mini-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.forecast-rain {
  color: var(--rain-accent);
  letter-spacing: 0.02em;
  text-transform: none;
}

.forecast-placeholder {
  height: 2.4rem;
  margin-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.55;
}

.forecast-unavailable {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  font-size: 0.7rem;
  color: var(--soft);
}

.time-block {
  align-self: center;
  justify-self: center;
  width: min(100%, 76rem);
  margin-top: -1vh;
  text-align: center;
  text-shadow: 0 0.15rem 1.8rem rgba(0, 0, 0, 0.22);
}

.greeting {
  margin: 0 0 clamp(0.2rem, 0.5vh, 0.5rem);
  font-size: clamp(0.72rem, 1.05vw, 0.95rem);
  font-weight: 620;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.clock {
  display: block;
  font-size: clamp(6rem, 17vw, 15rem);
  font-weight: 270;
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
}

.date {
  margin: clamp(0.8rem, 2vh, 1.5rem) 0 0;
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  font-weight: 430;
  letter-spacing: 0.025em;
  color: rgba(255, 255, 255, 0.82);
}

.footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  min-height: 7.5rem;
}

.quote-card {
  position: relative;
  grid-column: 2;
  width: min(46rem, 58vw);
  margin: 0;
  padding: 0 2rem;
  text-align: center;
  text-shadow: 0 0.15rem 1.2rem rgba(0, 0, 0, 0.3);
}

.quote-mark {
  position: absolute;
  top: -1.2rem;
  left: 0;
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.32);
}

.quote-card blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-style: italic;
  line-height: 1.45;
}

.quote-card figcaption {
  margin-top: 0.55rem;
  font-size: clamp(0.67rem, 0.85vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.photo-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.46);
}

.photo-meta a {
  width: fit-content;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.photo-meta a:hover,
.photo-meta a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.fullscreen-button {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(10, 14, 16, 0.18);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.fullscreen-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}

.fullscreen-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.connection-message {
  position: fixed;
  z-index: 5;
  top: 1rem;
  left: 50%;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(12, 16, 18, 0.58);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.6rem);
  transition: opacity 250ms ease, transform 250ms ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.connection-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.is-offline .topbar,
body.is-offline .footer,
body.is-offline .greeting,
body.is-offline .connection-message {
  display: none;
}

body.is-offline .background {
  opacity: 1;
  transform: scale(1);
}

body.is-offline .background:not(.is-loaded) {
  background-image:
    radial-gradient(circle at 72% 24%, rgba(54, 91, 111, 0.72), transparent 38%),
    radial-gradient(circle at 22% 72%, rgba(68, 79, 92, 0.58), transparent 42%),
    linear-gradient(145deg, #15232b, #0a1015 68%, #050709);
}

body.is-offline .veil {
  background: linear-gradient(180deg, rgba(4, 8, 11, 0.16), rgba(4, 8, 11, 0.48));
}

@media (max-width: 700px) {
  .dashboard {
    padding-top: 1.2rem;
  }

  .brand {
    display: none;
  }

  .topbar {
    display: flex;
    flex-direction: column;
  }

  .left-widgets {
    width: 100%;
  }

  .weather-card {
    width: 100%;
    min-width: 0;
  }

  .weather-forecast {
    grid-template-columns: 1fr;
  }

  .rain-next-hour {
    justify-content: center;
  }

  .topbar {
    justify-content: stretch;
  }

  .clock {
    font-size: clamp(5.5rem, 27vw, 10rem);
  }

  .footer {
    display: block;
    min-height: 8.8rem;
  }

  .quote-card {
    width: 100%;
    padding: 0 1.2rem;
  }

  .photo-meta {
    display: none;
  }

  .fullscreen-button {
    right: 50%;
    bottom: 0;
    transform: translateX(50%);
  }

  .fullscreen-button:hover,
  .fullscreen-button:focus-visible {
    transform: translate(50%, -2px);
  }
}

@media (max-height: 650px) and (min-width: 701px) {
  .dashboard {
    padding-top: 1.25rem;
    padding-bottom: 1.4rem;
  }

  .weather-card {
    width: min(42rem, 68vw);
    transform: scale(0.84);
    transform-origin: top right;
  }

  .clock {
    font-size: clamp(5.5rem, 19vh, 8rem);
  }

  .quote-card blockquote {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
