@font-face {
  font-family: "Lato Bedside";
  src: url("assets/fonts/Lato-Thin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Lato Bedside";
  src: url("assets/fonts/Lato-Light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

:root {
  --text: #f3eee4;
  --muted: #d8dcda;
  --accent: #e9b46a;
  --panel: #06131d;
  --line: rgba(225, 232, 230, .16);
  --night-brightness: .45;
  color-scheme: dark;
  font-family: "Lato Bedside", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

button,
input { font: inherit; }

button { color: inherit; }

.dashboard {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 360px;
  overflow: hidden;
  background: #020b13 url("assets/pnw-twilight.webp") center / cover no-repeat;
}

.topline {
  position: absolute;
  top: 67px;
  left: 52px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-size: 23px;
  font-weight: 300;
  letter-spacing: .015em;
}

.topline p { margin: 0; }
.weather { color: var(--muted); }

.clock-group {
  position: absolute;
  top: 25.8%;
  left: 52px;
  max-width: 78vw;
}

.time {
  margin: 0;
  font-size: 213px;
  line-height: .82;
  font-weight: 100;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .2);
}

.event,
.transition {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: .018em;
}

.event {
  margin: 36px 0 0;
  white-space: nowrap;
}

.accent { color: var(--accent); }

.transition {
  position: absolute;
  left: 52px;
  bottom: 60px;
  margin: 0;
}

.dashboard-actions {
  position: absolute;
  right: 36px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

.dashboard.controls-visible .dashboard-actions,
.dashboard-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.freshness {
  margin: 0;
  color: rgba(224, 229, 226, .72);
  font-size: 12px;
  letter-spacing: .045em;
}

.freshness.stale { color: var(--accent); }

.settings-toggle {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(220, 229, 227, .24);
  border-radius: 3px;
  background: rgba(3, 13, 20, .78);
  cursor: pointer;
}

.settings-toggle:hover,
.settings-toggle:focus-visible {
  border-color: rgba(234, 182, 107, .62);
  outline: none;
}

.dashboard.ultra-dark {
  background: #000;
  cursor: pointer;
}

.ultra-dark .topline,
.ultra-dark .event,
.ultra-dark .transition,
.ultra-dark .dashboard-actions { display: none; }

.ultra-dark .clock-group {
  inset: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ultra-dark .time {
  color: rgba(218, 222, 219, var(--night-brightness));
  font-size: 180px;
  text-shadow: none;
}

.settings {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow: auto;
  background: var(--panel);
}

.settings[hidden] { display: none; }

.settings-panel {
  width: min(680px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 34px clamp(24px, 5vw, 48px) 56px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.settings h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 300;
}

.settings h3 {
  margin: 0 0 14px;
  color: #d7dedc;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.close-button,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.settings-content { display: grid; gap: 28px; }

.setting-section {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.setting-section:last-child { border-bottom: 0; }

.fullscreen-button {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border: 1px solid rgba(234, 182, 107, .48);
  border-radius: 3px;
  background: #142837;
  text-align: left;
  cursor: pointer;
}

.fullscreen-button strong,
.fullscreen-button small,
.switch-setting strong,
.switch-setting small,
.data-source strong,
.data-source small { display: block; }

.fullscreen-button strong { font-size: 18px; font-weight: 300; }

.fullscreen-button small,
.switch-setting small,
.data-source small {
  margin-top: 3px;
  color: #aebbbb;
  font-size: 13px;
  font-weight: 300;
}

.help {
  margin: 10px 0 0;
  color: #9caaab;
  font-size: 13px;
  line-height: 1.45;
}

.range-setting,
.switch-setting,
.data-source {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.range-setting { margin-top: 20px; display: block; }
.range-setting > span { display: flex; justify-content: space-between; }
.range-setting input { width: 100%; margin: 14px 0 0; accent-color: var(--accent); }
.range-setting output { color: var(--accent); }

.time-row input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0e202d;
  color: var(--text);
}

.switch-setting,
.data-source { border-top: 1px solid rgba(225, 232, 230, .08); }
.switch-setting:first-of-type { border-top: 0; }
.switch-setting input { width: 22px; height: 22px; accent-color: var(--accent); }

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.time-row label { color: #aebbbb; font-size: 13px; }
.time-row input { display: block; width: 100%; margin-top: 6px; }
.data-source .secondary-button { flex: 0 0 auto; }
.setting-section > .secondary-button { margin-top: 14px; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 700px), (max-height: 500px) {
  .topline { top: 24px; left: 38px; right: 38px; font-size: 17px; }
  .clock-group { top: 25%; left: 38px; max-width: 90vw; }
  .time { font-size: min(23vw, 39vh); }
  .event,
  .transition { font-size: 17px; }
  .event { margin-top: 24px; }
  .transition { left: 38px; bottom: 22px; }
  .dashboard-actions { right: 20px; bottom: 16px; }
  .freshness { display: none; }
  .ultra-dark .time { font-size: min(30vw, 34vh); }
}

@media (max-width: 470px) {
  .topline { left: 20px; right: 20px; }
  .clock-group,
  .transition { left: 20px; }
  .event { white-space: normal; line-height: 1.35; }
  .settings-panel { padding: 24px 20px 44px; }
  .data-source { align-items: flex-start; flex-direction: column; padding: 12px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-actions { transition: none; }
}
