/* ============================================
   AIRCHAIR — Botanical Realism Edition
   Palette: deep green / white / black
   Typography: Sora + Manrope
   ============================================ */

:root {
  --c-black-green:  #04110A;
  --c-deep-forest:  #0a1f12;
  --c-dark-pine:    #0B2A18;
  --c-stem:         #2d6b3f;
  --c-rich-green:   #1E6B3B;
  --c-leaf:         #3d8b55;
  --c-vivid:        #4a9e62;
  --c-soft-white:   #F4F8F5;
  --c-white:        #FFFFFF;

  --f-heading: 'Sora', sans-serif;
  --f-body:    'Manrope', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-natural: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--f-body);
  background: var(--c-black-green);
  color: var(--c-soft-white);
  overflow-x: hidden;
}

/* ============================================
   ATMOSPHERIC BACKGROUND — fixed canvas layer
   ============================================ */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmosphere__canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* Smooth upscaling from half-res canvas — eliminates pixel grain */
  image-rendering: auto;
}

::selection {
  background: var(--c-vivid);
  color: var(--c-black-green);
}

/* ============================================
   CINEMATIC INTRO — load-in overlay
   ============================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-black-green);
  pointer-events: all;
  transition: opacity 1s var(--ease-natural);
}

.intro.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.intro.is-gone {
  display: none;
}

/* Lock scroll during intro */
body.intro-active {
  overflow: hidden;
}

.intro__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Horizontal accent lines */
.intro__line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 158, 98, 0.4), transparent);
  transition: width 1.8s var(--ease-out);
}

.intro.is-active .intro__line {
  width: 120px;
}

.intro__line--top {
  margin-bottom: 1.75rem;
}

.intro__line--bottom {
  margin-top: 1.75rem;
}

/* Title */
.intro__title {
  font-family: var(--f-heading);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-white);
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s var(--ease-natural) 0.3s, transform 1.2s var(--ease-natural) 0.3s;
}

.intro.is-active .intro__title {
  opacity: 1;
  transform: translateY(0);
}

/* Edition line */
.intro__edition {
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--c-vivid);
  margin: 0.75rem 0 0;
  opacity: 0;
  transition: opacity 1s var(--ease-natural) 0.8s;
}

.intro.is-active .intro__edition {
  opacity: 0.6;
}

/* Reduced motion — skip animation, just show static then dismiss */
@media (prefers-reduced-motion: reduce) {
  .intro__title,
  .intro__edition {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .intro__line {
    width: 120px;
    transition: none;
  }
  .intro {
    transition: opacity 0.3s ease;
  }
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  mix-blend-mode: difference;
}

.nav__logo {
  font-family: var(--f-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-white);
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-family: var(--f-body);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--c-white);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.nav__link:hover { opacity: 1; }

/* Nav CTA — now handled by .btn-glass--nav in buttons.css */

/* ============================================
   INDICATORS
   ============================================ */
.indicators {
  position: fixed;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.5s var(--ease-out);
}

.indicators__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 248, 245, 0.35);
  background: transparent;
  cursor: pointer;
  transition: background 0.4s, border-color 0.4s, transform 0.4s;
}

.indicators__dot--active {
  background: var(--c-vivid);
  border-color: var(--c-vivid);
  transform: scale(1.3);
}

/* ============================================
   SCROLL HINT
   ============================================ */
.scroll-hint {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.6s var(--ease-out);
}

.scroll-hint--hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint__text {
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-soft-white);
  opacity: 0.5;
}

.scroll-hint__line {
  width: 1px;
  height: 40px;
  background: var(--c-soft-white);
  opacity: 0.25;
  animation: hintPulse 2.5s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.25; }
  50%      { transform: scaleY(0.5); opacity: 0.5; }
}

/* ============================================
   STORY WRAPPER
   ============================================ */
.story {
  position: relative;
  z-index: 1;
}

/* ============================================
   BOTANICAL VINE — multi-layer realistic stem
   ============================================ */
.vine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* All stem layers use stroke-dashoffset for draw-on */
.vine__stem {
  will-change: stroke-dashoffset;
}

/* Branch stroked paths — draw-on via stroke-dashoffset driven by JS
   Junction swells — opacity driven by JS via SVG attribute */

/* Leaf groups — unfurl from attachment point on branch */
.vine__leaf {
  opacity: 0;
  transition: opacity 1s var(--ease-natural), transform 1s var(--ease-natural);
  transform: scale(0.15) rotate(25deg);
  transform-origin: 0 0;
}

.vine__leaf.is-visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ============================================
   CHAPTERS — shared
   ============================================ */
.chapter {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.chapter__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Transparent — continuous atmosphere shows through */
}

/* Section separator — thin elegant green line */
.chapter + .chapter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 158, 98, 0.12) 20%,
    rgba(74, 158, 98, 0.18) 50%,
    rgba(74, 158, 98, 0.12) 80%,
    transparent 100%
  );
  z-index: 1;
}

