/*
 * SemiMatrix Portal ULTRA — Premium Enhancement Layer
 * Add-on animations, reveals, hover effects, and transitions
 */

/* ===== BACKGROUND & OVERLAYS ===== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 45%, rgba(1, 11, 20, 0.45) 100%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s;
}

/* CRT Scanline Beam Animation */
.scanline-beam {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 240, 255, 0.04) 50%,
    transparent 100%
  );
  animation: scanline-move 8s linear infinite;
  pointer-events: none;
  z-index: 998;
}
@keyframes scanline-move {
  0% {
    top: -10%;
  }
  100% {
    top: 110%;
  }
}

/* Vignette borders */
.vignette-overlay {
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 997;
}

/* ===== NAVIGATION ENHANCEMENTS ===== */
nav {
  transition:
    background-color 0.4s,
    border-color 0.4s,
    box-shadow 0.4s,
    height 0.4s !important;
}
nav.scrolled {
  background: rgba(1, 11, 20, 0.9) !important;
  border-bottom-color: rgba(6, 182, 212, 0.25) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
  height: 70px !important;
}
.nav-links li a {
  position: relative;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition:
    width 0.3s ease,
    left 0.3s ease;
  transform: translateX(-50%);
}
.nav-links li a:hover::after {
  width: 80%;
}
.nav-logo:hover .logo-dot {
  box-shadow:
    0 0 20px #00f0ff,
    0 0 35px #00f0ff;
  transform: scale(1.3) rotate(180deg);
}

/* ===== HERO INTRO ENTRANCE ANIMATIONS ===== */
.hero-eyebrow {
  opacity: 0;
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-title .line1 {
  display: block;
  opacity: 0;
  filter: blur(20px);
  transform: translateY(30px);
  animation: blurSharpReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}
.hero-title .line2 {
  display: block;
  opacity: 0;
  letter-spacing: -6px;
  animation: letterExpand 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}
.hero-title .line3 {
  display: block;
  opacity: 0;
  text-shadow: 0 0 50px rgba(0, 229, 255, 0.8);
  animation: glowBurst 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}
.hero-desc {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}
.hero-stats {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}
.hero-ctas {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}
.hero-quickstart {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards;
}

@keyframes blurSharpReveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
@keyframes letterExpand {
  to {
    opacity: 0.6;
    letter-spacing: 4px;
  }
}
@keyframes glowBurst {
  to {
    opacity: 1;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.45);
  }
}
@keyframes fadeUpStagger {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== GLITCH TEXT EFFECT ===== */
.glitch-text {
  position: relative;
  display: block;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0.6;
  pointer-events: none;
}
.glitch-text::before {
  color: #ff00c1;
  z-index: -1;
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
  -webkit-text-fill-color: #ff00c1 !important;
  -webkit-text-stroke: 0 !important;
}
.glitch-text::after {
  color: #00fff0;
  z-index: -2;
  animation: glitch-anim-2 3.5s infinite linear alternate-reverse;
  -webkit-text-fill-color: #00fff0 !important;
  -webkit-text-stroke: 0 !important;
}

/* Specific Outlined Glitch style for Line 2 to align with parent hollow text */
.hero-title .line2.glitch-text::before {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-text-stroke: 1px #ff00c1 !important;
  animation:
    glitch-anim-1 3s infinite linear alternate-reverse,
    letterExpand-pseudo 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}
.hero-title .line2.glitch-text::after {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-text-stroke: 1px #00fff0 !important;
  animation:
    glitch-anim-2 3.5s infinite linear alternate-reverse,
    letterExpand-pseudo 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* Safe Glitch style for Thai Line 3 (bypass clip-path and content duplication to preserve tone marks) */
.hero-title .line3.glitch-text::before,
.hero-title .line3.glitch-text::after {
  content: none !important;
  display: none !important;
}
.hero-title .line3.glitch-text {
  animation:
    glowBurst 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards,
    thai-glitch-anim 3s infinite steps(2) 1.6s;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(40% 0 61% 0);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
  }
  40% {
    clip-path: inset(15% 0 80% 0);
  }
  60% {
    clip-path: inset(80% 0 5% 0);
  }
  80% {
    clip-path: inset(3% 0 92% 0);
  }
  100% {
    clip-path: inset(55% 0 30% 0);
  }
}
@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(25% 0 58% 0);
  }
  20% {
    clip-path: inset(70% 0 10% 0);
  }
  40% {
    clip-path: inset(5% 0 85% 0);
  }
  60% {
    clip-path: inset(90% 0 2% 0);
  }
  80% {
    clip-path: inset(12% 0 75% 0);
  }
  100% {
    clip-path: inset(45% 0 35% 0);
  }
}
@keyframes letterExpand-pseudo {
  from {
    letter-spacing: -6px;
  }
  to {
    letter-spacing: 4px;
  }
}
@keyframes thai-glitch-anim {
  0%,
  100% {
    text-shadow:
      0.03em 0 0 rgba(255, 0, 193, 0.65),
      -0.03em -0.015em 0 rgba(0, 255, 240, 0.65),
      0 0 15px rgba(6, 182, 212, 0.45);
  }
  20% {
    text-shadow:
      -0.03em -0.015em 0 rgba(255, 0, 193, 0.65),
      0.015em 0.015em 0 rgba(0, 255, 240, 0.65),
      0 0 15px rgba(6, 182, 212, 0.45);
  }
  40% {
    text-shadow:
      0.015em 0.03em 0 rgba(255, 0, 193, 0.65),
      -0.03em 0.03em 0 rgba(0, 255, 240, 0.65),
      0 0 15px rgba(6, 182, 212, 0.45);
  }
  60% {
    text-shadow:
      -0.02em 0.02em 0 rgba(255, 0, 193, 0.65),
      0.02em -0.02em 0 rgba(0, 255, 240, 0.65),
      0 0 15px rgba(6, 182, 212, 0.45);
  }
  80% {
    text-shadow:
      0.03em -0.03em 0 rgba(255, 0, 193, 0.65),
      -0.015em 0.015em 0 rgba(0, 255, 240, 0.65),
      0 0 15px rgba(6, 182, 212, 0.45);
  }
}

