/* ==========================================================================
   motion.css — animation & interaction layer
   Loaded after styles.css. Everything here is presentational; the page
   remains fully usable if this file (or js/motion.js) fails to load.
   All motion collapses under html[data-motion="reduced"] (bottom of file).
   ========================================================================== */

:root {
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.25s;
  --dur-mid: 0.55s;
  --dur-slow: 1.1s;
}

/* --------------------------------------------------------------------------
   1. Backdrop — canvas starfield, drifting aurora, breathing nebula
   -------------------------------------------------------------------------- */

.sky {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: skyIn 2.4s var(--ease-soft) 0.2s forwards;
}

.aurora {
  pointer-events: none;
  position: fixed;
  inset: -20vh -10vw;
  z-index: 0;
  overflow: hidden;
  /* The blobs are radial gradients and already soft; a light blur only
     smooths gradient banding without costing a full-viewport blur pass. */
  filter: blur(30px);
  opacity: 0.55;
}

.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora span:nth-child(1) {
  top: -12%;
  right: -6%;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(92, 225, 255, 0.16), transparent 62%);
  animation: drift-a 34s ease-in-out infinite;
}

.aurora span:nth-child(2) {
  bottom: -18%;
  left: -10%;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(196, 107, 45, 0.2), transparent 62%);
  animation: drift-b 44s ease-in-out infinite;
}

.aurora span:nth-child(3) {
  top: 32%;
  left: 38%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(232, 160, 106, 0.12), transparent 65%);
  animation: drift-c 52s ease-in-out infinite;
}

.starfield {
  animation: nebula 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes skyIn {
  to {
    opacity: 1;
  }
}

@keyframes nebula {
  0% {
    opacity: 0.75;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-6vw, 5vh, 0) scale(1.14); }
}

@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  50% { transform: translate3d(7vw, -6vh, 0) scale(1); }
}

@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
  50% { transform: translate3d(-4vw, -7vh, 0) scale(1.2); }
}

/* --------------------------------------------------------------------------
   2. Scroll progress rail
   -------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: rgba(92, 225, 255, 0.07);
}

.scroll-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--copper) 70%, var(--ember));
  box-shadow: 0 0 12px rgba(92, 225, 255, 0.6);
}

/* --------------------------------------------------------------------------
   3. Boot sequence — header, ticker, chrome
   -------------------------------------------------------------------------- */

.site-header {
  transition: min-height 0.45s var(--ease-soft), background 0.45s var(--ease-soft),
    border-color 0.45s var(--ease-soft), box-shadow 0.45s var(--ease-soft);
  animation: dropIn 0.9s var(--ease-spring) both;
}

.site-header.is-scrolled {
  min-height: 4.1rem;
  background: rgba(5, 6, 10, 0.9);
  box-shadow: 0 14px 40px -24px rgba(0, 0, 0, 0.9);
}

.brand {
  transition: transform 0.4s var(--ease-spring);
}

.brand:hover {
  transform: translateX(2px);
}

.brand-seal {
  transition: transform 0.6s var(--ease-spring), box-shadow 0.6s var(--ease-soft);
  animation: sealPulse 4.5s ease-in-out infinite;
}

.brand:hover .brand-seal {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 0 0 3px rgba(92, 225, 255, 0.16), 0 0 22px rgba(92, 225, 255, 0.35);
}

.brand-seal img {
  transition: transform 0.8s var(--ease-spring);
}

.brand:hover .brand-seal img {
  transform: scale(1.14);
}

@keyframes sealPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 225, 255, 0.22); }
  60% { box-shadow: 0 0 0 7px rgba(92, 225, 255, 0); }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Navigation — sliding ink bar + lift on hover */

/* Only the desktop bar needs a positioning context for the ink underline; on
   phones .site-nav is the fixed drawer and must keep that position. */
@media (min-width: 761px) {
  .site-nav {
    position: relative;
  }
}

.nav-ink {
  position: absolute;
  bottom: -0.55rem;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(92, 225, 255, 0.8);
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.5s var(--ease-spring), width 0.5s var(--ease-spring),
    opacity 0.3s var(--ease-soft);
  pointer-events: none;
}

