:root {
  --ink: #0b1220;
  --panel: #131f30;
  --panel-2: #16243a;
  --paper: #f2f5f4;
  --frost: #90a4b4;
  --amber: #e3a54b;
  --teal: #4fd3ac;
  --plum: #6a4e82;
  --rose: #b4667e;
  --hairline: rgba(242, 245, 244, 0.09);

  --c1: #122335;
  --c2: #6fa8c7;

  --tint-dawn: rgba(227, 165, 75, 0.16);
  --tint-day: rgba(111, 168, 199, 0.14);
  --tint-dusk: rgba(180, 102, 126, 0.18);
  --tint-night: rgba(4, 7, 13, 0.4);

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection {
  background: var(--teal);
  color: var(--ink);
}

a {
  color: var(--teal);
}

*:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.live-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--frost);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(79, 211, 172, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 211, 172, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(79, 211, 172, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 211, 172, 0);
  }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 55% at 26% 12%, var(--c2) 0%, transparent 60%),
    linear-gradient(165deg, var(--c1) 0%, var(--ink) 72%);
  opacity: 0.55;
}
.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.12;
  max-width: 16ch;
  margin: 0 0 clamp(1.75rem, 4vw, 2.75rem);
}

.hero-clock-row {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  flex-wrap: wrap;
}
.hero-analog {
  flex: 0 0 auto;
  width: clamp(150px, 22vw, 220px);
}
.hero-analog svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero-readout {
  flex: 1 1 260px;
  min-width: 240px;
}
.hero-place {
  font-size: 1rem;
  color: var(--frost);
  margin: 0 0 0.35rem;
}
.hero-place .note {
  color: var(--amber);
}
.hero-digital {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0 0 0.6rem;
  font-variant-numeric: tabular-nums;
}
.hero-date {
  margin: 0 0 0.2rem;
  color: var(--paper);
  font-size: 1rem;
}
.hero-offset {
  margin: 0;
  color: var(--frost);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.hero-sub {
  max-width: 62ch;
  color: var(--frost);
  font-size: 0.98rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--hairline);
}

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}
.search-field {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  gap: 0.55rem;
}
.search-field svg {
  flex: 0 0 auto;
  opacity: 0.6;
}
.search-field input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.search-field input::placeholder {
  color: var(--frost);
}
.clear-btn {
  background: transparent;
  border: 0;
  color: var(--frost);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  display: none;
}
.clear-btn.show {
  display: inline-block;
}

.format-toggle {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 3px;
}
.format-toggle button {
  border: 0;
  background: transparent;
  color: var(--frost);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.format-toggle button.active {
  background: var(--panel-2);
  color: var(--paper);
}

/* Grid */
.grid-section {
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 4rem;
}
.grid-intro {
  color: var(--frost);
  font-size: 1rem;
  margin: 0 0 1.5rem;
  max-width: 60ch;
}
.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}

.province-card {
  font-family: inherit;
  color: inherit;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.4rem;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.province-card:hover {
  border-color: rgba(242, 245, 244, 0.22);
}
.province-card:active {
  transform: scale(0.99);
}
.province-card.is-featured {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(79, 211, 172, 0.35);
}
.phase-tint {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: background-color 1.2s ease;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.card-clock {
  flex: 0 0 auto;
  width: 64px;
}
.card-clock svg {
  width: 100%;
  height: auto;
  display: block;
}

.card-text {
  flex: 1;
  min-width: 0;
}
.card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.25;
  margin: 0 0 0.15rem;
}
.card-city {
  font-size: 0.8rem;
  color: var(--frost);
  margin: 0 0 0.55rem;
}
.card-digital {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.2rem;
}
.card-date {
  font-size: 0.78rem;
  color: var(--frost);
  margin: 0 0 0.15rem;
}
.card-offset {
  font-size: 0.76rem;
  color: var(--frost);
  font-family: var(--font-mono);
  margin: 0;
}
.card-note {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--amber);
  border: 1px solid rgba(227, 165, 75, 0.35);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.empty-state {
  color: var(--frost);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.98rem;
}

/* Clock face */
.tick-major {
  stroke: var(--frost);
  stroke-width: 2;
  opacity: 0.85;
}
.tick-minor {
  stroke: var(--frost);
  stroke-width: 1;
  opacity: 0.35;
}
.clock-face {
  fill: var(--panel-2);
  stroke: var(--hairline);
  stroke-width: 1;
}
.clock-numeral {
  fill: var(--frost);
  font-family: var(--font-mono);
  font-size: 6px;
}
.hand {
  stroke-linecap: round;
  transform-origin: 50px 50px;
}
.hand-hour {
  stroke: var(--paper);
  stroke-width: 3;
}
.hand-minute {
  stroke: var(--paper);
  stroke-width: 2;
  opacity: 0.85;
}
.hand-second {
  stroke: var(--teal);
  stroke-width: 1.25;
}
.hand-cap {
  fill: var(--teal);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
  color: var(--frost);
  font-size: 0.88rem;
}
.site-footer p {
  max-width: 68ch;
  margin: 0 0 0.5rem;
}
.credit {
  color: rgba(144, 164, 180, 0.6);
}

/* Solar Progress Bar */
.solar-progress-wrapper {
  margin-top: 0.75rem;
  width: 100%;
}

.solar-track {
  position: relative;
  height: 6px;
  background: rgba(242, 245, 244, 0.08);
  border-radius: 999px;
  overflow: visible;
}

.solar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose) 0%, var(--amber) 40%, var(--teal) 100%);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.solar-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--teal);
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.solar-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--frost);
  margin-top: 0.35rem;
}

.hero-solar {
  max-width: 320px;
  margin-top: 1.1rem;
}

.card-solar .solar-track {
  height: 4px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero-clock-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .pulse-dot {
    animation: none;
  }
}

