:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #24271f;
  background: #f5f2e9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #24271f;
  --muted: #77786f;
  --line: #e8e4d9;
  --paper: #fffefa;
  --sun: #db832e;
  --night: #5d7091;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(233, 190, 133, 0.17), transparent 34rem),
    #f5f2e9;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100% - 40px, 840px);
  margin: 0 auto;
  padding: 28px 0 30px;
}

.topbar,
.brand,
.page-nav,
.settings-heading,
.form-footer,
.event-row,
.secondary-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 14px;
  margin-bottom: 32px;
}

.brand {
  justify-content: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  color: var(--sun);
  font-size: 23px;
  line-height: 1;
}

.page-nav {
  justify-content: flex-end;
  gap: 5px;
}

.page-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: #74766d;
  font-size: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.page-nav a:hover,
.page-nav a:focus-visible {
  background: #f2eee5;
}

.page-nav a[aria-current="page"] {
  color: #5e4d35;
  background: #f1e8d9;
  font-weight: 600;
}

.clock-card,
.settings-card {
  overflow: hidden;
  border: 1px solid rgba(66, 64, 51, 0.07);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 16px 42px rgba(70, 61, 36, 0.045);
}

.clock-card {
  padding: 38px 52px 25px;
}

.clock-intro {
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: #9a8061;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.17em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(24px, 4vw, 33px);
  font-weight: 600;
  letter-spacing: -0.055em;
}

.intro-copy,
.empty-state p,
footer p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.intro-copy {
  margin: 0;
}

.empty-state {
  max-width: 430px;
  margin: 44px auto 42px;
  text-align: center;
}

.sun-symbol {
  display: block;
  margin-bottom: 12px;
  color: var(--sun);
  font-size: 32px;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.empty-state p {
  margin-bottom: 0;
}

.clock-content {
  padding-top: 37px;
}

.clock-display {
  text-align: center;
}

.mode-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--sun);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mode-label span:first-child {
  font-family: sans-serif;
  font-size: 20px;
  line-height: 1;
}

.percentage {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 41px;
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.percent-sign {
  padding-left: 2px;
  color: #9a998f;
  font-size: 0.45em;
  font-weight: 400;
  letter-spacing: -0.05em;
  vertical-align: 0.35em;
}

.phase-caption {
  color: #77786f;
  font-size: 10px;
}

.phase-pie {
  display: grid;
  width: clamp(180px, 48vw, 220px);
  aspect-ratio: 1;
  place-items: center;
  margin: 16px auto 28px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #d77d32 0deg var(--progress-angle, 0deg),
    #eeece4 var(--progress-angle, 0deg) 360deg
  );
  transition: background 350ms ease;
}

.pie-label {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 5px;
  color: #24271f;
  text-align: center;
  text-shadow: 0 1px 5px rgba(255, 254, 250, 0.85), 0 0 2px #fffefa;
}

.clock-content.is-night .mode-label {
  color: var(--night);
}

.clock-content.is-night .phase-pie {
  background: conic-gradient(
    from 0deg,
    #586e91 0deg var(--progress-angle, 0deg),
    #eeece4 var(--progress-angle, 0deg) 360deg
  );
}

.event-row {
  margin-bottom: 25px;
}

.event-row > div {
  display: grid;
  gap: 4px;
}

.event-next {
  text-align: right;
}

.event-label {
  color: #8a8b81;
  font-size: 10px;
}

.event-row strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.secondary-clocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.secondary-clock {
  min-height: 82px;
  gap: 12px;
  padding: 17px 14px 14px;
}