.nav-ink.is-on {
  opacity: 1;
}

.site-nav a {
  position: relative;
  transition: color 0.3s var(--ease-soft), transform 0.35s var(--ease-spring);
}

.site-nav a:hover {
  transform: translateY(-2px);
}

.header-quote {
  animation: dropIn 0.9s var(--ease-spring) 0.25s both;
  transition: border-color 0.4s var(--ease-soft), box-shadow 0.4s var(--ease-soft);
}

.header-quote:hover {
  border-color: rgba(92, 225, 255, 0.45);
  box-shadow: 0 0 22px -6px rgba(92, 225, 255, 0.6);
}

.hq-px {
  transition: color 0.4s var(--ease-soft);
}

.menu-toggle span {
  transition: transform 0.4s var(--ease-spring), opacity 0.3s var(--ease-soft);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(0.28rem) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-0.28rem) rotate(-45deg);
}

.site-nav.is-open a {
  animation: navItemIn 0.45s var(--ease-spring) backwards;
}

.site-nav.is-open a:nth-child(1) { animation-delay: 0.04s; }
.site-nav.is-open a:nth-child(2) { animation-delay: 0.08s; }
.site-nav.is-open a:nth-child(3) { animation-delay: 0.12s; }
.site-nav.is-open a:nth-child(4) { animation-delay: 0.16s; }
.site-nav.is-open a:nth-child(5) { animation-delay: 0.20s; }
.site-nav.is-open a:nth-child(6) { animation-delay: 0.24s; }
.site-nav.is-open a:nth-child(7) { animation-delay: 0.28s; }
.site-nav.is-open a:nth-child(8) { animation-delay: 0.32s; }

@keyframes navItemIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   4. Hero — scanline sweep, split headline, orbit rings, float
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
}

.hero-scan {
  overflow: hidden;
  transform: translate3d(0, var(--py, 0px), 0);
  animation: scanDrift 9s linear infinite;
}

.hero-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(92, 225, 255, 0.55), transparent);
  filter: blur(0.5px);
  animation: scanSweep 7s var(--ease-soft) infinite;
}

@keyframes scanDrift {
  to {
    background-position: 0 8px;
  }
}

@keyframes scanSweep {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  70% { opacity: 0.5; }
  100% { transform: translateY(42vh); opacity: 0; }
}

/* Split headline — characters cascade in once the hero reveals */

.split-char {
  display: inline-block;
  will-change: transform, opacity;
}

.hero-copy[data-reveal] .split-char {
  opacity: 0;
  transform: translateY(0.65em) rotate(6deg);
}

.hero-copy[data-reveal].is-visible .split-char {
  animation: charIn 0.95s var(--ease-spring) forwards;
  animation-delay: var(--cd, 0ms);
}

