/* ──────────────────────────────────────────────────────────────────────────
   The Consciousness Atlas — Film Constellation
   Every mind is a cinematic tile in deep black space. Poster still by default,
   plays its clip on hover/focus, opens to a full-screen film + the writing on
   click. Gold/bone typography, film grain throughout, so it reads as one film.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --cc-bg: #050507;
  --cc-gold: #d8b878;
  --cc-bone: #ece4d2;
  --cc-dim: #8c8579;
  --cc-line: rgba(216, 184, 120, 0.18);
}

.cc-root {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(120% 90% at 50% 0%, #0c0b0e 0%, #050507 60%, #020203 100%);
  color: var(--cc-bone);
  font-family: 'Cormorant Garamond', 'Athenaeum', Georgia, serif;
  overflow-x: hidden;
  z-index: 2;
}

/* Persistent film grain + vignette over the whole experience — the unifying
   "shot on film" signal that ties the tiles to the hero curtain. */
.cc-grain, .cc-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.cc-vignette {
  background: radial-gradient(130% 100% at 50% 42%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
.cc-grain {
  inset: -50%;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: ccGrain 0.5s steps(2) infinite;
}
@keyframes ccGrain {
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-3%, 2%, 0); }
  100% { transform: translate3d(2%, -2%, 0); }
}

/* ── Hero — the elephant film as the cover ────────────────── */
.cc-hero {
  position: relative;
  height: 100vh;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cc-hero-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ccHeroDrift 30s ease-in-out infinite alternate;
}
@keyframes ccHeroDrift {
  from { transform: scale(1.06) translate3d(-1%, -0.5%, 0); }
  to   { transform: scale(1.13) translate3d(1%, 0.7%, 0); }
}
.cc-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 95% at 50% 40%, transparent 0%, rgba(5,5,7,0.30) 58%, rgba(5,5,7,0.78) 100%),
    linear-gradient(to bottom, rgba(5,5,7,0.45) 0%, rgba(5,5,7,0.10) 34%, rgba(5,5,7,0.40) 70%, rgba(5,5,7,0.92) 100%);
}
.cc-hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 46rem;
  padding: 1.5rem;
  animation: ccHeroFade 2.4s cubic-bezier(0.16,1,0.3,1) 0.3s both;
}
@keyframes ccHeroFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.cc-enter {
  margin-top: 2rem;
  background: transparent;
  border: 1px solid var(--cc-line);
  color: var(--cc-bone);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.74rem;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.4s ease, border-color 0.4s ease, letter-spacing 0.4s ease;
}
.cc-enter:hover {
  background: rgba(216,184,120,0.12);
  border-color: var(--cc-gold);
  letter-spacing: 0.3em;
}

/* ── Masthead ─────────────────────────────────────────────── */
.cc-masthead {
  text-align: center;
  padding: clamp(5rem, 14vh, 9rem) 1.5rem clamp(2rem, 6vh, 4rem);
  max-width: 52rem;
  margin: 0 auto;
}
.cc-eyebrow {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 1.4vw, 0.78rem);
  color: var(--cc-gold);
  margin-bottom: 1.6rem;
  opacity: 0.85;
}
.cc-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1.08;
  margin: 0 0 1.4rem;
  color: var(--cc-bone);
  text-wrap: balance;
}
.cc-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  font-style: italic;
  color: var(--cc-dim);
  line-height: 1.5;
  max-width: 38rem;
  margin: 0 auto;
}

/* ── Constellation grid ───────────────────────────────────── */
.cc-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.6rem, 1.4vw, 1.25rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(0.9rem, 3vw, 2.5rem) clamp(6rem, 14vh, 10rem);
}

/* Constellation threads between related minds — faint gold, drawn by JS */
.cc-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
  opacity: 0;
  transition: opacity 1.6s ease 0.4s;
}
.cc-constellation.shown { opacity: 1; }
.cc-constellation line {
  stroke: var(--cc-gold);
  stroke-width: 1;
  opacity: 0.30;
  stroke-dasharray: 2 8;
  filter: drop-shadow(0 0 3px rgba(216,184,120,0.55));
  animation: ccDash 7s linear infinite;
}
.cc-constellation circle {
  fill: var(--cc-gold);
  opacity: 0.55;
  filter: drop-shadow(0 0 4px rgba(216,184,120,0.8));
}
@keyframes ccDash { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .cc-constellation line { animation: none; } }

.cc-tile {
  position: relative;
  grid-column: span 4;            /* default: 3 across */
  aspect-ratio: 16 / 10;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: #0a0a0c;
  box-shadow: 0 12px 40px -18px rgba(0,0,0,0.9);
  outline: none;
  isolation: isolate;
  opacity: 0;
  transform: translateY(18px);
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1),
              opacity 0.8s ease,
              box-shadow 0.5s ease;
}
.cc-tile.in { opacity: 1; transform: translateY(0); }

