/* ============================================================
   EIDOLON — a museum of things that don't exist
   Palette: museum dark #08080a · bone #eee6d4 · amber #d4a24e
   Type:    Instrument Serif (plaques) · JetBrains Mono (stamps)
   ============================================================ */

:root {
  --bg: #08080a;
  --bg-soft: #0d0d11;
  --bone: #eee6d4;
  --bone-dim: #b9b2a2;
  --amber: #d4a24e;
  --amber-dim: #8a6c38;
  --line: rgba(212, 162, 78, 0.28);
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--serif);
  overflow-x: clip;   /* clip, not hidden — hidden breaks position:sticky */
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.mono { font-family: var(--mono); }

a { color: var(--amber); }

/* ---------- canvas ---------- */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------- header ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--amber);
  pointer-events: none;
  mix-blend-mode: normal;
}
.head-index { color: var(--amber-dim); letter-spacing: 0.22em; }

main { position: relative; z-index: 1; pointer-events: none; }
main a, .plaque, .colophon { pointer-events: auto; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  position: relative;
}
.hero-over {
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  color: var(--amber-dim);
  margin-bottom: 2.2rem;
  animation: fadeUp 1.2s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-title {
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 11.5rem);
  line-height: 0.95;
  letter-spacing: 0.06em;
  color: var(--bone);
  animation: fadeUp 1.4s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-sub {
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  color: var(--bone-dim);
  margin-top: 1.4rem;
  animation: fadeUp 1.4s 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-sub em { color: var(--amber); font-style: italic; }
.hero-note {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--amber-dim);
  margin-top: 2.6rem;
  animation: fadeUp 1.4s 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: var(--amber-dim);
  animation: fadeUp 1.4s 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hint-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(var(--amber), transparent);
  overflow: hidden;
  position: relative;
}
.hint-line::after {
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(transparent, var(--bone));
  animation: descend 2.4s ease-in-out infinite;
}
@keyframes descend { to { top: 100%; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- exhibits ---------- */
.exhibit {
  min-height: 175vh;
  position: relative;
  display: block;
}

.plaque {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  width: min(24rem, 38vw);
  padding: 1.8rem 0;
  margin: 0 6vw;
}
.plaque-right { margin-left: auto; }

.plq-no {
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  color: var(--amber-dim);
  margin-bottom: 1.1rem;
}
.plq-title {
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.02;
  color: var(--bone);
  margin-bottom: 1rem;
}
.plq-acc {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 1.2rem;
}
.plq-rule {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--line);
  transform-origin: left center;
  margin-bottom: 1.4rem;
}
.plq-text {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--bone-dim);
  max-width: 34ch;
  margin-bottom: 0.9rem;
}
.plq-text em { color: var(--amber); }

/* reveal choreography */
.plaque > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.plaque .plq-rule { transform: scaleX(0); transition-duration: 1.1s; }
.plaque.in > * { opacity: 1; transform: translateY(0); }
.plaque.in .plq-rule { transform: scaleX(1); }
.plaque.in > *:nth-child(1) { transition-delay: 0.05s; }
.plaque.in > *:nth-child(2) { transition-delay: 0.15s; }
.plaque.in > *:nth-child(3) { transition-delay: 0.25s; }
.plaque.in > *:nth-child(4) { transition-delay: 0.35s; }
.plaque.in > *:nth-child(5) { transition-delay: 0.5s; }
.plaque.in > *:nth-child(6) { transition-delay: 0.62s; }

/* ---------- colophon ---------- */
.colophon {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2.2rem;
  padding: 4rem 1.5rem;
}
.col-big {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15;
  color: var(--bone);
}
.col-big em { color: var(--amber); font-style: italic; }
.col-meta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--bone-dim);
}
.col-dot { color: var(--amber-dim); }
.col-sig {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  color: var(--amber-dim);
}
.col-link {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
}
.col-link:hover { color: var(--bone); border-color: var(--bone); }
.col-link:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: var(--amber-dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  white-space: nowrap;
}
.hud.visible { opacity: 1; }
.hud-active { display: none; color: var(--amber); }
.hud.focusing .hud-idle { display: none; }
.hud.focusing .hud-active { display: inline; }

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .site-head { padding: 1.1rem 1.2rem; }
  .exhibit { min-height: 165vh; }
  .plaque,
  .plaque-right {
    position: sticky;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    margin: 120vh 0 0 0;
    padding: 1.6rem 1.4rem 3.4rem;
    background: linear-gradient(transparent, rgba(8, 8, 10, 0.92) 22%, rgba(8, 8, 10, 0.97));
  }
  .plq-text { max-width: none; font-size: 0.98rem; }
  .hud { bottom: 0.9rem; font-size: 0.55rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-over, .hero-title, .hero-sub, .hero-note, .scroll-hint { animation: none; }
  .hint-line::after { animation: none; }
  .plaque > * { transition-duration: 0.01s; transition-delay: 0s !important; }
}
