/* Colour, depth, and motion. Bright multicolour is the default. Dark is optional.
   Adapted from the Webex lab wow.css. Reduced motion drops loops. */

html[data-theme="bloom"] {
  --bg: #f6f3ff;
  --card: #ffffff;
  --ink: #142033;
  --muted: #334155;
  --line: rgba(76, 29, 149, 0.16);
}
html[data-theme="dark"] {
  --bg: #0b1020;
  --card: #141a2e;
  --ink: #eef4ff;
  --muted: #cbd5e1;
  --line: rgba(226, 232, 240, 0.16);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(800px 360px at 0% 0%, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(700px 320px at 100% 0%, rgba(244, 114, 182, 0.16), transparent 50%),
    var(--bg);
}
html[data-theme="dark"] .canon-banner { filter: saturate(1.05); }
html[data-theme="dark"] .callout { background: #3b2a12; color: #ffedd5; }

html[data-motion="full"] .menu-btn { animation: glow-pulse 2.8s ease-in-out infinite; }
@keyframes glow-pulse {
  50% { box-shadow: 0 0 22px rgba(236, 72, 153, 0.85); }
}
html[data-motion="reduce"] .menu-btn { animation: none; }

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  color: #1e1b4b;
  background: none;
}
html[data-theme="dark"] .hero-title { color: #f8fafc; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .room-card,
html[data-theme="dark"] section.panel {
  background:
    linear-gradient(180deg, #141a2e, #1e1b4b) padding-box,
    linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6) border-box;
}

.hero-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 250px;
  margin: 0 0 12px;
  padding: 18px 24px 14px;
  border-radius: 28px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% 20%, rgba(34, 211, 238, 0.55), transparent 32%),
    radial-gradient(circle at 88% 10%, rgba(244, 114, 182, 0.5), transparent 36%),
    radial-gradient(circle at 70% 80%, rgba(250, 204, 21, 0.35), transparent 28%),
    linear-gradient(145deg, #070b16 0%, #1e1b4b 52%, #4c1d95 100%);
  box-shadow: 0 18px 40px rgba(49, 46, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hero-stage .hero-title { color: #f8fafc; max-width: 16ch; text-shadow: 0 0 24px rgba(34, 211, 238, 0.45); }
.hero-stage .kicker { color: #fde68a; }
.hero-stage .lede { color: #e0f2fe; max-width: 62ch; }
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 249, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 249, 255, 0.16) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.hero-orb, .hero-token {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
}
.hero-orb {
  filter: blur(0);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28), inset -12px -16px 0 rgba(15, 23, 42, 0.18), inset 10px 10px 0 rgba(255, 255, 255, 0.35);
}
.hero-orb-a { width: 150px; height: 150px; right: 8%; top: 28px; background: radial-gradient(circle at 32% 28%, #fff7ed, #fbbf24 36%, #f97316 70%, #7c2d12); }
.hero-orb-b { width: 96px; height: 96px; right: 24%; bottom: 28px; background: radial-gradient(circle at 30% 30%, #ecfeff, #22d3ee 40%, #0e7490); }
.hero-orb-c { width: 72px; height: 72px; right: 18%; top: 46%; background: radial-gradient(circle at 30% 28%, #fdf2f8, #f472b6 42%, #9d174d); }
.hero-token {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,.06));
  border: 2px solid rgba(255,255,255,.45);
  box-shadow: 0 16px 30px rgba(0,0,0,.3), 0 0 18px rgba(250, 204, 21, 0.45);
  transform: perspective(240px) rotateY(-18deg) rotateX(12deg);
}
.hero-token-a { right: 31%; top: 36px; }
.hero-token-b { right: 6%; bottom: 36px; }
html[data-motion="full"] .hero-orb-a { animation: hero-float 7s ease-in-out infinite; }
html[data-motion="full"] .hero-orb-b { animation: hero-float 5.5s ease-in-out infinite reverse; }
html[data-motion="full"] .hero-orb-c { animation: hero-float 6.4s ease-in-out infinite; }
html[data-motion="full"] .hero-token { animation: hero-float 8s ease-in-out infinite; }
@keyframes hero-float { 50% { transform: perspective(240px) rotateY(-18deg) rotateX(12deg) translateY(-12px); } }
html[data-motion="full"] .hero-orb { animation-name: hero-orb-float; }
@keyframes hero-orb-float { 50% { transform: translateY(-14px); } }
@media (max-height: 880px) and (min-width: 900px) {
  .hero-stage { min-height: 0; padding: 10px 20px 8px; }
  .hero-stage .hero-title { font-size: 2rem; }
  .hero-stage .lede { margin: 8px 0; }
  .hero-orb-a { width: 112px; height: 112px; top: 14px; }
  .hero-orb-b { width: 70px; height: 70px; bottom: 16px; }
  .hero-orb-c { width: 52px; height: 52px; }
}
@media (max-width: 720px) {
  .hero-stage { min-height: 0; padding: 12px 14px 10px; }
  .hero-stage .hero-title { font-size: 1.55rem; }
  .hero-stage .lede { font-size: 0.9rem; margin: 6px 0 8px; }
  .hero-stage .actions { margin: 6px 0 0; }
  .hero-stage .actions a { min-height: 36px; padding: 4px 10px; }
  .hero-orb-a { width: 56px; height: 56px; right: 8px; top: 8px; }
  .hero-orb-b, .hero-orb-c, .hero-token-b { display: none; }
  .hero-orb-c { width: 48px; height: 48px; }
  .hero-token-a { width: 44px; height: 44px; font-size: 1.2rem; right: 10px; top: auto; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-orb, .hero-token { animation: none !important; }
}

.flow-line { stroke-dasharray: 8 6; }
html[data-motion="full"] .flow-line { animation: flow-dash 2.4s linear infinite; }
@keyframes flow-dash { to { stroke-dashoffset: -56; } }
@media (prefers-reduced-motion: reduce) {
  .flow-line { animation: none !important; }
}

.stat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  min-width: 120px; min-height: 72px; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(160deg, #fff, #e0f2fe);
  border: 2px solid #67e8f9;
}
html[data-theme="dark"] .stat,
html[data-theme="midnight"] .stat,
html[data-theme="solar"] .stat,
html[data-theme="signal"] .stat {
  background: #0b1224;
  color: #f8fafc;
  border-color: #22d3ee;
}
html[data-theme="dark"] .stat b,
html[data-theme="midnight"] .stat b,
html[data-theme="solar"] .stat b,
html[data-theme="signal"] .stat b { color: #f8fafc; }
.stat b { display: block; font-size: 1.4rem; }
@media (max-width: 720px) {
  .stat { min-width: 0; flex: 1 1 0; min-height: 0; padding: 6px 8px; }
  .stat b { font-size: 1.2rem; }
  #overview { margin-top: 8px; padding: 10px 12px 8px; }
  #overview .lane-copy { margin: 6px 0 0; line-height: 1.3; padding-right: 96px; }
  .hero-stage .lede { line-height: 1.3; }
}

/* Round 3: themes, particles, parallax. Motion stops when the page asks. */
.fx-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.fx-field span {
  position: absolute;
  bottom: -12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #22d3ee 40%, #f472b6);
  box-shadow: 0 0 12px #22d3ee;
  animation: fx-rise 9s linear infinite;
}
@keyframes fx-rise {
  from { transform: translateY(0); opacity: 0; }
  12% { opacity: .85; }
  to { transform: translateY(-110vh); opacity: 0; }
}
html[data-motion="full"] .hero-grid {
  background-position: center calc(var(--parallax, 0px) * -0.35);
}
html[data-motion="full"] .hero-copy { transform: translateY(calc(var(--parallax, 0px) * -0.08)); }
html[data-motion="full"] .fx-field { transform: translateY(calc(var(--parallax, 0px) * -0.25)); }
html[data-motion="reduce"] .fx-field { display: none; }
html[data-motion="reduce"] .hero-orb,
html[data-motion="reduce"] .hero-token,
html[data-motion="reduce"] .section-chip { animation: none; transform: none; }

html[data-theme="midnight"],
html[data-theme="dark"] {
  --bg: #070b16;
  --card: #12182b;
  --ink: #eef4ff;
  --muted: #cbd5e1;
  color-scheme: dark;
}
html[data-theme="midnight"] body,
html[data-theme="dark"] body {
  background:
    radial-gradient(700px 320px at 0% 0%, rgba(34, 211, 238, 0.22), transparent 55%),
    radial-gradient(640px 300px at 100% 0%, rgba(244, 114, 182, 0.2), transparent 50%),
    var(--bg);
}
html[data-theme="solar"] {
  --bg: #2a1208;
  --card: #3b1d0c;
  --ink: #fff7ed;
  --muted: #fed7aa;
  color-scheme: dark;
}
html[data-theme="solar"] body {
  background:
    radial-gradient(720px 340px at 10% 0%, rgba(251, 191, 36, 0.45), transparent 55%),
    radial-gradient(640px 300px at 100% 10%, rgba(244, 63, 94, 0.35), transparent 50%),
    var(--bg);
}
html[data-theme="signal"] {
  --bg: #04121a;
  --card: #082433;
  --ink: #ecfeff;
  --muted: #a5f3fc;
  color-scheme: dark;
}
html[data-theme="signal"] body {
  background:
    radial-gradient(680px 320px at 0% 0%, rgba(34, 211, 238, 0.4), transparent 55%),
    radial-gradient(640px 280px at 100% 0%, rgba(168, 85, 247, 0.35), transparent 52%),
    var(--bg);
}
html[data-theme="midnight"] .card,
html[data-theme="midnight"] .room-card,
html[data-theme="midnight"] section.panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .room-card,
html[data-theme="dark"] section.panel,
html[data-theme="solar"] .card,
html[data-theme="solar"] .room-card,
html[data-theme="solar"] section.panel,
html[data-theme="signal"] .card,
html[data-theme="signal"] .room-card,
html[data-theme="signal"] section.panel {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 27, 75, 0.92)) padding-box,
    linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6) border-box;
  color: #f8fafc;
}
html[data-motion="full"] .room-card:hover,
html[data-motion="full"] .card:hover {
  transform: perspective(500px) rotateX(4deg) translateY(-6px);
}
@media (prefers-reduced-motion: reduce) {
  .fx-field { display: none; }
  .hero-orb, .hero-token, .section-chip, .room-card { animation: none !important; transform: none !important; }
  .route-node { transform: none !important; }
}

.route-desk { display: grid; gap: 12px; }
.route-sim-note { margin: 0; font-weight: 700; }
.route-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  perspective: 800px;
}
.route-node {
  min-height: 44px;
  min-width: 44px;
  border-radius: 14px;
  border: 2px solid #5b21b6;
  background: #ede9fe;
  color: #1e1b4b;
  font: 700 0.95rem/1.2 "Segoe UI", system-ui, sans-serif;
  padding: 10px 12px;
  cursor: pointer;
  transform: rotateX(8deg);
}
.route-node[aria-pressed="true"] { background: #5b21b6; color: #ffffff; }
.route-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.route-fields label { display: grid; gap: 4px; font-weight: 700; }
.route-fields button {
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid #5b21b6;
  background: #5b21b6;
  color: #ffffff;
  font: 700 1rem/1.2 "Segoe UI", system-ui, sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}
.route-fields select, .route-fields input {
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid #5b21b6;
  background: #ffffff;
  color: #142033;
  font: inherit;
  padding: 6px 8px;
}
.route-out { margin: 0; padding: 12px; border-radius: 12px; background: #eef2ff; color: #1e1b4b; }
html[data-theme="dark"] .route-out { background: #1e1b4b; color: #f8fafc; }
html[data-theme="dark"] .route-fields select,
html[data-theme="dark"] .route-fields input { background: #0b1020; color: #f8fafc; }
html[data-motion="reduce"] .route-node { transform: none; }
.route-node:focus-visible, .route-fields select:focus-visible, .route-fields input:focus-visible, .route-fields button:focus-visible {
  outline: 3px solid #0891b2;
  outline-offset: 2px;
}
