/* =========================================================
   BREITBECK — 3D-Motion-Layer additions
   (all new rules; does not override existing styles unless
   flagged with `!important` on layered elements)
   ========================================================= */

/* =======================================
   HERO headline — line-mask reveal (new structure)
   ======================================= */
.hero-h1 {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 0.95 !important;
  font-size: clamp(44px, 5.6vw, 92px) !important;
  letter-spacing: -0.01em !important;
  margin-bottom: 40px !important;
  font-weight: 400;
}
.hero-h1 .hl {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.02em 0.14em 0;
  line-height: 1;
}
.hero-h1 .hl-in {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.05s cubic-bezier(0.2, 0.85, 0.2, 1);
  will-change: transform;
  white-space: nowrap;
}
.hero-h1.risen .hl-in { transform: translateY(0); }

.hero-h1 .hl-in.accent {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 50%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  padding-right: 0.24em;
  margin-right: -0.08em;
  letter-spacing: -0.015em;
}

@media (max-width: 720px) {
  .hero-h1 { font-size: clamp(40px, 11vw, 68px) !important; }
}
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
#hero-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.hero { position: relative; isolation: isolate; }
.hero > .hero-inner { position: relative; z-index: 2; }
/* hero-bg and neon-col keep their absolute positioning from styles.css;
   just lift them above the canvas */
.hero > .hero-bg { z-index: 1; }
.hero > .neon-col { z-index: 2; }

/* Grain overlay over hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Slightly dim hero bg so canvas grid shows through */
.hero-bg { opacity: 0.85; }

/* =======================================
   SCROLL-INTRO FLYBY (between hero and fleet)
   ======================================= */
.flyby {
  position: relative;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
}
.flyby-track {
  position: absolute;
  left: 0; right: 0;
  top: -80px;
  height: 260px;
  overflow: hidden;
}
.flyby-shape {
  position: absolute;
  top: 50%;
  right: -40%;
  width: 60%;
  height: 14px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244, 210, 138, 0.0) 5%,
    rgba(244, 210, 138, 0.9) 45%,
    #fff 50%,
    rgba(230, 179, 74, 0.9) 55%,
    rgba(230, 179, 74, 0.0) 95%,
    transparent 100%
  );
  filter: blur(0.5px) drop-shadow(0 0 8px rgba(230, 179, 74, 0.9))
         drop-shadow(0 0 16px rgba(155, 78, 200, 0.5));
  transform: translateY(-50%) rotate(-12deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.9s ease;
  border-radius: 100px;
}
.flyby.trigger .flyby-shape {
  opacity: 1;
  right: 110%;
  transform: translateY(-50%) rotate(-12deg) scaleY(1.3);
}

/* Chrome-splitter shards between R8 & RS7 */
.chrome-splitter {
  position: relative;
  height: 140px;
  margin: -40px 0 -40px;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}
