/* =====================================================================
   Flash Layer — agency-tier visual upgrades
   Load AFTER polish-layer.css + motion-layer.css
   Companion: flash-layer.js (cursor blob, 3D tilt, magnetic buttons, number scramble)
   ===================================================================== */

/* ---------------------------------------------------------------------
   Real Calibre Consulting logo — replace .brand-text wordmark
   --------------------------------------------------------------------- */
.brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 200ms cubic-bezier(0.2, 0, 0, 1);
}
.brand a:hover { opacity: 0.75; }
.brand-logo {
  display: block;
  height: 56px;
  width: auto;
  outline: none !important;
}
.brand-text { display: none; }  /* hide old wordmark when image logo is present */

/* Footer logo — white variant via filter, slightly larger */
footer .brand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.9;
  height: 64px;
}

/* ---------------------------------------------------------------------
   Editorial scale — push H1 + section H2 dramatically larger
   --------------------------------------------------------------------- */
.hero h1 {
  font-size: clamp(40px, 6.2vw, 84px);
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-weight: 800;
  margin-bottom: 24px;
}

.hero h1 .underline {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.hero h1 .underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 14px;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    #ffb35c 50%,
    var(--accent) 100%);
  background-size: 200% 100%;
  opacity: 0.4;
  border-radius: 8px;
  z-index: -1;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

section .section-head h2,
section > .container > h2 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Animated hero background — tech imagery + dot grid + drifting blobs
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --mx: 50%;
  --my: 50%;
  background-image:
    /* Cursor-follow accent */
    radial-gradient(
      circle 600px at var(--mx) var(--my),
      rgba(230, 86, 68, 0.12),
      transparent 70%
    ),
    /* Subtle dot grid for tech feel */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><circle cx='1.5' cy='1.5' r='1.5' fill='%23413e3e' opacity='0.08'/></svg>"),
    /* Tech aesthetic background image (Unsplash, abstract AI network) */
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.92) 70%, rgba(255,255,255,0.98) 100%),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=2400&q=80");
  background-size: 100% 100%, 32px 32px, 100% 100%, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat, repeat, no-repeat, no-repeat;
  background-attachment: scroll;
  transition: background-image 200ms cubic-bezier(0.2, 0, 0, 1);
}

/* Hero blobs — drifting coral + green blurred circles in the background */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
  will-change: transform;
}

.hero::before {
  top: -200px; left: -150px;
  background: radial-gradient(circle, rgba(230, 86, 68, 0.4), transparent 70%);
  animation: blob-drift-1 18s ease-in-out infinite;
}

.hero::after {
  bottom: -200px; right: -150px;
  background: radial-gradient(circle, rgba(80, 185, 70, 0.32), transparent 70%);
  animation: blob-drift-2 22s ease-in-out infinite;
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(80px, 40px) scale(1.1); }
  66%      { transform: translate(-40px, 80px) scale(0.95); }
}

@keyframes blob-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-60px, -60px) scale(1.08); }
  66%      { transform: translate(60px, -30px) scale(0.92); }
}

.hero .container { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------
   Hero text reveal — word-by-word with blur + translate
   Replaces basic motion-layer hero reveal
   --------------------------------------------------------------------- */
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(40%);
  animation: word-reveal 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes word-reveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------
   Hero vis-card — glow + lift on viewport entry
   --------------------------------------------------------------------- */
.hero-visual .vis-card {
  position: relative;
  transition: transform 400ms cubic-bezier(0.2, 0, 0, 1), box-shadow 400ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}
.hero-visual .vis-card::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 24px;
  background: radial-gradient(
    circle at center,
    rgba(230, 86, 68, 0.18),
    transparent 70%
  );
  z-index: -1;
  opacity: 0;
  animation: card-glow-pulse 4s ease-in-out infinite;
}

@keyframes card-glow-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.04); }
}

/* ---------------------------------------------------------------------
   Floating cards — add glow + stronger float
   --------------------------------------------------------------------- */
