/* ============================================================
   EIDOLON — museum of lost things
   Deep hall dark · bone-white points · amber plaque type
   ============================================================ */

:root {
  --hall:        #0b0a0c;   /* near-black gallery dark */
  --hall-2:      #131117;   /* faintly warmer pool of light */
  --bone:        #efe7d6;   /* point / heading white */
  --bone-dim:    #b8b0a3;   /* body text */
  --bone-faint:  #6d675e;   /* meta / captions */
  --amber:       #d79a4a;   /* plaque accent */
  --amber-deep:  #b47a2f;
  --plaque-bg:   rgba(18,15,12,0.58);
  --rule:        rgba(215,154,74,0.35);
  --maxw:        1440px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--hall);
  color: var(--bone-dim);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: default;
}

::selection { background: rgba(215,154,74,0.28); color: var(--bone); }

a { color: inherit; text-decoration: none; }

/* thin custom scrollbar */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: #060506; }
::-webkit-scrollbar-thumb { background: #2a2620; border-radius: 9px; border: 2px solid #060506; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }

/* ---------- fixed atmosphere overlays ---------- */
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0.05; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 39; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 42%,
    transparent 0%, transparent 42%, rgba(0,0,0,0.55) 100%);
}

/* the point-cloud stage */
#scene {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100vh; display: block;
}

.webgl-fallback {
  position: fixed; inset: 0; z-index: 2; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, var(--hall-2), var(--hall) 70%);
  text-align: center; padding: 2rem;
}
.webgl-fallback p {
  font-family: "Fraunces", serif; font-style: italic; font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--bone-faint); line-height: 1.7;
}

/* focus ring — brightens while holding */
.focus-ring {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  transition: opacity 0.6s var(--ease);
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%),
    rgba(215,154,74,0.10) 0%, transparent 26%);
  mix-blend-mode: screen;
}
body.focusing .focus-ring { opacity: 1; }

/* focus HUD — a small curatorial readout that fades in while holding */
.focus-hud {
  position: fixed; left: 50%; bottom: clamp(1.4rem, 5vh, 3rem); z-index: 31;
  transform: translate(-50%, 8px); opacity: 0;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1rem; border: 1px solid rgba(215,154,74,0.3);
  border-radius: 999px; background: rgba(11,10,12,0.7);
  backdrop-filter: blur(6px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
body.focusing .focus-hud { opacity: 1; transform: translate(-50%, 0); }
.fh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 10px 2px rgba(215,154,74,0.7); animation: fhPulse 1.1s ease-in-out infinite; }
@keyframes fhPulse { 0%,100% { transform: scale(0.7); opacity: 0.6; } 50% { transform: scale(1.2); opacity: 1; } }
.fh-label { font-family: "Fraunces", serif; font-style: italic; font-size: 0.85rem; color: var(--bone); }
.fh-sub { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-faint); }

/* ---------- chrome ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: baseline; gap: 1.4rem;
  padding: clamp(1rem, 2.2vw, 1.7rem) clamp(1.2rem, 3.5vw, 2.6rem);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px 2px rgba(215,154,74,0.6);
  animation: pulseMark 4.5s var(--ease) infinite;
}
@keyframes pulseMark { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.brand-word {
  font-family: "Space Grotesk", sans-serif; font-weight: 500;
  letter-spacing: 0.42em; font-size: 0.82rem; color: var(--bone);
  padding-left: 0.1em;
}
.topbar-sub {
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-faint); margin-left: auto;
}
.topbar-idx {
  font-family: "Fraunces", serif; font-variant-numeric: tabular-nums;
  font-size: 0.82rem; color: var(--amber); letter-spacing: 0.12em;
  min-width: 4.4ch; text-align: right;
}

/* scroll cue */
.scroll-cue {
  position: fixed; left: 50%; bottom: clamp(1.4rem, 4vh, 2.6rem); z-index: 30;
  transform: translateX(-50%); display: flex; flex-direction: column;
  align-items: center; gap: 0.7rem; transition: opacity 0.7s var(--ease);
}
.scroll-cue.hidden { opacity: 0; pointer-events: none; }
.cue-word {
  font-family: "Fraunces", serif; font-style: italic; font-size: 0.9rem;
  color: var(--bone-faint); letter-spacing: 0.16em;
}
.cue-line {
  width: 1px; height: 42px;
  background: linear-gradient(var(--amber), transparent);
  animation: cueDrift 2.6s var(--ease) infinite;
}
@keyframes cueDrift {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ---------- scroll layout ---------- */
#hall { position: relative; z-index: 10; }

.panel {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.4rem, 6vw, 6rem);
}
.panel-exhibit { align-items: center; }

/* intro */
.panel-intro { align-items: center; }
.intro-inner { max-width: 40rem; }
.kicker {
  font-size: 0.7rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 1.6rem;
}
.intro-title {
  font-family: "Fraunces", serif; font-weight: 300;
  font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: 0.98;
  color: var(--bone); letter-spacing: -0.02em; margin-bottom: 1.8rem;
}
.intro-title .line { display: block; }
.intro-title .ital { font-style: italic; color: var(--amber); font-weight: 400; }
.intro-lede {
  font-size: clamp(1rem, 1.5vw, 1.14rem); color: var(--bone-dim);
  max-width: 34rem; margin-bottom: 1.4rem;
}
.intro-note {
  font-family: "Fraunces", serif; font-style: italic;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem); color: var(--bone-faint);
  max-width: 32rem;
}
.intro-note em { color: var(--amber); font-style: italic; }

