:root {
  --ink: #050505;
  --cream: #f4f0e6;
  --white: #ffffff;
  --gold: #c9a96e;
  --neon: #6fff97; /* Hyperframe Neon Green */
  --muted: #666666;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; font-size: 16px; }
body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── CINEMATIC OVERLAYS ── */
.grain-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}
.depth-layer {
  position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.05; pointer-events: none; z-index: -1;
}
.layer-1 { top: 10%; left: -10%; width: 40vw; height: 40vw; background: var(--gold); }
.layer-2 { top: 60%; right: -10%; width: 50vw; height: 50vw; background: var(--white); }

/* ── CURSOR ── */
#cursor-dot {
  width: 6px; height: 6px; background: var(--white); border-radius: 50%;
  position: fixed; top: 0; left: 0; z-index: 10000; pointer-events: none;
  transform: translate(-50%,-50%); transition: transform 0.1s;
}
#cursor-ring {
  width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  transform: translate(-50%,-50%); transition: transform 0.2s, width 0.3s, height 0.3s;
}
@media (hover: none) { #cursor-dot, #cursor-ring { display: none; } body { cursor: auto; } }

/* ── LOADER ── */
#loader {
  position: fixed; inset: 0; z-index: 9000; background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
}
#loader-logo { font-family: var(--serif); font-size: 3rem; letter-spacing: 0.2em; color: var(--white); opacity: 0; }
#loader-bar-wrap { width: 180px; height: 1px; background: rgba(255,255,255,0.1); overflow: hidden; }
#loader-bar { width: 0; height: 100%; background: var(--white); transition: width 1.5s ease; }

/* ── HEADER ── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 2rem 0;
  transition: all 0.5s var(--ease);
}
header.scrolled {
  background: rgba(5,5,5,0.8); backdrop-filter: blur(20px); padding: 1.25rem 0; border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; color: var(--white); letter-spacing: 0.1em; }
.desktop-nav { display: flex; gap: 2.5rem; }
.desktop-nav a { font-size: 0.9rem; text-decoration: none; color: var(--muted); transition: color 0.3s; }
.desktop-nav a:hover { color: var(--white); }
.header-ctas { display: flex; align-items: center; gap: 2rem; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--white); color: var(--ink); padding: 0.9rem 2rem; border-radius: 100px;
  text-decoration: none; font-size: 0.9rem; font-weight: 500; border: 1px solid var(--white);
  transition: all 0.3s var(--ease);
}
.btn-primary:hover { background: transparent; color: var(--white); }
.btn-secondary {
  background: transparent; color: var(--white); padding: 0.9rem 2rem; border-radius: 100px;
  text-decoration: none; font-size: 0.9rem; font-weight: 500; border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.btn-secondary:hover { border-color: var(--white); }
.btn-text { color: var(--white); text-decoration: none; font-size: 0.9rem; opacity: 0.6; transition: opacity 0.3s; }
.btn-text:hover { opacity: 1; }

/* ── HERO ── */
#hero { 
  padding: 12rem 2rem 10rem; 
  max-width: 1200px; 
  margin: 0 auto; 
  text-align: center; 
  position: relative;
  z-index: 50;
}
.hero-headline { font-family: var(--serif); font-size: clamp(2.5rem, 7vw, 4.8rem); line-height: 1.1; margin-bottom: 2rem; font-weight: 400; }
.hero-sub { color: var(--muted); font-size: 1.2rem; max-width: 640px; margin: 0 auto 3.5rem; }
.hero-ctas { display: flex; justify-content: center; gap: 1.25rem; margin-bottom: 6rem; }

.hero-visual {
  perspective: 2000px; max-width: 1100px; margin: 0 auto;
  position: relative;
}
.mockup-layers {
  position: relative; width: 100%; height: 500px;
  transform-style: preserve-3d;
}

