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

html {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

/* ── Cover ──────────────────────────────────────────────────────────────── */
.cover {
  height: 100dvh;
  background: #0e0c09;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.cover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.cover-eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244,237,224,0.35);
  margin-bottom: 1.6rem;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

.cover-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(5rem, 14vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #f4ede0;
  margin-bottom: 2rem;
  animation: fade-up 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.35s;
}

.cover-body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  line-height: 1.75;
  color: rgba(244,237,224,0.45);
  margin-bottom: 2rem;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.55s;
}

.cover-range {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: rgba(244,237,224,0.22);
  letter-spacing: 0.04em;
  margin-bottom: 3.5rem;
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.7s;
}

.cover-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244,237,224,0.2);
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.9s;
}

.cover-scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(244,237,224,0.2), transparent);
  animation: line-grow 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1.1s;
  transform-origin: top;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

@keyframes line-grow {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* ── Atlas wrapper ───────────────────────────────────────────────────────── */
.atlas {
  padding-right: 160px;
}

/* ── Sticky polaroid hero ────────────────────────────────────────────────── */
.hero-wrap {
  position: sticky;
  top: 0;
  height: 44dvh;
  background: var(--hero-bg, #f5f0e8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  overflow: hidden;
}

/* paper grain */
.grain-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* polaroid frame — JS controls the tilt transform */
.polaroid-frame {
  position: relative;
  display: inline-block;
}

/* tape strips */
.tape {
  position: absolute;
  width: 52px;
  height: 22px;
  background: rgba(214,185,72,0.58);
  z-index: 4;
  pointer-events: none;
}
.tape::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.12) 0, rgba(255,255,255,0.12) 2px,
    transparent 2px, transparent 6px
  );
}
.tape--tl { top: -10px; left: 18px; transform: rotate(-4deg); }
.tape--tr { top: -10px; right: 18px; transform: rotate(3.5deg); }

/* polaroid card */
.polaroid {
  background: #fdfaf4;
  padding: 12px 12px 48px;
  box-shadow:
    2px 4px 10px rgba(0,0,0,0.12),
    6px 12px 32px rgba(0,0,0,0.18),
    0 0 0 1px rgba(0,0,0,0.04);
  width: clamp(180px, 26vw, 320px);
}

/* image container — both hero imgs crossfade, parallax via transform */
.polaroid-inner {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #c4bdb0;
}

.hero-img {
  position: absolute;
  inset: -12px; /* extra room for parallax pan */
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.75s ease;
  will-change: opacity, transform;
}
.hero-img.active { opacity: 1; }

/* polaroid footer */
.polaroid-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 2px 0;
}
.polaroid-filename {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(30,16,8,0.28);
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

/* ── Hero temperature ticker ─────────────────────────────────────────────── */
.hero-temp {
  position: absolute;
  bottom: 1rem;
  right: 2rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  color: rgba(26,14,6,0.32);
  letter-spacing: -0.02em;
  pointer-events: none;
  white-space: nowrap;
  z-index: 25;
  transition: color 0.6s ease;
}
.hero-temp-u {
  font-style: italic;
  font-weight: 400;
  opacity: 0.7;
}

@keyframes ticker-flash {
  0%   { opacity: 1; }
  40%  { opacity: 0.15; }
  100% { opacity: 1; }
}
#hero-temp-val.ticker-flash {
  animation: ticker-flash 0.4s ease;
}

