@font-face {
  font-family: "Big Shoulders Display";
  src: url("/fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #05060a;
  --ink: #f7f4ee;
  --ink-soft: #e4ddd1;
  --accent: #ff9900;
  --panel: rgb(8 9 14 / 0.8);
  --line: rgb(247 244 238 / 0.16);
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--ink);
  font-family: var(--display);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--night); }

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

#road {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Darkens the sky behind the type so it reads on every scene. */
.scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(3 4 8 / 0.55) 0%, rgb(3 4 8 / 0.25) 42%, rgb(3 4 8 / 0) 62%);
}

main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.75rem, 7vh, 5.5rem) 1.25rem 0;
  text-align: center;
  text-shadow: 0 2px 16px rgb(0 0 0 / 0.55), 0 1px 2px rgb(0 0 0 / 0.65);
}

h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.84;
  text-wrap: balance;
}

.lead {
  font-weight: 600;
  font-size: clamp(2.25rem, 6.4vw, 5.75rem);
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.name {
  font-weight: 900;
  font-size: clamp(4.5rem, 15.5vw, 13rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.clock {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.25rem, 1.2vw, 1rem);
  margin-top: clamp(1.25rem, 3.6vh, 2.75rem);
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.6ch;
}

.num {
  display: flex;
  font-weight: 800;
  font-size: clamp(3.25rem, 9.5vw, 8.25rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

/* One fixed cell per digit, so the clock never shifts as the numbers change. */
.digit {
  display: inline-block;
  width: 0.56em;
  text-align: center;
}

.sep {
  font-weight: 600;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.9;
}

.label {
  margin-top: 0.55rem;
  font-weight: 700;
  font-size: clamp(0.8rem, 1.15vw, 1rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.when {
  margin: clamp(1rem, 2.6vh, 1.75rem) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  letter-spacing: 0.03em;
  color: var(--ink);
}

.when .local {
  font-weight: 500;
  font-size: 0.82em;
  color: var(--ink-soft);
}

.when .local:empty { display: none; }

body.live .sep { opacity: 0.35; }

.dock {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.scenes {
  display: flex;
  padding: 0.25rem;
  gap: 0.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.dock button {
  appearance: none;
  border: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 999px;
  min-height: 2.5rem;
  padding: 0 1rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dock button:hover { color: var(--ink); background: rgb(247 244 238 / 0.1); }

.dock .scenes button[aria-pressed="true"] {
  color: var(--night);
  background: var(--ink);
}

.dock .motion {
  display: grid;
  place-items: center;
  width: 3rem;
  min-height: 3rem;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.motion .icon-play { display: none; }
.motion[aria-pressed="true"] .icon-play { display: block; }
.motion[aria-pressed="true"] .icon-pause { display: none; }

.made {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.7);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .dock {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .dock button { padding: 0 0.8rem; font-size: 0.85rem; }
  .made { display: none; }
  .clock { gap: 0.5vw; }
  .num { font-size: 14.5vw; }
  .sep { font-size: 10vw; }
  .label { font-size: 0.7rem; letter-spacing: 0.1em; }
  .when { font-size: 1rem; padding: 0 0.5rem; }
}

@media (max-height: 520px) and (orientation: landscape) {
  main { padding-top: 1rem; }
  .name { font-size: clamp(3rem, 11vw, 6rem); }
  .lead { font-size: clamp(1.5rem, 4vw, 3rem); }
  .num { font-size: clamp(2.25rem, 7vw, 4.5rem); }
  .made { display: none; }
}
