/* =========================================================
   Agent A — #hero, #motion, #hud
   ========================================================= */

/* ---------------- HERO ---------------- */
#hero {
  --accent: var(--cyan);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(72px, 11vh, 130px) 0 clamp(110px, 15vh, 150px);
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(40, 60, 140, 0.22), transparent 60%),
    radial-gradient(80% 60% at 85% 30%, rgba(155, 123, 255, 0.10), transparent 70%),
    var(--bg);
}
#hero .hero-sky { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }

/* a planet's limb glowing at the bottom edge */
#hero .hero-limb {
  position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: calc(100% - 9vh);
  width: max(1600px, 230vw); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, #03050c 96%, rgba(3, 5, 12, 0) 100%);
  box-shadow:
    0 -1px 0 rgba(160, 250, 255, 0.55),
    0 -6px 24px rgba(92, 242, 255, 0.28),
    0 -30px 120px rgba(92, 242, 255, 0.16),
    0 -90px 260px rgba(155, 123, 255, 0.12);
}
#hero .hero-inner { position: relative; will-change: transform, opacity; }

#hero .hero-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.05rem, 9.1vw, 8.4rem);
  line-height: 0.98; letter-spacing: -0.035em;
  margin: 0 0 clamp(22px, 3.4vh, 40px);
  overflow-wrap: anywhere;
}
#hero .hero-title em { font-style: normal; color: var(--cyan); text-shadow: 0 0 42px rgba(92, 242, 255, 0.45), 0 0 2px rgba(92, 242, 255, 0.6); }
#hero .hero-word { display: inline-block; white-space: nowrap; }
#hero .hero-ch {
  display: inline-block; opacity: 0;
  transform: translateY(0.5em) rotate(7deg) scale(0.92);
  filter: blur(12px);
  animation: hero-letter 1.15s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 48ms + 120ms);
}
@keyframes hero-letter { to { opacity: 1; transform: none; filter: blur(0); } }

#hero .hero-in { opacity: 0; animation: hero-up 1.1s var(--ease-out) forwards; animation-delay: calc(var(--d) * 1s); }
@keyframes hero-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

#hero .hero-clock {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 clamp(26px, 4vh, 44px);
  font-size: var(--step--1); color: var(--ink-2); letter-spacing: 0.02em;
}
#hero .hero-clock b { color: var(--cyan); font-weight: 600; letter-spacing: 0.14em; margin-right: 4px; }
#hero .hero-clock__utc [data-k="utc"] { color: var(--ink); }
#hero .hero-clock__tz { color: var(--ink-3); }
#hero .hero-clock__tz span { color: var(--ink-2); }

#hero .hero-ride { margin: 0 0 clamp(28px, 5vh, 52px); }
#hero .hero-ride p { margin: 0; }
#hero .hero-ride__pre { color: var(--ink-2); font-size: var(--step-0); font-weight: 300; }
#hero .hero-ride__num {
  font-size: clamp(2.1rem, 6.6vw, 5.4rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em;
  color: var(--ink); text-shadow: 0 0 34px rgba(92, 242, 255, 0.35);
  display: flex; align-items: baseline; gap: 0.25em; flex-wrap: wrap;
}
#hero .hero-ride__num small { font-size: 0.38em; color: var(--cyan); font-weight: 400; letter-spacing: 0.08em; }
#hero .hero-ride__post { color: var(--ink-3); font-size: var(--step--1); max-width: 60ch; }

#hero .hero-counters {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 26px;
  border-top: 1px solid var(--line); padding-top: 20px; max-width: 1080px;
}
#hero .hero-count .stat__value { font-size: var(--step-1); }
#hero .hero-count--pop .stat__value { color: var(--cyan); }
#hero .hero-count .stat__label i { display: block; font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
#hero .hero-src { font-size: 11px; line-height: 1.5; color: var(--ink-3); max-width: 92ch; margin: 18px 0 0; }

#hero .hero-cue {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; padding: 6px 10px;
  opacity: 0; animation: hero-fade 1s var(--ease-out) 2.3s forwards;
}
@keyframes hero-fade { to { opacity: 1; } }
#hero .hero-cue i { position: relative; width: 1px; height: 42px; background: rgba(160, 180, 255, 0.18); overflow: hidden; }
#hero .hero-cue i::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: linear-gradient(transparent, var(--cyan)); animation: hero-drip 1.8s ease-in-out infinite;
}
#hero .hero-cue:hover, #hero .hero-cue:focus-visible { color: var(--cyan); }
@keyframes hero-drip { to { top: 100%; } }

@media (max-width: 760px) {
  #hero .hero-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
  #hero .hero-count--pop { grid-column: 1 / -1; }
  #hero .hero-clock { flex-direction: column; gap: 2px; }
  #hero .hero-limb { top: calc(100% - 6vh); }
}
@media (max-height: 640px) and (min-width: 761px) {
  #hero .hero-cue { display: none; }
}

