/* ============================================================
   Hyperloop Manchester — Premium Animation Layer v1.0
   Drop in after nav.css on all pages — no build step needed
   ============================================================ */

:root {
  --gold: #f5c400;
  --gold-glow: rgba(245,196,0,0.3);
  --gold-dim: rgba(245,196,0,0.08);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html { scroll-behavior: smooth; }

/* ── CUSTOM SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: rgba(245,196,0,0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245,196,0,0.65); }

/* ── PRELOADER ────────────────────────────────────────────── */
#hlm-preloader {
  position: fixed; inset: 0;
  background: #000;
  z-index: 100000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.5rem;
  pointer-events: all;
}
#hlm-preloader.hlm-pl-exit {
  animation: plExit 0.6s var(--ease-expo) forwards;
}
@keyframes plExit {
  to { opacity: 0; transform: scale(1.04); pointer-events: none; }
}
.hlm-pl-logo {
  height: 50px; width: auto;
  opacity: 0; transform: scale(0.82) translateY(10px);
  transition: opacity 0.55s var(--ease-expo), transform 0.55s var(--ease-expo);
  filter: drop-shadow(0 0 28px rgba(245,196,0,0.5));
}
.hlm-pl-logo.show { opacity: 1; transform: scale(1) translateY(0); }
.hlm-pl-bar {
  width: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(245,196,0,0.6), 0 0 20px rgba(245,196,0,0.2);
  transition: width 0.7s var(--ease-expo);
}
.hlm-pl-bar.show { width: 200px; }
.hlm-pl-dots {
  display: flex; gap: 7px; align-items: center;
}
.hlm-pl-dots span {
  width: 5px; height: 5px;
  background: rgba(245,196,0,0.4);
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.hlm-pl-dots span:nth-child(2) { animation-delay: 0.2s; }
.hlm-pl-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; background: var(--gold); box-shadow: 0 0 7px rgba(245,196,0,0.7); }
}

/* ── SCROLL PROGRESS BAR ──────────────────────────────────── */
#hlm-progress {
  position: fixed; top: 64px; left: 0; right: 0;
  height: 2px; z-index: 999; pointer-events: none;
}
#hlm-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), rgba(245,196,0,0.5));
  box-shadow: 0 0 8px rgba(245,196,0,0.5);
  transition: width 0.12s linear;
}

/* ── NAV SCROLL EFFECT ────────────────────────────────────── */
.hlm-nav { transition: background 0.3s ease, box-shadow 0.3s ease; }
.hlm-nav.hlm-scrolled {
  background: rgba(0,0,0,0.97) !important;
  border-bottom-color: rgba(245,196,0,0.22) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.7);
}

/* ── TICKER BAR ───────────────────────────────────────────── */
.hlm-ticker {
  overflow: hidden; position: relative;
  background: rgba(245,196,0,0.03);
  border-top: 1px solid rgba(245,196,0,0.12);
  border-bottom: 1px solid rgba(245,196,0,0.12);
  padding: 0.6rem 0;
  white-space: nowrap;
}
.hlm-ticker::before,
.hlm-ticker::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: 80px; z-index: 2; pointer-events: none;
}
.hlm-ticker::before { left: 0; background: linear-gradient(90deg, #000, transparent); }
.hlm-ticker::after  { right: 0; background: linear-gradient(270deg, #000, transparent); }
.hlm-ticker-track {
  display: inline-flex; gap: 0;
  animation: tickerRoll 38s linear infinite;
  will-change: transform;
}
@keyframes tickerRoll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.hlm-ticker-item {
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0 2.25rem;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
}
.hlm-ticker-dot {
  width: 3px; height: 3px;
  background: var(--gold); border-radius: 50%;
  box-shadow: 0 0 5px rgba(245,196,0,0.9);
  flex-shrink: 0;
}

/* ── SCROLL REVEAL SYSTEM ─────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  filter: blur(7px);
  transition:
    opacity 0.85s var(--ease-expo),
    transform 0.85s var(--ease-expo),
    filter 0.85s var(--ease-expo);
}
[data-reveal="up"]    { transform: translateY(36px); }
[data-reveal="left"]  { transform: translateX(-44px); }
[data-reveal="right"] { transform: translateX(44px); }
[data-reveal="scale"] { transform: scale(0.9); opacity: 0; }
[data-reveal="fade"]  { }
[data-reveal].hlm-visible {
  opacity: 1 !important;
  transform: none !important;
  filter: blur(0) !important;
}

/* ── HERO ENHANCEMENTS ────────────────────────────────────── */
/* Slow Ken Burns on homepage hero image */
.hlm-hero-pod-bg {
  animation: heroKenBurns 22s ease-in-out infinite alternate !important;
}
@keyframes heroKenBurns {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.07) translateY(-2%); }
}

/* Subtle engineering grid overlay on hero */
.hlm-hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(245,196,0,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,196,0,0.022) 1px, transparent 1px);
  background-size: 55px 55px;
}
.hlm-hero-pod-bg { z-index: 0 !important; }
.hlm-hero-content { z-index: 3 !important; }

