/* ==========================================================================
   FX — HUD layer, scramble helpers, dividers, targeting brackets, glow
   Split from sections.css to keep files under the 500-line budget.
   ========================================================================== */

/* ==========================================================================
   Scroll progress bar
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 600;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6), 0 0 2px rgba(0, 255, 136, 0.8);
  transform: scaleX(0);
  transform-origin: left;
}

/* ==========================================================================
   Scramble text (JS toggles .is-scrambling; static text is the safe default)
   ========================================================================== */

[data-scramble],
[data-scramble-hover] {
  display: inline-block;
}

/* ==========================================================================
   Hero HUD layer
   ========================================================================== */

.hero-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.hud-status {
  position: absolute;
  top: calc(var(--nav-h) + 1.25rem);
  left: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hud-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.7);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hud-node {
  position: absolute;
  top: 50%;
  right: clamp(0.75rem, 2.5vw, 1.75rem);
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.55;
  white-space: nowrap;
}

.hud-readout {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: 2rem;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .hud-node,
  .hud-readout {
    display: none;
  }
}

/* Corner brackets */
.hud-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(0, 255, 136, 0.35);
  border-style: solid;
  border-width: 0;
}

.hud-corner-tl {
  top: calc(var(--nav-h) + 0.75rem);
  left: clamp(1.25rem, 4vw, 3rem);
  border-top-width: 1px;
  border-left-width: 1px;
}

.hud-corner-tr {
  top: calc(var(--nav-h) + 0.75rem);
  right: clamp(1.25rem, 4vw, 3rem);
  border-top-width: 1px;
  border-right-width: 1px;
}

.hud-corner-bl {
  bottom: 0.75rem;
  left: clamp(1.25rem, 4vw, 3rem);
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.hud-corner-br {
  bottom: 0.75rem;
  right: clamp(1.25rem, 4vw, 3rem);
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* ==========================================================================
   Perspective grid floor (pure CSS, bottom of hero)
   ========================================================================== */

.hero-grid-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  max-height: 220px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  perspective: 400px;
  perspective-origin: 50% 100%;
  mask-image: linear-gradient(to top, black 0%, transparent 92%);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 92%);
}

.hero-grid-floor::before {
  content: '';
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -20%;
  height: 200%;
  background-image:
    repeating-linear-gradient(to right, rgba(0, 255, 136, 0.06) 0, rgba(0, 255, 136, 0.06) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(0, 255, 136, 0.06) 0, rgba(0, 255, 136, 0.06) 1px, transparent 1px, transparent 48px);
  transform: rotateX(75deg);
  transform-origin: bottom center;
}

/* ==========================================================================
   Section dividers — sweep segment scrubbed by ScrollTrigger
   ========================================================================== */

.section-divider {
  position: relative;
  height: 1px;
  width: 100%;
  background: var(--line);
  overflow: hidden;
  --sweep-x: 0px;
}

.section-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120px;
  width: 120px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
  transform: translateX(var(--sweep-x));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .section-divider::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   Card targeting brackets — capability + timeline cards
   ========================================================================== */

.cap-card,
.timeline-card {
  position: relative;
}

.cap-card::before,
.cap-card::after,
.timeline-card::before,
.timeline-card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(0, 255, 136, 0.3);
  border-style: solid;
  border-width: 0;
  transition: border-color 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}

.cap-card::before,
.timeline-card::before {
  top: 8px;
  left: 8px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.cap-card::after,
.timeline-card::after {
  bottom: 8px;
  right: 8px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

.cap-card:hover::before,
.cap-card:hover::after,
.timeline-card:hover::before,
.timeline-card:hover::after {
  border-color: var(--accent);
  width: 18px;
  height: 18px;
}

.cap-card:hover::before,
.timeline-card:hover::before {
  transform: translate(-3px, -3px);
}

.cap-card:hover::after,
.timeline-card:hover::after {
  transform: translate(3px, 3px);
}

.cap-card.brackets-flash::before,
.cap-card.brackets-flash::after,
.timeline-card.brackets-flash::before,
.timeline-card.brackets-flash::after {
  border-color: var(--accent);
}

/* Capability card scanline sweep on hover (pointer:fine only) */
.cap-card {
  overflow: hidden;
}

.cap-card::marker { content: none; }

@media (pointer: fine) {
  .cap-card {
    isolation: isolate;
  }

  .cap-card .cap-scanline {
    position: absolute;
    left: 0;
    right: 0;
    top: -2px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    opacity: 0;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    pointer-events: none;
    z-index: 1;
  }

  .cap-card:hover .cap-scanline {
    animation: scanline-sweep 0.9s ease-in-out 1;
  }
}

@keyframes scanline-sweep {
  0% { top: -2px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ==========================================================================
   Heading glow + micro-details
   ========================================================================== */

.marquee-item em {
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
}

.timeline-entry::before {
  content: '';
  position: absolute;
  top: 0.4rem;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.65);
}

@media (min-width: 1024px) {
  .timeline-entry::before {
    left: calc(50% - 4px);
  }
}

.contact-cta {
  transition: text-shadow 0.4s ease;
}

.contact-button:hover .contact-cta,
#contact:hover .contact-cta {
  text-shadow: 0 0 24px rgba(0, 255, 136, 0.35);
}

/* ==========================================================================
   Capabilities grid: 6 cards, 1 col mobile, 2 col tablet, 3 col desktop
   (override lives here, not sections.css, to stay under its line budget)
   ========================================================================== */

@media (min-width: 1024px) {
  .capabilities-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ==========================================================================
   Reduced motion, strip decorative animation, keep static layout
   ========================================================================== */

/* ==========================================================================
   Text links (contact + footer): LinkedIn, current work
   ========================================================================== */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
}

.text-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s ease;
}

.text-link:hover {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .hud-status-dot {
    animation: none;
  }

  .cap-card:hover .cap-scanline {
    animation: none;
  }

  .text-link {
    transition: none;
  }
}