/* exhibit plaques */
.plaque {
  position: relative;
  max-width: 30rem;
  background: var(--plaque-bg);
  backdrop-filter: blur(7px) saturate(1.1);
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
  border: 1px solid rgba(215,154,74,0.16);
  border-left: none;                 /* replaced by the animated bar below */
  padding: clamp(1.6rem, 3vw, 2.4rem);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
}
/* amber left rule that "draws in" from the top when the plaque reveals —
   like a curator's brass edge catching the gallery light */
.plaque::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(var(--amber), var(--amber-deep));
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.1s cubic-bezier(0.22,1,0.36,1) 0.15s;
}
.panel.in-view .plaque::before { transform: scaleY(1); }
/* small acquisition stamp in the plaque's top-right corner */
.plaque::after {
  content: "ACC. " attr(data-acc); position: absolute; top: clamp(1.6rem,3vw,2.4rem);
  right: clamp(1.6rem,3vw,2.4rem);
  font-size: 0.56rem; letter-spacing: 0.18em; color: var(--bone-faint);
  opacity: 0.5;
}
.plaque-left  { margin-right: auto; }
.plaque-right { margin-left: auto; }

.plaque-num {
  font-family: "Fraunces", serif; font-style: italic; font-weight: 400;
  font-size: 0.92rem; color: var(--amber); letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.plaque-title {
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.06;
  color: var(--bone); letter-spacing: -0.015em; margin-bottom: 1rem;
}
.plaque-meta {
  display: flex; flex-direction: column; gap: 0.15rem;
  font-size: 0.72rem; letter-spacing: 0.06em; color: var(--bone-faint);
  text-transform: uppercase; margin-bottom: 1.1rem;
}
.plaque-rule {
  height: 1px; width: 100%; margin-bottom: 1.1rem;
  background: linear-gradient(90deg, var(--amber), transparent);
}
.plaque-body {
  font-size: 0.95rem; color: var(--bone-dim); line-height: 1.72;
  margin-bottom: 1.2rem;
}
.plaque-tag {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber-deep);
  padding-top: 0.9rem; border-top: 1px dotted rgba(215,154,74,0.25);
}

/* outro */
.panel-outro { align-items: center; }
.outro-inner { max-width: 40rem; margin: 0 auto; text-align: center; }
.outro-title {
  font-family: "Fraunces", serif; font-style: italic; font-weight: 300;
  font-size: clamp(2rem, 6vw, 4rem); line-height: 1.04;
  color: var(--bone); margin-bottom: 1.6rem; letter-spacing: -0.01em;
}
.outro-body {
  font-size: clamp(0.98rem, 1.5vw, 1.12rem); color: var(--bone-dim);
  max-width: 34rem; margin: 0 auto 2.2rem;
}
.outro-cta {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif; font-size: 0.72rem;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--amber);
  padding: 0.85rem 1.6rem; border: 1px solid rgba(215,154,74,0.4);
  border-radius: 999px; transition: all 0.5s var(--ease);
}
.outro-cta:hover {
  background: var(--amber); color: var(--hall); border-color: var(--amber);
  box-shadow: 0 0 30px -4px rgba(215,154,74,0.5);
}

/* ---------- reveal states ---------- */
.plaque, .intro-inner, .outro-inner {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.panel.in-view .plaque,
.panel.in-view .intro-inner,
.panel.in-view .outro-inner { opacity: 1; transform: none; }

/* stagger meta lines in */
.panel.in-view .plaque-meta span {
  animation: metaIn 0.8s var(--ease) both;
}
.panel.in-view .plaque-meta span:nth-child(2) { animation-delay: 0.08s; }
.panel.in-view .plaque-meta span:nth-child(3) { animation-delay: 0.16s; }
@keyframes metaIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
.credit {
  position: relative; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.6rem;
  padding: 2rem clamp(1.4rem, 6vw, 6rem) 2.6rem;
  font-size: 0.72rem; letter-spacing: 0.08em; color: var(--bone-faint);
  border-top: 1px solid rgba(215,154,74,0.12);
  background: linear-gradient(transparent, rgba(6,5,6,0.9));
}
.credit-mid { margin-left: auto; }
.credit a { color: var(--bone-dim); border-bottom: 1px solid var(--rule); transition: color 0.3s; }
.credit a:hover { color: var(--amber); }
.credit-build { color: var(--amber) !important; letter-spacing: 0.12em; }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .topbar-sub { margin-left: 0; width: 100%; order: 3; }
  .topbar-idx { margin-left: auto; }
  .plaque { max-width: 100%; margin: 0; background: rgba(14,11,9,0.82); backdrop-filter: blur(10px) saturate(1.1); }
  .plaque-left, .plaque-right { margin: 0; }
  /* push cards to the lower band so the lifted artifact reads above them */
  .panel-exhibit { align-items: flex-end; }
  .panel { padding: 6rem 1.3rem 3.5rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cue-line, .brand-mark { animation: none; }
  .plaque, .intro-inner, .outro-inner { transition: opacity 0.4s ease; transform: none; }
  .plaque-meta span { animation: none !important; }
}