/* ── EYEBROW PULSE ────────────────────────────────────────── */
.eyebrow,
.hlm-eyebrow,
.hlm-what-eyebrow,
.hlm-pod-eyebrow,
.hlm-comp-eyebrow,
.hlm-contact-eyebrow,
.tech-eyebrow,
.hlm-model-eyebrow {
  animation: eyebrowPulse 4.5s ease-in-out infinite;
}
@keyframes eyebrowPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 14px rgba(245,196,0,0.2), 0 0 28px rgba(245,196,0,0.07); }
}

/* ── BUTTON SHIMMER ───────────────────────────────────────── */
.hlm-btn-primary,
.hlm-split-btn-gold,
.hlm-pod-btn,
.hlm-comp-btn,
.btn-gold,
.find-btn,
.why-cta a {
  position: relative;
  overflow: hidden;
}
.hlm-btn-primary::before,
.hlm-split-btn-gold::before,
.hlm-pod-btn::before,
.hlm-comp-btn::before,
.btn-gold::before,
.find-btn::before,
.why-cta a::before {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.hlm-btn-primary:hover::before,
.hlm-split-btn-gold:hover::before,
.hlm-pod-btn:hover::before,
.hlm-comp-btn:hover::before,
.btn-gold:hover::before,
.find-btn:hover::before,
.why-cta a:hover::before {
  animation: shimmerSlide 0.55s ease forwards;
}
@keyframes shimmerSlide {
  to { left: 150%; }
}

/* ── ENHANCED CARD HOVERS ─────────────────────────────────── */
.hlm-comp-card,
.pillar-card,
.why-card,
.benefit-card,
.ach-card,
.doc-card {
  transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease !important;
}
.hlm-comp-card:hover,
.pillar-card:hover,
.why-card:hover,
.benefit-card:hover,
.ach-card:hover,
.doc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.35), 0 0 0 1px rgba(245,196,0,0.18) !important;
}
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(245,196,0,0.1) !important;
}
.member-card,
.stl-card {
  transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease !important;
}
.member-card:hover,
.stl-card:hover {
  box-shadow: 0 10px 36px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,196,0,0.2) !important;
}

/* ── CURSOR GLOW (desktop only — injected via JS) ─────────── */
#hlm-cursor-glow {
  position: fixed;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,196,0,0.032) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: left, top;
}

/* ── INNER PAGE HERO GRID OVERLAY ────────────────────────── */
/* Subtle engineering grid on inner page heroes (no image) */
.page-hero {
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(245,196,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,196,0,0.02) 1px, transparent 1px);
  background-size: 58px 58px;
}
.page-hero-inner { position: relative; z-index: 2; }
/* Don't override partners.html hero bg-img positioning */
.page-hero .hero-bg-img { z-index: 0 !important; }
.page-hero .hero-bg-overlay { z-index: 1 !important; }