/* ===== TILT & SHIMMER CARDS ===== */
.interactive-cyber-card,
.topic-card,
.career-card,
.featured-tool-card {
  position: relative;
  transition:
    transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  transform-style: preserve-3d;
}
.interactive-cyber-card::before,
.topic-card::before,
.career-card::before,
.featured-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 60%,
    rgba(0, 240, 255, 0.08) 100%
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.interactive-cyber-card:hover::before,
.topic-card:hover::before,
.career-card:hover::before,
.featured-tool-card:hover::before {
  opacity: 1;
}

/* ===== SCROLL REVEALS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== RIPPLE WATER CLICK ===== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.5s linear;
  pointer-events: none;
  z-index: 100;
}
@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== FOOTER SHIMMER GRADIENT LINE ===== */
.footer-shimmer-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 25%,
    var(--accent3) 50%,
    var(--accent) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: footerShimmer 5s linear infinite;
  margin-bottom: 20px;
}
@keyframes footerShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Adjust telemetry cell styles for pulse effects */
.telemetry-cell {
  position: relative;
}
.telemetry-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.telemetry-cell.active-pulse::after {
  opacity: 0.6;
  animation: telemetryPulse 0.5s ease-out;
}
@keyframes telemetryPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

/* ===== PERFORMANCE ECO MODE OVERRIDES ===== */
/* Apply recursively to ALL children/descendants to avoid inheritance gaps */
.perf-eco * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
}

.perf-eco .scanline-beam,
.perf-eco .vignette-overlay,
.perf-eco .footer-shimmer-line,
.perf-eco .orb,
.perf-eco .ambient-orbs,
.perf-eco .grid-overlay {
  display: none !important;
  animation: none !important;
}

.perf-eco .map-container,
.perf-eco .detail-sidebar,
.perf-eco .career-panel,
.perf-eco .interactive-cyber-card,
.perf-eco .topic-card,
.perf-eco .career-card,
.perf-eco .featured-tool-card,
.perf-eco .stat-item,
.perf-eco .live-telemetry-hud,
.perf-eco .ticker-bar,
.perf-eco nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(15, 23, 42, 0.98) !important; /* solid slate background fallback */
  box-shadow: none !important;
  text-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.perf-eco .ticker-track {
  animation: none !important;
  transform: none !important;
}

.perf-eco .flowline.active {
  animation: none !important;
  stroke-dasharray: none !important;
}

.perf-eco .node-pulse {
  animation: none !important;
}

.perf-eco .glitch-text::before,
.perf-eco .glitch-text::after {
  content: none !important;
  display: none !important;
}

