:root {
  --bg-dark: #17203F;
  --bg-paper: #FCFCFD;
  --text-main: #151823;
  --brand: #1441EB;
  --accent: #6EEDBD;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Typography */
.marker {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.dark-section .marker {
  color: var(--accent);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.hl {
  color: var(--brand);
}

.dark-section .hl {
  color: var(--accent);
}

p {
  max-width: 38em;
  margin-bottom: 1rem;
}

/* Layout */
section {
  padding-block: var(--section-y);
}

.dark-section {
  background: var(--bg-dark);
  color: var(--bg-paper);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: center;
}

@media (max-width: 768px) {
  .flex-row { flex-direction: column; }
  .flex-row.reverse { flex-direction: column-reverse; }
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(110, 237, 189, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-main);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(21, 24, 35, 0.05);
  transform: translateY(-2px);
}

.dark-section .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

.dark-section .btn-secondary:hover {
  background: rgba(252, 252, 253, 0.08);
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.card {
  background: var(--bg-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 12px 32px -12px rgba(21, 24, 35, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.dark-section .badge {
  background: var(--accent);
  color: var(--bg-dark);
}

.step-list {
  list-style: none;
  counter-reset: step-counter;
}

.step-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  counter-increment: step-counter;
}

.step-list li::before {
  content: counter(step-counter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

th {
  font-weight: 600;
  width: 35%;
}

td {
  vertical-align: top;
}

.alert-box {
  background: rgba(20, 65, 235, 0.06);
  border-left: 4px solid var(--brand);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin: 1.5rem 0;
}

.dark-section .alert-box {
  background: rgba(110, 237, 189, 0.08);
  border-left-color: var(--accent);
}

/* Header & Footer */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-paper);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img {
  height: 32px;
  width: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--brand);
}

nav a[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding: 3rem 0;
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-grid a {
  color: var(--accent);
  text-decoration: none;
}

.footer-grid a:hover {
  text-decoration: underline;
}

.footer-meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* SVG Panel & Animation Classes */
.svg-panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.hero .svg-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-section .svg-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Keyframes & Animation States */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slide-up {
  0% { transform: translateY(24px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes node-light {
  0%, 100% { stroke-opacity: 0.2; stroke-width: 1.5; }
  50% { stroke-opacity: 1; stroke-width: 2.5; fill: var(--accent); }
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 5s ease forwards;
}

.breathe {
  animation: breathe 3.5s ease-in-out infinite;
}

.slide-up {
  animation: slide-up 1.2s ease forwards;
}

.node-light {
  animation: node-light 6s ease-in-out infinite;
}

.float-gentle {
  animation: float-gentle 4s ease-in-out infinite;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .draw, .breathe, .slide-up, .node-light, .float-gentle {
    animation: none !important;
  }
}