@keyframes charIn {
  from {
    opacity: 0;
    transform: translateY(0.65em) rotate(6deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Gradient sheen across the italic accents */

h1 em,
h2 em {
  background: linear-gradient(100deg, var(--copper) 0%, #ffd9b3 42%, var(--copper) 72%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s linear infinite;
}

@keyframes sheen {
  from { background-position: 220% 0; }
  to { background-position: -20% 0; }
}

.kicker {
  position: relative;
  display: inline-block;
  padding-left: 1.6rem;
}

.kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.1rem;
  height: 1px;
  background: currentColor;
  transform-origin: 0 50%;
  animation: kickerLine 3.4s var(--ease-soft) infinite;
}

@keyframes kickerLine {
  0%, 100% { transform: scaleX(0.35); opacity: 0.5; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* Portrait — counter-rotating rings, orbit dot, sheen, float */

.hero-portrait {
  animation: float-a 9s ease-in-out infinite;
  will-change: transform;
}

.portrait-ring::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(232, 160, 106, 0.22);
  border-radius: 50%;
  animation: spin-rev 34s linear infinite;
}

.portrait-ring::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px 2px rgba(92, 225, 255, 0.8);
}

.portrait-frame {
  position: relative;
  transition: transform 0.7s var(--ease-spring), box-shadow 0.7s var(--ease-soft),
    border-color 0.5s var(--ease-soft);
  transform-style: preserve-3d;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(92, 225, 255, 0.18) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: sweep 6.5s var(--ease-soft) 1.6s infinite;
}

.portrait-frame img {
  transition: transform 1.2s var(--ease-spring), filter 0.6s var(--ease-soft);
  animation: portraitIn 1.6s var(--ease-spring) backwards;
}

.hero-portrait:hover .portrait-frame {
  border-color: rgba(92, 225, 255, 0.4);
  box-shadow: 0 40px 110px -30px rgba(92, 225, 255, 0.35), 0 30px 80px rgba(0, 0, 0, 0.5);
}

.hero-portrait:hover .portrait-frame img {
  transform: scale(1.05);
  filter: saturate(1.05) contrast(1.08);
}

@keyframes portraitIn {
  from {
    opacity: 0;
    transform: scale(1.14);
    filter: blur(10px) saturate(0.4);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sweep {
  0% { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}

@keyframes spin-rev {
  to { transform: rotate(-360deg); }
}

/* --py is written by the scroll-parallax module; the float keyframes fold it
   in so a single transform channel serves both effects. */
@keyframes float-a {
  0%, 100% { transform: translate3d(0, var(--py, 0px), 0); }
  50% { transform: translate3d(0, calc(var(--py, 0px) - 12px), 0); }
}

@keyframes float-b {
  0%, 100% { transform: translate3d(0, var(--py, 0px), 0); }
  50% { transform: translate3d(0, calc(var(--py, 0px) - 8px), 0); }
}

/* Hero tape — floats on its own phase, grid shimmer, live glow */

.hero-tape {
  position: relative;
  overflow: hidden;
  animation: float-b 11s ease-in-out 0.8s infinite;
  transition: border-color 0.5s var(--ease-soft), box-shadow 0.6s var(--ease-soft);
}

.hero-tape::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(92, 225, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 225, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000, transparent 72%);
  animation: gridPan 22s linear infinite;
}

.hero-tape:hover {
  border-color: rgba(92, 225, 255, 0.36);
  box-shadow: 0 0 0 1px rgba(92, 225, 255, 0.1), 0 34px 80px -30px rgba(92, 225, 255, 0.35);
}

@keyframes gridPan {
  to { background-position: 34px 34px, 34px 34px; }
}

/* Live status pill */

.live-pill::before {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.6;
}

.live-pill {
  transition: background 0.45s var(--ease-soft), color 0.45s var(--ease-soft),
    box-shadow 0.45s var(--ease-soft);
}

.live-pill.is-live::before {
  opacity: 1;
  animation: blink 1.6s ease-in-out infinite;
}

.live-pill.is-live {
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.72); }
}

@keyframes livePulse {
  0% { box-shadow: 0 0 16px rgba(92, 225, 255, 0.45), 0 0 0 0 rgba(92, 225, 255, 0.4); }
  70% { box-shadow: 0 0 16px rgba(92, 225, 255, 0.45), 0 0 0 10px rgba(92, 225, 255, 0); }
  100% { box-shadow: 0 0 16px rgba(92, 225, 255, 0.45), 0 0 0 0 rgba(92, 225, 255, 0); }
}

/* Scroll cue, tucked into the hero gutter */

.scroll-cue {
  position: absolute;
  left: 1.15rem;
  bottom: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  writing-mode: vertical-rl;
  transition: color 0.35s var(--ease-soft);
  animation: fadeIn 1s var(--ease-soft) 1.6s both;
}

.scroll-cue:hover {
  color: var(--cyan);
}

.scroll-cue span.line {
  display: block;
  width: 1px;
  height: 3.2rem;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  overflow: hidden;
  position: relative;
}

.scroll-cue span.line::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 40%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: cueRun 2.2s var(--ease-soft) infinite;
}

@keyframes cueRun {
  0% { transform: translateY(-100%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(320%); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   5. Buttons & links
   -------------------------------------------------------------------------- */

.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease-spring), background 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft), box-shadow 0.4s var(--ease-soft), border-color 0.3s;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, 0.4) 50%, transparent 66%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease-soft);
}