.hero-floating {
  box-shadow:
    0 8px 24px rgba(65, 62, 62, 0.12),
    0 24px 64px rgba(65, 62, 62, 0.08),
    0 0 32px rgba(230, 86, 68, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-floating.f1 {
  background: linear-gradient(135deg, rgba(225, 246, 222, 0.95), rgba(225, 246, 222, 0.85));
  border: 1px solid rgba(80, 185, 70, 0.18);
}

.hero-floating.f2 {
  background: linear-gradient(135deg, rgba(255, 244, 214, 0.95), rgba(255, 244, 214, 0.85));
  border: 1px solid rgba(255, 209, 104, 0.4);
}

.hero-floating .metric {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, var(--charcoal), var(--accent-dark));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------------
   Marquee logo strip — continuous horizontal scroll
   !important on layout props to override inline page-specific CSS
   --------------------------------------------------------------------- */
.logo-strip {
  overflow: hidden !important;
  padding: 48px 0 !important;
}
.logo-strip .container {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  max-width: 100% !important;
  padding: 0 !important;
}
.logo-strip .label {
  text-align: center !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
  font-size: 11px !important;
  letter-spacing: 2.5px !important;
}
.logo-strip .logos {
  display: flex !important;
  flex-wrap: nowrap !important;
  grid-template-columns: none !important;
  gap: 80px !important;
  align-items: center;
  animation: marquee 32s linear infinite;
  width: max-content !important;
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.logo-strip .logos:hover { animation-play-state: paused; }

.logo-placeholder {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap;
  padding: 0 !important;
  height: 28px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  opacity: 0.45;
  color: var(--charcoal) !important;
}
.logo-placeholder:hover { opacity: 0.85; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 820px) {
  .logo-strip .logos > *:nth-child(n+4) { display: inline-flex !important; }
  .logo-strip .logos { gap: 56px !important; }
}

/* ---------------------------------------------------------------------
   3D Tilt cards — JS adds --tx and --ty per card on mousemove
   Apply to: .block, .why-card, .case-card, .process-step, .anchor-card
   --------------------------------------------------------------------- */
.block,
.why-card,
.cases-grid .case-card,
.process-step,
.anchor-card {
  --tx: 0deg;
  --ty: 0deg;
  --intensity: 0;
  transform: perspective(1000px) rotateX(var(--ty)) rotateY(var(--tx));
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
  transform-style: preserve-3d;
}

.block:hover,
.why-card:hover,
.cases-grid .case-card:hover,
.process-step:hover {
  box-shadow:
    0 4px 8px rgba(65, 62, 62, 0.06),
    0 16px 40px rgba(230, 86, 68, 0.10),
    0 40px 80px rgba(65, 62, 62, 0.08);
}

/* ---------------------------------------------------------------------
   Dark outcome band — tech imagery underlay + colored ambient glows
   Overlay lightened so the Earth-from-space image shows through clearly
   --------------------------------------------------------------------- */
.outcome-band {
  position: relative;
  overflow: hidden;
  background-color: #0a0a14;
  background-image:
    linear-gradient(180deg, rgba(10,10,20,0.72) 0%, rgba(20,20,32,0.78) 100%),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=2400&q=80");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.outcome-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><circle cx='1.5' cy='1.5' r='1.5' fill='%23ffd168' opacity='0.06'/></svg>");
  background-size: 32px 32px;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}

.outcome-band::after {
  content: "";
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 200%; height: 100%;
  background:
    radial-gradient(ellipse at center top, rgba(255, 209, 104, 0.12), transparent 50%),
    radial-gradient(ellipse at center bottom, rgba(230, 86, 68, 0.10), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.outcome-band > .container { position: relative; z-index: 1; }

/* Glassmorphism cards inside the dark band */
.outcome-band .outcome-stat {
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 250ms cubic-bezier(0.2, 0, 0, 1), background 250ms cubic-bezier(0.2, 0, 0, 1);
}
.outcome-band .outcome-stat:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.06);
}

.outcome-band .outcome-stat .num {
  background: linear-gradient(135deg, #ffd168 0%, #ffb35c 50%, #ff8a5c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(255, 209, 104, 0.4));
}

/* ---------------------------------------------------------------------
   Magnetic buttons — JS adjusts --bx and --by based on cursor proximity
   --------------------------------------------------------------------- */
.btn,
.btn-outline {
  --bx: 0px;
  --by: 0px;
  transform: translate(var(--bx), var(--by));
  transition-property: transform, background-color, color, box-shadow, scale;
  transition-duration: 250ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.2, 0, 0, 1);
  z-index: -1;
}

.btn:hover {
  transform: translate(var(--bx), var(--by)) translateY(-2px);
  box-shadow:
    0 4px 12px rgba(48, 177, 37, 0.20),
    0 12px 32px rgba(48, 177, 37, 0.25),
    0 0 32px rgba(80, 185, 70, 0.15);
}
.btn:hover::before { opacity: 1; }

.btn-outline:hover {
  box-shadow:
    0 4px 12px rgba(80, 185, 70, 0.15),
    0 12px 32px rgba(80, 185, 70, 0.10);
}

/* ---------------------------------------------------------------------
   Link underline — animated draw-in from left on hover
   --------------------------------------------------------------------- */
a:not(.btn):not(.btn-outline):not(.nav-links a):not(.case-link):not(.logo-placeholder):not(.faq-item summary):not(.tab-button):not(.halo-icon):not(.halo-center *):not(.mini-frame):not(.module-card):not(.pillar-card):not(.work-card):not(.mini-cta):not(.pillar-cta):not(.founder-linkedin):not(footer a) {
  position: relative;
  text-decoration: none;
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0% 2px no-repeat;
  transition: background-size 350ms cubic-bezier(0.16, 1, 0.3, 1);
}
a:not(.btn):not(.btn-outline):not(.nav-links a):not(.case-link):not(.logo-placeholder):not(.faq-item summary):not(.tab-button):not(.halo-icon):not(.halo-center *):not(.mini-frame):not(.module-card):not(.pillar-card):not(.work-card):not(.mini-cta):not(.pillar-cta):not(.founder-linkedin):not(footer a):hover {
  background-size: 100% 2px;
}

/* Nav link underline — stays the existing style but with smooth grow */
.nav-links a {
  position: relative;
  padding-bottom: 4px;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------------------
   Trust strip — animated dots between items
   --------------------------------------------------------------------- */
.trust-strip {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  position: relative;
}
.trust-strip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.3;
}
.trust-strip .sep {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.4;
  margin: 0 4px;
  color: transparent;
  transform: scale(0.5);
  animation: dot-pulse 3s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.5); }
  50%      { opacity: 0.7; transform: scale(0.7); }
}

