/* ============================================================
   FROM TREE TO REALITY — rhino-heads.css
   Layers on top of home.css (shares tokens, header, footer,
   hero, buttons, .section/.container, reveals).
   Only the journey morph + statement/metrics/work live here.
   ============================================================ */

/* ------------------------------------------------------------
   THE JOURNEY — default (fallback) = readable vertical stack
   ------------------------------------------------------------ */
.ftr-journey {
  position: relative;
  z-index: 2;
  background: var(--bg);
}
.ftr-stage { position: relative; }

.ftr-state {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050505;
}
.ftr-state + .ftr-state { margin-top: 4px; }
.ftr-state > img,
.ftr-state > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* caption — child of each state, so it crossfades with it */
.ftr-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: clamp(1.6rem, 5vw, 4.5rem) var(--page-pad);
  max-width: 760px;
  background: linear-gradient(to top, rgba(8,8,8,.92) 0%, rgba(8,8,8,.55) 45%, transparent 100%);
}
.ftr-cap__idx {
  display: block;
  font-family: var(--font-d);
  font-size: .82rem; letter-spacing: .34em;
  color: var(--accent); margin-bottom: 1rem;
}
.ftr-cap__title {
  font-family: var(--font-d);
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 500; line-height: 1; letter-spacing: -.01em;
  color: var(--text); margin-bottom: 1rem;
}
.ftr-cap__desc {
  font-size: clamp(.95rem, 1.4vw, 1.12rem);
  font-weight: 300; line-height: 1.7;
  color: rgba(248,248,248,.78); max-width: 54ch;
}

/* overlay, rail, progress, hint — only meaningful when enhanced */
.ftr-stage__overlay,
.ftr-rail,
.ftr-progress,
.ftr-hint { display: none; }

/* ------------------------------------------------------------
   ENHANCED — pinned full-viewport crossfade morph
   ------------------------------------------------------------ */
.ftr-journey.is-enhanced .ftr-stage {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}
.ftr-journey.is-enhanced .ftr-state {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto;
  margin: 0;
  opacity: 0;
  will-change: opacity;
}
.ftr-journey.is-enhanced .ftr-state > img,
.ftr-journey.is-enhanced .ftr-state > video {
  will-change: transform;
}
.ftr-journey.is-enhanced .ftr-cap {
  padding-bottom: clamp(3rem, 9vh, 7rem);
  max-width: min(760px, 78vw);
}

/* cinematic edge vignette over the stage */
.ftr-journey.is-enhanced .ftr-stage__overlay {
  display: block;
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(8,8,8,.55) 100%),
    linear-gradient(to top, rgba(8,8,8,.35), transparent 30%);
}

/* chapter rail — left edge */
.ftr-journey.is-enhanced .ftr-rail {
  display: flex; flex-direction: column; gap: .15rem;
  position: absolute; left: var(--page-pad); top: 50%;
  transform: translateY(-50%);
  z-index: 6;
}
.ftr-rail__item {
  display: flex; align-items: center; gap: .85rem;
  padding: .55rem 0;
  color: var(--muted);
  opacity: .5;
  transition: opacity .4s var(--ease), color .4s var(--ease);
}
.ftr-rail__n {
  font-family: var(--font-d); font-size: .72rem;
  letter-spacing: .18em; min-width: 1.6em;
}
.ftr-rail__t {
  font-size: .62rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  position: relative; padding-left: 0;
  max-width: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; transform: translateX(-6px);
  transition: max-width .5s var(--ease), opacity .4s var(--ease), transform .4s var(--ease);
}
.ftr-rail__item::before {
  content: ''; width: 16px; height: 1px; background: currentColor;
  opacity: .6; transition: width .4s var(--ease);
}
.ftr-rail__item:hover { opacity: 1; color: var(--text); }
.ftr-rail__item.is-active { opacity: 1; color: var(--accent); }
.ftr-rail__item.is-active::before { width: 30px; }
.ftr-rail__item.is-active .ftr-rail__t { max-width: 240px; opacity: 1; transform: none; }

/* gold progress thread — far left */
.ftr-journey.is-enhanced .ftr-progress {
  display: block;
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  z-index: 6; background: rgba(248,248,248,.08);
}
.ftr-progress__fill {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(var(--accent), rgba(201,168,106,.3));
  transform: scaleY(0); transform-origin: top;
}

/* scroll hint */
.ftr-journey.is-enhanced .ftr-hint {
  display: block;
  position: absolute; right: var(--page-pad); bottom: clamp(2rem, 6vh, 4rem);
  z-index: 6;
  font-size: .6rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted);
  transition: opacity .5s var(--ease);
}

