:root {
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-body: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --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);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* Typography */
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: var(--gap);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--color-brand); }
.section-divider { border: none; border-top: 1px solid rgba(21, 21, 35, 0.12); margin: var(--section-y) 0; }

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.nav-cta { margin-left: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-body);
  color: var(--color-body);
}
.dark-surface .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* Sections & Panels */
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section.dark { background: var(--color-dark); color: var(--color-paper); }
.section.dark .hl { color: var(--color-accent); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  color: var(--color-paper);
}
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(21, 21, 35, 0.35); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 16px 0; }
  nav { flex-wrap: wrap; justify-content: center; }
}

/* Definition List */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.dl-item dt { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.dl-item dd { color: rgba(21, 21, 35, 0.85); margin-bottom: 12px; }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; min-width: 320px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(21, 21, 35, 0.1); }
th { font-weight: 600; background: rgba(21, 21, 35, 0.03); }

/* FAQ */
details { margin-bottom: 16px; border-bottom: 1px solid rgba(21, 21, 35, 0.1); padding-bottom: 16px; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
summary::marker { content: ''; }
summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 12px; }
details p { margin-top: 8px; color: rgba(21, 21, 35, 0.85); }

/* News Cards */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-card time { font-size: 0.85rem; color: rgba(21, 21, 35, 0.6); margin-bottom: 8px; display: block; }
.news-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.news-card p { font-size: 0.95rem; color: rgba(21, 21, 35, 0.85); flex-grow: 1; }

/* Step Badges */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  margin-right: 8px;
}

/* SVG Animation Setup */
.svg-container svg { width: 100%; height: auto; display: block; }
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease forwards;
}
.flow-line {
  stroke-dasharray: 12 12;
  animation: dash-flow 2s linear infinite;
}
.breathe { animation: breathe 4s ease-in-out infinite; }
.float {
  animation: float 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dash-flow { to { stroke-dashoffset: -24; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Footer */
footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: flex-start;
}
.footer-col h4 { font-weight: 600; margin-bottom: 16px; color: var(--color-accent); }
.footer-col a { display: block; margin-bottom: 8px; opacity: 0.85; }
.footer-col a:hover { opacity: 1; }
.copyright { margin-top: 48px; text-align: center; font-size: 0.9rem; opacity: 0.6; }
