/* ═══════════════════════════════════════════════════════════════════════
   QUINTALUZ  |  V4, the descent
   Near-black. One hue at a time. Long passages of darkness between
   moments. Inscriptions, not paragraphs. An artwork first, a website
   reluctantly.
   Type: Space Grotesk (self-hosted, variable weight).
   Three sizes only: display, small-caps label, fine print.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
}

:root {
  --bg: #0a0908;
  --ink: #d9d3c7;
  --ink-dim: #98907f;
  --ink-faint: #6d6557;
  --accent: #e07a60; /* set per-solid by the page */
  --font: "Space Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* three sizes */
  --size-display: clamp(1.9rem, 1.4rem + 2.8vw, 3.4rem);
  --size-label: 0.8125rem;
  --size-fine: 0.75rem;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 340;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: #2e2a22; color: var(--ink); }

.num { font-variant-numeric: tabular-nums; }

a { color: var(--ink-dim); }

/* ── skip link ─────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  font-size: var(--size-label);
  letter-spacing: 0.08em;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 1px solid var(--ink-dim);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── the threshold: name alone in the dark ─────────────────────────── */
.threshold {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: var(--pad);
  text-align: center;
}

.wordmark {
  font-size: var(--size-display);
  font-weight: 380;
  letter-spacing: 0.52em;
  margin-right: -0.52em; /* optical centering against tracking */
  color: var(--ink);
}

.place {
  font-size: var(--size-label);
  font-weight: 400;
  letter-spacing: 0.44em;
  margin-right: -0.44em;
  color: var(--ink-faint);
  text-transform: lowercase;
}

/* ── passages: long darkness, one inscription ──────────────────────── */
.passage {
  min-height: 110vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  text-align: center;
}

.inscription {
  font-size: var(--size-label);
  font-weight: 400;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  line-height: 2.4;
  color: var(--ink-dim);
  text-transform: lowercase;
  max-width: 34em;
}
.inscription.low { color: var(--ink-faint); }

/* ── the matrix breath ─────────────────────────────────────────────── */
.matrix-passage {
  min-height: 130vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 8vh, 6rem);
  padding: var(--pad);
  text-align: center;
}

.matrix-host {
  width: min(78vw, 60vh, 560px);
  aspect-ratio: 1;
  pointer-events: none;
}
.matrix-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── the chamber: one lit object in an unlit room ──────────────────── */
.chamber {
  min-height: 120vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vh, 3.5rem);
  padding: clamp(4rem, 12vh, 8rem) var(--pad);
  text-align: center;
}

.stage-wrap {
  display: flex;
  justify-content: center;
}
#stageCanvas {
  width: min(74vw, 56vh, 460px);
  aspect-ratio: 1;
  height: auto;
}

.plaque {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  min-height: 11.5rem; /* steady across solids: nothing jumps */
}

.plaque h2 {
  font-size: var(--size-display);
  font-weight: 380;
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: var(--ink);
}

.element {
  font-size: var(--size-label);
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  color: var(--accent);
  text-transform: lowercase;
  transition: color 1.2s var(--ease);
}

.counts {
  display: flex;
  gap: 1.6rem;
  font-size: var(--size-fine);
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

.whisper {
  font-size: var(--size-label);
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  color: var(--ink-faint);
  text-transform: lowercase;
  max-width: 30em;
}

/* the five glyphs: small geometric marks, the only navigation */
.picker {
  display: flex;
  gap: clamp(0.4rem, 2vw, 1rem);
}

.glyph {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.glyph svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.glyph svg polygon,
.glyph svg rect {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.1;
  transition: stroke 0.7s var(--ease);
}
.glyph:hover svg polygon,
.glyph:hover svg rect { stroke: var(--ink-dim); }
.glyph[aria-checked="true"] svg polygon,
.glyph[aria-checked="true"] svg rect {
  stroke: var(--accent);
  stroke-width: 1.4;
}

/* ── atelier glimpse: emerging from black, heavily veiled ──────────── */
.atelier {
  position: relative;
  margin: 22vh auto;
  width: min(78vw, 620px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.atelier .artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.62;
  filter: saturate(0.82);
}
.atelier::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* heavy vignette: the image surfaces from the dark, edges dissolve */
  background:
    radial-gradient(ellipse 68% 62% at 50% 50%, transparent 22%, var(--bg) 96%),
    linear-gradient(180deg, var(--bg) 0%, transparent 26%, transparent 74%, var(--bg) 100%);
}

/* ── the two names ─────────────────────────────────────────────────── */
.names {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  padding: var(--pad);
  text-align: center;
}
.names p {
  font-size: var(--size-label);
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  color: var(--ink);
  text-transform: uppercase;
  font-weight: 400;
}

/* ── contact: one quiet line ───────────────────────────────────────── */
.contact {
  text-align: center;
  padding: 4rem var(--pad) 26vh;
}
.contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--ink-dim);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-decoration: none;
  border-bottom: 1px solid #262219;
  transition: color 0.7s var(--ease), border-color 0.7s var(--ease);
}
.contact a:hover { color: var(--ink); border-bottom-color: var(--ink-faint); }

/* ── fine print: one line, the very end ────────────────────────────── */
.fine {
  padding: 0 var(--pad) 3.5rem;
  display: flex;
  justify-content: center;
}
.fine p {
  font-size: var(--size-fine);
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: #8b8272;
  max-width: 52ch;
  text-align: center;
}

/* ── reveals: slow surfacing from the dark ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.6s var(--ease), transform 1.6s var(--ease);
}
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── small screens ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .passage { min-height: 96vh; }
  .matrix-passage { min-height: 110vh; }
  .inscription { letter-spacing: 0.26em; margin-right: -0.26em; }
  .counts { gap: 1.1rem; flex-wrap: wrap; justify-content: center; }
  .plaque { min-height: 12.5rem; }
}