/* ---------------- MOTION ---------------- */
#motion { --accent: var(--cyan); overflow: hidden; }
#motion::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 40% at 90% 10%, rgba(92, 242, 255, 0.07), transparent 70%),
              radial-gradient(50% 40% at 0% 60%, rgba(155, 123, 255, 0.07), transparent 70%);
}

#motion .motion-lat {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 12px 16px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(10, 13, 24, 0.5); font-size: var(--step--1); color: var(--ink-2);
}
#motion .motion-lat b { color: var(--cyan); font-weight: 600; }
#motion .motion-lat__how { color: var(--ink-3); }
#motion .motion-lat__note { color: var(--ink-3); font-size: 12px; flex-basis: 100%; }
#motion .motion-btn {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(92, 242, 255, 0.55);
  background: rgba(92, 242, 255, 0.08); color: var(--cyan); transition: background 0.2s;
}
#motion .motion-btn:hover { background: rgba(92, 242, 255, 0.18); }
#motion .motion-btn:disabled { opacity: 0.55; cursor: default; }
#motion .motion-btn:focus-visible, #motion .motion-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

#motion .motion-stack { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
#motion .motion-row {
  display: grid; align-items: center; gap: 8px 22px;
  grid-template-columns: 40px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "idx what speed dist" "idx bar bar bar" "idx cmp cmp cmp";
  padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s;
}
#motion .motion-row:hover { border-color: rgba(92, 242, 255, 0.35); }
#motion .motion-row__idx { grid-area: idx; align-self: start; color: var(--cyan); font-size: 12px; padding-top: 4px; }
#motion .motion-row__what { grid-area: what; min-width: 0; }
#motion .motion-row__name { font-family: var(--f-display); font-weight: 500; font-size: var(--step-0); margin: 0; line-height: 1.25; }
#motion .motion-row__ref { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.35; }
#motion .motion-row__speed, #motion .motion-row__dist { display: flex; flex-direction: column; min-width: 0; }
#motion .motion-row__speed { grid-area: speed; }
#motion .motion-row__dist { grid-area: dist; }
#motion .motion-row__v, #motion .motion-row__d { font-weight: 600; font-size: var(--step-1); line-height: 1.1; white-space: nowrap; }
#motion .motion-row__v small { font-size: 0.5em; color: var(--ink-2); font-weight: 400; margin-left: 0.3em; }
#motion .motion-row__d { color: var(--cyan); }
#motion .motion-row__kmh, #motion .motion-row__dl { font-size: 12px; color: var(--ink-3); }
#motion .motion-row__bar { grid-area: bar; height: 3px; border-radius: 3px; background: rgba(160, 180, 255, 0.08); overflow: hidden; }
#motion .motion-row__bar i {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, rgba(92, 242, 255, 0.5), var(--cyan));
  box-shadow: 0 0 10px rgba(92, 242, 255, 0.6); transition: width 1.2s var(--ease-out);
}
#motion .motion-row__cmp { grid-area: cmp; margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

#motion .motion-fine { font-size: 11px; line-height: 1.6; color: var(--ink-3); max-width: 120ch; margin: 0 0 44px; }

/* diagram */
#motion .motion-viz { margin: 0 0 22px; padding: clamp(16px, 2.2vw, 26px); }
#motion .motion-viz__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#motion .motion-viz__head h3 { margin: 0; }
#motion .motion-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
#motion .motion-tab {
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
  font-family: var(--f-mono); font-size: 12px; padding: 6px 12px; border-radius: 999px; transition: background 0.25s, color 0.25s;
}
#motion .motion-tab:hover { color: var(--ink); }
#motion .motion-tab[aria-selected="true"] { background: rgba(92, 242, 255, 0.14); color: var(--cyan); }
#motion .motion-viz__stage { position: relative; height: clamp(320px, 42vw, 460px); margin: 14px 0 10px; }
#motion .motion-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#motion .motion-viz__cap { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; min-height: 3em; max-width: 90ch; }

/* galactic years */
#motion .motion-gy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 64px; }
#motion .motion-gy .stat__value { font-size: var(--step-2); }
#motion .motion-gy .stat__label b { color: var(--cyan); font-weight: 500; }