/* ── ANIMATED BODY BACKGROUND ─────────────────────────────── */
body::before {
  animation: bgBreathe 12s ease-in-out infinite !important;
  will-change: opacity;
}
@keyframes bgBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── MOBILE NAV SLIDE-IN ──────────────────────────────────── */
@media (max-width: 900px) {
  .hlm-nav-links.open {
    animation: navSlideDown 0.22s var(--ease-expo) both;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── FOCUS STATES ─────────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── TIMELINE CONNECTOR ANIMATE ───────────────────────────── */
.timeline-list::before {
  background: linear-gradient(180deg, var(--gold) 0%, rgba(245,196,0,0.08) 100%) !important;
  animation: timelineGrow 1.5s var(--ease-expo) both;
  transform-origin: top;
}
@keyframes timelineGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* ── TIER CARD POPULAR BADGE GLOW ─────────────────────────── */
.popular-badge {
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,196,0,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(245,196,0,0); }
}

/* ── STYLED ICON CONTAINERS ──────────────────────────────── */
/* Transforms emoji icons into gold-framed tech boxes */
.pillar-icon,
.why-card-icon,
.benefit-icon,
.ach-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 54px !important; height: 54px !important;
  font-size: 1.4rem !important;
  background: rgba(245,196,0,0.07) !important;
  border: 1px solid rgba(245,196,0,0.22) !important;
  border-radius: 14px !important;
  margin-bottom: 1.25rem !important;
  transition: background 0.3s ease, box-shadow 0.3s ease !important;
  flex-shrink: 0;
}
.pillar-card:hover .pillar-icon,
.why-card:hover .why-card-icon,
.benefit-card:hover .benefit-icon,
.ach-card:hover .ach-icon {
  background: rgba(245,196,0,0.13) !important;
  box-shadow: 0 0 18px rgba(245,196,0,0.14) !important;
}
.hlm-split-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 50px !important; height: 50px !important;
  font-size: 1.35rem !important;
  background: rgba(245,196,0,0.07) !important;
  border: 1px solid rgba(245,196,0,0.22) !important;
  border-radius: 12px !important;
  margin-bottom: 0.5rem !important;
  transition: background 0.3s ease, box-shadow 0.3s ease !important;
}
.hlm-split-card:hover .hlm-split-icon {
  background: rgba(245,196,0,0.13) !important;
  box-shadow: 0 0 14px rgba(245,196,0,0.12) !important;
}

/* ── NAV ACTIVE LINK UNDERLINE ────────────────────────────── */
.hlm-nav-links a {
  position: relative;
}
.hlm-nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--gold);
  border-radius: 1px;
  box-shadow: 0 0 5px rgba(245,196,0,0.6);
}

/* ── SUBTEAM PHOTO HOVER ──────────────────────────────────── */
.subteam-photo,
.group-photo,
.pod-image-wrap img,
.hlm-pod-image {
  transition: transform 0.5s ease, box-shadow 0.5s ease !important;
}
.pod-image-wrap:hover img,
.hlm-pod-inner:hover .hlm-pod-image {
  transform: scale(1.015) !important;
  box-shadow: 0 12px 48px rgba(245,196,0,0.12) !important;
}

/* ── FOOTER GOLD ACCENT ───────────────────────────────────── */
.hlm-footer {
  position: relative;
}
.hlm-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,196,0,0.3), transparent);
  box-shadow: 0 0 6px rgba(245,196,0,0.2);
}

/* ── SECTION DIVIDER GOLD LINES ───────────────────────────── */
.hlm-pod { border-top: 1px solid rgba(255,255,255,0.05); }
.hlm-split { border-top: 1px solid rgba(255,255,255,0.05); }
.hlm-comp  { border-top: 1px solid rgba(255,255,255,0.05); }

/* ── SPEC VALUE GLOW (pod specs) ──────────────────────────── */
.hlm-pod-spec-value {
  transition: text-shadow 0.3s ease;
}
.hlm-pod-spec:hover .hlm-pod-spec-value {
  text-shadow: 0 0 12px rgba(245,196,0,0.5);
}

/* ── RESEARCH CARD HOVER ──────────────────────────────────── */
.res-card {
  transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease !important;
}
.res-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,0.3), 0 0 0 1px rgba(245,196,0,0.2) !important;
}

/* ── YEAR TAB ACTIVE GLOW ─────────────────────────────────── */
.year-tab.active,
.comp-tab.active {
  box-shadow: 0 4px 16px rgba(245,196,0,0.25) !important;
}
.year-tab, .comp-tab { cursor: pointer; }

