/* LIID Digital — demo build (new.liiddigital.co.za)
   FOURTH PASS. History, so the reasoning isn't lost:
   - Pass 1-2: scroll-triggered TEXT reveals only (opacity/translateY) —
     Ryan's feedback: that isn't "motion" to him at all.
   - Pass 3: added a full-bleed autoplay background video (dark register,
     liquid-glass nav/buttons sourced byte-for-byte from mindloop-hero.md
     in the motionsites.ai library) — closer, but still wrong: the video
     played on its own timer/scroll-fade, not truly scroll-SCRUBBED, and
     it was competing with the actual signature moment (Signal Path) for
     attention — Stage 5/9's own "one genuine signature moment" rule.
   - Pass 4 (this one): video approach scrapped entirely per Ryan's
     explicit correction. Hero reverted to calm/restrained/text-only.
     All real motion now lives in Signal Path, built as a true
     scroll-scrubbed illustrated timeline (GSAP ScrollTrigger,
     scrub:true + pin:true) — scroll position IS the timeline position,
     zero autoplay/timers anywhere. See js/script.js.

   Liquid-glass CSS (still used on nav/buttons) is copied byte-for-byte
   from the real sourced mindloop-hero.md spec. Fade-rise keyframes/
   timing (0.8s ease-out, 0/0.2s/0.4s delays) are the real sourced
   values too. LIID's own real gold accent is kept (validated across
   three passes now) on top of the sourced dark/glass mechanic. */

:root {
  --bg-0: #050505;
  --bg-1: #0D0D0D;
  --bg-2: #141414;
  --fg: #F4F1EA;
  --fg-soft: #B7B2A6;
  --fg-mute: #7A756A;
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --line: rgba(244, 241, 234, 0.12);
  --line-soft: rgba(244, 241, 234, 0.06);

  --serif: 'Cormorant Garamond', serif;
  --display: 'Instrument Serif', serif;
  --sans: 'Syne', sans-serif;
  --mono: 'DM Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
}

/* ==========================================================
   LIQUID GLASS — SOURCED byte-for-byte from mindloop-hero.md
   (same spec as the Equilibrium prompt Ryan pasted — this is the
   real technique, not a reinterpretation).
   ========================================================== */
.liquid-glass {
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.15) 80%,
    rgba(255, 255, 255, 0.45) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================
   FADE-RISE — SOURCED keyframes/timing from mindloop-hero.md
   ========================================================== */
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-rise { animation: fade-rise 0.8s var(--ease-out) both; }
.animate-fade-rise-delay { animation: fade-rise 0.8s var(--ease-out) 0.2s both; }
.animate-fade-rise-delay-2 { animation: fade-rise 0.8s var(--ease-out) 0.4s both; }

/* ---------- Nav (liquid-glass pill, per sourced spec) ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 24px;
  background: rgba(5, 5, 5, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.nav-logo em { color: var(--gold-light); font-style: normal; }
.nav-links {
  display: none;
  gap: 34px;
  font-size: 0.88rem;
  color: var(--fg);
}
.nav-links a { color: inherit; text-decoration: none; opacity: 0.8; transition: opacity 200ms ease-out; }
.nav-links a:hover { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 300ms var(--ease-out);
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.97); }
.btn-glass {
  color: var(--fg);
  padding: 10px 24px;
  font-size: 0.85rem;
}
.btn-glass-lg {
  color: var(--fg);
  padding: 20px 56px;
  font-size: 1rem;
}
.btn-solid {
  background: var(--gold);
  color: var(--bg-0);
  padding: 13px 26px;
  font-size: 0.9rem;
  border: none;
}
.btn-solid:hover { background: var(--gold-light); }

/* ---------- Hero — calm, restrained, text-only (video-based
   approach scrapped; see index.html's hero comment for why) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg-0);
}
.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100svh;
  padding: 128px 24px 96px;
}
h1.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 0;
  color: var(--fg);
}
h1.hero-title em { font-style: italic; color: var(--gold-light); }
.hero-sub {
  margin-top: 32px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--fg-soft);
  max-width: 620px;
}
.hero-actions {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Sections (generic) ---------- */
section { position: relative; padding: 110px 0; scroll-margin-top: 84px; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.15;
  margin: 14px 0 0;
  color: var(--fg);
}
.section-title em { font-style: italic; color: var(--gold-light); }

/* ---------- Generic scroll-trigger for below-fold content
   (Pattern 4 — plain one-shot reveal, not the signature moment;
   Signal Path below carries the real motion) ---------- */
.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal-up.is-visible { opacity: 1; transform: translateY(0); }
.reveal-up.stagger-1 { transition-delay: 90ms; }
.reveal-up.stagger-2 { transition-delay: 180ms; }
.reveal-up.stagger-3 { transition-delay: 270ms; }
.reveal-up.stagger-4 { transition-delay: 360ms; }

