/* ─── Fonts ─────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────── */

:root {
  --color-text: #f5ede0;
  --color-text-muted: rgba(245, 237, 224, 0.75);
  --color-text-dark: #1a1410;
  --color-btn-hover: rgba(245, 237, 224, 0.1);
}

/* ─── Loader ─────────────────────────────────────────────────────────────── */

.loader {
  position: fixed;
  inset: 0;
  background: #1a1610;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-family: "Cinzel", serif;
  transition: opacity 0.6s ease;
}

.loader_text {
  font-size: 1.6rem;
  letter-spacing: 0.1em;
}

.loader--done {
  opacity: 0;
  pointer-events: none;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */

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

* {
  hyphens: auto;
}

body {
  overscroll-behavior: none;
}

/* ─── Scroll ─────────────────────────────────────────────────────────────── */

.scroll-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: none;
}

.section {
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
}

/* ─── Layers ─────────────────────────────────────────────────────────────── */

.background-layer, .tower, .fog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.background-layer {
  opacity: 0;
  z-index: 0;
  object-position: left center;
  transition: object-position 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

body.detail-shifted .background-layer {
  object-position: right center;
}

.background-layer--active {
  opacity: 1;
}

.fog {
  pointer-events: none;
}

.fog-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  opacity: 0;
  z-index: 200;
}

.transition-cover {
  position: fixed;
  inset: 0;
  background: var(--color-text);
  pointer-events: none;
  opacity: 0;
  z-index: 250;
}

.fog-black {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: 15; /* between section_content (10) and detail (20) */
  opacity: 0.5;
}

.fog-black--back {
  width: 53%; /* 5% wider than the front so it peeks out on the left while still reaching the right edge */
  z-index: 14; /* one step below the front fog-black so the front paints on top */
}

.scroll-container.locked {
  overflow: hidden;
}

.tower {
  transform: translateX(-50%);
}

/* ─── Section content ────────────────────────────────────────────────────── */

.word {
  display: inline-block;
  will-change: transform, opacity;
}

.section_content {
  position: fixed;
  top: 80px;
  right: 80px;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: right;
  width: 100%;
}

.section_content--active {
  opacity: 1;
  pointer-events: auto;
}

.section_title {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--color-text-dark);
  text-align: right;
  width: 50%;
  white-space: pre-line;
      filter: drop-shadow(#d5c9c9 0px 0px 10px);

}

/* ─── Detail panel ───────────────────────────────────────────────────────── */

