:root {
  --bg: #151719;
  --bg-soft: #1c1f22;
  --card: #24282c;
  --card-light: #2d3237;
  --text: #f3f4f6;
  --muted: #a9b0b8;
  --faint: #737b84;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #b7a7ff;
  --accent-2: #7dd3fc;
  --shadow: rgba(0, 0, 0, 0.35);

  /*
    Change this one value if you want the whole widget denser or roomier.
    Try 0.85 for extra compact, or 1.15 for a bigger dashboard feel.
  */
  --scale: 0.85;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  font-family:
    ui-monospace,
    "SFMono-Regular",
    "Cascadia Mono",
    "Roboto Mono",
    "Liberation Mono",
    Menlo,
    Consolas,
    monospace;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(183, 167, 255, 0.16), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(125, 211, 252, 0.11), transparent 26rem),
    linear-gradient(135deg, #101113, var(--bg) 48%, #191b1f);
  padding: clamp(0.35rem, 2vw, 2rem);
}

.app-shell {
  width: 100%;
  max-width: 1050px;
  margin-inline: auto;
  container-type: inline-size;
}

.hero {
  margin-bottom: calc(clamp(0.55rem, 2.4cqw, 1.5rem) * var(--scale));
}

.eyebrow {
  margin: 0 0 0.45em;
  color: var(--accent-2);
  font-size: calc(clamp(0.58rem, 1.7cqw, 0.78rem) * var(--scale));
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: calc(clamp(1.55rem, 9cqw, 5.2rem) * var(--scale));
  line-height: 0.92;
  letter-spacing: -0.08em;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 60ch;
  margin: 0.8em 0 0;
  color: var(--muted);
  font-size: calc(clamp(0.72rem, 2.4cqw, 1.08rem) * var(--scale));
  line-height: 1.55;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: calc(clamp(0.45rem, 1.8cqw, 1rem) * var(--scale));
  min-width: 0;
}

.clock-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: calc(clamp(0.65rem, 2.6cqw, 1.25rem) * var(--scale));
  border: 1px solid var(--line);
  border-radius: calc(clamp(0.8rem, 3cqw, 1.35rem) * var(--scale));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--card);
  box-shadow: 0 1.3rem 3.5rem var(--shadow);
  container-type: inline-size;
}

.clock-card::before {
  content: "";
  position: absolute;
  inset: -35% -35% auto auto;
  width: 55cqw;
  max-width: 11rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(183, 167, 255, 0.16);
  filter: blur(0.5rem);
  pointer-events: none;
}

.clock-card.featured {
  background:
    linear-gradient(145deg, rgba(183, 167, 255, 0.16), rgba(125, 211, 252, 0.045)),
    var(--card-light);
}

.card-topline,
.meta,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(clamp(0.35rem, 1.5cqw, 0.75rem) * var(--scale));
  min-width: 0;
}

.card-topline {
  position: relative;
  z-index: 1;
  margin-bottom: calc(clamp(0.9rem, 9cqw, 2.15rem) * var(--scale));
}

.status-dot {
  flex: 0 0 auto;
  width: calc(clamp(0.42rem, 3.2cqw, 0.72rem) * var(--scale));
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0.85rem var(--accent);
}

.zone-label {
  min-width: 0;
  margin-right: auto;
  color: var(--text);
  font-size: calc(clamp(0.7rem, 5.2cqw, 0.95rem) * var(--scale));
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time {
  position: relative;
  z-index: 1;
  width: 12ch;
  max-width: 100%;
  margin-bottom: 0.25em;
  font-size: calc(clamp(1.35rem, 18cqw, 3.6rem) * var(--scale));
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  white-space: nowrap;
  overflow: hidden;
}

.date {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: calc(clamp(0.66rem, 5.2cqw, 0.96rem) * var(--scale));
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.meta {
  position: relative;
  z-index: 1;
  margin-top: calc(clamp(0.9rem, 6cqw, 1.35rem) * var(--scale));
  padding-top: calc(clamp(0.55rem, 3.5cqw, 1rem) * var(--scale));
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: calc(clamp(0.58rem, 4.4cqw, 0.84rem) * var(--scale));
}

.timezone,
.offset {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timezone {
  color: var(--muted);
}

footer {
  margin-top: calc(clamp(0.55rem, 1.8cqw, 1rem) * var(--scale));
  color: var(--faint);
  font-size: calc(clamp(0.64rem, 1.7cqw, 0.9rem) * var(--scale));
  flex-wrap: wrap;
}

button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: calc(clamp(0.45rem, 1.5cqw, 0.75rem) * var(--scale)) calc(clamp(0.65rem, 2cqw, 1rem) * var(--scale));
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.18);
}

button:active {
  transform: translateY(0);
}

@container (max-width: 190px) {
  .hero {
    display: none;
  }

  .clock-grid {
    gap: 0.4rem;
  }

  .clock-card {
    padding: 0.55rem;
  }

  .card-topline {
    margin-bottom: 0.65rem;
  }

  .date {
    display: none;
  }

  .meta {
    margin-top: 0.65rem;
  }

  footer {
    display: none;
  }
}

@container (max-width: 135px) {
  .meta {
    display: none;
  }

  .time {
    font-size: 17cqw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
