/* ─────────────────────────────────────────
   CĀO STORY PAGE — Layout & Visual CSS
   All animation states driven by cao-story.js
───────────────────────────────────────── */

/* ROOT */
.psh-root {
  position: relative;
  background: #0d0b08;
}

/* ── PINNED STAGE (hero only gets full viewport height) ── */
.psh-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #0d0b08;
}

/* Hero image */
.psh-hero-img {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.psh-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform-origin: center center;
}

/* Left panel */
.psh-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  z-index: 3;
  overflow: hidden;
  transform: translateX(-100%);
}
.psh-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Right panel */
.psh-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: 3;
  overflow: hidden;
  transform: translateY(-100%);
}
.psh-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Divider */
.psh-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(232,226,217,0.25);
  z-index: 10;
  transform: scaleY(0);
  transform-origin: top center;
}

/* Headline block */
.psh-headline {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  width: 90%;
  max-width: 900px;
  pointer-events: none;
}
.psh-eyebrow {
  display: block;
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.5);
  margin-bottom: 1.2rem;
  opacity: 0;
}
.psh-h1 {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(52px, 9vw, 120px);
  font-weight: 300;
  line-height: 0.92;
  color: #e8e2d9;
  margin: 0 0 1.4rem;
  letter-spacing: -0.02em;
}
.psh-h1-line {
  display: block;
  overflow: hidden;
}
.psh-h1-line-inner {
  display: block;
  transform: translateY(110%);
}
.psh-subline {
  display: block;
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.45);
  opacity: 0;
}

/* Meta labels */
.psh-meta {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
}
.psh-meta--tl { top: 2rem; left: 2rem; }
.psh-meta--tr { top: 2rem; right: 2rem; align-items: flex-end; }
.psh-meta--bl { bottom: 2rem; left: 2rem; }
.psh-meta--br { bottom: 2rem; right: 2rem; align-items: flex-end; }
.psh-meta__label {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.35);
}
.psh-meta__value {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.7);
}

/* Nav */
.psh-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 1.4rem 2rem;
  opacity: 0;
  transform: translateY(-10px);
}
.psh-nav__link {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}
.psh-nav__link:hover { color: #e8e2d9; }
.psh-nav__link--active { color: #e8e2d9; }

/* ── CHAPTERS ── */
.ps-chapter {
  position: relative;
  width: 100%;
}

/* Color chapter — height driven by content, not viewport */
.ps-chapter--color {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1510;
}
.ps-chapter--color-light {
  background: #e8e2d9;
}
.ps-chapter--slides-over {
  position: relative;
  z-index: 10;
}
.ps-color-inner {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 12vh 2rem;
  text-align: center;
}
.ps-color-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.ps-chapter-num {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.3);
  display: block;
}
.ps-color-headline {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 300;
  line-height: 1;
  color: #e8e2d9;
  margin: 0;
  letter-spacing: -0.02em;
}
.ps-color-body {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.6;
  color: rgba(232,226,217,0.75);
  margin: 0;
}
.ps-color-rule {
  width: 40px;
  height: 1px;
  background: rgba(232,226,217,0.25);
}
.ps-color-note {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(11px, 1.1vw, 13px);
  line-height: 1.7;
  color: rgba(232,226,217,0.45);
  letter-spacing: 0.04em;
  margin: 0;
}

/* ── MATERIAL CHAPTER — height driven by content ── */
.ps-chapter--material {
  background: #1a1510;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
}
@media (max-width: 768px) {
  .ps-chapter--material {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
}

/* Inner image wrappers — directional scrub stays here (correct usage) */
.ps-material-photo {
  position: relative;
  overflow: hidden;
  min-height: 55vh;
}
.ps-material-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
}
.ps-material-photo__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,11,8,0.3);
}
/* Initial states for inner image wrappers (GSAP animates these in) */
.ps-material-photo--left {
  transform: translateX(-60px);
  opacity: 0;
}
.ps-material-photo--right {
  transform: translateX(60px);
  opacity: 0;
}

.ps-material-specs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5vh 3vw;
  background: #1a1510;
  border-left: 1px solid rgba(232,226,217,0.08);
  border-right: 1px solid rgba(232,226,217,0.08);
}

