﻿/* ============================================================
   PORTAL HERO — cinematic pillar-jumping experience for OnRemarK
   States: ConvHi AI -> Customer Experience -> Operations Intelligence
   ============================================================ */

.hero--portal {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  background: #0B1220;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
}

/* ---------- Backgrounds (one video per state) ---------- */
.hp-bg, .hp-bgv, .hp-shade, .hp-transition, .hp-transition video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hp-bgv { object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.hp-bgv.is-visible { opacity: 1; }
.hp-shade {
  z-index: 1;
  background: linear-gradient(to bottom, rgba(11,18,32,.42) 0%, transparent 34%, transparent 52%, rgba(11,18,32,.92) 100%);
  pointer-events: none;
}

.hp-chrome {
  position: absolute;
  z-index: 4;
  transition: opacity .45s ease, filter .45s ease;
}
.hero--portal.is-transitioning .hp-chrome { opacity: 0; filter: blur(8px); pointer-events: none; }

/* ---------- Pillar list (left rail, like planet-list) ---------- */
.hp-pillars {
  left: clamp(18px, 1.95vw, 28px);
  top: 50%;
  transform: translateY(-43%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}
.hp-pillar {
  display: flex;
  align-items: center;
  min-height: 20px;
  color: rgba(255,255,255,.62);
  text-decoration: none;
  cursor: pointer;
  transition: color .25s ease;
  white-space: nowrap;
}
.hp-pillar:hover { color: #fff; }
.hp-pillar.active { font-size: 17px; font-weight: 700; gap: 10px; color: #fff; }
.hp-pillar.active::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--coral, #F2823E);
  flex: none;
}
.hp-pillars.is-switching .hp-pillar { animation: hpRow .58s cubic-bezier(.22,1,.36,1) both; }
.hp-pillars.is-switching .hp-pillar:nth-child(1){animation-delay:.02s}
.hp-pillars.is-switching .hp-pillar:nth-child(2){animation-delay:.05s}
.hp-pillars.is-switching .hp-pillar:nth-child(3){animation-delay:.08s}
.hp-pillars.is-switching .hp-pillar.active::before { animation: hpDot .55s cubic-bezier(.22,1,.36,1) .18s both; }

/* ---------- Portal (canvas window) ---------- */
.hp-portal-wrap {
  left: 50%;
  top: 50%;
  width: min(320px, 31vw);
  transform: translate(-50%, -54%);
}
.hp-portal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  opacity: 0;
}
.hp-portal-heading strong { font-size: 17px; margin-left: 8px; }
.hp-portal {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 320/350;
  padding: 0;
  border: 0;
  border-radius: 90px;
  background: transparent;
  cursor: none;
}
.hp-portal video, .hp-portal img {
  visibility: hidden;
  position: absolute;
  width: 1px; height: 1px;
  pointer-events: none;
}
.hp-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hp-scene { display: none; }

/* ---------- Content (giant title + facts + CTA) ---------- */
.hp-content {
  left: clamp(28px, 4vw, 58px);
  right: clamp(28px, 3vw, 44px);
  bottom: clamp(24px, 3vh, 30px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}
.hp-content h1 {
  font-size: clamp(96px, 15.5vw, 220px);
  font-weight: 700;
  line-height: .82;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin: 0 0 .1em;
  transform: translateX(-24px);
  opacity: 0;
}
/* per-state eyebrow: full pillar name above the display title */
.hp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px 2px;
  font: 700 clamp(11px, 1vw, 13px)/1 "Space Grotesk", sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
  opacity: 0;
}
.hp-eyebrow i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hp-accent, var(--coral, #F2823E));
  box-shadow: 0 0 12px var(--hp-accent, var(--coral, #F2823E));
}
/* per-state accent — pillar colour system */
.hero--portal[data-state="convhi"]   { --hp-accent: #9D8BFF; }
.hero--portal[data-state="cx"]       { --hp-accent: #FF7A5C; }
.hero--portal[data-state="opsintel"] { --hp-accent: #6FA8FF; }
.hero--portal #hp-title { transition: color .6s ease; text-shadow: 0 2px 34px rgba(5,10,24,.35); }
.hero--portal[data-state="convhi"] #hp-title { text-shadow: 0 2px 38px rgba(120,95,255,.4); }
.hero--portal[data-state="cx"] #hp-title { color: #FF8A6A; text-shadow: 0 2px 38px rgba(242,107,91,.45); }
.hero--portal[data-state="opsintel"] #hp-title { text-shadow: 0 2px 38px rgba(95,150,255,.42); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero--portal[data-state="cx"] #hp-title {
    color: transparent;
    background: linear-gradient(100deg, #FFC4AC 0%, #FF7A5C 55%, #F04D6B 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}
.hp-sub {
  font-size: 15px;
  color: rgba(255,255,255,.72);
  max-width: 44ch;
  margin: 0 0 18px;
  opacity: 0;
}
.hp-cta { display: flex; gap: 12px; opacity: 0; }
.hp-cta .btn--primary { box-shadow: 0 8px 28px rgba(242,107,91,.4); }
.hp-cta .btn--ghost { border-color: rgba(255,255,255,.4); color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hp-cta .btn--ghost:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.6); }

.hp-facts { width: min(430px, 34vw); margin: 0; font-size: 15px; }
.hp-fact {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.42);
  opacity: 0;
}
.hp-fact:last-child { border-bottom: 0; }
.hp-fact dt { font-weight: 700; }
.hp-fact dd { margin: 0; color: rgba(255,255,255,.78); }

/* ---------- Autoplay progress ---------- */
.hp-progress {
  left: 50%;
  bottom: clamp(14px, 1.6vh, 18px);
  width: min(220px, 30vw);
  height: 2px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.18);
  border-radius: 2px;
  overflow: hidden;
}
.hp-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--coral, #F2823E);
  border-radius: 2px;
}
body.hp-intro .hp-progress i {
  animation: hpProgress 6s linear forwards;
}
.hero--portal.auto-off .hp-progress i { animation-play-state: paused; opacity: .35; }
@keyframes hpProgress { from { width: 0 } to { width: 100% } }

/* ---------- Autoplay toggle ---------- */
.hp-autoplay {
  position: absolute;
  right: clamp(18px, 2vw, 30px);
  bottom: clamp(14px, 2vh, 22px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(11,18,32,.42);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.85);
  font: 600 12px/1 "Space Grotesk", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: none;
  transition: background .2s ease, border-color .2s ease;
}
.hp-autoplay:hover { background: rgba(11,18,32,.65); border-color: rgba(255,255,255,.5); }
.hp-autoplay svg { width: 12px; height: 12px; }
.hp-autoplay .hp-ic-play { display: none; }
.hero--portal.auto-off .hp-autoplay .hp-ic-pause { display: none; }
.hero--portal.auto-off .hp-autoplay .hp-ic-play { display: block; }

/* ---------- Transition & loading ---------- */
.hp-transition { display: none; z-index: 5; }
.hp-loading {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  opacity: 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: opacity .2s;
}
.hero--portal.is-loading .hp-loading { opacity: .8; }
.hero--portal.is-transitioning .hp-pillars { opacity: 1; filter: none; pointer-events: auto; }
.hero--portal.is-committing .hp-bgv { transition: none !important; }

/* ---------- Custom cursor (scoped to hero) ---------- */
.hero--portal, .hero--portal button, .hero--portal a { cursor: none !important; }
.hp-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  width: 1px; height: 1px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.hp-cursor.is-visible { opacity: 1; }
.hp-cursor-dot, .hp-cursor-orbit {
  position: absolute;
  left: 0; top: 0;
  border-radius: 50%;
  transform: translate(-50%,-50%);
}
.hp-cursor-dot { width: 12px; height: 12px; background: #fff; }
.hp-cursor-orbit {
  width: 36px; height: 36px;
  border: 1px solid #fff;
  background: rgba(255,255,255,.28);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.hp-cursor.is-enter .hp-cursor-orbit { transform: translate(-50%,-50%) scale(1.16); }
.hp-cursor-label {
  position: absolute;
  top: 26px; left: 0;
  transform: translateX(-50%) translateY(-4px);
  font: 15px/1.2 "Space Grotesk", sans-serif;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.hp-cursor.is-enter .hp-cursor-label { opacity: 1; transform: translateX(-50%) translateY(0); }
body:not(.preload-complete) .hp-cursor { opacity: 0 !important; }

/* ---------- Preloader ---------- */
.hp-preloader {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  overflow: hidden;
}
.hp-preloader video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hp-preloader-shade {
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent, #000);
}
.hp-preloader.is-background { z-index: 0; }
.hp-preloader.is-background .hp-preloader-shade { opacity: 0; }

.hp-logo {
  position: fixed;
  z-index: 62;
  left: 50%; top: 50%;
  width: 120px; height: auto;
  opacity: .2;
  transform: translate(-50%,-50%);
  will-change: left, top, width, height, transform;
  transition: left 1.6s cubic-bezier(.16,1,.3,1), top 1.6s cubic-bezier(.16,1,.3,1),
              width 1.6s cubic-bezier(.16,1,.3,1), height 1.6s cubic-bezier(.16,1,.3,1),
              transform 1.6s cubic-bezier(.16,1,.3,1), opacity .4s ease;
}
.hp-logo.is-docked { opacity: 0; }

.hp-count {
  position: fixed;
  z-index: 62;
  left: 50%;
  bottom: clamp(22px, 3.1vh, 28px);
  display: flex;
  align-items: flex-end;
  gap: 4px;
  transform: translateX(-50%);
  color: #fff;
  line-height: 1;
}
.hp-count > span:first-child { font-size: 64px; font-weight: 100; }
.hp-count .pct { font-size: 22px; padding-bottom: 4px; }
.hp-count.is-leaving { animation: hpCountOut .75s cubic-bezier(.22,1,.36,1) both; }
@keyframes hpCountOut { to { opacity: 0; filter: blur(7px); transform: translate(-50%,-34px); } }
.hp-skip {
  position: fixed;
  z-index: 63;
  right: 22px; top: 22px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font: 600 12px/1 "Space Grotesk", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.hp-skip:hover { background: rgba(255,255,255,.22); }

/* ---------- Entrance / switch animations ---------- */
body:not(.hp-intro) .hp-pillars,
body:not(.hp-intro) .hp-eyebrow,
body:not(.hp-intro) .hp-content h1,
body:not(.hp-intro) .hp-sub,
body:not(.hp-intro) .hp-cta,
body:not(.hp-intro) .hp-fact { opacity: 0; }

.hp-intro .hp-pillars { animation: hpSide .9s cubic-bezier(.22,1,.36,1) .65s both; }
.hp-content-revealing .hp-eyebrow { animation: hpFact .72s cubic-bezier(.22,1,.36,1) .16s both; }
.hp-content-revealing h1   { animation: hpTitle 1.05s cubic-bezier(.16,1,.3,1) both; }
.hp-content-revealing .hp-sub { animation: hpFact .72s cubic-bezier(.22,1,.36,1) .3s both; }
.hp-content-revealing .hp-cta { animation: hpFact .72s cubic-bezier(.22,1,.36,1) .44s both; }
.hp-content-revealing .hp-fact { animation: hpFact .72s cubic-bezier(.22,1,.36,1) both; }
.hp-content-revealing .hp-fact:nth-child(1){animation-delay:.52s}
.hp-content-revealing .hp-fact:nth-child(2){animation-delay:.68s}
.hp-content-revealing .hp-fact:nth-child(3){animation-delay:.84s}
.hp-content-revealing .hp-fact:nth-child(4){animation-delay:1s}
.hp-mask-revealing .hp-portal-heading { animation: hpCaption .85s cubic-bezier(.22,1,.36,1) both; }

@keyframes hpSide   { from{opacity:0;filter:blur(8px);transform:translate(-20px,-43%)} to{opacity:1;filter:blur(0);transform:translate(0,-43%)} }
@keyframes hpTitle  { from{opacity:0;filter:blur(12px);transform:translate(-24px,42px)} to{opacity:1;filter:blur(0);transform:translate(-24px,0)} }
@keyframes hpFact   { from{opacity:0;filter:blur(7px);transform:translateY(18px)} to{opacity:1;filter:blur(0);transform:translateY(0)} }
@keyframes hpCaption{ from{opacity:0;filter:blur(7px);transform:translateY(22px)} to{opacity:1;filter:blur(0);transform:translateY(0)} }
@keyframes hpRow    { from{opacity:.35;transform:translateX(-8px)} to{opacity:1;transform:translateX(0)} }
@keyframes hpDot    { from{opacity:0;transform:scale(0)} to{opacity:1;transform:scale(1)} }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hp-portal-wrap { width: min(300px, 48vw); }
  .hp-content h1 { font-size: clamp(80px, 20vw, 150px); }
  .hp-facts { width: 42vw; }
  .hp-fact { grid-template-columns: 120px 1fr; }
  .hp-pillars { font-size: 13px; }
  .hp-pillar.active { font-size: 15px; }
}
@media (max-width: 640px) {
  .hero--portal { min-height: 600px; }
  .hp-pillars { display: none; }
  .hp-portal-wrap { top: 42%; width: min(250px, 62vw); }
  .hp-portal { border-radius: 70px; }
  .hp-content { left: 18px; right: 18px; bottom: 18px; display: block; }
  .hp-content h1 { font-size: clamp(72px, 22vw, 130px); margin-bottom: 14px; transform: none; }
  .hp-sub { font-size: 14px; }
  .hp-facts { width: 100%; font-size: 13px; margin-top: 18px; }
  .hp-fact { grid-template-columns: 96px 1fr; padding: 5px 0; }
  .hp-portal-heading { font-size: 13px; }
  .hp-portal-heading strong { font-size: 15px; }
  .hero--portal, .hero--portal button, .hero--portal a { cursor: auto !important; }
  .hp-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero--portal *, .hero--portal *::before, .hero--portal *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .hp-portal { transform: none !important; }
  .hp-preloader, .hp-count, .hp-logo, .hp-skip { display: none !important; }
}
