:root {
  --bg: #121a2e;
  --fg: #efe8dc;
  --display: "Mona Sans", system-ui, sans-serif;
  --edge: clamp(24px, 4vw, 64px);
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="light"] {
  --bg: #f1ece2;
  --fg: #16130f;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  transition: background-color 2s;
}

/* The painting fades in once the weather is known. */
.art {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.art.ready { opacity: 1; }

#scene, #bridge, #fx, .grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Vignette: draws the eye to the bridge and the light. */
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 46%, transparent 52%, rgba(6, 10, 40, 0.34) 100%);
}

/* Canvas weave over the paint. */
.grain {
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.35' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.layer {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.layer a, .layer button { pointer-events: auto; }

a { color: inherit; }

.content {
  margin-top: auto;
  padding: 0 var(--edge) clamp(36px, 6vh, 72px);
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.prose {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.35;
}
.hello {
  font-size: clamp(28px, 2.8vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 0.4em;
}
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--fg) 45%, transparent);
  transition: text-decoration-color 0.15s ease;
}
.prose a:hover { text-decoration-color: var(--fg); }

.links {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.links a {
  display: inline-block;
  padding: 10px 0;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--fg) 40%, transparent);
  transition: text-decoration-color 0.15s;
}
.links a:hover { text-decoration-color: var(--fg); }
.sep { opacity: 0.45; padding: 0 6px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; border-radius: 2px; }
.content { text-shadow: 0 1px 24px color-mix(in srgb, var(--bg) 45%, transparent); }
::selection { background: var(--fg); color: var(--bg); }

/* Entrance: the text rises in, one block after the other. */
.content > * { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.prose { animation-delay: 0.15s; }
.links { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-height: 720px) {
  .content { gap: 18px; padding-bottom: 40px; }
}
@media (max-width: 640px) {
  .content { padding: 0 24px calc(28px + env(safe-area-inset-bottom)); gap: 18px; }
  .hello { font-size: 28px; }
  .prose { font-size: 18px; }
  .links a { display: inline-block; padding: 6px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .content > * { animation: none; }
  .art, .stage { transition: none; }
}