.ps-material-spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(20px);
}
.ps-mat-spec__num {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 300;
  color: #e8e2d9;
  line-height: 1;
  letter-spacing: -0.02em;
}
.ps-mat-spec__label {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.5);
}
.ps-mat-spec__note {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(232,226,217,0.35);
}

.ps-material-rule {
  width: 100%;
  height: 1px;
  background: rgba(232,226,217,0.1);
  margin: 1.5rem 0;
  transform: scaleX(0);
  transform-origin: left center;
}

.ps-material-cta {
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
}
.ps-mat-cta__line {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(14px, 1.4vw, 18px);
  font-style: italic;
  color: rgba(232,226,217,0.5);
  letter-spacing: 0.01em;
}

/* ── HORIZONTAL SCROLL ── */
.ps-chapter--hscroll {
  position: relative;
  background: #0d0b08;
}

.ps-hscroll-curtain {
  height: 40px;
  background: #1a1510;
}
.ps-hscroll-curtain--enter { background: #1a1510; }
.ps-hscroll-curtain--exit { background: #e8e2d9; }

.ps-hscroll-pin {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ps-hscroll-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.ps-hslide {
  position: relative;
  width: 70vw;
  height: 85vh;
  flex-shrink: 0;
  overflow: hidden;
}
@media (max-width: 768px) {
  .ps-hslide {
    width: 88vw;
    height: 60vh;
  }
}

.ps-hslide-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ps-hslide.is-active .ps-hslide-img {
  transform: scale(1);
}

.ps-hslide-caption {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.ps-hslide.is-active .ps-hslide-caption {
  opacity: 1;
  transform: translateY(0);
}
.ps-hslide-num {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(232,226,217,0.45);
  text-transform: uppercase;
}
.ps-hslide-text {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 300;
  color: #e8e2d9;
  letter-spacing: -0.01em;
}

.ps-hscroll-progress {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  width: 80px;
  height: 1px;
  background: rgba(232,226,217,0.15);
}
.ps-hscroll-bar {
  height: 100%;
  width: 0%;
  background: rgba(232,226,217,0.6);
  transition: width 0.1s linear;
}

/* ── ORIGIN CHAPTER — height driven by content ── */
.ps-chapter--origin {
  background: #1a1510;
}
.ps-origin-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10vh 4vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
}
@media (max-width: 768px) {
  .ps-origin-inner { grid-template-columns: 1fr; }
}

/* Inner wrappers — fade-up (not horizontal scrub on the section) */
.ps-origin-img {
  overflow: hidden;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(40px);
}
.ps-origin-img img {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  display: block;
}
.ps-origin-text {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  opacity: 0;
  transform: translateY(40px);
}
.ps-origin-headline {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 300;
  color: #e8e2d9;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.ps-origin-body {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 1.75;
  color: rgba(232,226,217,0.6);
  margin: 0;
}
.ps-origin-rule {
  width: 32px;
  height: 1px;
  background: rgba(232,226,217,0.2);
}
.ps-origin-note {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.7;
  color: rgba(232,226,217,0.35);
  letter-spacing: 0.04em;
  margin: 0;
}
.ps-origin-cta {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e8e2d9;
  text-decoration: none;
  border-bottom: 1px solid rgba(232,226,217,0.3);
  padding-bottom: 2px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.ps-origin-cta:hover {
  color: #e8e2d9;
  border-color: rgba(232,226,217,0.8);
}

/* ── SIGNOFF — height driven by content ── */
.ps-chapter--signoff {
  background: #0d0b08;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12vh 2rem;
}
.ps-signoff-inner {
  text-align: center;
  opacity: 0;
}
.ps-signoff-line {
  font-family: 'Canela', 'Georgia', serif;
  font-size: clamp(22px, 3.5vw, 48px);
  font-weight: 300;
  color: rgba(232,226,217,0.5);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.ps-signoff-mark {
  font-family: 'Suisse Intl', 'Helvetica Neue', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(232,226,217,0.2);
  margin: 0;
}

/* Fade block initial state */
[data-ps-fade-block] {
  opacity: 0;
  transform: translateY(30px);
}
[data-ps-fade-block].is-visible {
  opacity: 1;
  transform: translateY(0);
}