:root {
  --bg: #f6f2ea;
  --bg-deep: #ebe4d6;
  --fg: #1b1814;
  --muted: #6f665b;
  --line: rgba(27, 24, 20, 0.13);
  --line-strong: rgba(15, 118, 110, 0.42);
  --accent: #0f766e;
  --ping: 15, 118, 110;
  --tile-ink: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1412;
    --bg-deep: #070b0a;
    --fg: #eef1ea;
    --muted: #8f9a93;
    --line: rgba(220, 235, 225, 0.09);
    --line-strong: rgba(63, 199, 184, 0.38);
    --accent: #3fc7b8;
    --ping: 63, 199, 184;
    --tile-ink: #0d1412;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1412;
  --bg-deep: #070b0a;
  --fg: #eef1ea;
  --muted: #8f9a93;
  --line: rgba(220, 235, 225, 0.09);
  --line-strong: rgba(63, 199, 184, 0.38);
  --accent: #3fc7b8;
  --ping: 63, 199, 184;
  --tile-ink: #0d1412;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: radial-gradient(120% 90% at 70% 40%, var(--bg) 0%, var(--bg-deep) 100%) fixed, var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  animation: fade 2.4s 0.2s ease forwards;
}

/* Soft vignette so the type always sits on calm ground. */
.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, transparent 62%),
    linear-gradient(0deg, var(--bg) 0%, transparent 28%);
  opacity: 0.85;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(16px, 5vw, 64px) max(24px, env(safe-area-inset-bottom));
}

header, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 0.98rem;
}
.brand { color: inherit; text-decoration: none; }
.brand .tile {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--tile-ink);
  display: grid;
  place-items: center;
}
.brand svg { width: 20px; height: 20px; display: block; overflow: visible; }
.brand .rail { transform-box: fill-box; transform-origin: center; transform: scaleX(0); animation: slide 0.8s cubic-bezier(.2,.8,.2,1) forwards; }
.brand .sun { transform: translateY(7px); opacity: 0; animation: peek 1s 0.45s cubic-bezier(.2,.8,.2,1) forwards; }
.brand .arc { opacity: 0; animation: fade 0.8s 0.9s ease forwards; }
.brand .ring { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; animation: ring 3.6s 1.1s ease-out infinite; }

.meta {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  align-self: center;
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, ui-serif, serif;
}
h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.9rem, 9vw, 7.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; white-space: nowrap; }
h1 .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: up 1.2s cubic-bezier(.16,.84,.24,1) forwards;
}
h1 .line:nth-child(2) > span { animation-delay: 0.14s; }
h1 .line:nth-child(3) > span { animation-delay: 0.28s; }
h1 em { font-style: italic; color: var(--accent); }

.sub {
  margin: 1.6rem 0 0;
  max-width: 30ch;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.55;
  color: var(--muted);
  opacity: 0;
  animation: fade 1.4s 0.9s ease forwards;
}

footer { opacity: 0; animation: fade 1.4s 1.2s ease forwards; }
.back {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.2rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.back:hover, .back:focus-visible { color: var(--accent); border-color: var(--accent); }
.soon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.soon .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--ping), 0.5);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes fade { to { opacity: 1; } }
@keyframes up { to { transform: translateY(0); } }
@keyframes slide { to { transform: scaleX(1); } }
@keyframes peek { to { transform: translateY(0); opacity: 1; } }
@keyframes ring {
  0% { opacity: 0.9; transform: scale(0.55); }
  55%, 100% { opacity: 0; transform: scale(1.25); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--ping), 0.5); }
  80%, 100% { box-shadow: 0 0 0 12px rgba(var(--ping), 0); }
}

@media (max-width: 640px) {
  .veil {
    background:
      linear-gradient(0deg, var(--bg) 0%, transparent 45%),
      linear-gradient(180deg, var(--bg) 0%, transparent 20%);
  }
  .hero { align-self: end; padding-bottom: 2.5rem; }
  .meta.place { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