.perf-eco .hero-eyebrow,
.perf-eco .hero-title .line1,
.perf-eco .hero-title .line2,
.perf-eco .hero-title .line3,
.perf-eco .hero-desc,
.perf-eco .hero-stats,
.perf-eco .hero-ctas,
.perf-eco .hero-quickstart,
.perf-eco .reveal {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
  transition: none !important;
}

/* Stop rotating large chip SVG and remove drop-shadow (completely hide in eco mode to save mobile DOM layout space) */
.perf-eco .hero-chip {
  filter: none !important;
  animation: none !important;
  box-shadow: none !important;
}
.perf-eco .chip-svg {
  display: none !important;
  filter: none !important;
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* De-thrash background scrolling repaint on mobile GPUs */
.perf-eco body {
  background-attachment: scroll !important;
}

/* Hide telemetry bar to save DOM nodes update processing in eco mode */
.perf-eco .live-telemetry-hud {
  display: none !important;
}

/* ── Transistor Morpher Node Selector Buttons & Telemetry Gauges ── */
.control-card {
  background: rgba(255, 255, 255, 0.01) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition:
    border-color 0.3s,
    box-shadow 0.3s !important;
}
.control-card:hover {
  border-color: rgba(6, 182, 212, 0.2) !important;
}

.node-tabs {
  display: flex !important;
  background: rgba(255, 255, 255, 0.01) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 6px !important;
  gap: 6px !important;
}

.node-tab {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 12px !important;
  color: var(--text-mid) !important;
  cursor: pointer !important;
  font-family: var(--mono) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-align: center !important;
  transition: all 0.25s !important;
}

.node-tab:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.node-tab.active {
  background: rgba(6, 182, 212, 0.12) !important;
  border: 1px solid var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.25) !important;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.6) !important;
}

.gauge-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-top: 10px !important;
}

.gauge-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.01) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  transition:
    background-color 0.3s,
    border-color 0.3s !important;
}

.gauge-row:hover {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(6, 182, 212, 0.15) !important;
}

.gauge-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.gauge-name {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  color: var(--text-dim) !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
}

.gauge-val {
  font-family: var(--mono) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #fff !important;
}

.gauge-indicator {
  position: relative !important;
}

.gauge-svg {
  width: 100% !important;
  height: 100% !important;
  transform: rotate(-90deg) !important;
}

.gauge-bg-circle {
  fill: none !important;
  stroke: rgba(255, 255, 255, 0.05) !important;
  stroke-width: 4 !important;
}

.gauge-fill-circle {
  fill: none !important;
  stroke-width: 4 !important;
  stroke-linecap: round !important;
  transition: stroke-dashoffset 0.3s !important;
}

#morph-circle-control {
  stroke: var(--accent) !important;
  filter: drop-shadow(0 0 4px var(--accent)) !important;
}

#morph-circle-ion {
  stroke: var(--accent4) !important;
  filter: drop-shadow(0 0 4px var(--accent4)) !important;
}

#morph-circle-ioff {
  stroke: var(--red) !important;
  filter: drop-shadow(0 0 4px var(--red)) !important;
}

/* Override and reset any glossary tooltips in parameter slider labels to maintain visual symmetry */
.morpher-slider-lbl .sc-glossary-trigger,
.morpher-slider-lbl .sc-glossary-trigger:hover,
.morpher-slider-lbl .sc-glossary-trigger:focus {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
  text-decoration: none !important;
  border-bottom: none !important;
  cursor: default !important;
  pointer-events: none !important;
}

/* Make portal page text elements bolder/thicker for premium cyber aesthetic and readability */
body,
p,
li,
td,
th,
label,
select,
input,
textarea,
.hero-desc,
.section-sub,
[class*='-desc'],
[class$='-desc'] {
  font-weight: 500 !important;
}

/* ======================== QUANTUM CINEMATIC EFFECTS ======================== */

/* SemiMatrix Quantum Interface â€” cinematic enhancement layer */
:root {
  --quantum-cyan: #35f2ff;
  --quantum-violet: #8b5cf6;
  --quantum-mint: #5fffc8;
  --pointer-x: 50vw;
  --pointer-y: 42vh;
  --portal-progress: 0%;
  --card-x: 50%;
  --card-y: 50%;
  --stage-index: '';
}