/* ---------- Ownership strip ---------- */
.ownership {
  padding: 64px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
}
.ownership-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.ownership-media {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
  will-change: transform;
}
.ownership p { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.4; margin: 0; color: var(--fg); }
.ownership strong { color: var(--gold-light); font-weight: 500; }

/* ---------- Signal Path (signature moment) — true scroll-scrubbed
   timeline (GSAP ScrollTrigger, scrub:true + pin:true — see
   js/script.js's initSignalPathScrub()). No CSS transitions on the
   scrubbed properties below: GSAP sets them directly every scroll
   tick as a pure function of scroll position, and a CSS transition
   racing against that would just add lag/fight the scrub. The
   .signal-node.is-active rule is kept only as the reduced-motion
   instant end-state (see the media query below) — GSAP bypasses it
   entirely by tweening inline styles. ---------- */
.signal { background: var(--bg-0); }
.signal-diagram { position: relative; padding: 48px 0 8px; }
.signal-track { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.signal-line { position: absolute; top: 27px; left: 27px; right: 27px; height: 2px; background: var(--line); z-index: 0; }
.signal-line-draw {
  position: absolute; top: 27px; left: 27px; width: calc(100% - 54px); height: 2px;
  background: var(--gold-light);
  box-shadow: 0 0 10px rgba(232, 201, 122, 0.5);
  z-index: 1;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}
.signal-node { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; width: 18%; min-width: 92px; }
.signal-node-dot {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--fg-mute);
  margin-bottom: 16px;
}
.signal-node.is-active .signal-node-dot {
  border-color: var(--gold-light);
  background: var(--bg-2);
  color: var(--gold-light);
  box-shadow: 0 0 22px rgba(232, 201, 122, 0.3);
}
.signal-node-label { font-family: var(--sans); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-soft); margin-bottom: 4px; }
.signal-node-sub { font-size: 0.78rem; color: var(--fg-mute); line-height: 1.35; }
.signal-transcript {
  margin: 56px auto 0; max-width: 620px; padding: 20px 24px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1);
  font-family: var(--mono); font-size: 0.92rem; color: var(--fg-soft); min-height: 1.6em;
}
.signal-transcript .caret {
  display: inline-block; width: 8px; height: 1em; background: var(--gold-light);
  margin-left: 2px; vertical-align: -2px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Who it's for ---------- */
.audience-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden;
}
.audience-item {
  background: var(--bg-1);
  padding: 32px 28px;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out), background 300ms var(--ease-out);
}
.audience-item:hover {
  transform: translateY(-6px);
  background: var(--bg-2);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.5);
}
.audience-item h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 0 0 10px; color: var(--fg); }
.audience-item p { font-size: 0.92rem; color: var(--fg-soft); line-height: 1.55; margin: 0; }

/* ---------- Stack credibility line ---------- */
.stack-line { border-top: 1px solid var(--line-soft); padding-top: 40px; }
.stack-line-items { display: flex; flex-wrap: wrap; gap: 12px 0; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; color: var(--fg-soft); }
.stack-line-items .sep { margin: 0 18px; color: var(--fg-mute); font-weight: 400; }
.stack-line-items strong { color: var(--fg); font-weight: 700; }
.stack-line-note { margin-top: 22px; font-size: 0.85rem; color: var(--fg-mute); max-width: 620px; line-height: 1.6; }

/* ---------- Final CTA ---------- */
.final-cta { text-align: center; padding: 130px 0; background: var(--bg-1); }
.final-cta .section-title { margin: 0 auto 30px; }
.final-cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line-soft); padding: 32px 0;
  font-family: var(--sans); font-weight: 600; font-size: 0.78rem; color: var(--fg-mute);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

@media (max-width: 720px) {
  section { padding: 76px 0; }
  .signal-track { flex-wrap: wrap; row-gap: 32px; }
  .signal-node { width: 46%; }
  .signal-line, .signal-line-draw { display: none; }
  .ownership-inner { flex-direction: column; gap: 12px; }
  .btn-glass-lg { padding: 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-fade-rise, .animate-fade-rise-delay, .animate-fade-rise-delay-2 { animation: none !important; opacity: 1 !important; transform: none !important; }
  .reveal-up { transition: none !important; opacity: 1 !important; transform: none !important; }
  /* Signal Path: no ScrollTrigger/pin at all for reduced-motion (see
     script.js) — jump straight to the end state instead of scrubbing. */
  .signal-line-draw { transform: scaleX(1) !important; }
  .signal-transcript .caret { animation: none; }
}