/* Settings Panel (Behind) */
.mockup-settings {
  position: absolute; top: 10%; left: 0; width: 650px;
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 16px; padding: 3rem;
  transform: rotateY(15deg) rotateX(5deg) translateZ(0);
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  text-align: left;
}
.settings-title { font-size: 1.8rem; margin-bottom: 0.5rem; font-family: var(--serif); }
.settings-sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 2.5rem; }
.settings-body { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-row label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.1em; display: block; margin-bottom: 0.75rem; }
.custom-select, .color-picker, .drop-zone {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  padding: 0.9rem; border-radius: 8px; display: flex; align-items: center; justify-content: space-between;
  font-size: 0.9rem;
}
.color-picker { width: 160px; }
.color-swatch { width: 18px; height: 18px; background: var(--white); border-radius: 3px; }
.drop-zone { height: 100px; flex-direction: column; justify-content: center; gap: 10px; border-style: dashed; color: var(--muted); }
.settings-footer { margin-top: 2rem; display: flex; justify-content: flex-end; }
.btn-next { background: var(--white); color: var(--ink); padding: 0.6rem 1.5rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

/* Video Preview (Foreground) */
.mockup-preview {
  position: absolute; top: 0%; right: 0; width: 580px;
  background: #000; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transform: rotateY(-10deg) rotateX(5deg) translateZ(100px);
  box-shadow: 0 60px 120px rgba(0,0,0,0.8);
  z-index: 10;
}
.preview-screen { position: relative; aspect-ratio: 16/10; background: #111; overflow: hidden; }
.preview-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.preview-overlay { position: absolute; inset: 0; padding: 1.5rem; display: flex; align-items: flex-start; }
.status-badge {
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); padding: 0.5rem 1rem;
  border-radius: 100px; border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 10px; font-size: 0.75rem;
}
.pulse { width: 8px; height: 8px; background: var(--white); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }

.preview-controls { background: #0a0a0a; padding: 1rem; border-top: 1px solid var(--border); }
.control-icons { display: flex; justify-content: flex-end; gap: 1.5rem; opacity: 0.4; }

.ui-tag-float {
  position: absolute; top: -10%; right: 10%; background: var(--white); color: var(--ink);
  padding: 0.5rem 1rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700;
  transform: translateZ(150px);
}

@media (max-width: 900px) {
  .mockup-layers { height: auto; display: flex; flex-direction: column; gap: 2rem; perspective: none; }
  .mockup-settings, .mockup-preview { position: static; width: 100%; transform: none !important; }
}

/* ── THE MOMENT (Pinned Animation) ── */
.moment-pin-wrapper {
  height: 400vh; /* Scroll duration */
  position: relative;
  background: var(--ink);
  margin-top: clamp(6rem, 10vh, 10rem); /* Space from Hero */
  z-index: 100;
  /* Ensure anchor jumps don’t hide content behind fixed header */
  scroll-margin-top: calc(var(--nav-h, 96px) + 24px);
}
.moment-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Reserve space for the fixed header so the first line isn't obscured */
  padding-top: calc(var(--nav-h, 96px) + 24px);
  box-sizing: border-box;
}
.gap-progress {
  position: absolute;
  right: clamp(1rem, 2.5vw, 2rem);
  top: 50%;
  translate: 0 -50%;
  width: 2.25rem;
  height: min(52vh, 380px);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0.9;
  overflow: hidden;
}
.gap-progress__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.gap-progress::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(111, 255, 151, 0.9),
    rgba(255, 255, 255, 0.75)
  );
  transform-origin: 50% 100%;
  transform: scaleY(0);
  filter: drop-shadow(0 0 24px rgba(111, 255, 151, 0.18));
}
.gap-progress::after {
  content: var(--gap-progress-text, "");
  position: absolute;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in hsl, var(--white), transparent 35%);
  writing-mode: vertical-rl;
  rotate: 180deg;
}
@media (max-width: 900px) {
  .gap-progress {
    display: none;
  }
}
.moment-lines {
  max-width: 1200px;
  width: 100%;
  padding: clamp(6rem, 14vh, 11rem) 5% 0;
  position: relative;
}
.moment-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
  padding: 0;
}
.moment-line {
  margin-bottom: 0.2rem;
  opacity: 0;
  transform: translateY(20px);
  display: block;
  transition: all 0.8s var(--ease);
}
.moment-line:not(.active) {
  display: none;
}
.moment-line.active { 
  opacity: 1; 
  transform: translateY(0); 
}
.moment-line { vertical-align: middle; }

.moment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--neon);
  margin-left: 1rem;
  font-size: 1.2em;
  vertical-align: middle;
  transform: scale(0.5);
  transition: transform 0.8s var(--ease);
}
.moment-icon svg {
  color: var(--neon);
}
.moment-line.active .moment-icon { transform: scale(1); }
.moment-line.highlight { color: var(--neon); margin-top: 0; }
.moment-line.highlight.active { margin-top: 3rem; }