body {
  background:
    radial-gradient(ellipse at 78% 4%, rgba(91, 55, 255, 0.15), transparent 34rem),
    radial-gradient(ellipse at 10% 32%, rgba(0, 224, 255, 0.09), transparent 30rem), #020810;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      420px circle at var(--pointer-x) var(--pointer-y),
      rgba(53, 242, 255, 0.075),
      transparent 72%
    ),
    linear-gradient(rgba(53, 242, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 242, 255, 0.025) 1px, transparent 1px);
  background-size:
    auto,
    64px 64px,
    64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.quantum-aurora {
  position: fixed;
  width: 58vw;
  height: 58vw;
  top: -34vw;
  right: -8vw;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 130deg,
    rgba(53, 242, 255, 0),
    rgba(53, 242, 255, 0.16),
    rgba(139, 92, 246, 0.18),
    transparent 62%
  );
  filter: blur(64px);
  opacity: 0.7;
  pointer-events: none;
  animation: quantum-breathe 12s ease-in-out infinite alternate;
}

.quantum-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: var(--portal-progress, 0%);
  height: 2px;
  z-index: 10002;
  background: linear-gradient(
    90deg,
    var(--quantum-violet),
    var(--quantum-cyan),
    var(--quantum-mint)
  );
  box-shadow:
    0 0 18px var(--quantum-cyan),
    0 0 4px #fff;
  transition: width 0.1s linear;
}

.quantum-corner {
  position: fixed;
  z-index: 996;
  width: 52px;
  height: 52px;
  pointer-events: none;
  opacity: 0.42;
}
.quantum-corner::before,
.quantum-corner::after {
  content: '';
  position: absolute;
  background: var(--quantum-cyan);
  box-shadow: 0 0 10px rgba(53, 242, 255, 0.7);
}
.quantum-corner::before {
  width: 100%;
  height: 1px;
}
.quantum-corner::after {
  width: 1px;
  height: 100%;
}
.quantum-corner--tl {
  top: 92px;
  left: 22px;
}
.quantum-corner--br {
  right: 22px;
  bottom: 22px;
  transform: rotate(180deg);
}

.hero {
  isolation: isolate;
  min-height: min(960px, 100svh);
}

.hero::before {
  content: 'SEMIMATRIX / QUANTUM LEARNING CORE';
  position: absolute;
  top: 122px;
  left: 40px;
  writing-mode: vertical-rl;
  font: 9px/1 var(--mono);
  letter-spacing: 0.32em;
  color: rgba(159, 245, 255, 0.34);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 8% 4% 3%;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(78, 229, 255, 0.07);
  clip-path: polygon(
    0 0,
    22% 0,
    22% 1px,
    78% 1px,
    78% 0,
    100% 0,
    100% 24%,
    calc(100% - 1px) 24%,
    calc(100% - 1px) 76%,
    100% 76%,
    100% 100%,
    78% 100%,
    78% calc(100% - 1px),
    22% calc(100% - 1px),
    22% 100%,
    0 100%
  );
}

.hero-chip {
  overflow: visible !important;
}
.hero-chip::before,
.hero-chip::after {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 1px solid rgba(53, 242, 255, 0.18);
  border-top-color: rgba(53, 242, 255, 0.8);
  border-bottom-color: rgba(139, 92, 246, 0.55);
  filter: drop-shadow(0 0 10px rgba(53, 242, 255, 0.2));
  pointer-events: none;
  animation: orbit-spin 18s linear infinite;
}
.hero-chip::after {
  inset: 5%;
  border-style: dashed;
  opacity: 0.65;
  animation-direction: reverse;
  animation-duration: 11s;
}

.hero-eyebrow {
  padding: 8px 13px 8px 28px;
  border: 1px solid rgba(53, 242, 255, 0.2);
  border-radius: 999px;
  background: rgba(2, 15, 27, 0.54);
  box-shadow:
    inset 0 0 22px rgba(53, 242, 255, 0.04),
    0 0 32px rgba(53, 242, 255, 0.04);
}
.hero-eyebrow::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  margin: 4px 0 0 -16px;
  border-radius: 50%;
  background: var(--quantum-mint);
  box-shadow: 0 0 12px var(--quantum-mint);
  animation: signal-pulse 1.8s ease-out infinite;
}