.chrome-splitter .shard {
  position: absolute;
  background: linear-gradient(
    135deg,
    rgba(244, 210, 138, 0.0) 0%,
    rgba(244, 210, 138, 0.85) 40%,
    #fff 50%,
    rgba(200, 160, 80, 0.85) 60%,
    rgba(200, 160, 80, 0.0) 100%
  );
  filter: drop-shadow(0 0 6px rgba(230, 179, 74, 0.7))
         drop-shadow(0 0 12px rgba(155, 78, 200, 0.35));
  opacity: 0;
  transform: translateX(-30vw) rotate(-18deg);
  border-radius: 2px;
}
.chrome-splitter.trigger .shard {
  animation: shardFly 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes shardFly {
  0%   { opacity: 0; transform: translateX(-40vw) rotate(-18deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(60vw) rotate(-18deg); }
}

/* =======================================
   FLEET CARDS: violet rim-glow + exhaust
   ======================================= */
.fleet-card {
  position: relative;
  isolation: isolate;
}
.fleet-card .rim-glow {
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(155, 78, 200, 0.35) 0%,
    rgba(155, 78, 200, 0.14) 30%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.fleet-card.in-view .rim-glow {
  opacity: 1;
  animation: rimBreathe 5s ease-in-out 1.2s forwards;
}
@keyframes rimBreathe {
  0%   { opacity: 1; }
  70%  { opacity: 0.55; }
  100% { opacity: 0.22; }
}

/* Exhaust particles container */
.fleet-card .exhaust {
  position: absolute;
  right: 8%;
  bottom: 20%;
  width: 60px;
  height: 120px;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.fleet-card .exhaust .puff {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffb84a 0%, #e6b34a 40%, rgba(230, 179, 74, 0) 70%);
  filter: blur(1.5px);
  opacity: 0;
  animation: puffRise 3.2s ease-out infinite;
  mix-blend-mode: screen;
}
.fleet-card .exhaust .puff:nth-child(1) { animation-delay: 0s;   left: 40%; }
.fleet-card .exhaust .puff:nth-child(2) { animation-delay: 0.5s; left: 55%; }
.fleet-card .exhaust .puff:nth-child(3) { animation-delay: 1.0s; left: 48%; }
.fleet-card .exhaust .puff:nth-child(4) { animation-delay: 1.5s; left: 60%; }
.fleet-card .exhaust .puff:nth-child(5) { animation-delay: 2.0s; left: 45%; }
.fleet-card .exhaust .puff:nth-child(6) { animation-delay: 2.5s; left: 52%; }
@keyframes puffRise {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  15%  { opacity: 0.8; }
  100% { opacity: 0; transform: translate(-50%, -110px) scale(1.8); }
}

/* Tag pulse-glow */
.fleet-card .tag {
  box-shadow: 0 0 0 0 rgba(230, 179, 74, 0.5);
  animation: tagPulse 3s ease-in-out infinite;
}
@keyframes tagPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 179, 74, 0.0); }
  50%      { box-shadow: 0 0 16px 2px rgba(230, 179, 74, 0.35); }
}

/* =======================================
   TIMELINE — animated path + energy dot
   (positioned over the original CSS line at left:40px)
   ======================================= */
.timeline.motion-enabled {
  position: relative;
}
/* Hide the original static CSS line — animated SVG replaces it */
.timeline.motion-enabled::before {
  opacity: 0 !important;
}
.timeline-svg {
  position: absolute;
  left: 40px;
  top: 80px;
  transform: translateX(-50%);
  width: 4px;
  height: calc(100% - 160px);
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.timeline-svg .tl-path {
  stroke: var(--gold);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  filter: drop-shadow(0 0 6px rgba(230, 179, 74, 0.5));
  transition: stroke-dashoffset 1.4s ease;
}
.timeline.motion-enabled.in-view .tl-path {
  stroke-dashoffset: 0;
}
.timeline-dot {
  position: absolute;
  left: 40px;
  top: 80px;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--gold) 45%, rgba(230, 179, 74, 0) 80%);
  box-shadow: 0 0 16px rgba(230, 179, 74, 0.9),
              0 0 32px rgba(230, 179, 74, 0.45),
              0 0 48px rgba(155, 78, 200, 0.3);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.timeline.motion-enabled.in-view .timeline-dot { opacity: 1; }

/* Mobile: line sits at left:31px */
@media (max-width: 900px) {
  .timeline-svg,
  .timeline-dot { left: 31px; }
}

/* Activate circles when dot passes */
.tl-dot.activated {
  animation: dotActivate 0.8s cubic-bezier(0.5, 1.5, 0.5, 1) forwards;
}
@keyframes dotActivate {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 179, 74, 0); }
  40%  { transform: scale(0.92); }
  70%  { transform: scale(1.08); box-shadow: 0 0 40px 8px rgba(230, 179, 74, 0.5); }
  100% { transform: scale(1); box-shadow: 0 0 20px 2px rgba(230, 179, 74, 0.3); }
}

/* =======================================
   MAGNETIC CTA golden hover ring
   ======================================= */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 4px;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%),
              rgba(244, 210, 138, 0.55) 0%,
              rgba(230, 179, 74, 0) 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}
.btn-primary:hover::after { opacity: 1; }

/* =======================================
   COUNT-UP specs — flicker while counting
   ======================================= */
.counting {
  text-shadow: 0 0 8px rgba(230, 179, 74, 0.5);
  color: var(--gold-soft);
  transition: color 0.3s ease;
}

/* =======================================
   Nav scroll-shrink already handled; add CTA glow
   ======================================= */
.nav .btn-primary {
  position: relative;
}
.nav.scrolled .btn-primary {
  box-shadow: 0 8px 22px rgba(230, 179, 74, 0.3),
              0 0 20px rgba(230, 179, 74, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* =======================================
   Reduced motion
   ======================================= */
@media (prefers-reduced-motion: reduce) {
  .flyby-shape,
  .chrome-splitter .shard,
  .fleet-card .exhaust,
  .tag,
  .timeline-dot,
  .timeline-svg .tl-path {
    animation: none !important;
    transition: none !important;
  }
  #hero-canvas { display: none; }
}

/* =======================================
   Mobile — simplify
   ======================================= */
@media (max-width: 720px) {
  #hero-canvas { opacity: 0.55; }
  .fleet-card .exhaust { display: none; }
  .chrome-splitter { display: none; }
}