/* ── GOLD CORNER BRACKETS (injected via JS on cards) ─────── */
/* Inspired by 21st.dev Dark Grid corner square pattern       */
.hlm-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.32s ease;
  border-radius: inherit;
  background:
    /* top-left */
    linear-gradient(var(--gold), var(--gold)) 0 0 / 16px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 0 / 1.5px 16px no-repeat,
    /* top-right */
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 16px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 1.5px 16px no-repeat,
    /* bottom-left */
    linear-gradient(var(--gold), var(--gold)) 0 100% / 16px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 1.5px 16px no-repeat,
    /* bottom-right */
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 16px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 1.5px 16px no-repeat;
}
.member-card:hover .hlm-corners,
.stl-card:hover .hlm-corners,
.res-card:hover .hlm-corners,
.pillar-card:hover .hlm-corners,
.why-card:hover .hlm-corners,
.benefit-card:hover .hlm-corners,
.ach-card:hover .hlm-corners,
.doc-card:hover .hlm-corners,
.hlm-comp-card:hover .hlm-corners {
  opacity: 1;
}

/* ── FILM GRAIN TEXTURE ───────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── TYPEWRITER CURSOR ────────────────────────────────────── */
.hlm-tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--gold);
  border-radius: 1px;
  margin-left: 2px;
  vertical-align: text-bottom;
  box-shadow: 0 0 6px rgba(245,196,0,0.7);
  animation: hlmCursorBlink 0.9s step-end infinite;
}
@keyframes hlmCursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── HERO CARD PULSE GLOW ─────────────────────────────────── */
/* Pseudo-element approach: only `opacity` animates (GPU Composite, no Paint) */
.hlm-hero-content::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  border: 1px solid rgba(245,196,0,0.42);
  box-shadow: 0 0 55px rgba(245,196,0,0.1), 0 0 20px rgba(245,196,0,0.06);
  opacity: 0;
  pointer-events: none;
  animation: hlmHeroPulse 6s ease-in-out 1.8s infinite;
}
@keyframes hlmHeroPulse {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* ── SECTION HEADING ANIMATED UNDERLINE ───────────────────── */
.section-header h2,
.hlm-what-inner h2,
.hlm-contact-inner h2 {
  position: relative;
}
.section-header h2::after,
.hlm-what-inner h2::after,
.hlm-contact-inner h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 52px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(245,196,0,0.55);
  transition: transform 0.65s var(--ease-expo) 0.3s;
}
.section-header.hlm-visible h2::after,
.hlm-what-inner.hlm-visible h2::after,
.hlm-contact-inner.hlm-visible h2::after {
  transform: translateX(-50%) scaleX(1);
}

/* ── BACK TO TOP BUTTON ───────────────────────────────────── */
#hlm-back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: rgba(245,196,0,0.07);
  border: 1px solid rgba(245,196,0,0.28);
  border-radius: 10px;
  color: var(--gold);
  cursor: pointer;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
}
#hlm-back-top svg { width: 18px; height: 18px; stroke: var(--gold); }
#hlm-back-top.hlm-bt-show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
#hlm-back-top:hover {
  background: rgba(245,196,0,0.15);
  box-shadow: 0 0 20px rgba(245,196,0,0.22);
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  #hlm-preloader { display: none !important; }
  .hlm-ticker-track { animation: none !important; }
  .hlm-pl-dots span { animation: none !important; }
  .hlm-hero-pod-bg { animation: none !important; }
  .eyebrow, .hlm-eyebrow, .hlm-what-eyebrow,
  .hlm-pod-eyebrow, .hlm-comp-eyebrow, .hlm-contact-eyebrow { animation: none !important; }
  .popular-badge { animation: none !important; }
  .hlm-hero-content { animation: none !important; }
  .hlm-hero-content::before { animation: none !important; opacity: 0 !important; }
  .hlm-tw-cursor { animation: none !important; }
  #hlm-particles { display: none !important; }
  .section-header h2::after,
  .hlm-what-inner h2::after,
  .hlm-contact-inner h2::after { transition: none !important; }
  #hlm-back-top { transition: opacity 0.3s ease !important; }
}
