:root {
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  --color-text-on-dark: #FCFCFD;
  --color-accent-on-dark: #6EEDBD;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(21, 24, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 252, 253, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 24, 35, 0.06);
  padding: 16px 0;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 32px; width: auto; vertical-align: middle; display: block; }
.logo span { margin-left: 10px; font-weight: 700; font-size: 1.1rem; color: var(--color-text); vertical-align: middle; }
nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
nav a { text-decoration: none; color: var(--color-text); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
nav a[aria-current="page"] { font-weight: 700; border-bottom: 2px solid var(--color-brand); }
.header-cta { display: inline-flex; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent); color: var(--color-dark); border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent; color: var(--color-text); border: 1px solid var(--color-text);
}
.btn-secondary:hover { background: rgba(21, 24, 35, 0.05); }
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* Sections & Backgrounds */
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.bg-dark { background-color: var(--color-dark); color: var(--color-text-on-dark); }
.bg-dark h2, .bg-dark h3, .bg-dark p, .bg-dark li { color: var(--color-text-on-dark); }
.bg-dark .hl { color: var(--color-accent-on-dark); }
.bg-dark .tag { color: var(--color-accent-on-dark); }
.paper-card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.paper-card h3, .paper-card p, .paper-card li { color: var(--color-text); }

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; margin-top: 0; margin-bottom: 16px; font-weight: 700; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); text-wrap: balance; }
/* Prevent inline elements like <time> from causing horizontal overflow */
time { word-break: break-all; overflow-wrap: anywhere; white-space: normal; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 48px; }
h3 { font-size: 1.25rem; margin-top: 24px; }
p { margin-bottom: 16px; max-width: 38em; }
.lead { font-size: 1.125rem; color: #4a5568; margin-bottom: 24px; }
.tag {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 8px; color: var(--color-brand);
}
.hl { color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent-on-dark); }

/* Layout Utilities */
.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; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.text-center { text-align: center; }
.hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .hero-layout { grid-template-columns: 1fr; } .hero-layout > *:first-child { order: -1; } }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.95rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
th, td { padding: 12px 16px; border-bottom: 1px solid rgba(21, 24, 35, 0.1); text-align: left; white-space: nowrap; }
th { font-weight: 600; background: rgba(21, 24, 35, 0.03); }
tr:last-child td { border-bottom: none; }
.bg-dark table th, .bg-dark table td { border-bottom-color: rgba(252, 252, 253, 0.1); background: transparent; color: var(--color-text-on-dark); }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 12px; padding: 16px; background: var(--color-paper); }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 24px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-weight: 400; }
details[open] summary::after { content: "-"; }
details p { margin-top: 12px; margin-bottom: 0; }

/* Footer */
footer { background: var(--color-dark); color: var(--color-text-on-dark); padding: 48px 0 24px; margin-top: var(--section-y); }
footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
footer nav ul { flex-direction: column; gap: 12px; }
footer a { color: var(--color-accent-on-dark); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-copy { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(252, 252, 253, 0.1); text-align: center; font-size: 0.85rem; opacity: 0.8; }

/* SVG Animation System */
svg { width: 100%; height: auto; max-width: 100%; display: block; }
.anim-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.anim-draw { animation: drawLine 4s ease-in-out infinite alternate; }

@keyframes floatNode { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.node { animation: floatNode 5s ease-in-out infinite; }
.node:nth-child(odd) { animation-delay: 0.6s; }
.node:nth-child(even) { animation-delay: 1.4s; }

@keyframes pulseDot { 0%, 100% { r: 3; opacity: 0.6; } 50% { r: 5; opacity: 1; } }
.dot-pulse { animation: pulseDot 2.5s ease-in-out infinite; }

@keyframes dashFlow { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
.flow-line { stroke-dasharray: 3 5; animation: dashFlow 1.2s linear infinite; }

@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; }
}