.button:hover::after {
  transform: translateX(130%);
}

.button-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -14px rgba(92, 225, 255, 0.75);
}

.button-primary:active {
  transform: translateY(-1px) scale(0.98);
}

.button-outline:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -20px rgba(92, 225, 255, 0.6);
}

.text-link span {
  display: inline-block;
  transition: transform 0.4s var(--ease-spring);
}

.text-link {
  transition: color 0.3s var(--ease-soft);
}

.text-link:hover span {
  transform: translate(3px, -3px);
}

/* Click ripple, positioned by js/motion.js */

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
  pointer-events: none;
  animation: ripple 0.65s var(--ease-soft) forwards;
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   6. Ticker
   -------------------------------------------------------------------------- */

.ticker {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.ticker-track {
  transition: opacity 0.4s var(--ease-soft);
}

.ticker:hover .ticker-track {
  opacity: 0.75;
}

.ticker-track.is-paused {
  animation-play-state: paused;
}

.ticker span {
  transition: color 0.3s var(--ease-soft), text-shadow 0.3s var(--ease-soft);
}

.ticker span:hover {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(92, 225, 255, 0.6);
}

.ticker i {
  display: inline-block;
  animation: pip 3s ease-in-out infinite;
}

@keyframes pip {
  0%, 100% { opacity: 0.45; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(180deg); }
}

/* --------------------------------------------------------------------------
   7. Reveal system — directional variants + grouped stagger
   -------------------------------------------------------------------------- */

[data-reveal] {
  will-change: opacity, transform;
}

[data-reveal="left"] { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="scale"] { transform: scale(0.94) translateY(14px); }
[data-reveal="blur"] { filter: blur(8px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }

/* Cards read better rising and scaling than sliding. These selectors carry
   extra specificity, so the matching .is-visible overrides do too. */
.company-grid li[data-reveal] { transform: scale(0.94) translateY(20px); }
.flight-log li[data-reveal] { transform: translateX(-22px); }

.company-grid li[data-reveal].is-visible,
.flight-log li[data-reveal].is-visible {
  transform: none;
}

.flight-log li[data-reveal].is-visible:hover {
  transform: translateX(6px);
}

[data-reveal].is-visible {
  transform: none;
  filter: none;
}

/* --------------------------------------------------------------------------
   8. Market board — value flashes, sparkline draw, hover states
   -------------------------------------------------------------------------- */

.board,
.tsla-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.5s var(--ease-soft), box-shadow 0.6s var(--ease-soft),
    transform 0.6s var(--ease-spring);
}

.board::after,
.tsla-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(20rem 20rem at var(--mx, 50%) var(--my, 0%), rgba(92, 225, 255, 0.09), transparent 62%);
  transition: opacity 0.5s var(--ease-soft);
}

.board:hover::after,
.tsla-card:hover::after {
  opacity: 1;
}

.board:hover,
.tsla-card:hover {
  border-color: rgba(92, 225, 255, 0.32);
  box-shadow: 0 30px 80px -40px rgba(92, 225, 255, 0.5);
}

.board-price,
.tape-price,
.tsla-price {
  display: inline-block;
  transition: text-shadow 0.5s var(--ease-soft), transform 0.4s var(--ease-spring);
  font-variant-numeric: tabular-nums;
}

.tape-mini dd,
.telemetry dd,
.hq-px,
.hq-chg {
  font-variant-numeric: tabular-nums;
}

/* Value change flashes — driven by MutationObserver in js/motion.js */

.m-flash {
  border-radius: 0.35rem;
  animation: flashNeutral 1s var(--ease-soft);
}

.m-flash-up {
  border-radius: 0.35rem;
  animation: flashUp 1s var(--ease-soft);
}

.m-flash-down {
  border-radius: 0.35rem;
  animation: flashDown 1s var(--ease-soft);
}

