:root {
  --ink: #05070c;
  --paper: #f3ede3;
  --muted: rgba(243, 237, 227, 0.55);
  --font: "Inter Display", "Inter", -apple-system, "SF Pro Display", "Segoe UI Variable Display",
    "Segoe UI", "Helvetica Neue", Ubuntu, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  /* Shown before the shader's first frame, and instead of it without WebGL. */
  background:
    radial-gradient(60% 50% at 70% 65%, rgba(232, 150, 74, 0.22), transparent 70%),
    radial-gradient(70% 60% at 25% 30%, rgba(26, 110, 122, 0.35), transparent 70%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 2.4s ease;
}
#field.on { opacity: 1; }

main {
  position: relative;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  padding: 0 16px;
  text-align: center;
}

.mark {
  font-weight: 200;
  font-size: clamp(4.25rem, 17vw, 14rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  /* Optical centering: the trailing letter-spacing pushes the word left. */
  padding-left: 0.045em;
  text-shadow: 0 0 80px rgba(5, 7, 12, 0.35);
  user-select: none;
}

.mark span {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.12em);
  animation: rise 1.6s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}
.mark span:nth-child(1) { animation-delay: 0.30s; }
.mark span:nth-child(2) { animation-delay: 0.38s; }
.mark span:nth-child(3) { animation-delay: 0.46s; }
.mark span:nth-child(4) { animation-delay: 0.54s; }
.mark span:nth-child(5) { animation-delay: 0.62s; }
.mark span:nth-child(6) { animation-delay: 0.70s; }
.mark span:nth-child(7) { animation-delay: 0.78s; }

@keyframes rise {
  to { opacity: 1; filter: blur(0); transform: none; }
}

.line {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: clamp(0.66rem, 1.6vw, 0.78rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fade 1.8s ease 1.5s forwards;
}

.rule {
  width: clamp(1.5rem, 6vw, 3.5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}

footer {
  position: fixed;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fade 1.8s ease 2s forwards;
}

#clock { font-variant-numeric: tabular-nums; }

@keyframes fade { to { opacity: 1; } }

@media (max-width: 480px) {
  .line { letter-spacing: 0.22em; gap: 0.6rem; }
  footer { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .mark span, .line, footer { animation: none; opacity: 1; filter: none; transform: none; }
  #field { transition: none; }
}
