/* ============================================================
   HRIA — Kinfolk-Inspired Motion Layer
   Page loader · Split-word reveals · Sticky scrub · Nav transitions
   ============================================================ */

/* ── 0. Disable body scroll during load ─────────────────── */
body.kf-loading { overflow: hidden !important; }

/* ── 1. PAGE LOADER ─────────────────────────────────────── */
#kf-loader {
  position: fixed; inset: 0; z-index: 999999;
  background: #080F1C;
  display: flex; align-items: center; justify-content: center;
  will-change: transform;
}
#kf-loader::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 30%, rgba(245,129,32,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(245,129,32,0.06) 0%, transparent 60%);
  pointer-events: none;
}
#kf-loader-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
  position: relative; z-index: 1;
}
/* Text slide-up reveal — Kinfolk style */
#kf-loader-text-mask {
  overflow: hidden; line-height: 1;
}
#kf-loader-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
#kf-loader-text.kf-up { transform: translateY(0); }

/* Progress line */
#kf-loader-progress {
  width: 48px; height: 2px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}
#kf-loader-progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #F58120, #F58120);
  border-radius: 2px;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}
#kf-loader-progress-bar.kf-full { width: 100%; }

/* Subtitle */
#kf-loader-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0);
  transition: color 0.6s ease 0.7s;
}
#kf-loader-sub.kf-visible { color: rgba(255,255,255,0.45); }

/* Slide-up exit */
#kf-loader.kf-exit {
  transform: translateY(-100%);
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.3, 1) 0s;
}

/* ── 2. SPLIT-WORD TEXT REVEAL ──────────────────────────── */
.kf-split-el {
  overflow: visible;
}
.kf-word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* 2px bottom breathing room so descenders don't clip */
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.kf-word {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.kf-word.kf-word-visible {
  transform: translateY(0);
}

/* ── 3. KINFOLK STAGGER REVEAL ──────────────────────────── */
.kf-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.kf-reveal.kf-reveal-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── 4. STATEMENT SECTION — full-viewport, scroll-driven word reveal ── */
.kf-sticky-section {
  position: relative;
  background-color: #f9fafb;
  background-image: radial-gradient(circle, rgba(12,22,39,0.065) 1px, transparent 1px);
  background-size: 28px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(60px, 8vh, 90px) 0;
  box-sizing: border-box;
  overflow: hidden;
}
.kf-sticky-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 140px;
  background: linear-gradient(to bottom, #f9fafb, transparent);
  pointer-events: none; z-index: 2;
}
.kf-sticky-section::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 140px;
  background: linear-gradient(to top, #f9fafb, transparent);
  pointer-events: none; z-index: 2;
}

/* Content container */
.kf-sticky-body {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 6rem);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Eyebrow chip */
.kf-sticky-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,129,32,0.08);
  border: 1px solid rgba(245,129,32,0.28);
  border-radius: 999px;
  padding: 6px 18px 6px 12px;
  margin-bottom: clamp(28px, 4vh, 52px);
  margin-left: auto;
  margin-right: auto;
}
.kf-sticky-eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #F58120;
  box-shadow: 0 0 0 3px rgba(245,129,32,0.22);
  animation: kfPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes kfPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(245,129,32,0.22); }
  50%      { box-shadow: 0 0 0 7px rgba(245,129,32,0.06); }
}
.kf-sticky-eyebrow-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #F58120;
}

/* Statement text */
.kf-sticky-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2rem, 4vw, 5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  user-select: none;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

/* Each word — JS drives color directly each scroll frame, no CSS transition */
.kf-sw {
  display: inline-block;
  margin-right: 0.2em;
  color: rgb(180, 180, 180);
  transition: none;
  will-change: color;
}