.hero-title {
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.45));
}
.hero-title .line1 {
  background: linear-gradient(110deg, #fff 8%, #bdf9ff 42%, #fff 58%, #91f7ff 78%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    blurSharpReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards,
    spectral-shift 7s linear 1.4s infinite;
}

.live-telemetry-hud,
.portal-command-deck,
.topic-card,
.career-card,
.featured-tool-card,
.map-container {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    radial-gradient(
      circle at var(--card-x, 50%) var(--card-y, 50%),
      rgba(53, 242, 255, 0.09),
      transparent 42%
    ) !important;
}

.topic-card,
.career-card,
.featured-tool-card,
.command-card {
  overflow: hidden;
}
.topic-card::after,
.career-card::after,
.featured-tool-card::after,
.command-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.11) 45%,
    transparent 65%
  );
  transform: translateX(-130%);
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.topic-card:hover::after,
.career-card:hover::after,
.featured-tool-card:hover::after,
.command-card:hover::after {
  transform: translateX(130%);
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes quantum-breathe {
  to {
    transform: translate(-6vw, 8vw) scale(1.16) rotate(24deg);
    opacity: 0.92;
  }
}
@keyframes signal-pulse {
  0%,
  100% {
    transform: scale(0.75);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}
@keyframes spectral-shift {
  to {
    background-position: 220% center;
  }
}

@media (max-width: 900px) {
  .hero::before,
  .quantum-corner {
    display: none;
  }
  .hero::after {
    inset: 6% 12px 2%;
  }
  .quantum-aurora {
    width: 110vw;
    height: 110vw;
    top: -64vw;
    right: -45vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quantum-aurora,
  .hero-chip::before,
  .hero-chip::after,
  .hero-eyebrow::before,
  .hero-title .line1 {
    animation: none !important;
  }
  .quantum-progress {
    transition: none;
  }
}

.perf-eco .quantum-aurora,
.perf-eco .quantum-corner,
.perf-eco .hero-chip::before,
.perf-eco .hero-chip::after {
  display: none !important;
}
.perf-eco body::before {
  background: none !important;
}

/* ===== PREMIUM NAVIGATION POLISH ===== */
.sm-nav-indicator {
  --indicator-x: 0px;
  --indicator-width: 0px;
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--indicator-width);
  height: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--indicator-x));
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--quantum-violet),
    var(--quantum-cyan),
    var(--quantum-mint)
  );
  box-shadow: 0 0 14px rgba(53, 242, 255, 0.75);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}

.sm-nav-indicator.is-visible {
  opacity: 1;
}

