:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-border: rgba(25, 21, 35, 0.12);
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --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);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-paper);
  -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);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section + .section { border-top: 1px solid var(--color-border); }
.section.dark { background: var(--color-dark); color: var(--color-paper); }
.section.dark .hl { color: var(--color-accent); }
.section.paper { background: var(--color-paper); color: var(--color-text); }
.section.paper .hl { color: var(--color-brand); }

/* Typography */
.marker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.section.paper .marker { color: var(--color-brand); }
.section.dark .marker { color: var(--color-accent); }

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 700; }
.section.paper .hl { color: var(--color-brand); }
.section.dark .hl { color: var(--color-accent); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.section.dark .site-header { background: rgba(33, 22, 60, 0.9); border-color: rgba(244, 243, 247, 0.15); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 28px; height: 28px; object-fit: contain; }
nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { font-weight: 500; font-size: 0.95rem; padding: 0.25rem 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.section.dark nav a:hover, .section.dark nav a[aria-current="page"] { color: var(--color-accent); }
nav a[aria-current="page"]::after {
  content: ""; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { background: #d9835f; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.section.dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.section.dark .btn-secondary:hover { background: rgba(244, 243, 247, 0.1); }

/* Cards & Panels */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  border: var(--card-border);
  transition: box-shadow 0.2s ease;
}
.section.dark .card { background: #2b1f52; color: var(--color-paper); }
.card:hover { box-shadow: 0 12px 32px -12px rgba(25, 21, 35, 0.4); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  overflow: hidden;
}
.section.paper .panel { background: var(--color-dark); }

/* Grid & Flex 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; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--color-border); }
.timeline-item { position: relative; margin-bottom: 2rem; padding-left: 1rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -2.55rem; top: 0.25rem; width: 12px; height: 12px;
  background: var(--color-brand); border-radius: 50%; border: 2px solid var(--color-paper);
}
.section.dark .timeline-item::before { background: var(--color-accent); border-color: var(--color-dark); }
.time-tag { font-size: 0.85rem; font-weight: 700; color: var(--color-brand); margin-bottom: 0.25rem; display: block; }
.section.dark .time-tag { color: var(--color-accent); }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.step-card { text-align: center; padding: 1.5rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 800; border-radius: 10px; margin-bottom: 0.75rem;
}

/* Table */
.data-table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table thead, .data-table tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.data-table tr {
  display: table-row;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  word-break: break-all;
}
.data-table th {
  font-weight: 700;
  width: 40%;
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item summary {
  padding: 1rem; background: rgba(25, 21, 35, 0.04); border-radius: var(--radius-btn);
  cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 1rem; margin: 0; font-size: 0.95rem; line-height: 1.7; }

/* SVG Animation Base */
.svg-wrap { width: 100%; height: auto; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.anim-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 6s linear infinite;
}
.anim-float {
  animation: floatY 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-bubble {
  opacity: 0.8;
  animation: bubblePop 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: -1; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bubblePop { 0%, 100% { opacity: 0.6; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 768px) {
  .flex-row { flex-direction: column; }
  .steps-grid { grid-template-columns: 1fr; }
}
