/* ==========================================================================
   AEW home page motion — loaded only on the landing page (home.html).
   Works with liquid.css (section 8) and home-motion.js.
   ========================================================================== */

/* ── Hero: welding sparks canvas + spinning gear outlines with mouse parallax ── */
.hero-sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.hero-gears {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-gears .hg {
  position: absolute;
  fill: none;
  stroke: rgba(191, 219, 254, .38);
  stroke-width: 1.4;
  translate: var(--px, 0px) var(--py, 0px);
  transition: translate .8s var(--lg-ease);
  opacity: 0;
  animation: gearIn 1.6s var(--lg-ease) forwards, spin linear infinite;
}
.hero-gears .hg use { stroke-dasharray: 6 5; }
.hero-gears .hg .hg-ring { stroke-dasharray: 2 7; stroke: rgba(253, 230, 138, .45); }
.hero-gears .hg-1 { width: min(440px, 34vw); right: 6vw;  top: 14%;  animation-duration: 1.6s, 46s; animation-delay: .5s, 0s; }
.hero-gears .hg-2 { width: min(250px, 19vw); right: 27vw; top: 56%;  animation-duration: 1.6s, 30s; animation-delay: .8s, 0s; animation-direction: normal, reverse; stroke: rgba(253, 186, 116, .4); }
.hero-gears .hg-3 { width: min(170px, 13vw); right: 3vw;  top: 66%;  animation-duration: 1.6s, 22s; animation-delay: 1.1s, 0s; }
@keyframes gearIn { to { opacity: 1; } }
@keyframes spin { to { rotate: 360deg; } }
.hero-orbs { translate: var(--px, 0px) var(--py, 0px); transition: translate 1.2s var(--lg-ease); }

/* magnetic CTAs (home-motion.js sets --tx/--ty) */
.magnetic { translate: var(--tx, 0px) var(--ty, 0px); transition: translate .5s var(--lg-spring), transform .55s var(--lg-spring), box-shadow .35s var(--lg-ease) !important; }

/* ── Section titles: words rise out of a mask ── */
.split-words .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.split-words .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform .9s var(--lg-ease);
  transition-delay: calc(var(--wi) * 60ms + 100ms);
}
.split-words.in .w > span { transform: none; }

/* eyebrow: tracking opens up as the section arrives */
.section .section-head .eyebrow {
  letter-spacing: .02em;
  opacity: .4;
  transition: letter-spacing 1.1s var(--lg-ease), opacity 1.1s var(--lg-ease);
}
.section.visible .section-head .eyebrow { letter-spacing: .14em; opacity: 1; }