.sm-count-pop {
  animation: sm-count-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sm-count-pop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
    text-shadow: 0 0 22px rgba(53, 242, 255, 0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sm-nav-indicator {
    transition: opacity 0.2s ease;
  }
  .sm-count-pop {
    animation: none;
  }
}

.perf-eco .sm-nav-indicator {
  display: none !important;
}
.perf-eco .sm-count-pop {
  animation: none !important;
}

/* ==========================================================================
   SEMIMATRIX MISSION CONTROL — PORTAL V3
   ========================================================================== */
body {
  background-color: #020711 !important;
  background-image:
    radial-gradient(circle at 76% 8%, rgba(45, 212, 255, 0.1), transparent 27rem),
    radial-gradient(circle at 18% 28%, rgba(119, 70, 255, 0.08), transparent 32rem),
    linear-gradient(180deg, #020711 0%, #050b16 45%, #020711 100%) !important;
}

main {
  overflow: clip;
}

.mission-status-rail {
  position: absolute;
  top: 94px;
  left: clamp(28px, 6.5vw, 104px);
  right: clamp(28px, 6.5vw, 104px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 15px;
  border: 1px solid rgba(111, 231, 255, 0.13);
  border-radius: 4px;
  color: rgba(184, 216, 228, 0.56);
  background: linear-gradient(90deg, rgba(5, 19, 32, 0.82), rgba(5, 19, 32, 0.28));
  backdrop-filter: blur(14px);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mission-status-rail::after {
  content: '';
  flex: 1;
  height: 1px;
  order: 3;
  background: linear-gradient(90deg, rgba(53, 242, 255, 0.3), transparent);
}
.mission-status-rail span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.mission-status-rail span:nth-child(2) {
  margin-left: auto;
}
.mission-status-rail span:nth-child(4) {
  order: 4;
  color: #81ffd0;
}
.mission-status-rail b {
  color: #ddfaff;
  font-weight: 700;
}
.mission-status-rail i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--quantum-cyan);
  box-shadow: 0 0 12px var(--quantum-cyan);
}
.mission-status-live i {
  background: var(--quantum-mint);
  box-shadow: 0 0 12px var(--quantum-mint);
  animation: signal-pulse 1.6s ease-in-out infinite;
}

.hero {
  min-height: max(820px, 100svh) !important;
  padding: clamp(180px, 21vh, 220px) clamp(28px, 6.5vw, 104px) 100px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr) !important;
  grid-template-rows: auto auto auto auto auto 1fr !important;
  column-gap: clamp(52px, 7vw, 120px) !important;
  align-content: center !important;
  background:
    linear-gradient(
      90deg,
      rgba(2, 7, 17, 0.95) 0%,
      rgba(2, 7, 17, 0.7) 42%,
      rgba(2, 7, 17, 0.12) 72%
    ),
    repeating-linear-gradient(90deg, transparent 0 89px, rgba(82, 229, 255, 0.025) 90px),
    repeating-linear-gradient(0deg, transparent 0 89px, rgba(82, 229, 255, 0.02) 90px) !important;
}
.hero > :not(.hero-chip):not(.hero-glow):not(.mission-status-rail):not(.scroll-indicator) {
  grid-column: 1;
}
.hero::before {
  top: 168px !important;
  left: 30px !important;
}
.hero::after {
  inset: 14% 2.1% 3% !important;
  border-color: rgba(81, 231, 255, 0.1) !important;
}
.hero-glow {
  width: 42vw !important;
  height: 42vw !important;
  left: auto !important;
  right: 4vw !important;
  top: 51% !important;
  background: radial-gradient(
    circle,
    rgba(31, 215, 255, 0.12),
    rgba(109, 66, 255, 0.05) 40%,
    transparent 70%
  ) !important;
}
.hero-eyebrow {
  justify-self: start;
  margin-bottom: 20px !important;
  letter-spacing: 0.2em !important;
}
.hero-title {
  margin: 0 !important;
  font-size: clamp(62px, 6.7vw, 112px) !important;
  line-height: 0.88 !important;
  letter-spacing: -0.06em !important;
  text-wrap: balance;
}
.hero-title span {
  transform-origin: left center;
}
.hero-title .line1 {
  color: #f2fbff !important;
  -webkit-text-fill-color: initial !important;
  background: none !important;
  font-weight: 250 !important;
}
.hero-title .line2 {
  margin-top: 0.08em;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-text-stroke: 1.5px rgba(185, 242, 255, 0.66) !important;
  font-weight: 700 !important;
}
.hero-title .line3 {
  margin-top: 0.12em;
  background: linear-gradient(100deg, #3fe9ff, #75a7ff 45%, #a78bfa 85%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  font-size: 0.56em !important;
  letter-spacing: -0.025em !important;
}
.hero-desc {
  max-width: 600px !important;
  margin: 30px 0 0 !important;
  padding-left: 18px;
  border-left: 1px solid rgba(69, 234, 255, 0.48);
  color: rgba(217, 235, 242, 0.72) !important;
  font-size: clamp(16px, 1.25vw, 20px) !important;
  line-height: 1.75 !important;
}
.hero-stats {
  margin-top: 30px !important;
  gap: 0 !important;
  width: min(100%, 600px);
  border-block: 1px solid rgba(111, 231, 255, 0.1);
}
.hero-stats .stat-item {
  flex: 1;
  padding: 16px 20px !important;
  border-left: 1px solid rgba(111, 231, 255, 0.1);
}
.hero-stats .stat-item:first-child {
  border-left: 0;
  padding-left: 0 !important;
}
.hero-stats .stat-num {
  font-size: 25px !important;
  letter-spacing: -0.03em;
}
.hero-stats .stat-label {
  font-size: 9px !important;
}
.hero-ctas {
  margin-top: 30px !important;
}
.hero-ctas a {
  min-height: 58px;
  padding-inline: 28px !important;
  border-radius: 4px !important;
  letter-spacing: 0.04em;
}
.hero-quickstart {
  margin-top: 20px !important;
}

.hero-chip {
  grid-column: 2 !important;
  grid-row: 1 / -1 !important;
  position: relative !important;
  inset: auto !important;
  width: min(46vw, 720px) !important;
  height: min(46vw, 720px) !important;
  align-self: center !important;
  justify-self: center !important;
  transform: none !important;
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.45));
}
.hero-chip::before {
  inset: -4% !important;
  border-color: rgba(53, 242, 255, 0.28) !important;
  box-shadow: inset 0 0 42px rgba(53, 242, 255, 0.03);
}
.hero-chip::after {
  inset: 8% !important;
}
.hero-chip-container {
  width: 84% !important;
  height: 84% !important;
  left: 8%;
  top: 8%;
}
.chip-tooltip {
  bottom: 2% !important;
}
.chip-orbit-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.16em;
  color: rgba(153, 235, 255, 0.55);
}
.orbit-label {
  position: absolute;
  padding: 7px 10px;
  border: 1px solid rgba(70, 227, 255, 0.14);
  background: rgba(3, 13, 25, 0.72);
  backdrop-filter: blur(8px);
}
.orbit-label::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, rgba(53, 242, 255, 0.6), transparent);
}
.orbit-label--a {
  top: 11%;
  left: 0;
}
.orbit-label--a::before {
  left: 100%;
}
.orbit-label--b {
  top: 23%;
  right: -1%;
}
.orbit-label--b::before {
  right: 100%;
  transform: rotate(180deg);
}
.orbit-label--c {
  bottom: 15%;
  right: 3%;
}
.orbit-label--c::before {
  right: 100%;
  transform: rotate(180deg);
}
.live-telemetry-hud {
  grid-column: 2 !important;
  position: absolute !important;
  right: 5%;
  bottom: 10%;
  width: min(38vw, 610px) !important;
  z-index: 7;
  transform: translateY(20px);
}