/* ── GAP (Scroll-linked “fill” effect) ──
   Scoped to #problem only and guarded by @supports so it never breaks older browsers.
*/
@supports (animation-timeline: scroll()) {
  .moment-pin-wrapper {
    /* Use the section itself as the timeline source */
    view-timeline-name: --gap;
    view-timeline-axis: block;
  }

  /* Text fill: stroke + animated background-clip */
  .moment-line {
    background-image: linear-gradient(90deg, var(--white) 0 0),
      linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 0);
    background-size: 220% 1lh, 100% 100%;
    background-repeat: no-repeat, repeat;
    background-position-x: 200%, 0;
    background-position-y: 100%;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
    animation: gap-fill both linear;
    animation-timeline: --gap;
    /* Fill over the middle of the section’s scroll */
    animation-range: entry 10% exit 70%;
  }

  .moment-line.highlight {
    background-image: linear-gradient(90deg, var(--neon) 0 0),
      linear-gradient(90deg, rgba(111, 255, 151, 0.14) 0 0);
    -webkit-text-stroke: 1px rgba(111, 255, 151, 0.35);
  }

  @keyframes gap-fill {
    to {
      background-position-x: 100%, 0;
    }
  }

  /* Progress pill on the right */
  @property --gap-progress {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
  }

  .moment-pin-wrapper {
    --gap-progress: 0;
    animation: gap-progress both linear;
    animation-timeline: --gap;
    animation-range: entry 0% exit 100%;
  }
  @keyframes gap-progress {
    to {
      --gap-progress: 1;
    }
  }

  .gap-progress::before {
    transform: scaleY(var(--gap-progress));
  }

  /* Optional label (kept subtle); set as text only via var for zero layout thrash */
  .moment-pin-wrapper {
    --gap-progress-text: "GAP";
  }
}

/* ── FEATURES ── */
/* ── FEATURES STACK (Cinematic Scroll) ── */
.features-stack { padding: 10rem 0; background: var(--ink); }
.stack-header { max-width: 1200px; margin: 0 auto 8rem; padding: 0 2rem; }
.stack-title { font-family: var(--serif); font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.1; margin-bottom: 2rem; }
.stack-sub { color: var(--muted); max-width: 600px; font-size: 1.1rem; }

.stack-container {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  position: relative;
}

.stack-card {
  position: sticky;
  top: 10vh;
  min-height: 80vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background: #050505; /* Force solid background */
  border: 1px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
  margin-bottom: 20vh; /* Increased spacing */
  transform-origin: center top;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.8);
  transition: transform 0.5s var(--ease);
}

/* Ensure stacking order */
.stack-card:nth-child(1) { z-index: 10; }
.stack-card:nth-child(2) { z-index: 20; }
.stack-card:nth-child(3) { z-index: 30; }
.stack-card:nth-child(4) { z-index: 40; }
.stack-card:nth-child(5) { z-index: 50; }

.stack-text {
  padding: 4rem;
}
.stack-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  padding: 0.5rem 1.25rem; border-radius: 100px; margin-bottom: 2rem;
  font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
}
.stack-text h3 { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.1; margin-bottom: 1.5rem; }
.stack-text p { color: var(--muted); font-size: 1rem; line-height: 1.6; max-width: 480px; }

.stack-visual {
  position: relative;
  height: 100%;
  background: #000;
  overflow: hidden;
}
.visual-wrap {
  width: 100%; height: 100%;
  padding: 2rem;
}
.visual-wrap video, .visual-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 20px; border: 1px solid var(--border);
}

.stack-card:nth-child(even) .stack-text { order: 2; }
.stack-card:nth-child(even) .stack-visual { order: 1; }

@media (max-width: 900px) {
  .stack-card { grid-template-columns: 1fr; min-height: auto; position: relative; top: 0; margin-bottom: 2rem; border-radius: 20px; }
  .stack-text { padding: 3rem 2rem; }
  .stack-visual { height: 300px; }
  .stack-card:nth-child(even) .stack-text { order: 1; }
  .stack-card:nth-child(even) .stack-visual { order: 2; }
}

