/* ---------------------------------------------------------
   Peace be with you — simple, elegant, classic, single page
   Vanilla HTML/CSS/JS. No scrolling. No frameworks.
--------------------------------------------------------- */

:root {
  --ink: #f5f1e8;
  --ink-dim: rgba(245, 241, 232, 0.72);
  --ink-faint: rgba(245, 241, 232, 0.5);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
  /* Keep the ordinary arrow cursor everywhere; only real links (below) get a pointer. */
  cursor: default;
}

html,
body {
  margin: 0;
  padding: 0;
  /* Lock the viewport — there is nothing else to scroll to. */
  height: 100%;
  overflow: hidden;
  background: #0b0c0e; /* graceful fallback if the photo never loads */
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Use dvh so mobile browser chrome (address bars) never causes scroll/clipping */
  height: 100dvh;
  width: 100vw;
  position: relative;
  isolation: isolate;
}

/* ---------- Background photo ---------- */

.bg-photo {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  object-fit: cover;      /* fills the screen edge-to-edge, no bars, no distortion */
  object-position: center;
  z-index: -2;
  user-select: none;
  pointer-events: none;
}

/* If the image fails to load, fall back to a quiet, classic gradient */
.bg-photo.is-missing {
  display: none;
}

body:has(.bg-photo.is-missing) {
  background: radial-gradient(ellipse at center, #1b1f27 0%, #0b0c0e 70%);
}

.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Subtle vignette/scrim so text stays crisp and legible on any photo */
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.38) 0%,
      rgba(0, 0, 0, 0.12) 28%,
      rgba(0, 0, 0, 0.18) 60%,
      rgba(0, 0, 0, 0.5) 100%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.35) 100%);
}

/* ---------- Centerpiece ---------- */

.stage {
  position: fixed;
  inset: 0;
}

.title {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  /* Anchored to the exact center of the screen, independent of all other content */
  transform: translate(-50%, -50%);
  width: min(92vw, 56rem);
  text-align: center;
  font-weight: 400;
  font-style: normal;
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
  font-size: clamp(1.6rem, 4.6vw + 0.6rem, 3.6rem);
  line-height: 1.25;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0.5px 20px rgba(0, 0, 0, 0.25);
}

/* ---------- World clocks ---------- */

.clocks {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 0);
  /* Pushes the clocks a comfortable distance below the perfectly-centered title */
  margin-top: clamp(2.2rem, 6.5vh + 1rem, 4.4rem);
  width: min(94vw, 58rem);

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.75rem) clamp(1rem, 3vw, 2.25rem);
  justify-items: center;
}

.clock {
  text-align: center;
  min-width: 0;
}

.clock .city {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(0.58rem, 1vw + 0.35rem, 0.74rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 0.3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock .time {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.82rem, 1.5vw + 0.4rem, 1.15rem);
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* 7 items: 4 on the top row, 3 centered on the next — clean on tablets */
@media (max-width: 720px) {
  .clocks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Phones: two per row reads far more cleanly than cramming three */
@media (max-width: 480px) {
  .clocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
  }
}

/* Short viewports (landscape phones, small laptops in a browser bar) */
@media (max-height: 480px) {
  .title {
    font-size: clamp(1.1rem, 3vw + 0.4rem, 2rem);
    line-height: 1.15;
  }
  .clocks {
    margin-top: clamp(1.5rem, 7.5vh, 2.6rem);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 1rem;
  }
  .clock .city {
    font-size: 0.56rem;
    margin-bottom: 0.2em;
  }
  .clock .time {
    font-size: 0.78rem;
  }
}

@media (max-height: 480px) and (max-width: 480px) {
  .clocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Footer links ---------- */

.legal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: calc(env(safe-area-inset-bottom, 0px) + 1.1rem) 1rem 1.2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(0.68rem, 1vw + 0.3rem, 0.8rem);
  letter-spacing: 0.05em;
}

.legal-link {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.legal-link:hover,
.legal-link:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink-faint);
}

.legal-dot {
  color: var(--ink-faint);
  opacity: 0.6;
}

/* Respect users who prefer reduced motion: nothing animates by default,
   this simply guarantees any future transitions stay minimal. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