/* ---------------------------------------------------------------------
   Caveat step numbers — bigger + animated draw-in
   --------------------------------------------------------------------- */
.process-step .step-num {
  font-size: 56px;
  line-height: 1.25;
  padding: 14px 10px 22px;
  display: inline-block;
  overflow: visible;
  background: linear-gradient(135deg, var(--accent), #ff8a5c);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 12px rgba(230, 86, 68, 0.25));
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1);
}
.process-step:hover .step-num {
  transform: scale(1.08) rotate(-3deg);
}

/* ---------------------------------------------------------------------
   Tabs nav — animated active indicator
   --------------------------------------------------------------------- */
.tabs-nav button {
  position: relative;
}
.tabs-nav button::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff8a5c);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.tabs-nav button[aria-selected="true"]::after {
  transform: scaleX(1);
}
.tabs-nav button[aria-selected="true"] {
  border-bottom-color: transparent;
}

/* ---------------------------------------------------------------------
   Comparison table — sticky first column + hover row highlight
   --------------------------------------------------------------------- */
.comp-table table tbody tr {
  transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1);
}
.comp-table table tbody tr:hover {
  background-color: rgba(230, 86, 68, 0.03);
}

/* ---------------------------------------------------------------------
   Final CTA — tech imagery underlay + animated ambient glow
   --------------------------------------------------------------------- */
.offer {
  position: relative;
  overflow: hidden;
  background-color: #0a0a14;
  background-image:
    linear-gradient(135deg, rgba(10,10,20,0.74) 0%, rgba(20,20,32,0.80) 100%),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=2400&q=80");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.offer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 209, 104, 0.12), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(230, 86, 68, 0.14), transparent 50%);
  pointer-events: none;
  animation: offer-pulse 8s ease-in-out infinite;
}
.offer .container { position: relative; z-index: 1; }

@keyframes offer-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* ---------------------------------------------------------------------
   Custom scrollbar
   --------------------------------------------------------------------- */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border-radius: 6px;
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-dark), var(--accent));
}

/* ---------------------------------------------------------------------
   Eyebrow — animated underline accent
   --------------------------------------------------------------------- */
.eyebrow {
  position: relative;
  padding-left: 32px;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 24px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------------------------------------------------------------------
   Reduced motion — strip animations
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after,
  .hero h1 .underline::after,
  .hero-visual .vis-card::before,
  .logo-strip .logos,
  .trust-strip .sep,
  .offer::before {
    animation: none !important;
  }
  .hero h1 .word {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
  }
}