/* ── CASE STUDY ── */
.case-section { padding: 8rem 2rem; max-width: 1200px; margin: 0 auto; }
.case-card {
  display: grid; grid-template-columns: 1.2fr 0.8fr; border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; background: #0a0a0a;
}
.case-content { padding: 5rem; }
.case-tag { font-size: 0.8rem; text-transform: uppercase; color: var(--muted); margin-bottom: 2.5rem; letter-spacing: 0.2em; }
.case-title { font-family: var(--serif); font-size: 2.8rem; margin-bottom: 2rem; line-height: 1.2; }
.case-desc { color: var(--muted); margin-bottom: 4rem; font-size: 1.1rem; }
.case-meta { display: flex; justify-content: space-between; align-items: flex-end; }
.case-metric { display: flex; flex-direction: column; }
.metric-val { font-family: var(--serif); font-size: 4rem; line-height: 1; margin-bottom: 0.5rem; }
.metric-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.case-image { background: #151515; }

/* ── CTA ── */
.cta-section { padding: 12rem 2rem; text-align: center; border-top: 1px solid var(--border); }
.cta-title { font-family: var(--serif); font-size: 4rem; margin-bottom: 2rem; }
.cta-sub { color: var(--muted); max-width: 640px; margin: 0 auto 4rem; font-size: 1.2rem; }
.cta-btns { display: flex; justify-content: center; gap: 1.5rem; }

/* ── FOOTER ── */
footer { padding: 6rem 2rem 4rem; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6rem; }
.footer-logo { font-family: var(--serif); font-size: 2rem; }
.footer-links { display: flex; gap: 3rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid var(--border); }
.footer-copy { font-size: 0.85rem; color: var(--muted); }
.footer-social { display: flex; gap: 1.5rem; }
.footer-social a { color: var(--muted); transition: color 0.3s; }
.footer-social a:hover { color: var(--white); }

/* ── MODALS ── */
#login-overlay {
  position: fixed; inset: 0; z-index: 8000; background: rgba(0,0,0,0.9); backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: all 0.5s var(--ease);
}
#login-overlay.open { opacity: 1; pointer-events: all; }
.login-modal {
  background: #111; border: 1px solid var(--border); width: min(480px, 90vw); padding: 5rem 4rem;
  border-radius: 20px; position: relative; transform: translateY(30px); transition: transform 0.6s var(--ease);
}
#login-overlay.open .login-modal { transform: translateY(0); }
.login-close { position: absolute; top: 2rem; right: 2rem; background: none; border: none; color: var(--muted); cursor: pointer; }
.login-badge { font-size: 0.7rem; color: var(--gold); border: 1px solid rgba(201,169,110,0.2); padding: 0.5rem 1rem; border-radius: 100px; display: inline-block; margin-bottom: 2rem; }
.login-title { font-family: var(--serif); font-size: 2.5rem; margin-bottom: 1rem; }
.login-sub { color: var(--muted); margin-bottom: 3.5rem; font-size: 0.95rem; }
.login-form { display: flex; flex-direction: column; gap: 2rem; }
.form-row { display: flex; flex-direction: column; gap: 0.75rem; }
.form-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.1em; }
.form-input { background: rgba(255,255,255,0.02); border: 1px solid var(--border); padding: 1.25rem; border-radius: 8px; color: var(--white); outline: none; transition: border-color 0.3s; }
.form-input:focus { border-color: var(--white); }
.btn-login { background: var(--white); color: var(--ink); padding: 1.25rem; border: none; border-radius: 8px; font-weight: 500; cursor: pointer; transition: opacity 0.3s; }
.btn-login:hover { opacity: 0.9; }

/* ── MOBILE NAV ── */
.nav-toggle {
  display: none; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 12px; z-index: 5000; border-radius: 8px; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 1.5px; background: var(--white); transition: 0.4s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.nav-links {
  position: fixed; inset: 0; background: var(--ink); display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 3rem; opacity: 0; visibility: hidden;
  transition: 0.5s var(--ease); z-index: 4000;
}
.nav-links.active { opacity: 1; visibility: visible; }
.nav-links a { font-family: var(--serif); font-size: 2.5rem; color: var(--white); text-decoration: none; }

/* ── FLOATING WHATSAPP ── */
.floating-whatsapp {
  position: fixed; bottom: 2.5rem; right: 2.5rem; z-index: 7000; background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px); border: 1px solid var(--border); padding: 1rem 1.5rem; border-radius: 100px;
  display: flex; align-items: center; gap: 1rem; color: var(--white); text-decoration: none;
  font-weight: 500; transition: all 0.3s var(--ease);
}
.floating-whatsapp:hover { background: var(--white); color: var(--ink); transform: translateY(-5px); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .case-card { grid-template-columns: 1fr; }
  .case-content { padding: 3rem; }
}
@media (max-width: 900px) {
  .desktop-nav, .header-ctas { display: none; }
  .nav-toggle { display: flex; }
  .hero-headline { font-size: 3.5rem; }
  .footer-top { flex-direction: column; gap: 3rem; text-align: center; }
}

/* ── REVEAL SYSTEM ── */
.reveal { opacity: 0; }
.reveal-scale { opacity: 0; }