@media (hover: hover) {
  .ftr-rail__item { cursor: pointer; }
}

/* ------------------------------------------------------------
   SCROLL-TO-PLAY hint (video chapters, enhanced mode only)
   ------------------------------------------------------------ */
.ftr-scrub { display: none; }
.ftr-journey.is-enhanced .ftr-scrub {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  position: absolute; left: 50%; top: clamp(3.2rem, 11vh, 6rem);
  transform: translateX(-50%); z-index: 5;
  padding: .85rem 1.15rem .95rem; border-radius: 16px;
  color: rgba(248,248,248,.9); pointer-events: none;
  background: rgba(8,8,8,.26);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  text-shadow: 0 2px 12px rgba(0,0,0,.65);
}
.ftr-scrub__mouse {
  width: 22px; height: 34px; border: 1.5px solid currentColor; border-radius: 12px;
  position: relative; opacity: .9;
}
.ftr-scrub__mouse::after {
  content: ''; position: absolute; left: 50%; top: 6px;
  width: 2px; height: 6px; border-radius: 2px; background: var(--accent);
  transform: translateX(-50%); animation: ftrWheel 1.7s ease-in-out infinite;
}
@keyframes ftrWheel {
  0% { opacity: 0; transform: translate(-50%, 0); }
  25% { opacity: 1; }
  60% { opacity: 1; transform: translate(-50%, 8px); }
  100% { opacity: 0; transform: translate(-50%, 11px); }
}
.ftr-scrub__label {
  font-size: .58rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
}

/* ------------------------------------------------------------
   STATEMENT
   ------------------------------------------------------------ */
.ftr-statement {
  padding: clamp(6rem, 14vh, 11rem) 0;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(201,168,106,.08), transparent 70%),
    var(--bg-card);
  text-align: center;
}
.ftr-statement__text {
  font-family: var(--font-d);
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  font-weight: 400; line-height: 1.18; letter-spacing: -.005em;
  max-width: 22ch; margin-inline: auto; color: var(--text);
}
.ftr-statement__text em { font-style: italic; color: var(--accent); }

/* ------------------------------------------------------------
   METRICS
   ------------------------------------------------------------ */
.ftr-metrics { padding: clamp(5rem, 11vh, 9rem) 0; background: var(--bg); }
.ftr-metrics__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.ftr-metric { border-top: 1px solid var(--border); padding-top: 1.4rem; }
.ftr-metric strong {
  display: block; font-family: var(--font-d);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 500; line-height: 1; color: var(--accent);
}
.ftr-metric span {
  display: block; margin-top: .7rem;
  font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ------------------------------------------------------------
   WHAT LEAVES OUR FLOOR
   ------------------------------------------------------------ */
.ftr-work { padding: clamp(5rem, 11vh, 9rem) 0; background: var(--bg-card); }
.ftr-work__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.ftr-work__card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 3 / 4; border: 1px solid var(--border);
}
.ftr-work__card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(.82);
  transition: transform .8s var(--ease), filter .5s var(--ease);
}
.ftr-work__card::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.ftr-work__card:hover img { transform: scale(1.06); filter: brightness(1); }
.ftr-work__card:hover::after { transform: scaleX(1); }
.ftr-work__meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.4rem 1.2rem;
  background: linear-gradient(to top, rgba(8,8,8,.9), transparent);
}
.ftr-work__meta b { font-family: var(--font-d); font-weight: 500; font-size: 1.2rem; color: var(--text); }
.ftr-work__meta i { font-style: normal; font-size: .58rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  .ftr-metrics__grid { grid-template-columns: repeat(2, 1fr); }
  .ftr-work__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* keep the rail subtle on small screens — numbers only */
  .ftr-journey.is-enhanced .ftr-rail { left: 14px; gap: 0; }
  .ftr-rail__t { display: none; }
  .ftr-cap { max-width: none; }
  .ftr-scrub { top: clamp(3.5rem, 12vh, 6.5rem); }
}
@media (max-width: 600px) {
  .ftr-metrics__grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.2rem; }
  .ftr-work__grid { grid-template-columns: 1fr; }
  .ftr-work__card { aspect-ratio: 16 / 10; }
}

/* reduced motion — never pin; rely on the readable stacked fallback */
@media (prefers-reduced-motion: reduce) {
  .ftr-journey.is-enhanced .ftr-stage { height: auto; overflow: visible; }
  .ftr-journey.is-enhanced .ftr-state { position: relative; inset: auto; opacity: 1; aspect-ratio: 16/9; }
  .ftr-journey.is-enhanced .ftr-rail,
  .ftr-journey.is-enhanced .ftr-progress,
  .ftr-journey.is-enhanced .ftr-hint { display: none; }
}