.detail {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100vh;
  padding: 40px 20px 40px 40px;
  color: var(--color-text);
  opacity: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.detail--active {
  pointer-events: auto;
}

.detail_inner {
  flex: 1;
  overflow-y: auto;
  touch-action: pan-y;
  padding-right: 40px;
}

.detail_title {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: 0.03em;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.detail_inner p {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  max-width: 540px;
}

/* ─── End section ────────────────────────────────────────────────────────── */

.section--end {
  display: flex;
  align-items: center;
  justify-content: center;
}

.end_scroll-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(#101010 0px 0px 10px);
}

.end_scroll-info p {
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin: 0;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.section--hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: "Cinzel", serif;
  color: var(--color-text);
  text-align: center;
}

h1 {
  font-size: 9rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.05em;
  margin-bottom: -20px;
  filter: drop-shadow(#101010 0px 0px 10px);
}

.hero_subtitle {
  font-size: 3rem;
  letter-spacing: 0.07em;
  margin-top: 10px;
  filter: drop-shadow(#101010 0px 0px 10px);
}

.hero_scroll-info {
  position: absolute;
  filter: drop-shadow(#101010 0px 0px 10px);
  bottom: 16%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero_scroll-info .arrow-icon {
  animation: arrow-pulse 2.5s ease-in-out infinite;
}

.hero_scroll-info p {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin: 0;
}

/* ─── Story scroll indicators ────────────────────────────────────────────── */

.story-indicator {
  position: fixed;
  z-index: 10;
  color: var(--color-text);
  font-family: "Cinzel", serif;
  pointer-events: none;
  opacity: 0;
}

body.detail-open .story-indicator {
  opacity: 0 !important;
  transition: opacity 0.4s ease;
}

.story-indicator_label {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  filter: drop-shadow(#101010 0px 0px 10px);
}

@keyframes arrow-pulse {
  0%, 100% {
    filter: drop-shadow(#101010 0px 0px 4px) drop-shadow(var(--color-text) 0px 0px 2px);
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    filter:
      drop-shadow(var(--color-text) 0px 0px 8px)
      drop-shadow(var(--color-text) 0px 0px 20px)
      drop-shadow(var(--color-text) 0px 0px 40px)
      drop-shadow(var(--color-text) 0px 0px 80px)
      drop-shadow(#f5c87a 0px 0px 40px);
    opacity: 1;
    transform: scale(1.3);
  }
}

.arrow-icon {
  width: 24px;
  height: auto;
  filter: drop-shadow(#101010 0px 0px 10px);
  display: block;
}

.story-indicator .arrow-icon {
  animation: arrow-pulse 2.5s ease-in-out infinite;
}

.story-indicator .arrow-icon--up {
  transform-origin: center;
  animation: arrow-pulse-up 2.5s ease-in-out infinite;
}

.story-indicator .arrow-icon--right {
  transform-origin: center;
  animation: arrow-pulse-right 2.5s ease-in-out infinite;
}

@keyframes arrow-pulse-up {
  0%, 100% {
    filter: drop-shadow(#101010 0px 0px 4px) drop-shadow(var(--color-text) 0px 0px 2px);
    opacity: 0.3;
    transform: rotate(180deg) scale(1);
  }
  50% {
    filter:
      drop-shadow(var(--color-text) 0px 0px 8px)
      drop-shadow(var(--color-text) 0px 0px 20px)
      drop-shadow(var(--color-text) 0px 0px 40px)
      drop-shadow(var(--color-text) 0px 0px 80px)
      drop-shadow(#f5c87a 0px 0px 40px);
    opacity: 1;
    transform: rotate(180deg) scale(1.3);
  }
}

@keyframes arrow-pulse-right {
  0%, 100% {
    filter: drop-shadow(#101010 0px 0px 4px) drop-shadow(var(--color-text) 0px 0px 2px);
    opacity: 0.3;
    transform: rotate(-90deg) scale(1);
  }
  50% {
    filter:
      drop-shadow(var(--color-text) 0px 0px 8px)
      drop-shadow(var(--color-text) 0px 0px 20px)
      drop-shadow(var(--color-text) 0px 0px 40px)
      drop-shadow(var(--color-text) 0px 0px 80px)
      drop-shadow(#f5c87a 0px 0px 40px);
    opacity: 1;
    transform: rotate(-90deg) scale(1.3);
  }
}

@keyframes arrow-pulse-left {
  0%, 100% {
    filter: drop-shadow(#101010 0px 0px 4px) drop-shadow(var(--color-text) 0px 0px 2px);
    opacity: 0.3;
    transform: rotate(90deg) scale(1);
  }
  50% {
    filter:
      drop-shadow(var(--color-text) 0px 0px 8px)
      drop-shadow(var(--color-text) 0px 0px 20px)
      drop-shadow(var(--color-text) 0px 0px 40px)
      drop-shadow(var(--color-text) 0px 0px 80px)
      drop-shadow(#f5c87a 0px 0px 40px);
    opacity: 1;
    transform: rotate(90deg) scale(1.3);
  }
}

.detail-back-indicator .arrow-icon--left {
  animation: arrow-pulse-left 2.5s ease-in-out infinite;
}

.arrow-icon--up {
  transform: rotate(180deg);
}

.arrow-icon--right {
  transform: rotate(-90deg);
}

.arrow-icon--left {
  transform: rotate(90deg);
}

.story-indicator--scroll {
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.story-indicator--right {
  top: var(--y, 50%);
  right: var(--x, 40px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

/* Back-to-tower indicator — fixed bottom-left, fade controlled by GSAP in openDetail/closeDetail */
.detail-back-indicator {
  position: fixed;
  bottom: 50%;
  left: 40px;
  z-index: 25; /* above .detail (20), below .fog-overlay (200) */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  color: var(--color-text);
  font-family: "Cinzel", serif;
  pointer-events: none;
  opacity: 0;
}