/* ---------- tokens (shadcn/ui dark, zinc) ---------- */
:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --radius: 0.5rem;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --gutter: clamp(28px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  cursor: default;
}

.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.01em; }
.muted { color: hsl(var(--muted-foreground)); }

/* ---------- background ---------- */
#topo, #relief {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 2.2s var(--ease-out), transform 3.2s var(--ease-out);
}
/* the relief is a tiny bitmap stretched by the compositor (GPU), never redrawn at full size */
#relief { image-rendering: auto; }
#topo.is-ready, #relief.is-ready { opacity: 1; transform: none; }

.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 50% at 50% 50%, hsl(var(--background) / 0.5), transparent 70%),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, hsl(var(--background)) 100%);
}

/* corner registration marks */
.mark {
  position: fixed; width: 14px; height: 14px; pointer-events: none;
  color: hsl(var(--muted-foreground) / 0.5);
  --m: calc(var(--gutter) * 0.5 - 7px);
  opacity: 0; animation: fade 1.2s var(--ease-out) 1000ms forwards;
}
.mark::before, .mark::after { content: ""; position: absolute; background: currentColor; }
.mark::before { width: 100%; height: 1px; top: 50%; }
.mark::after { height: 100%; width: 1px; left: 50%; }
.mark--tl { top: var(--m); left: var(--m); }
.mark--tr { top: var(--m); right: var(--m); }
.mark--bl { bottom: var(--m); left: var(--m); }
.mark--br { bottom: var(--m); right: var(--m); }

/* ---------- layout ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
}

.top, .bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: hsl(var(--foreground)); text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: -0.01em;
}
.top__meta { display: flex; align-items: center; gap: 10px; color: hsl(var(--muted-foreground)); }
.sep { opacity: 0.4; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status__dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: hsl(var(--foreground));
  animation: ping 2.4s ease-out infinite;
}

/* ---------- hero ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  width: 100%;
  padding: 48px 0;
  will-change: transform;
}

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 24px; padding: 0 10px 0 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--background) / 0.75);
  font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground));
}
.badge__pulse {
  position: relative; width: 6px; height: 6px; border-radius: 999px;
  background: hsl(var(--foreground));
}
.badge__pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: inherit;
  border: 1px solid hsl(var(--foreground) / 0.6);
  animation: ripple 2.2s var(--ease-out) infinite;
}

.title {
  margin: 22px 0 0;
  font-size: clamp(2.6rem, 7.6vw, 6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
  text-wrap: balance;
  max-width: 12ch;
}
.title .w {
  display: inline-block; overflow: hidden; vertical-align: top;
  padding-bottom: 0.1em; margin-bottom: -0.1em;
}
.title .w > span {
  display: inline-block;
  transform: translateY(110%) rotate(2deg);
  transform-origin: 0 100%;
  animation: rise 1.3s var(--ease-out) forwards;
  animation-delay: calc(160ms + var(--i) * 70ms);
}

.lede {
  margin: 24px 0 0;
  max-width: 44ch;
  font-size: clamp(15px, 1.4vw, 17px); line-height: 1.6;
  color: hsl(var(--muted-foreground));
  text-wrap: pretty;
}

/* status ticker */
.ticker {
  margin-top: 40px;
  display: flex; align-items: center; gap: 16px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px;
}
.ticker__rule {
  width: clamp(32px, 6vw, 72px); height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--muted-foreground) / 0.6));
  position: relative; overflow: hidden;
}
.ticker__rule:last-child { transform: scaleX(-1); }
.ticker__rule::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--foreground)), transparent);
  transform: translateX(-100%);
  animation: sweep 3.2s var(--ease-in-out) infinite;
}
.ticker__slot { position: relative; display: inline-grid; min-width: 22ch; }
.ticker__slot > span {
  grid-area: 1 / 1;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out), filter 600ms;
}
.ticker__slot > span.is-out { opacity: 0; transform: translateY(-8px); filter: blur(3px); }
.ticker__slot > span.is-in  { opacity: 0; transform: translateY(8px);  filter: blur(3px); transition: none; }

/* ---------- footer ---------- */
.bottom { color: hsl(var(--muted-foreground)); }
.coords { display: flex; gap: 14px; }
.coords b { font-weight: 500; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.scale { display: flex; align-items: center; gap: 10px; }
.scale__bar {
  width: 96px; height: 5px; position: relative;
  border: 1px solid hsl(var(--muted-foreground) / 0.6); border-top: 0;
}
.scale__bar::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: hsl(var(--muted-foreground) / 0.6);
}

/* ---------- motion ---------- */
.reveal {
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 1.1s var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}

@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { to { transform: translateY(0) rotate(0); } }
@keyframes ripple {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 hsl(var(--foreground) / 0.45); }
  70%, 100% { box-shadow: 0 0 0 7px hsl(var(--foreground) / 0); }
}
@keyframes sweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

@media (max-width: 640px) {
  .scale { display: none; }
  .mark { display: none; }
  .sep, #clock { display: none; }
  .coords span:nth-child(2) { display: none; }
  .ticker__slot { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .title .w > span, .mark { animation-duration: 1ms; animation-delay: 0ms; }
  .badge__pulse::after, .status__dot, .ticker__rule::after { animation: none; }
  #topo, #relief { transition: none; transform: none; }
}