/* voyagers */
#motion .motion-voy__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#motion .motion-voy__title { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
#motion .motion-voy__lede { color: var(--ink-2); margin: 10px 0 22px; max-width: 60ch; }
#motion .motion-voy__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#motion .motion-craft header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
#motion .motion-craft h4 { font-family: var(--f-display); font-weight: 500; font-size: var(--step-1); margin: 0; }
#motion .motion-craft dl { margin: 14px 0; display: grid; gap: 10px; }
#motion .motion-craft dl div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
#motion .motion-craft dt { font-size: 13px; color: var(--ink-3); }
#motion .motion-craft dd { margin: 0; text-align: right; font-weight: 600; font-size: 15px; color: var(--ink); }
#motion .motion-craft dd small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
#motion .motion-craft__msg { margin: 0; font-size: 14px; color: var(--ink-2); }
#motion .motion-craft__msg b { color: var(--cyan); font-weight: 600; white-space: nowrap; }
#motion .motion-craft__msg span { color: var(--ink-3); }
#motion .motion-voy__milestone {
  margin: 18px 0 8px; padding: 12px 16px; font-size: 14.5px; color: var(--ink-2);
  border-left: 2px solid var(--amber); background: rgba(255, 181, 71, 0.06); border-radius: 0 12px 12px 0;
}

#motion .motion-voy__track { position: relative; height: 74px; margin: 22px 26px 10px; }
#motion .motion-voy__line {
  position: absolute; left: 0; right: 0; top: 30px; height: 1px;
  background: linear-gradient(90deg, rgba(255, 181, 71, 0.8), rgba(160, 180, 255, 0.35) 40%, rgba(92, 242, 255, 0.5));
}
#motion .motion-voy__mark {
  position: absolute; left: var(--x, 0%); top: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; transition: left 0.6s linear;
}
#motion .motion-voy__mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin: 0 0 6px; }
#motion .motion-voy__mark--hp i { width: 1px; height: 14px; border-radius: 0; background: var(--amber); margin-top: -3px; margin-bottom: 0; }
#motion .motion-voy__mark--hp { color: var(--amber); }
#motion .motion-voy__mark--craft { top: 6px; flex-direction: column-reverse; color: var(--cyan); font-weight: 600; font-size: 11px; }
#motion .motion-voy__mark--craft i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); margin: 6px 0 0; }
#motion .motion-voy__scale { position: absolute; right: 0; bottom: 0; font-size: 10px; color: var(--ink-3); }
#motion .motion-voy .motion-fine { margin-top: 10px; margin-bottom: 0; }

@media (max-width: 900px) {
  #motion .motion-gy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #motion .motion-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "what what" "speed dist" "bar bar" "cmp cmp";
    padding: 16px; position: relative;
  }
  #motion .motion-row__idx { position: absolute; top: 14px; right: 16px; padding: 0; }
  #motion .motion-row__what { padding-right: 26px; }
  #motion .motion-voy__grid { grid-template-columns: minmax(0, 1fr); }
  #motion .motion-viz__stage { height: 340px; }
  #motion .motion-voy__track { margin-left: 18px; margin-right: 14px; }
  #motion .motion-voy__mark--hp span, #motion .motion-voy__scale { font-size: 9px; }
}
@media (max-width: 420px) {
  #motion .motion-gy .stat__value { font-size: var(--step-1); }
  #motion .motion-tab { padding: 6px 9px; font-size: 11px; }
}

/* ---------------- HUD ---------------- */
#hud .hud-pill {
  display: flex; align-items: center; max-width: 100%; overflow: hidden;
  padding: 9px 6px; border-radius: 999px;
  background: rgba(10, 13, 24, 0.72); border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(92, 242, 255, 0.05);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
#hud .hud-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 12px; }
#hud .hud-item + .hud-item { border-left: 1px solid var(--line); }
#hud .hud-item b { color: var(--ink); font-weight: 600; font-size: 13px; }
#hud .hud-item--lead b { color: var(--cyan); }
#hud .hud-item--lead .hud-lbl { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
#hud .hud-dot { align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(92, 242, 255, 0.7); animation: hud-ping 1.8s infinite; }
@keyframes hud-ping { to { box-shadow: 0 0 0 8px rgba(92, 242, 255, 0); } }

@media (max-width: 900px) {
  #hud .hud-item--iss { display: none; }
}
@media (max-width: 640px) {
  #hud .hud-pill { font-size: 11px; padding: 8px 2px; }
  #hud .hud-item { padding: 0 8px; gap: 4px; }
  #hud .hud-item b { font-size: 12px; }
  #hud .hud-item--quake, #hud .hud-item--lead .hud-lbl, #hud .hud-x { display: none; }
}
@media (max-width: 350px) {
  #hud .hud-item--wiki { display: none; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  #hero .hero-ch, #hero .hero-in { animation: none; opacity: 1; transform: none; filter: none; }
  #hero .hero-cue { animation: none; opacity: 1; }
  #hero .hero-cue i::after, #hud .hud-dot { animation: none; }
  #motion .motion-row__bar i, #motion .motion-voy__mark { transition: none; }
}