.secondary-clock + .secondary-clock {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.secondary-description {
  margin: 5px 0 0;
  color: #898a81;
  font-size: 10px;
}

.secondary-clock strong {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.location-caption {
  width: fit-content;
  max-width: 100%;
  margin: 11px auto 0;
  padding: 6px 10px;
  border: 1px solid #eee6d8;
  border-radius: 999px;
  color: #786b58;
  background: #faf6ef;
  font-size: 10px;
  text-align: center;
}

.brendan-card {
  padding-bottom: 32px;
}

.brendan-clock {
  padding: 24px 0 0;
  text-align: center;
}

.analog-clock {
  width: min(58vw, 310px);
  margin: 0 auto;
  filter: drop-shadow(0 10px 24px rgba(70, 61, 36, 0.09));
}

.clock-face {
  display: block;
  width: 100%;
  overflow: visible;
}

.clock-ring {
  fill: #fffefa;
  stroke: #e8e4d9;
  stroke-width: 1.5;
}

.clock-ticks line {
  stroke: #b7ad9a;
  stroke-linecap: round;
  stroke-width: 2;
}

.clock-number {
  fill: #77786f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.hour-hand,
.minute-hand,
.second-hand {
  stroke-linecap: round;
}

.clock-hand-group {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.hour-hand {
  stroke: #3a3b33;
  stroke-width: 5;
}

.minute-hand {
  stroke: #7d786b;
  stroke-width: 3;
}

.second-hand {
  stroke: var(--sun);
  stroke-width: 1.5;
}

.clock-pivot {
  fill: var(--sun);
}

.brendan-clock.is-night .hour-hand {
  stroke: #465773;
}

.brendan-clock.is-night .clock-pivot,
.brendan-clock.is-night .second-hand {
  stroke: var(--night);
  fill: var(--night);
}

.brendan-digital {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.brendan-digital strong {
  font-size: clamp(29px, 6vw, 42px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.brendan-digital span {
  color: #797a70;
  font-size: 13px;
}

.actual-time-reference {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: fit-content;
  margin: 15px auto 0;
  padding: 10px 18px;
  border: 1px solid #eee9df;
  border-radius: 9px;
  background: #faf8f2;
}

.actual-time-reference strong {
  color: #77786f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.brendan-status {
  margin: 13px 0 0;
  color: #8a8b81;
  font-size: 11px;
}

.brendan-clock.is-night .brendan-digital {
  color: var(--night);
}

.anchor-key {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 23px;
  color: #77786f;
  font-size: 10px;
}

.anchor-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.anchor-key i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
}

.anchor-key .anchor-noon {
  background: #baa174;
}

.anchor-key .anchor-sunset {
  background: var(--night);
}

.settings-card {
  margin-top: 16px;
  padding: 26px 30px 22px;
}

.settings-heading {
  margin-bottom: 21px;
}

.settings-heading .eyebrow {
  margin-bottom: 6px;
}

.settings-heading h2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.location-button,
.save-button {
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  transition: background-color 150ms ease, transform 150ms ease;
}

.location-button {
  padding: 10px 12px;
  color: #6b573c;
  background: #f5eee2;
}

.location-button:hover,
.location-button:focus-visible {
  background: #eee1cb;
}

.location-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.input-grid label {
  display: grid;
  gap: 7px;
  color: #65665e;
  font-size: 10px;
  font-weight: 600;
}

.optional {
  color: #99998f;
  font-weight: 400;
}

.input-grid input {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 10px;
  border: 1px solid #e8e5db;
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: #fffefa;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.input-grid input:focus {
  border-color: #bf9560;
  box-shadow: 0 0 0 3px rgba(191, 149, 96, 0.12);
}

.time-zone-autocomplete {
  position: relative;
  display: block;
}

.time-zone-suggestions {
  position: absolute;
  z-index: 2;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(70, 61, 36, 0.14);
}

.time-zone-suggestion {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.time-zone-suggestion:hover,
.time-zone-suggestion.is-active {
  background: #f2eee5;
}

.time-zone-suggestion-city {
  font-size: 12px;
  font-weight: 600;
}

.time-zone-suggestion-id {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.form-footer {
  gap: 16px;
  margin-top: 18px;
}

.form-footer p {
  margin: 0;
  color: #92938a;
  font-size: 10px;
  line-height: 1.5;
}

.form-footer p.error-message {
  color: #b34d3c;
}

.save-button {
  flex: 0 0 auto;
  padding: 11px 15px;
  color: white;
  background: #2b3129;
}

.save-button:hover,
.save-button:focus-visible {
  background: #414a3e;
}

.save-button span {
  margin-left: 6px;
}

footer {
  padding: 19px 10px 0;
  text-align: center;
}

footer p {
  margin: 0 auto;
  max-width: 610px;
  color: #93938a;
  font-size: 10px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 650px) {
  .app-shell {
    width: min(100% - 24px, 540px);
    padding-top: 19px;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }

  .brand {
    max-width: 190px;
    align-items: flex-start;
    font-size: 11px;
    line-height: 1.4;
  }

  .page-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }

  .page-nav a {
    padding: 5px 7px;
    font-size: 9px;
  }

  .clock-card {
    padding: 30px 24px 21px;
    border-radius: 14px;
  }

  .clock-content {
    padding-top: 30px;
  }

  .analog-clock {
    width: min(68vw, 280px);
  }

  .phase-pie {
    margin-bottom: 24px;
  }

  .secondary-clocks {
    grid-template-columns: 1fr;
  }

  .secondary-clock {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .secondary-clock + .secondary-clock {
    padding-left: 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .secondary-clock strong {
    font-size: 16px;
  }

  .settings-card {
    padding: 22px 19px 19px;
  }

  .input-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 390px) {
  .topbar {
    gap: 6px;
  }

  .page-nav a {
    font-size: 8px;
  }
  .settings-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .location-button {
    max-width: 145px;
    line-height: 1.4;
  }
  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