/* Responsive */
@media (max-width: 1024px) {
  .kf-sticky-text { font-size: clamp(1.8rem, 3.8vw, 4rem); }
}
@media (max-width: 768px) {
  .kf-sticky-text { font-size: clamp(1.6rem, 6vw, 3rem); line-height: 1.2; }
  .kf-sticky-section { padding: 60px 0; }
}
@media (max-width: 480px) {
  .kf-sticky-text { font-size: clamp(1.4rem, 7vw, 2.4rem); line-height: 1.25; }
  .kf-sticky-eyebrow { margin-bottom: 20px; }
}

/* ── 5. NAV — fully opaque white (mix-blend-mode needs 100% white) */
.nav-wrapper,
.nav-wrapper.kf-dark {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8) !important;
}

/* Logo: multiply only on the video itself, container stays normal */
.logo {
  mix-blend-mode: normal !important;
  background: transparent !important;
}
.logo video {
  mix-blend-mode: multiply !important;
  background: transparent !important;
}

/* ══════════════════════════════════════════════════════════
   6. KINFOLK FULL-SCREEN HERO
   ══════════════════════════════════════════════════════════ */

/* Core animation keyframe */
@keyframes kfHeroSlideUp {
  from { opacity: 0; transform: translateY(48px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}

/* ── Make hero fill the entire viewport ─────────────────── */
.hero {
  margin-top: 0 !important;
  min-height: 100svh !important;
  min-height: 100vh !important;  /* svh fallback */
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

/* Container stretches full height and centres content */
.hero > .container {
  height: 100%;
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  /* push content below fixed announce-bar (44px) + nav (~80px) */
  padding-top: calc(44px + 90px) !important;
  padding-bottom: 96px !important;
  box-sizing: border-box !important;
}

/* Single centred column — override the old row layout */
.hero-content {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0 !important;
  max-width: 1050px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.hero-text {
  width: 100% !important;
  text-align: center !important;
  align-items: center !important;
  /* freeze in place; JS triggers animation after loader */
  opacity: 0;
  animation: none !important;
}

/* ── EYEBROW — subtle, lightweight ─────────────────────── */
.hero-eyebrow {
  font-size: clamp(0.78rem, 1.2vw, 0.98rem) !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.6 !important;
  color: rgba(255,255,255,0.62) !important;
  margin-bottom: clamp(20px, 3.5vh, 44px) !important;
  opacity: 0 !important;
  animation: none !important;
}

/* ── HEADLINE — Kinfolk scale ───────────────────────────── */
.hero-text h1 {
  font-family: 'Inter', sans-serif !important;
  font-size: clamp(4.2rem, 9.5vw, 11.5rem) !important;
  font-weight: 900 !important;
  line-height: 1.0 !important;
  letter-spacing: -0.045em !important;
  text-align: center !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.06em !important;
  margin-bottom: 0 !important;
  white-space: normal !important;
}

/* "Meet HRIA," span */
.hero-text h1 > span:first-child {
  white-space: normal !important;
  opacity: 0;
  animation: none !important;
}

/* Subtitle: "The AI Agent / Built for Every Workflow" */
.hero-text h1 .subtitle-text {
  font-size: clamp(1.6rem, 3.8vw, 4.5rem) !important;
  font-weight: 300 !important;
  letter-spacing: -0.02em !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  line-height: 1.2 !important;
  text-align: center !important;
  width: 100% !important;
  display: block !important;
  opacity: 0;
  animation: none !important;
}

/* ── Post-loader animation triggers (added by JS via body.kf-loaded) */
body.kf-loaded .hero-text {
  animation: kfHeroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both !important;
}
body.kf-loaded .hero-eyebrow {
  animation: kfHeroSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both !important;
  opacity: 0 !important; /* animation handles it */
}
body.kf-loaded .hero-text h1 > span:first-child {
  animation: kfHeroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both !important;
}
body.kf-loaded .hero-text h1 .subtitle-text {
  animation: kfHeroSlideUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both !important;
}
body.kf-loaded .kf-hero-cta {
  animation: kfHeroSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both !important;
}
body.kf-loaded .kf-hero-scroll {
  animation: kfHeroSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both !important;
}

/* ── CTA button (injected by JS) ────────────────────────── */
.kf-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #F58120, #F58120);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(245,129,32,0.35);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s ease;
  margin-top: clamp(28px, 5vh, 60px);
  opacity: 0;
  animation: none;
}
.kf-hero-cta:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 36px rgba(245,129,32,0.5);
}
.kf-hero-cta-arrow {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.kf-hero-cta:hover .kf-hero-cta-arrow { transform: translateX(5px); }

/* ── Scroll indicator (injected by JS) ─────────────────── */
.kf-hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.kf-hero-scroll.kf-scroll-visible { opacity: 1; }
.kf-hero-scroll.kf-scroll-gone    { opacity: 0; }

.kf-hero-scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), transparent);
  transform-origin: top center;
  animation: kfScrollDrop 2s cubic-bezier(0.16,1,0.3,1) infinite;
}
@keyframes kfScrollDrop {
  0%   { transform: scaleY(0); opacity: 1; }
  55%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
.kf-hero-scroll-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero > .container {
    padding-top:  calc(44px + 70px) !important;
    padding-bottom: 72px !important;
  }
  .hero-text h1 {
    font-size: clamp(3.2rem, 12vw, 6rem) !important;
    letter-spacing: -0.035em !important;
  }
  .hero-text h1 .subtitle-text {
    font-size: clamp(1.4rem, 7vw, 3rem) !important;
  }
  .kf-hero-scroll { bottom: 18px; }
}

