:root {
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #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: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
ul, ol { margin-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* Badges & Highlights */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.hl { color: var(--color-brand); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 768px) {
  .split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
  .split-layout.reverse { direction: rtl; }
  .split-layout.reverse > * { direction: ltr; }
}

/* Dark Surface Overrides */
.dark-surface { background-color: var(--color-dark); color: var(--color-paper); }
.dark-surface h1, .dark-surface h2, .dark-surface h3, .dark-surface p, .dark-surface li, .dark-surface td, .dark-surface th { color: var(--color-paper); }
.dark-surface .badge, .dark-surface a:not(.btn) { color: var(--color-accent); }
.dark-surface .hl { color: var(--color-accent); }
.dark-surface .btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.dark-surface .btn-primary:hover { background-color: #5dd9ab; }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-surface .btn-secondary:hover { background-color: rgba(255,255,255,0.1); }
.dark-surface .btn-primary:focus-visible { outline-color: var(--color-accent); }
.dark-surface .btn-secondary:focus-visible { outline-color: var(--color-paper); }

/* Light Card inside Dark Surface */
.light-card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.light-card h1, .light-card h2, .light-card h3, .light-card p, .light-card li, .light-card td, .light-card th { color: var(--color-text); }
.light-card .badge, .light-card a:not(.btn) { color: var(--color-brand); }
.light-card .hl { color: var(--color-brand); }

/* Buttons */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; border: none; transition: transform 0.2s, background-color 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background-color: var(--color-brand); color: var(--color-paper); }
.btn-primary:hover { background-color: #1036c4; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background-color: rgba(21, 24, 35, 0.05); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }

/* Cards & Panels */
.card {
  background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card);
  padding: var(--gap); transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.panel {
  background-color: var(--color-dark); border-radius: var(--radius-card);
  padding: var(--gap); overflow: hidden; position: relative;
}
.panel.light { background-color: var(--color-paper); border: var(--card-border); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; table-layout: fixed; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(21, 24, 35, 0.1); overflow-wrap: break-word; word-wrap: break-word; }
th { font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 0.5rem; overflow: hidden; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 2.5rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); transition: transform 0.2s; }
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details > div { padding: 0 1rem 1rem; color: var(--color-text); }
.dark-surface details { border-color: rgba(255,255,255,0.2); }
.dark-surface details > div { color: var(--color-paper); }

/* SVG Styles */
.svg-anim { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-anim path, .svg-anim circle, .svg-anim rect { transition: stroke-dashoffset 0.5s ease; }

/* Keyframes */
@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseDot {
  0%, 100% { r: 3; opacity: 1; }
  50% { r: 4.5; opacity: 0.7; }
}
@keyframes flowLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Animation Classes */
.draw-path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 1.5s ease forwards; }
.float-bubble { animation: floatBubble 3s ease-in-out infinite; }
.slide-in { animation: slideIn 0.8s ease forwards; }
.pulse-dot { animation: pulseDot 2s ease-in-out infinite; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowLine 2s linear infinite; }
.breathe { animation: breathe 2.5s ease-in-out infinite; }

/* 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-path, .flow-line { stroke-dashoffset: 0; }
  .float-bubble, .slide-in, .pulse-dot, .breathe { animation: none; }
}

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(21,24,35,0.08);
  padding: 0.75rem 0; backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--color-text); text-decoration: none; }
.logo img { height: 28px; width: auto; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { color: var(--color-text); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--color-brand); }
.nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; }
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
}
.site-footer { background: var(--color-dark); color: var(--color-paper); padding: 3rem 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { color: var(--color-accent); margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-paper); opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.copyright { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; opacity: 0.7; }