.portal-stage {
  position: relative;
  margin-block: 22px !important;
  border-top: 1px solid rgba(75, 226, 255, 0.08);
}
.portal-stage::before {
  content: var(--stage-index);
  position: absolute;
  top: 30px;
  left: max(20px, calc((100vw - 1440px) / 2));
  z-index: 2;
  color: rgba(118, 231, 255, 0.2);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.18em;
}
.portal-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(800px circle at 12% 0%, rgba(30, 211, 255, 0.035), transparent 60%);
}
.section-header h2,
.section-title,
.process-compare-section h2 {
  letter-spacing: -0.035em !important;
  text-wrap: balance;
}
.portal-command-deck {
  border-radius: 6px !important;
  border-color: rgba(72, 224, 255, 0.12) !important;
}
.command-card {
  border-radius: 3px !important;
}

.portal-orbit-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  z-index: 990;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 8px;
  transform: translateY(-50%);
  border: 1px solid rgba(70, 226, 255, 0.1);
  border-radius: 999px;
  background: rgba(2, 10, 20, 0.58);
  backdrop-filter: blur(12px);
}
.portal-orbit-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: transparent;
  text-decoration: none;
}
.portal-orbit-nav i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(165, 207, 222, 0.34);
  transition: 0.3s ease;
}
.portal-orbit-nav span {
  position: absolute;
  right: 28px;
  padding: 5px 7px;
  opacity: 0;
  pointer-events: none;
  color: #bff8ff;
  background: #061321;
  border: 1px solid rgba(65, 230, 255, 0.16);
  font: 700 8px/1 var(--mono);
  transition: 0.2s ease;
}
.portal-orbit-nav a:hover span,
.portal-orbit-nav a:focus-visible span {
  opacity: 1;
}
.portal-orbit-nav a.active i {
  width: 7px;
  height: 7px;
  background: var(--quantum-cyan);
  box-shadow: 0 0 12px var(--quantum-cyan);
}

