:root {
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --body-line-height: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--body-line-height);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* Typography */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.on-paper .section-label { color: var(--color-brand); }
.on-dark .section-label { color: var(--color-accent); }

.section-number {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
}
.on-paper .section-number { background: var(--color-brand); color: #fff; }

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 32px;
}
h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 16px;
}
p { margin-bottom: 16px; max-width: 38em; }
.hl { font-weight: 600; }
.on-paper .hl { color: var(--color-brand); }
.on-dark .hl { color: var(--color-accent); }

/* Surfaces */
.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-dark { background: var(--color-dark); color: var(--color-paper); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
  border: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.on-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }

/* Cards */
.card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
  background: color-mix(in srgb, var(--color-paper) 92%, var(--color-brand) 8%);
}
.surface-dark .card {
  background: color-mix(in srgb, var(--color-dark) 88%, var(--color-accent) 12%);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--color-paper) 95%, var(--color-brand) 5%);
}
.on-dark .table-wrap {
  background: color-mix(in srgb, var(--color-dark) 90%, var(--color-accent) 10%);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
th { font-weight: 600; }
td:first-child { font-weight: 500; color: var(--color-brand); }
.on-dark th { color: var(--color-paper); }
.on-dark td:first-child { color: var(--color-accent); }

/* FAQ */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--color-paper) 92%, var(--color-brand) 8%);
  margin-bottom: 12px;
}
.on-dark .faq-item {
  background: color-mix(in srgb, var(--color-dark) 88%, var(--color-accent) 12%);
}
summary {
  padding: 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 20px 20px; }

/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-paper) 90%, var(--color-dark) 10%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.on-dark .site-header {
  background: color-mix(in srgb, var(--color-dark) 90%, var(--color-paper) 10%);
  border-bottom-color: color-mix(in srgb, var(--color-accent) 15%, transparent);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; padding: 8px 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.on-dark nav a:hover, .on-dark nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  padding: 48px 0;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; opacity: 0.8; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { font-size: 0.9rem; opacity: 0.85; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.copyright {
  margin-top: 32px;
  font-size: 0.85rem;
  opacity: 0.6;
  text-align: center;
}

/* SVG Sizing & Animation */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 4s ease-in-out infinite alternate;
}
.anim-float {
  animation: float 6s ease-in-out infinite alternate;
}
.anim-breathe {
  animation: breathe 3s ease-in-out infinite alternate;
}
.anim-slide {
  animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}
@keyframes breathe {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* Layout Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-gap { margin-top: var(--gap); }
.mb-gap { margin-bottom: var(--gap); }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-row { flex-direction: column; height: auto; padding: 16px 0; gap: 16px; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
