:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --background: #050505;
  --foreground: #f7f7f5;
  --muted: #9d9d98;
  --accent: #e82127;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
}

body {
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.dashboard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 0.8fr);
  align-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: max(2rem, env(safe-area-inset-top)) max(3rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(3rem, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 82% 18%, rgba(232, 33, 39, 0.06), transparent 34%),
    var(--background);
}

.clock-panel {
  display: flex;
  align-items: stretch;
  min-width: 0;
  padding-right: clamp(2rem, 5vw, 6rem);
}

.accent {
  width: clamp(0.35rem, 0.55vw, 0.75rem);
  margin-right: clamp(1.5rem, 3vw, 3.5rem);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 2.5rem rgba(232, 33, 39, 0.22);
}

.time-row {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.time {
  display: block;
  font-size: clamp(8rem, 20vw, 24rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.085em;
  line-height: 0.8;
  white-space: nowrap;
}

.seconds {
  min-width: 2ch;
  margin: 0.15em 0 0 0.42em;
  color: var(--muted);
  font-size: clamp(2rem, 4.5vw, 5rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.date-panel {
  align-self: center;
  padding-left: clamp(2rem, 4vw, 5rem);
  border-left: 1px solid #262624;
}

.weekday {
  margin-bottom: clamp(0.8rem, 1.6vw, 1.5rem);
  color: var(--accent);
  font-size: clamp(1.8rem, 3.3vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}

.date {
  display: block;
  max-width: 9ch;
  font-size: clamp(2.2rem, 4.2vw, 5rem);
  font-weight: 440;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.offline {
  position: absolute;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #777772;
  font-size: clamp(0.75rem, 1vw, 1rem);
  font-weight: 650;
  letter-spacing: 0.13em;
}

.offline[hidden] {
  display: none;
}

.offline-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #777772;
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--background);
  color: var(--foreground);
  font-size: 1.25rem;
  text-align: center;
}

@media (max-aspect-ratio: 6 / 5) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: clamp(3rem, 8vh, 6rem);
    padding: max(2rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  }

  .clock-panel {
    justify-content: center;
    padding-right: 0;
  }

  .time {
    font-size: clamp(6rem, 27vw, 13rem);
  }

  .seconds {
    font-size: clamp(1.8rem, 7vw, 3.5rem);
  }

  .date-panel {
    justify-self: center;
    padding: 0;
    border: 0;
    text-align: center;
  }

  .date {
    max-width: none;
  }
}

@media (max-height: 420px) {
  .dashboard {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .time {
    font-size: min(18vw, 11rem);
  }

  .weekday {
    font-size: min(3vw, 2.2rem);
  }

  .date {
    font-size: min(3.8vw, 2.8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