@media (max-width: 1100px) {
  .mission-status-rail span:nth-child(2),
  .mission-status-rail span:nth-child(3) {
    display: none;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr) !important;
    column-gap: 28px !important;
  }
  .hero-title {
    font-size: clamp(56px, 7vw, 78px) !important;
  }
  .live-telemetry-hud {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .mission-status-rail {
    top: 82px;
    left: 16px;
    right: 16px;
  }
  .hero {
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
    padding: 150px 22px 72px !important;
  }
  .hero-chip {
    order: 5;
    width: min(92vw, 540px) !important;
    height: min(92vw, 540px) !important;
    margin: 28px auto 0;
  }
  .hero-title {
    font-size: clamp(54px, 16vw, 82px) !important;
  }
  .hero-desc {
    font-size: 16px !important;
  }
  .hero-stats {
    order: 4;
  }
  .hero-ctas {
    order: 6;
  }
  .hero-quickstart {
    order: 7;
  }
  .scroll-indicator,
  .portal-orbit-nav {
    display: none !important;
  }
  .portal-stage::before {
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mission-status-live i {
    animation: none;
  }
  .portal-orbit-nav i,
  .portal-orbit-nav span {
    transition: none;
  }
}

.perf-eco .chip-orbit-labels,
.perf-eco .portal-orbit-nav,
.perf-eco .mission-status-live i {
  animation: none !important;
}

/* ===== TYPOGRAPHY REFINEMENT =====
   Human-readable Thai first; monospace is reserved for system metadata. */
.hero,
.portal-stage,
.portal-command-deck {
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif;
}

.hero-title {
  max-width: 720px;
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif !important;
  font-size: clamp(48px, 4.9vw, 78px) !important;
  font-weight: 600 !important;
  line-height: 1.06 !important;
  letter-spacing: -0.045em !important;
}
.hero-title .line1 {
  font-weight: 300 !important;
  letter-spacing: -0.035em !important;
}
.hero-title .line2 {
  margin-top: 0.1em !important;
  font-weight: 500 !important;
  letter-spacing: -0.045em !important;
}
.hero-title .line3 {
  margin-top: 0.24em !important;
  font-size: 0.48em !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
}

.hero-eyebrow {
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.12em !important;
}

.hero-desc {
  max-width: 560px !important;
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif !important;
  font-size: clamp(15px, 1.05vw, 17px) !important;
  font-weight: 300 !important;
  line-height: 1.85 !important;
  letter-spacing: 0.005em !important;
}

.mission-status-rail,
.chip-orbit-labels,
.telemetry-lbl,
.telemetry-val,
.stat-live-indicator,
.portal-orbit-nav {
  font-family: 'Share Tech Mono', ui-monospace, monospace !important;
}

.mission-status-rail {
  font-size: 9px !important;
  letter-spacing: 0.11em !important;
}
.hero-stats .stat-num {
  font-family: 'Outfit', 'Kanit', sans-serif !important;
  font-size: 23px !important;
  font-weight: 600 !important;
}
.hero-stats .stat-label {
  font-family: 'Kanit', 'Outfit', sans-serif !important;
  font-size: 10px !important;
  font-weight: 300 !important;
  line-height: 1.45 !important;
}
.hero-ctas a {
  font-family: 'Kanit', 'Outfit', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.hero-qs-pill,
.hero-qs-label {
  font-size: 10px !important;
}

.portal-stage .section-title,
.portal-stage .section-header h2,
.portal-stage > h2,
.process-compare-section h2 {
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif !important;
  font-size: clamp(30px, 3.25vw, 48px) !important;
  font-weight: 500 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.028em !important;
}

.portal-stage .section-sub,
.portal-stage .section-header p,
.portal-stage > p {
  font-size: clamp(14px, 1.1vw, 16px) !important;
  font-weight: 300 !important;
  line-height: 1.75 !important;
}

.topic-card h3,
.career-card h3,
.featured-tool-card h3,
.command-card strong {
  font-family: 'Kanit', 'Outfit', system-ui, sans-serif !important;
  font-size: clamp(16px, 1.3vw, 19px) !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.012em !important;
}

.topic-card p,
.career-card p,
.featured-tool-card p,
.command-card small {
  font-size: 13px !important;
  font-weight: 300 !important;
  line-height: 1.65 !important;
}

@media (max-width: 1100px) {
  .hero-title {
    font-size: clamp(46px, 6vw, 64px) !important;
  }
}

@media (max-width: 820px) {
  .hero-title {
    font-size: clamp(42px, 12vw, 58px) !important;
    line-height: 1.08 !important;
  }
  .hero-title .line3 {
    font-size: 0.46em !important;
    line-height: 1.3 !important;
  }
  .hero-desc {
    font-size: 15px !important;
    line-height: 1.8 !important;
  }
  .hero-stats .stat-num {
    font-size: 21px !important;
  }
  .portal-stage .section-title,
  .portal-stage .section-header h2,
  .portal-stage > h2,
  .process-compare-section h2 {
    font-size: clamp(27px, 8vw, 36px) !important;
    line-height: 1.24 !important;
  }
}

@media (max-width: 460px) {
  .mission-status-rail {
    font-size: 8px !important;
  }
  .mission-status-brand {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-title {
    font-size: clamp(38px, 11.5vw, 50px) !important;
  }
  .hero-eyebrow {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }
  .hero-ctas a {
    font-size: 13px !important;
  }
}
