:root {
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-bg-card-light: #FDFDFD;
  --color-bg-card-dark: #1A0E2A;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --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;
  --lh-base: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--lh-base);
  -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; }
table { table-layout: fixed; width: 100%; }
td, th { overflow-wrap: anywhere; word-break: break-all; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); }
.section--dark { background-color: var(--color-dark); color: var(--color-paper); }
.section--paper { background-color: var(--color-paper); color: var(--color-text); }

/* Typography */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; letter-spacing: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) * 0.5); }
p { margin-bottom: 1em; max-width: 38em; }
.lead { font-size: 1.125rem; opacity: 0.9; margin-bottom: calc(var(--gap) * 2); }
.hl { color: var(--color-brand); }
.section--dark .hl { color: var(--color-accent); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; margin-bottom: 0.75em;
}
.badge::before { content: ""; width: 24px; height: 2px; background: currentColor; border-radius: 2px; }
.section--paper .badge { color: var(--color-brand); }
.section--dark .badge { color: var(--color-accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.75em 1.5em; border-radius: var(--radius-btn); font-weight: 600;
  cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease;
  height: 52px; font-size: 1rem; border: none; white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn--primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn--primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn--secondary { background: transparent; border: 2px solid currentColor; color: inherit; }
.section--paper .btn--secondary { border-color: var(--color-text); color: var(--color-text); }
.section--dark .btn--secondary { border-color: var(--color-paper); color: var(--color-paper); }

/* Cards & Panels */
.card {
  background: var(--color-bg-card-light);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.section--dark .card { background: var(--color-bg-card-dark); color: var(--color-paper); }

/* Grid & Flex */
.grid-2 { 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; }
.content-narrow { max-width: 680px; }

/* Table */
table { width: 100%; border-collapse: collapse; margin-block: var(--gap); }
th, td { padding: 1em; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 600; }
.section--dark th, .section--dark td { border-color: rgba(255,255,255,0.15); }

/* FAQ */
details { margin-bottom: 1em; border-radius: var(--radius-card); overflow: hidden; }
summary {
  padding: 1.25em; cursor: pointer; font-weight: 600; list-style: none;
  background: var(--color-bg-card-light); position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 1.5em; top: 50%; transform: translateY(-50%); font-size: 1.2em; }
details[open] summary::after { content: "-"; }
.section--dark summary { background: var(--color-bg-card-dark); color: var(--color-paper); }
details p { padding: 0 1.25em 1.25em; line-height: var(--lh-base); }

/* Step Badge */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background-color: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.9rem; margin-bottom: 0.75em;
}

/* Header & Nav */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(233, 232, 234, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.1);
}
.section--dark header { background: rgba(35, 19, 52, 0.95); border-bottom-color: rgba(255,255,255,0.1); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.logo { display: flex; align-items: center; gap: 0.75em; font-weight: 700; font-size: 1.25rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 2em; }
nav a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
nav a:hover, nav a[aria-current="page"] { opacity: 1; }
nav a[aria-current="page"] { font-weight: 700; }

/* SVG Animation Base */
.svg-panel { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.anim-float { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-delay { animation: float 6s ease-in-out infinite 1.5s; transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawDash 4s linear infinite; }
.anim-pulse { animation: pulseOpacity 3s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes drawDash {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes pulseOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-float, .anim-float-delay, .anim-draw, .anim-pulse { animation: none !important; }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-container { flex-wrap: wrap; height: auto; padding: 1em 0; }
  nav ul { order: 3; width: 100%; margin-top: 1em; justify-content: center; }
  .hero-layout { flex-direction: column; }
}