/* ── Temperature band backgrounds ────────────────────────────────────────── */
.band-absolute { background-color: #d0e4f0; }
.band-frigid   { background-color: #d8eaf2; }
.band-ambient  { background-color: #f0ebe0; }
.band-warm     { background-color: #ece0cc; }
.band-hot      { background-color: #e6d4b4; }
.band-furnace  { background-color: #ddc49a; }
.band-stellar  { background-color: #d4b07c; }
.band-plasma   { background-color: #ca9a62; }
.band-nuclear  { background-color: #be844a; }
.band-cosmic   { background-color: #b06c38; }
.band-infinite { background-color: #a05428; }

/* ── Item cards ──────────────────────────────────────────────────────────── */
.item {
  min-height: 100dvh;
  padding: 4rem 4rem 4rem 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
  border-top: 1px solid rgba(30,16,8,0.06);
}

/* ── Item entrance animations ────────────────────────────────────────────── */
.item-seq,
.item-temp,
.item-name,
.item-rule,
.item-caption,
.item-label {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(4px);
  transition:
    opacity   0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    filter    0.6s  cubic-bezier(0.16, 1, 0.3, 1);
}

.item.in-view .item-seq     { opacity: 1; transform: none; filter: none; transition-delay: 0s; }
.item.in-view .item-temp    { opacity: 1; transform: none; filter: none; transition-delay: 0.08s; }
.item.in-view .item-name    { opacity: 1; transform: none; filter: none; transition-delay: 0.18s; }
.item.in-view .item-rule    { opacity: 1; transform: none; filter: none; transition-delay: 0.27s; }
.item.in-view .item-caption { opacity: 1; transform: none; filter: none; transition-delay: 0.36s; }
.item.in-view .item-label   { opacity: 1; transform: none; filter: none; transition-delay: 0.48s; }

/* sequence counter */
.item-seq {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(30,16,8,0.45);
}

/* temperature */
.item-temp {
  line-height: 1;
  letter-spacing: -0.02em;
}
.temp-val {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(3.2rem, 6.5vw, 5.5rem);
  display: inline-block;
  min-width: 1ch;
}
.temp-unit {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  margin-left: 0.08em;
  opacity: 0.6;
}

/* item name */
.item-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  color: #1a0e06;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* divider */
.item-rule {
  width: 32px;
  height: 1.5px;
  border-radius: 1px;
  background: rgba(30,16,8,0.2);
  margin: 0.1rem 0;
}

/* caption */
.item-caption {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.75;
  color: rgba(26,14,6,0.72);
  max-width: 480px;
}

/* band label pill */
.item-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid currentColor;
  padding: 4px 11px;
  opacity: 0.55;
  border-radius: 2px;
  width: fit-content;
  margin-top: 0.4rem;
}

/* ── Fixed right scale panel ─────────────────────────────────────────────── */
.scale-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 160px;
  height: 100dvh;
  background: #0e0c09;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 0;
}

.scale-cap {
  font-family: 'Inter', sans-serif;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  flex-shrink: 0;
}
.scale-cap--btm { margin-top: 0.4rem; }

.scale-svg {
  flex: 1;
  width: 100%;
  overflow: visible;
}

.scale-dot {
  cursor: pointer;
  transition: r 0.2s ease, fill-opacity 0.2s ease;
}

/* Active dot pulse */
@keyframes dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.65; }
}
.scale-dot.active-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: dot-pulse 2s ease-in-out infinite;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
.scale-tooltip {
  position: fixed;
  right: 168px;
  background: #1a0e06;
  color: #f4ede0;
  padding: 6px 11px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  transform: translateY(-50%);
}
.scale-tooltip .tt-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 1px;
}
.scale-tooltip .tt-temp {
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

/* ── Progress strip ──────────────────────────────────────────────────────── */
.progress-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 160px;
  height: 2px;
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: rgba(30,16,8,0.22);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.6s ease;
  width: 0%;
}

/* ── Finale screen ───────────────────────────────────────────────────────── */
.finale {
  height: 100dvh;
  background: #0e0c09;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.finale-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.finale.in-view .finale-inner {
  opacity: 1;
  transform: none;
}

.finale-eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244,237,224,0.25);
}

.finale-poster {
  width: clamp(160px, 22vw, 280px);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

.finale-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.finale-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: rgba(244,237,224,0.88);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .atlas { padding-right: 0; }
  .scale-panel { display: none; }
  .progress-strip { right: 0; }
  .item { padding: 3rem 1.75rem; min-height: 60dvh; }
  .hero-wrap { height: 46dvh; }
}