@media (max-width: 480px) {
  .hero > .container {
    padding-top: calc(44px + 60px) !important;
    padding-bottom: 60px !important;
  }
  .hero-text h1 {
    font-size: clamp(2.8rem, 13.5vw, 5rem) !important;
    letter-spacing: -0.03em !important;
  }
  .hero-text h1 .subtitle-text {
    font-size: clamp(1.2rem, 7.5vw, 2.5rem) !important;
  }
  .kf-hero-cta { padding: 13px 24px; }
}

/* Hard-reset any margin-top the base stylesheet re-applies at breakpoints */
@media (max-width: 768px) { .hero { margin-top: 0 !important; padding: 0 !important; } }
@media (max-width: 480px) { .hero { margin-top: 0 !important; padding: 0 !important; } }
@media (max-width: 360px) { .hero { margin-top: 0 !important; padding: 0 !important; } }

/* ── 7. MAGNETIC BUTTON ─────────────────────────────────── */
.kf-magnetic {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.kf-magnetic:hover {
  /* JS drives the exact translate; this just ensures smooth return */
}

/* ── 8. SECTION DIVIDER LINE (Kinfolk uses dashed SVG borders) */
.kf-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(12,22,39,0.08), transparent);
  border: none;
  margin: 0;
}

/* ── 9. COUNTER ROLL ANIMATION ──────────────────────────── */
.kf-counting .s-num,
.kf-counting .stat-number {
  display: inline-block;
  animation: kfCountPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes kfCountPop {
  from { transform: scale(0.85); opacity: 0.4; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ── 10. CARDS — enhanced Kinfolk hover ─────────────────── */
.stat-item,
.security-card,
[style*="border-radius:24px"]:not(.announce-bar):not(#kf-loader) {
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.55s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ── 11. RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  #kf-loader-text { font-size: clamp(2.8rem, 14vw, 5rem); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #kf-loader { display: none !important; }
  .kf-word { transform: none !important; transition: none !important; }
  .kf-word-visible { transform: none !important; }
  .kf-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .kf-sw              { color: #0C1627 !important; }
  .kf-sw.kf-sw-accent { color: #F58120 !important; }
  .kf-sticky-eyebrow-dot { animation: none !important; }
  .kf-magnetic { transition: none !important; }
}
