/* Motion layer — premium, restrained. */

@media (prefers-reduced-motion: reduce) {
  /* Scope reduced-motion kill to OUR reveal/transition layer only —
     marquee and other always-on motion stay alive. */
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
  .callout-anim, .callout-anim .callout-line { animation: none !important; opacity: 1 !important; transform: none !important; }
  .btn-primary::after { transition: none !important; }
  .page-intro-title em::after { transition: none !important; transform: scaleX(1) !important; }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .9s cubic-bezier(.16,.84,.32,1) var(--reveal-delay, 0ms),
    transform .9s cubic-bezier(.16,.84,.32,1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Headline mask-reveal — heavier hit for hero titles */
.hero-text .display.reveal { transform: translateY(32px); transition-duration: 1.2s; }
.page-intro-title.reveal { transform: translateY(28px); transition-duration: 1.1s; }
.contact-bio-name.reveal { transform: translateY(28px); transition-duration: 1.1s; }
.foot-cta-title.reveal { transform: translateY(28px); transition-duration: 1.0s; }
.manifesto-quote.reveal { transform: translateY(28px); transition-duration: 1.2s; }
.story-title.reveal,
.feature-title.reveal,
.patent-title.reveal {
  transform: translateY(24px);
  transition-duration: 1.0s;
}

/* Callout sequencing on hero drawing */
.callout {
  transition: transform .25s ease;
}
.drawing .callout.callout-anim {
  opacity: 0;
  transform: translateY(-4px);
  animation: callout-in .8s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: var(--callout-delay, .4s);
}
@keyframes callout-in {
  0%   { opacity: 0; transform: translateY(-4px); }
  60%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}
/* Animated line — draws in */
.drawing .callout.callout-anim .callout-line {
  transform-origin: left center;
  transform: scaleX(0);
  animation: line-draw .55s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--callout-delay, .4s) + .15s);
}
.drawing .callout.callout-anim[style*="row-reverse"] .callout-line {
  transform-origin: right center;
}
@keyframes line-draw {
  to { transform: scaleX(1); }
}

/* Stat counter — emphasis on first paint */
.stat-num {
  transition: color .25s ease;
}

/* Service-row gradient ribbon on hover */
.svc-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--accent) 12%, transparent),
    transparent 60%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.svc-row:hover::before { opacity: 1; }
.svc-row-arrow { transition: opacity .25s ease, transform .35s cubic-bezier(.2,.7,.2,1); }

/* Card hover refinement */
.port-card { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease; }
.port-card:hover { box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--ink) 30%, transparent); }
.industry { transition: background .4s ease, transform .4s cubic-bezier(.2,.7,.2,1); }
.industry:hover { transform: translateY(-2px); }
.contact-card { transition: background .25s, border-color .25s, transform .4s cubic-bezier(.2,.7,.2,1); }
.contact-card:hover { transform: translateY(-3px); }
.roster-card { transition: background .25s, transform .4s cubic-bezier(.2,.7,.2,1), border-color .25s; }
.roster-card:hover { transform: translateY(-3px); }
.pat-row { transition: background .25s, padding .25s; }

/* Nav link smooth */
.nav-links a { transition: color .2s; }

/* Marquee already animates via shell CSS; nothing here. */

/* Make the drawing image draggable feeling */
.hero .drawing img { transition: transform .6s cubic-bezier(.16,.84,.32,1); }

/* Underline draw on page-intro headline */
.page-intro-title em {
  position: relative;
  display: inline-block;
}
.page-intro-title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.08em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(.16,.84,.32,1) .6s;
}
.page-intro-title.reveal.is-in em::after { transform: scaleX(1); }

/* Hero CTA — subtle accent pulse on primary */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  z-index: -1;
  transform: translateX(-101%);
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.btn-primary:hover::after { transform: translateX(0); }
.btn-primary:hover { border-color: var(--accent); color: var(--accent-ink); background: transparent; }

/* Page-intro split lines — top hairline tracks in */
.page-intro {
  position: relative;
}
.page-intro::before {
  content: "";
  position: absolute;
  left: var(--pad-x); right: var(--pad-x); top: 0;
  height: 1px;
  background: var(--rule);
  transform: scaleX(0);
  transform-origin: left;
  animation: hairline 1.2s cubic-bezier(.16,.84,.32,1) .1s forwards;
}
@keyframes hairline { to { transform: scaleX(1); } }
