/* Noa Ellsworth: a botanist made of 66,000 dots. Values from PROMPT.md, sections 1, 2, 4 and 5. */
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --color-night: #0f110d;
  --color-paper: #f0e5c8;
  --color-dots: #c9d4b8;
  --color-tech: #7fa8a3;
  --color-muted: #7f8a6a;
  --color-surface: #fff;
  --color-ink: #111;
  --color-line: #1111111a;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--color-night); }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.page { position: fixed; inset: 0; overflow: hidden; margin: 0; background: var(--color-night); color: var(--color-paper);
  cursor: crosshair; touch-action: none; }
.page[data-phase="ready"] { cursor: none; }
.page::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05; filter: invert(1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.7 -0.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.stage { position: absolute; inset: 0; }
.stage canvas { width: 100%; height: 100%; display: block; }

/* Loader */
.loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity 0.5s 0.15s; }
.page[data-phase="ready"] .loader { opacity: 0; }
.loader-ring { position: absolute; top: 50%; left: 50%; width: 220px; height: 220px; translate: -50% -50%; overflow: visible; }
.loader-ring circle { fill: color-mix(in srgb, var(--color-paper) 18%, transparent); r: 1.6px; transition: fill 0.25s, r 0.25s; }
.loader-ring circle[data-on] { fill: var(--color-paper); r: 2.2px; }
.loader-count { position: absolute; top: 50%; left: 50%; translate: -50% -60%; font-family: var(--font-mono); font-size: 34px;
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loader-label { position: absolute; top: 50%; left: 50%; translate: -50% 26px; font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.5; white-space: nowrap; }

/* Text */
.logo, .name, .tagline, .hint { position: absolute; margin: 0; opacity: 0;
  transition: opacity 0.9s, translate 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.name, .tagline { top: 50%; font-weight: 400; font-size: clamp(17px, 1.6vw, 24px); letter-spacing: -0.01em; line-height: 1.2;
  translate: 0 calc(10px - 50%); }
.name { left: clamp(20px, 4vw, 64px); }
.tagline { right: clamp(20px, 4vw, 64px); color: var(--color-muted); transition-delay: 0.12s; }
.page[data-phase="ready"] .name, .page[data-phase="ready"] .tagline { opacity: 1; translate: 0 -50%; }

.logo { top: 20px; left: clamp(20px, 4vw, 64px); font-family: var(--font-serif); font-size: 26px; color: inherit; text-decoration: none; }
.page[data-phase="ready"] .logo { opacity: 0.9; }
.page[data-phase="ready"] .logo:hover, .page[data-phase="ready"] .logo:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.hint { bottom: 22px; left: 50%; translate: -50% 10px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; white-space: nowrap; transition-delay: 0.5s; }
.page[data-phase="ready"] .hint { opacity: 0.45; translate: -50% 0; }

/* EN / FR switch (BOS addition, not in the prompt): small mono letters, top right, level with the logo */
.lang { position: absolute; top: 20px; right: clamp(20px, 4vw, 64px); z-index: 6; display: flex; align-items: center; height: 32px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--color-paper); }
.lang span { opacity: 0.35; }
.lang a { color: inherit; text-decoration: none; opacity: 0.5; min-width: 28px; min-height: 28px; display: grid; place-items: center; cursor: pointer; }
.lang a[aria-current] { opacity: 0.9; }
.lang a:hover, .lang a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* Pill */
.pill { position: fixed; bottom: 20px; left: 20px; z-index: 7; background: var(--color-surface); color: var(--color-ink);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; padding: 8px 12px; border-radius: 6px; text-decoration: none;
  box-shadow: 0 0 0 1px var(--color-line), 0 10px 24px -12px #0006; animation: pill-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 4s both; }
@keyframes pill-in { 0% { opacity: 0; transform: translateY(8px); } }

@media (max-width: 700px) {
  .name, .tagline { font-size: 16px; top: 72px; translate: 0 10px; }
  .page[data-phase="ready"] .name, .page[data-phase="ready"] .tagline { translate: 0 0; }
  .hint { bottom: 60px; }
}
@media (max-width: 600px) {
  .pill { padding: 6px 9px; font-size: 11px; bottom: 12px; left: auto; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .loader, .logo, .name, .tagline, .hint { transition: none; }
  .pill { animation: none; }
}