.chapter__content {
  position: relative;
  z-index: 3;
  max-width: 520px;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease-natural), transform 1s var(--ease-natural);
}

.chapter__content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chapter__content--right {
  margin-left: auto;
  margin-right: 8vw;
  text-align: right;
}

.chapter__content--left {
  margin-left: 8vw;
  margin-right: auto;
}

.chapter__label {
  display: block;
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: var(--c-vivid);
  opacity: 0.65;
}

.chapter__title {
  font-family: var(--f-heading);
  font-weight: 300;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--c-white);
}

.chapter__desc {
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  max-width: 420px;
  opacity: 0.55;
}

.chapter__content--right .chapter__desc {
  margin-left: auto;
}

/* Chapter photos */
.chapter__photo {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  overflow: hidden;
}

.chapter__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.chapter__content--right .chapter__photo {
  margin-left: auto;
}

/* ============================================
   BOTTOM CTA
   ============================================ */
.bottom-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 6rem 1.5rem;
}

.bottom-cta__card {
  position: relative;
  z-index: 2;
  max-width: 400px;
  text-align: center;
}

/* CTA Vine */
.cta-vine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cta-vine__stem {
  will-change: stroke-dashoffset;
}

.cta-vine__leaf {
  opacity: 0;
}

.cta-vine__leaf.is-visible {
  opacity: 1;
}

/* Leaf unfurl — same as main vine */
.cta-vine__leaf .leaf-shape {
  opacity: 0;
  transform: scale(0.15) rotate(25deg);
  transform-origin: 0 0;
  transition: opacity 1s var(--ease-natural), transform 1s var(--ease-natural);
}

.cta-vine__leaf.is-visible .leaf-shape {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.cta-vine__dot {
  transition: opacity 0.6s var(--ease-natural);
}

.cta-vine__dot.is-visible {
  opacity: 0.8;
}

/* Auto-draw animation for CTA vine */
@keyframes ctaVineDraw {
  from { stroke-dashoffset: var(--vine-length); }
  to { stroke-dashoffset: 0; }
}

.cta-vine--animate .cta-vine__stem {
  animation: ctaVineDraw 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.bottom-cta__label {
  display: block;
  font-family: var(--f-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--c-vivid);
  margin-bottom: 1rem;
}

.bottom-cta__title {
  font-family: var(--f-heading);
  font-weight: 300;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.03em;
  color: var(--c-white);
  margin-bottom: 1rem;
}

.bottom-cta__desc {
  font-family: var(--f-body);
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--c-soft-white);
  opacity: 0.55;
  margin-bottom: 2rem;
}

.bottom-cta__price {
  font-family: var(--f-heading);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--c-white);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}

.bottom-cta__trust {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--c-soft-white);
  opacity: 0.3;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Stable viewport height for mobile browser chrome --- */
.chapter {
  height: 100vh;
  height: 100dvh;
}

/* --- Tablet (≤ 768px) --- */
@media (max-width: 768px) {
  .nav { padding: 1.25rem 1.5rem; }
  .nav__links { gap: 1.25rem; }
  .indicators { right: 1.25rem; }

  .chapter__content--right { margin-right: 5vw; }
  .chapter__content--left { margin-left: 5vw; }
  .chapter__title { font-size: clamp(1.75rem, 7vw, 2.75rem); }
  .chapter__desc { font-size: 0.9375rem; }

  .chapter__photo { max-width: 100%; }
}

/* --- Phone (≤ 480px) --- */
@media (max-width: 480px) {
  /* Nav — hide text link, keep CTA */
  .nav { padding: 1rem 1rem; }
  .nav__link:not(.star-btn) { display: none; }
  .nav__links { gap: 0; }

  /* Indicators */
  .indicators { right: 0.75rem; gap: 0.6rem; }
  .indicators__dot { width: 7px; height: 7px; }

  /* Chapters — both sides left-aligned with padding clear of vine */
  .chapter__content--right,
  .chapter__content--left {
    margin: 0;
    padding: 0 1.25rem 0 4.5rem;
    text-align: left;
    max-width: none;
  }

  .chapter__content--right .chapter__desc { margin-left: 0; }
  .chapter__title { font-size: clamp(1.5rem, 8vw, 2.25rem); }
  .chapter__desc { font-size: 0.875rem; max-width: none; }

  /* Vine — smaller but visible */
  .vine { opacity: 0.4; }

  .chapter__photo { max-width: 100%; }
}

/* --- Small phone (≤ 375px) --- */
@media (max-width: 375px) {
  .nav { padding: 0.75rem 0.75rem; }
  .nav__logo { font-size: 0.9375rem; }

  .chapter__content--right,
  .chapter__content--left {
    padding: 0 1rem 0 3rem;
  }

  .chapter__title { font-size: 1.375rem; }
  .chapter__label { font-size: 0.6rem; margin-bottom: 1rem; }
  .chapter__desc { font-size: 0.8125rem; }
}