@keyframes flashUp {
  0% { background-color: rgba(93, 255, 177, 0.24); box-shadow: 0 0 0 5px rgba(93, 255, 177, 0.14); }
  100% { background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}

@keyframes flashDown {
  0% { background-color: rgba(255, 107, 122, 0.24); box-shadow: 0 0 0 5px rgba(255, 107, 122, 0.14); }
  100% { background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}

@keyframes flashNeutral {
  0% { background-color: rgba(92, 225, 255, 0.2); box-shadow: 0 0 0 5px rgba(92, 225, 255, 0.12); }
  100% { background-color: transparent; box-shadow: 0 0 0 5px transparent; }
}

.tape-price.m-tick,
.board-price.m-tick,
.tsla-price.m-tick {
  animation: priceTick 0.8s var(--ease-spring);
}

@keyframes priceTick {
  0% { transform: translateY(0); }
  35% { transform: translateY(-4px); text-shadow: 0 0 26px currentColor; }
  100% { transform: translateY(0); }
}

/* Sparkline: line draws itself, a live head-dot pulses at the tip */

.spark-line {
  transition: stroke-dashoffset var(--dur-slow) var(--ease-soft);
}

.spark-fill {
  transition: opacity 0.8s var(--ease-soft);
}

.spark-dot {
  fill: currentColor;
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

.spark-dot.is-on {
  opacity: 1;
}

.spark-halo {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.spark-halo.is-on {
  animation: haloPing 2.2s ease-out infinite;
}

@keyframes haloPing {
  0% { opacity: 0.75; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(3.4); }
}

/* Telemetry rows cascade in, then respond to hover */

.telemetry div {
  transition: background 0.35s var(--ease-soft), border-color 0.35s var(--ease-soft),
    transform 0.35s var(--ease-spring);
}

.telemetry div:hover {
  background: rgba(92, 225, 255, 0.05);
  border-top-color: rgba(92, 225, 255, 0.45);
  transform: translateY(-2px);
}

.board.is-visible .telemetry div {
  animation: rowIn 0.6s var(--ease-spring) backwards;
}

.board.is-visible .telemetry div:nth-child(1) { animation-delay: 0.18s; }
.board.is-visible .telemetry div:nth-child(2) { animation-delay: 0.23s; }
.board.is-visible .telemetry div:nth-child(3) { animation-delay: 0.28s; }
.board.is-visible .telemetry div:nth-child(4) { animation-delay: 0.33s; }
.board.is-visible .telemetry div:nth-child(5) { animation-delay: 0.38s; }
.board.is-visible .telemetry div:nth-child(6) { animation-delay: 0.43s; }
.board.is-visible .telemetry div:nth-child(7) { animation-delay: 0.48s; }
.board.is-visible .telemetry div:nth-child(8) { animation-delay: 0.53s; }
.board.is-visible .telemetry div:nth-child(9) { animation-delay: 0.58s; }
.board.is-visible .telemetry div:nth-child(10) { animation-delay: 0.63s; }
.board.is-visible .telemetry div:nth-child(11) { animation-delay: 0.68s; }
.board.is-visible .telemetry div:nth-child(12) { animation-delay: 0.73s; }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   9. Profile
   -------------------------------------------------------------------------- */

.profile-grid blockquote {
  position: relative;
  overflow: hidden;
  transition: transform 0.6s var(--ease-spring), background 0.5s var(--ease-soft);
}

.profile-grid blockquote::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--copper), transparent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.2s var(--ease-soft) 0.2s;
}

.profile-grid blockquote.is-visible::before {
  transform: scaleY(1);
}

.profile-grid blockquote[data-reveal].is-visible:hover {
  transform: translateX(6px);
  background: rgba(232, 160, 106, 0.1);
}

.fact-strip li {
  position: relative;
  overflow: hidden;
  transition: background 0.4s var(--ease-soft), transform 0.45s var(--ease-spring);
}

.fact-strip li::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease-spring);
}

.fact-strip li:hover {
  background: var(--panel-2);
  transform: translateY(-3px);
}

.fact-strip li:hover::after {
  transform: scaleX(1);
}

.fact-strip.is-visible li {
  animation: rowIn 0.65s var(--ease-spring) backwards;
}

.fact-strip.is-visible li:nth-child(1) { animation-delay: 0.05s; }
.fact-strip.is-visible li:nth-child(2) { animation-delay: 0.15s; }
.fact-strip.is-visible li:nth-child(3) { animation-delay: 0.25s; }