/* ── "Who we are": text lights up word by word as you scroll ── */
.scrub-text .sw {
  color: #475569;
  opacity: .25;
  transition: opacity .25s linear;
}
.scrub-text .sw.on { opacity: 1; }
.scrub-text { font-size: 16px; line-height: 1.75; font-weight: 400; color: #475569; }

/* ── Strength band: rotating conic border ── */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.strength-band > div {
  border: 1px solid transparent !important;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc) padding-box,
    conic-gradient(from var(--angle), #dbe3ef 0deg, #60a5fa 60deg, #f59e0b 120deg, #dbe3ef 180deg, #dbe3ef 360deg) border-box !important;
  animation: borderSpin 6s linear infinite;
}
.strength-band > div:nth-child(2) { animation-delay: -2s; }
.strength-band > div:nth-child(3) { animation-delay: -4s; }
@keyframes borderSpin { to { --angle: 360deg; } }

/* ── Cards: idle icon float, list items cascade, numbers glow ── */
.mfg-icon, .ind-icon, .cap-box-icon { animation: bob 4.5s ease-in-out infinite; }
.mfg-card:nth-child(2n) .mfg-icon, .cap-box:nth-child(2n) .cap-box-icon, .ind-card:nth-child(2n) .ind-icon { animation-delay: -2.2s; }
@keyframes bob { 50% { translate: 0 -5px; } }

.card-details li {
  opacity: 0;
  translate: -10px 0;
  transition: opacity .5s var(--lg-ease), translate .5s var(--lg-ease);
  transition-delay: calc(var(--li, 0) * 70ms + 350ms + var(--stagger, 0s));
}
.visible .card-details li,
.card-details.in li { opacity: 1; translate: 0 0; }

.why-number {
  background: linear-gradient(135deg, #2563eb, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-variant-numeric: tabular-nums;
  transition: transform .6s var(--lg-spring);
  display: inline-block;
  /* the card is a grid, which stretched this to the full card width and scaled it from the middle,
     pushing "01" out past the card's left edge on hover: keep it digit-sized and grow from the left */
  justify-self: start;
  width: fit-content;
  transform-origin: left center;
}
.why-card:hover .why-number { transform: scale(1.15) rotate(-4deg); }

/* ── Process timeline: line draws with scroll, steps light up ── */
.process-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.process-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 31px;
  height: 3px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
}
.process-line > span {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--fill, 0));
  background: linear-gradient(90deg, #2563eb, #60a5fa 60%, #f59e0b);
  box-shadow: 0 0 12px rgba(37, 99, 235, .6);
}
.process-step {
  position: relative;
  text-align: center;
  opacity: .45;
  translate: 0 14px;
  transition: opacity .6s var(--lg-ease), translate .6s var(--lg-ease);
}
.process-step.is-active { opacity: 1; translate: 0 0; }
.process-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px -12px rgba(15, 23, 42, .35);
  transition: transform .7s var(--lg-spring), background .4s, border-color .4s, box-shadow .4s;
}
.process-icon { font-size: 26px; line-height: 1; }
.process-num {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #94a3b8;
  transition: background .4s;
}
.process-step.is-active .process-dot {
  transform: scale(1.08);
  border-color: rgba(37, 99, 235, .35);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 6px rgba(37, 99, 235, .10), 0 16px 32px -12px rgba(37, 99, 235, .55);
}
.process-step.is-active .process-num { background: linear-gradient(135deg, #2563eb, #f59e0b); }
.process-step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 750; color: #0f172a; }
.process-step p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #64748b; }

/* ── Closing CTA band: animated mesh gradient ── */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0;
  padding: clamp(64px, 10vw, 120px) 6vw;
  background: #0b1222;
  color: #fff;
  text-align: center;
}
.cta-mesh { position: absolute; inset: 0; z-index: -1; filter: blur(70px); }
.cta-mesh span { position: absolute; border-radius: 50%; opacity: .55; }
.cta-mesh span:nth-child(1) { width: 50vw; height: 50vw; left: -10vw; top: -20vw; background: #2563eb; animation: orbA 14s ease-in-out infinite alternate; }
.cta-mesh span:nth-child(2) { width: 40vw; height: 40vw; right: -8vw; bottom: -18vw; background: #f59e0b; opacity: .35; animation: orbB 17s ease-in-out infinite alternate; }
.cta-mesh span:nth-child(3) { width: 26vw; height: 26vw; left: 38%; top: 10%; background: #06b6d4; opacity: .3; animation: orbC 12s ease-in-out infinite alternate; }
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  animation: dots 30s linear infinite;
}
@keyframes dots { to { background-position: 220px 220px; } }
.cta-inner { max-width: 760px; margin: 0 auto; }
.cta-band .eyebrow { color: #93c5fd; }
.cta-band h2 { margin: 8px 0 14px; font-weight: 800; font-size: clamp(28px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.cta-band p { color: rgba(226, 232, 240, .9); font-size: 17px; line-height: 1.65; }
.cta-band .hero-actions { justify-content: center; margin-top: 28px; }

/* ── "Who we are": copy + glass highlights panel ── */
.who-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.who-copy { max-width: none; }
.who-copy .scrub-text { margin-top: 0; }
.who-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-weight: 750;
  color: #2563eb;
  text-decoration: none;
}
.who-more span { transition: transform .45s var(--lg-spring); }
.who-more:hover span { transform: translateX(5px); }

.who-panel {
  position: relative;
  isolation: isolate;
  padding: 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .78));
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: inset 0 1px 0 #fff, 0 24px 48px -28px rgba(15, 23, 42, .35);
  overflow: hidden;
}
.who-panel::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 280px;
  height: 280px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, .28), transparent 65%);
  animation: orbB 14s ease-in-out infinite alternate;
}
.who-panel-title,
.who-panel-sub {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2563eb;
}
.who-panel-sub { margin: 22px 0 12px; color: #64748b; }
.who-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.who-facts li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #eef2f7;
  box-shadow: 0 6px 16px -12px rgba(15, 23, 42, .3);
  opacity: 0;
  translate: 18px 0;
  transition: opacity .6s var(--lg-ease), translate .6s var(--lg-ease), box-shadow .3s, border-color .3s;
}
.who-facts li:nth-child(2) { transition-delay: .1s; }
.who-facts li:nth-child(3) { transition-delay: .2s; }
.visible .who-facts li { opacity: 1; translate: 0 0; }
.who-facts li:hover { border-color: #bfdbfe; box-shadow: 0 12px 24px -14px rgba(37, 99, 235, .45); }
.who-ico {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 19px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}
.who-facts strong { display: block; font-size: 14px; color: #0f172a; margin-bottom: 2px; }
.who-facts li > div > span { font-size: 13.5px; line-height: 1.5; color: #64748b; }
.who-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 10px -6px rgba(15, 23, 42, .4);
  transition: transform .45s var(--lg-spring);
}
.chip:hover { transform: translateY(-2px) scale(1.05); }
.chip-brass  { background: linear-gradient(180deg, #fef3c7, #fcd34d); }
.chip-copper { background: linear-gradient(180deg, #ffedd5, #fdba74); }
.chip-ms     { background: linear-gradient(180deg, #f1f5f9, #cbd5e1); }
.chip-ss     { background: linear-gradient(180deg, #f8fafc, #e2e8f0); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-gears .hg-2 { display: none; }
  .hero-gears .hg-1 { width: 46vw; right: -12vw; top: 8%; opacity: .5; }
  .hero-gears .hg-3 { right: -4vw; width: 24vw; }
  .process-track { grid-template-columns: 1fr; gap: 26px; padding-left: 84px; margin-top: 26px; }
  .process-line { left: 31px; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .process-line > span { transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); }
  .process-step { text-align: left; translate: 14px 0; }
  .process-dot { position: absolute; left: -84px; top: -4px; }
  .who-grid { grid-template-columns: minmax(0, 1fr); }
  .who-panel { padding: 20px; }
}

/* ── Reduced motion: keep layout, drop movement ── */
@media (prefers-reduced-motion: reduce) {
  .hero-sparks { display: none; }
  .hero-gears .hg { animation: none; opacity: 1; }
  .split-words .w > span { transform: none; transition: none; }
  .strength-band > div, .mfg-icon, .ind-icon, .cap-box-icon, .cta-mesh span, .cta-band::before { animation: none !important; }
  .scrub-text .sw { opacity: 1; }
  .card-details li, .process-step, .who-facts li { opacity: 1; translate: none; transition: none; }
  .who-panel::before { animation: none; }
}
