:root {
  --bg: #071226;
  --bg-soft: #0b1a33;
  --surface: #10284d;
  --surface-2: #123462;
  --primary: #1f7cff;
  --primary-2: #42d5ff;
  --text: #e9f4ff;
  --muted: #a6bfd6;
  --ok: #3ed29f;
  --warn: #ffd76a;
  --border: rgba(160, 205, 255, 0.22);
  --focus: #7be0ff;
  --shadow: rgba(1, 7, 18, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --font-head: "Space Grotesk", "Kanit", sans-serif;
  --font-body: "Sarabun", "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  background:
    radial-gradient(circle at 15% 0%, rgba(31, 124, 255, 0.35), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(66, 213, 255, 0.2), transparent 40%),
    linear-gradient(160deg, #050d1f 0%, #0b1a33 45%, #09172f 100%);
  color: var(--text);
  line-height: 1.7;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(95, 175, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 175, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

body.theme-light {
  --bg: #f2f8ff;
  --bg-soft: #e8f3ff;
  --surface: #ffffff;
  --surface-2: #f5faff;
  --text: #0f2b4e;
  --muted: #3f5f85;
  --border: rgba(20, 80, 145, 0.18);
  --shadow: rgba(18, 43, 78, 0.14);
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 124, 255, 0.18), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(66, 213, 255, 0.14), transparent 42%),
    linear-gradient(150deg, #edf6ff 0%, #f7fbff 55%, #ecf6ff 100%);
}

a {
  color: var(--text);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: min(var(--container), calc(100% - 2.2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  background: var(--primary-2);
  color: #031025;
  z-index: 100;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(66, 213, 255, 0.45));
}

.brand-text {
  font-size: 1.02rem;
}

.brand small {
  color: var(--primary-2);
  display: block;
  font-size: 0.72rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.controls {
  display: flex;
  gap: 0.6rem;
}

.btn-ghost,
.btn-solid,
.btn-link {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 0.52rem 0.92rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover,
.btn-solid:hover,
.btn-link:hover {
  transform: translateY(-1px);
}

.btn-solid {
  background-color: #7be0ff;
  background: linear-gradient(95deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #021223;
  font-weight: 700;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero {
  padding: 4.6rem 0 2.2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.panel {
  background: color-mix(in srgb, var(--surface) 90%, var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 38px var(--shadow);
  padding: 1.2rem;
  animation: panelEnter 0.55s ease both;
}

.eyebrow {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  color: var(--primary-2);
  letter-spacing: 0.03em;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0.85rem 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

p {
  margin: 0.3rem 0 0.8rem;
  color: var(--muted);
  line-height: 1.72;
}

.section-intro {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  max-width: 72ch;
}

.stat-grid,
.card-grid,
.kpi-grid,
.flow-grid,
.benefit-grid {
  display: grid;
  gap: 0.8rem;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.kpi-grid,
.flow-grid,
.benefit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat,
.kpi,
.flow,
.benefit,
.module-card,
.trust-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: color-mix(in srgb, var(--surface) 56%, transparent);
}

.stat strong,
.kpi strong {
  display: block;
  font-size: 1.32rem;
  color: var(--text);
  font-family: var(--font-head);
}

.section {
  padding: 1.35rem 0 2.55rem;
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 6px;
  border-left: 3px solid var(--primary-2);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  padding: 0.9rem 0.9rem 0.9rem 1rem;
  scroll-margin-top: 96px;
  background:
    linear-gradient(90deg, rgba(22, 64, 118, 0.85), rgba(15, 41, 81, 0.45)),
    repeating-linear-gradient(0deg, rgba(114, 191, 255, 0.06), rgba(114, 191, 255, 0.06) 1px, transparent 1px, transparent 24px);
  transform: translateY(12px);
  opacity: 0;
  animation: revealUp 0.52s ease forwards;
}

.module-card .btn-link {
  width: fit-content;
  border-color: rgba(123, 224, 255, 0.45);
}

.module-card:nth-child(2) { animation-delay: 0.08s; }
.module-card:nth-child(3) { animation-delay: 0.16s; }
.module-card:nth-child(4) { animation-delay: 0.24s; }
.module-card:nth-child(5) { animation-delay: 0.32s; }
.module-card:nth-child(6) { animation-delay: 0.4s; }
.module-card:nth-child(7) { animation-delay: 0.48s; }
.module-card:nth-child(8) { animation-delay: 0.56s; }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.system-mesh,
.system-viz {
  margin-top: 0.25rem;
}

.viz-switch {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0.1rem 0 0.65rem;
}

.viz-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.viz-btn.is-active {
  color: var(--text);
  border-color: rgba(123, 224, 255, 0.6);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.system-viz[data-viz-mode="mesh"] .orbit-svg {
  display: none;
}

.system-viz[data-viz-mode="orbit"] .mesh-svg {
  display: none;
}

.mesh-svg {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
}

.mesh-orbit {
  fill: none;
  stroke: rgba(66, 213, 255, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 4 6;
}

.mesh-core-glow {
  fill: url(#coreGlow);
}

.mesh-link {
  stroke: rgba(121, 214, 255, 0.52);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 6 7;
  animation: meshFlow 3.2s linear infinite;
}

.mesh-runner {
  fill: #9ee9ff;
  filter: drop-shadow(0 0 6px rgba(158, 233, 255, 0.95));
}

.mesh-core {
  fill: #0b2b4a;
  stroke: #89e6ff;
  stroke-width: 2;
}

.mesh-core-text {
  fill: #d9f7ff;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mesh-node {
  cursor: pointer;
}

.mesh-node-dot {
  fill: color-mix(in srgb, var(--surface) 84%, #1d79dc 16%);
  stroke: rgba(150, 229, 255, 0.85);
  stroke-width: 1.4;
  animation: nodePulse 2.8s ease-in-out infinite;
}

.mesh-node:hover .mesh-node-dot,
.mesh-node:focus .mesh-node-dot,
.mesh-node.is-active .mesh-node-dot {
  fill: color-mix(in srgb, var(--surface) 76%, #3aa8ff 24%);
  stroke: #9deeff;
}

.mesh-label {
  fill: #dff8ff;
  font-family: var(--font-head);
  font-size: 8.6px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mesh-legend {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mesh-chip {
  font: inherit;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.16rem 0.46rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  background: transparent;
  cursor: pointer;
}

.mesh-chip:hover,
.mesh-chip:focus-visible,
.mesh-chip.is-active {
  color: var(--text);
  border-color: rgba(123, 224, 255, 0.68);
}

body.theme-light .mesh-node-dot {
  fill: rgba(236, 247, 255, 0.97);
  stroke: #2a8ae8;
}

body.theme-light .mesh-core {
  fill: #e7f4ff;
  stroke: #1c78dc;
}

body.theme-light .mesh-core-text,
body.theme-light .mesh-label {
  fill: #0f2b4e;
}

body.theme-light .mesh-link {
  stroke: rgba(30, 114, 198, 0.52);
}

.mesh-orbit-alt {
  opacity: 0.65;
  stroke-dasharray: 8 9;
}

.orbit-links .mesh-link {
  stroke-width: 1.3;
}

.module-card.module-focus {
  opacity: 1;
  transform: none;
  animation: focusPulse 1.4s ease;
  border-left-color: rgba(62, 210, 159, 0.72);
  box-shadow: 0 0 0 1px rgba(62, 210, 159, 0.16), 0 8px 22px rgba(1, 7, 18, 0.16);
  background:
    linear-gradient(90deg, rgba(20, 52, 92, 0.78), rgba(10, 28, 51, 0.42)),
    repeating-linear-gradient(0deg, rgba(114, 191, 255, 0.05), rgba(114, 191, 255, 0.05) 1px, transparent 1px, transparent 24px);
}

.narrative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.narrative-card {
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(90deg, rgba(19, 51, 92, 0.82), rgba(10, 27, 50, 0.45));
}

body.theme-light .narrative-card {
  background: linear-gradient(90deg, rgba(212, 236, 255, 0.92), rgba(236, 246, 255, 0.9));
  border-left-color: #1972d6;
}

body.theme-light .module-card {
  background:
    linear-gradient(90deg, rgba(221, 240, 255, 0.95), rgba(241, 248, 255, 0.92)),
    repeating-linear-gradient(0deg, rgba(70, 150, 225, 0.12), rgba(70, 150, 225, 0.12) 1px, transparent 1px, transparent 20px);
  border-left-color: #1d78de;
}

body.theme-light .flow,
body.theme-light .kpi,
body.theme-light .benefit {
  background: linear-gradient(90deg, rgba(226, 242, 255, 0.95), rgba(243, 250, 255, 0.92));
  border-left-color: #2a8ae8;
}

.narrative-card h3 {
  font-size: 1.03rem;
}

.cta-band {
  margin: 1rem 0 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(31, 124, 255, 0.22), rgba(62, 210, 159, 0.13));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(123, 224, 255, 0.24);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(1, 7, 18, 0.24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 60;
}

.back-to-top svg {
  width: 1rem;
  height: 1rem;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: rgba(123, 224, 255, 0.55);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

body.theme-light .back-to-top {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 10px 20px rgba(18, 43, 78, 0.12);
}

.flow,
.kpi,
.benefit {
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 2px solid var(--primary-2);
  background: linear-gradient(90deg, rgba(21, 49, 86, 0.72), rgba(11, 32, 59, 0.3));
  position: relative;
  padding-left: 1.15rem;
}

.flow::before,
.kpi::before,
.benefit::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-2);
  position: absolute;
  left: -4px;
  top: 1rem;
  box-shadow: 0 0 0 4px rgba(66, 213, 255, 0.16);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.8rem;
  color: var(--muted);
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--primary-2);
  font-size: 0.75rem;
}

@keyframes revealUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes meshFlow {
  to {
    stroke-dashoffset: -26;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(62, 210, 159, 0.26), 0 8px 22px rgba(1, 7, 18, 0.16);
  }

  100% {
    box-shadow: 0 0 0 10px rgba(62, 210, 159, 0), 0 8px 22px rgba(1, 7, 18, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .module-card {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .card-grid,
  .trust-grid,
  .narrative-grid,
  .kpi-grid,
  .flow-grid,
  .benefit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.4rem;
  }

  .hero-grid,
  .card-grid,
  .trust-grid,
  .narrative-grid,
  .kpi-grid,
  .flow-grid,
  .benefit-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }
}