/* --------------------------------------------------------------------------
   10. Company grid — cursor spotlight, 3D tilt, index slide
   -------------------------------------------------------------------------- */

.company-grid li {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-spring), border-color 0.4s var(--ease-soft),
    box-shadow 0.5s var(--ease-soft), background 0.4s var(--ease-soft);
}

.company-grid li::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(16rem 16rem at var(--mx, 50%) var(--my, 50%), rgba(92, 225, 255, 0.13), transparent 60%);
  transition: opacity 0.45s var(--ease-soft);
}

.company-grid li::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--copper));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.6s var(--ease-spring);
}

.company-grid li:hover::before {
  opacity: 1;
}

.company-grid li:hover::after {
  transform: scaleX(1);
}

.company-grid li:hover {
  border-color: rgba(92, 225, 255, 0.34);
  box-shadow: 0 28px 70px -34px rgba(92, 225, 255, 0.55);
}

.company-grid span,
.company-grid h3 {
  transition: transform 0.45s var(--ease-spring), color 0.35s var(--ease-soft);
  display: inline-block;
}

.company-grid li:hover span {
  transform: translateX(4px);
  color: var(--copper);
}

.company-grid li:hover h3 {
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   11. Timeline — the rail draws itself as you scroll
   -------------------------------------------------------------------------- */

.flight-log {
  position: relative;
}

.flight-log::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--cyan), var(--copper));
  box-shadow: 0 0 12px rgba(92, 225, 255, 0.45);
  transform: scaleY(var(--progress, 0));
  transform-origin: top;
  transition: transform 0.25s linear;
}

.flight-log li {
  transition: transform 0.45s var(--ease-spring);
}

.flight-log li:hover {
  transform: translateX(6px);
}

.flight-log li::before {
  transition: transform 0.4s var(--ease-back), box-shadow 0.4s var(--ease-soft);
}

.flight-log li.is-visible::before {
  animation: dotPop 0.6s var(--ease-back) backwards;
}

.flight-log li:last-child.is-visible::before {
  animation: dotPop 0.6s var(--ease-back) backwards, dotPulse 2.4s ease-out 0.8s infinite;
}

.flight-log li:hover::before {
  transform: scale(1.5);
  box-shadow: 0 0 22px var(--copper);
}

.flight-log time {
  display: inline-block;
  transition: transform 0.45s var(--ease-spring), color 0.35s;
}

.flight-log li:hover time {
  transform: translateX(-3px);
  color: var(--copper);
}

@keyframes dotPop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes dotPulse {
  0% { box-shadow: 0 0 12px var(--copper), 0 0 0 0 rgba(232, 160, 106, 0.5); }
  70% { box-shadow: 0 0 12px var(--copper), 0 0 0 14px rgba(232, 160, 106, 0); }
  100% { box-shadow: 0 0 12px var(--copper), 0 0 0 0 rgba(232, 160, 106, 0); }
}

/* --------------------------------------------------------------------------
   12. Social + contact
   -------------------------------------------------------------------------- */

.x-embed-wrap {
  transition: border-color 0.5s var(--ease-soft), box-shadow 0.6s var(--ease-soft);
}

.x-embed-wrap:hover {
  border-color: rgba(92, 225, 255, 0.3);
  box-shadow: 0 30px 80px -40px rgba(92, 225, 255, 0.45);
}

.contact-email {
  position: relative;
}

.contact-email::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.5s var(--ease-spring);
}

.contact-email:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.field {
  position: relative;
}

.field input,
.field select,
.field textarea {
  transition: border-color 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft),
    background 0.35s var(--ease-soft), transform 0.35s var(--ease-spring);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(92, 225, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(92, 225, 255, 0.1);
  background: #0a0f18;
}

.field label {
  transition: color 0.3s var(--ease-soft), letter-spacing 0.4s var(--ease-soft);
}

.field:focus-within label {
  color: var(--cyan);
  letter-spacing: 0.18em;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  animation: shake 0.45s var(--ease-soft);
}

.field-error {
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-spring);
}