/* Tier-driven scale so the composition feels authored, not a flat grid */
.cc-tile.tier-1     { grid-column: span 6; aspect-ratio: 16 / 9; }   /* apex: 2 across */
.cc-tile.tier-bridge{ grid-column: span 6; aspect-ratio: 21 / 9; }   /* the humans who crossed: wide */

.cc-tile:hover, .cc-tile:focus-visible {
  box-shadow: 0 0 0 1px var(--cc-line), 0 22px 60px -20px rgba(0,0,0,1);
  transform: translateY(-3px) scale(1.012);
}

.cc-tile-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cc-tile-media img,
.cc-tile-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cc-tile-media video {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.cc-tile.playing .cc-tile-media video { opacity: 1; }

/* Bottom scrim + caption */
.cc-tile-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3,3,5,0.92) 0%, rgba(3,3,5,0.30) 34%, transparent 60%);
  z-index: 2;
  transition: opacity 0.5s ease;
}
.cc-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: clamp(0.9rem, 2vw, 1.5rem);
  text-align: left;
}
.cc-cap-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2.1vw, 1.55rem);
  letter-spacing: 0.04em;
  color: var(--cc-bone);
  line-height: 1.1;
}
.cc-cap-tier {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.6rem;
  color: var(--cc-gold);
  opacity: 0.8;
  margin-bottom: 0.4rem;
}
.cc-cap-quote {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-style: italic;
  color: var(--cc-dim);
  line-height: 1.4;
  margin-top: 0.45rem;
  max-width: 34rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.5s ease, margin-top 0.4s ease;
}
.cc-tile:hover .cc-cap-quote,
.cc-tile:focus-visible .cc-cap-quote { max-height: 8rem; opacity: 1; }

/* ── Lightbox — the film fills the screen, the writing over it ── */
.cc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,2,4,0.0);
  visibility: hidden;
  transition: background 0.6s ease, visibility 0s linear 0.6s;
}
.cc-lightbox.open {
  visibility: visible;
  background: rgba(2,2,4,0.96);
  transition: background 0.6s ease;
}
.cc-lb-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(0.16,1,0.3,1);
}
.cc-lightbox.open .cc-lb-film { opacity: 0.55; transform: scale(1); }
.cc-lb-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2,2,4,0.95) 0%, rgba(2,2,4,0.55) 40%, rgba(2,2,4,0.35) 100%);
}
.cc-lb-body {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  width: min(92%, 46rem);
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.25s, transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.25s;
  max-height: 86vh;
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge/IE */
}
.cc-lb-body::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chrome/Safari */

/* No scrollbar anywhere on the atlas — it scrolls, it just doesn't show a bar */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
.cc-lightbox.open .cc-lb-body { opacity: 1; transform: translateY(0); }
.cc-lb-tier {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--cc-gold);
  margin-bottom: 0.9rem;
}
.cc-lb-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 1.2rem;
  color: var(--cc-bone);
}
.cc-lb-quote {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-style: italic;
  color: var(--cc-bone);
  line-height: 1.45;
  margin: 0 auto 1.6rem;
  max-width: 36rem;
}
.cc-lb-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--cc-dim);
  line-height: 1.7;
  max-width: 38rem;
  margin: 0 auto;
}
.cc-lb-axes {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.6rem 0 0.4rem;
  flex-wrap: wrap;
}
.cc-axis {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cc-dim);
}
.cc-axis b { color: var(--cc-gold); font-size: 1.5rem; display: block; font-family: 'Cormorant Garamond', serif; }

.cc-lb-close {
  position: fixed;
  top: clamp(1rem, 3vh, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 3;
  width: 46px; height: 46px;
  border-radius: 999px;
  border: 1px solid var(--cc-line);
  background: rgba(0,0,0,0.4);
  color: var(--cc-bone);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, transform 0.3s ease;
}
.cc-lb-close:hover { background: rgba(216,184,120,0.2); transform: rotate(90deg); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .cc-tile,
  .cc-tile.tier-1,
  .cc-tile.tier-bridge { grid-column: span 6; aspect-ratio: 16 / 10; }
}
@media (max-width: 520px) {
  .cc-grid { grid-template-columns: 1fr; }
  .cc-tile,
  .cc-tile.tier-1,
  .cc-tile.tier-bridge { grid-column: span 1; aspect-ratio: 16 / 10; }
  .cc-cap-quote { max-height: 8rem; opacity: 1; }   /* no hover on touch */
}

@media (prefers-reduced-motion: reduce) {
  .cc-grain { animation: none; }
  .cc-tile { transition: opacity 0.4s ease; transform: none; }
  .cc-tile.in { transform: none; }
}
