:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #111111;
  --muted: #565656;
  --line: #d8d8d8;
  --accent: #d5122d;
  --link: #0d59b5;
}

:root[data-theme='day'] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #111111;
  --muted: #565656;
  --line: #d8d8d8;
  --accent: #111111;
  --link: #111111;
}

:root[data-theme='night'] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #000000;
  --panel-strong: #000000;
  --ink: #ffffff;
  --muted: #d0d0d0;
  --line: #3f3f3f;
  --accent: #ffffff;
  --link: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(1120px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 10px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.topbar-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.brand {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.theme-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.theme-badge,
.theme-detail {
  margin: 0;
}

.theme-badge {
  padding: 6px 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.theme-detail {
  font-size: 0.9rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  font-size: 0.95rem;
}

.layout {
  display: grid;
  gap: 22px;
}

.hero {
  background: var(--panel);
  padding: 0;
  text-align: center;
}

.status,
.date-line,
.sun-line,
.stat-copy,
.detail-panel dt,
.about {
  color: var(--muted);
}

.status {
  margin: 0 0 8px;
  font-size: clamp(2rem, 2.8vw, 2.7rem);
}

.headline {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.time-readout {
  margin: 0;
  font-size: clamp(4.8rem, 13vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 700;
  color: var(--accent);
}

.date-line {
  margin: 8px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.sun-line {
  margin: 8px 0 0;
  font-size: 1rem;
}

.world-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  font-size: 1.25rem;
}

.subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  text-align: left;
}

.stat-card,
.detail-panel,
.about {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 18px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-value,
.zone-name,
.detail-panel dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-panel h2,
.section-heading h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.detail-panel dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.detail-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-panel div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.world-clocks {
  display: grid;
  gap: 12px;
}

.clock-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 14px;
}

.clock-card {
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 0;
  min-height: auto;
  box-shadow: none;
  border-bottom: 1px dotted var(--line);
  padding-bottom: 8px;
}

.clock-city {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--link);
}

.clock-time {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.clock-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.city-grid-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.city-grid-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--muted);
}

.city-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  line-height: 1.5;
}

.city-grid a {
  white-space: nowrap;
}

.about {
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
}

.quote {
  margin-top: 0;
}

.languages {
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .subgrid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 14px;
  }

  .topbar-tools,
  .theme-status,
  .topnav {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .theme-status {
    flex-direction: column;
  }
}