.field.is-invalid .field-error {
  animation: rowIn 0.35s var(--ease-spring) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.contact-form button[type="submit"] span {
  display: inline-block;
  transition: transform 0.4s var(--ease-spring);
}

.contact-form button[type="submit"]:hover span {
  transform: translateX(5px);
}

.contact-form.is-sending button[type="submit"] {
  animation: sending 1s ease-in-out infinite;
}

@keyframes sending {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.form-status.is-success {
  animation: rowIn 0.45s var(--ease-spring) both;
}

.form-status .caret {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  background: currentColor;
  animation: caret 0.9s steps(2) infinite;
}

@keyframes caret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.site-footer nav a,
.site-footer a {
  position: relative;
  transition: color 0.3s var(--ease-soft);
}

.site-footer nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.4s var(--ease-spring);
}

.site-footer nav a:hover {
  color: var(--cyan);
}

.site-footer nav a:hover::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   14. Cursor aura (fine pointers only)
   -------------------------------------------------------------------------- */

.cursor-aura,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.35s var(--ease-soft), width 0.3s var(--ease-spring),
    height 0.3s var(--ease-spring), border-color 0.3s;
  will-change: transform;
}

.cursor-aura {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  background: radial-gradient(circle, rgba(92, 225, 255, 0.55), rgba(92, 225, 255, 0) 70%);
  mix-blend-mode: screen;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(92, 225, 255, 0.35);
}

.cursor-aura.is-on,
.cursor-ring.is-on {
  opacity: 1;
}

.cursor-ring.is-hot {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-color: rgba(232, 160, 106, 0.7);
}

.cursor-aura.is-hot {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
}

@media (hover: none), (pointer: coarse) {
  .cursor-aura,
  .cursor-ring {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   15. Section headings — masked line reveal
   -------------------------------------------------------------------------- */

.section-heading h2 {
  overflow: hidden;
  /* room for descenders and the italic accent, which the mask would clip */
  padding-bottom: 0.14em;
  margin-bottom: 0.76rem;
}

.section-heading[data-reveal] h2 > .line-inner {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-spring) 0.12s;
}

.section-heading[data-reveal].is-visible h2 > .line-inner {
  transform: none;
}

/* --------------------------------------------------------------------------
   16. Responsive trims
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .scroll-cue {
    display: none;
  }
}

@media (max-width: 760px) {
  .aurora {
    filter: none;
    opacity: 0.4;
  }

  .hero-portrait,
  .hero-tape {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   17. Reduced motion — hard stop
   -------------------------------------------------------------------------- */

/* Motion is opt-out rather than automatic: the page animates unless
   html[data-motion="reduced"] is set (via ?motion=reduced or localStorage), so
   an OS-level "reduce animations" setting does not silently flatten the site.
   This matches how the standalone landing page behaved before the merge. */

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

html[data-motion="reduced"] .sky,
html[data-motion="reduced"] .aurora,
html[data-motion="reduced"] .cursor-aura,
html[data-motion="reduced"] .cursor-ring,
html[data-motion="reduced"] .scroll-cue,
html[data-motion="reduced"] .hero-scan::after,
html[data-motion="reduced"] .portrait-frame::after {
  display: none !important;
}

html[data-motion="reduced"] .sky {
  opacity: 1;
}

html[data-motion="reduced"] .hero-copy[data-reveal] .split-char,
html[data-motion="reduced"] .section-heading[data-reveal] h2 > .line-inner {
  opacity: 1;
  transform: none;
}

html[data-motion="reduced"] .flight-log::after {
  transform: scaleY(1);
}

html[data-motion="reduced"] h1 em,
html[data-motion="reduced"] h2 em {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--copper);
}

/* --------------------------------------------------------------- Voices */

/* The card lifts on hover from site.css; motion.css only owns the scroll
   reveal, and the .is-visible rule has to match the [data-reveal] selector's
   specificity or the card never settles back to its resting transform. */
.video-card[data-reveal] { transform: translateY(22px) scale(0.985); }
.video-card[data-reveal].is-visible { transform: none; }

.video-play::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--copper));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.6s var(--ease-spring);
}

.video-play:hover::after,
.video-play:focus-visible::after { transform: scaleX(1); }
