:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-main: 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; }
body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { list-style: none; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Typography */
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: 0; color: var(--color-text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }
.lead { font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.6; margin-bottom: var(--gap); }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(245, 240, 229, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(31,21,35,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 8px 12px; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.nav-actions { display: flex; align-items: center; gap: var(--gap); }

footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
footer .container { display: flex; flex-direction: column; gap: var(--gap); }
footer a { color: var(--color-paper); opacity: 0.8; }
footer a:hover { opacity: 1; color: var(--color-accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; font-weight: 600; font-size: 1rem; cursor: pointer; border: none; transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-1px); background: #d95eb0; }
.btn-primary:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background: rgba(31,21,35,0.05); }
.btn-secondary:focus-visible { outline: 3px solid var(--color-text); outline-offset: 2px; }

/* Sections & Layout */
section { padding: var(--section-y) 0; border-bottom: 1px solid rgba(31,21,35,0.1); }
section:last-child { border-bottom: none; }
.section-header { margin-bottom: calc(var(--gap) * 2); }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 8px; display: block; }
.paper-surface .eyebrow { color: var(--color-brand); }
.dark-surface .eyebrow { color: var(--color-accent); }

.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); }
.card { background: var(--color-paper); border: var(--card-border); box-shadow: var(--card-shadow); padding: var(--gap); }
.card h3 { margin-top: 0; }
.card-body { font-size: 0.95rem; color: rgba(31,21,35,0.85); }

/* Table */
.table-wrap { overflow-x: auto; margin: var(--gap) 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid rgba(31,21,35,0.1); }
th { font-weight: 600; background: rgba(31,21,35,0.03); }
td:first-child { font-weight: 600; width: 40%; }

/* FAQ */
details { border: var(--card-border); margin-bottom: var(--gap); background: var(--color-paper); }
summary { padding: var(--gap); font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 40px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 400; }
details[open] summary::after { content: '−'; }
details .faq-answer { padding: 0 var(--gap) var(--gap); font-size: 0.95rem; color: rgba(31,21,35,0.85); }

/* Steps */
.step-list { counter-reset: step; }
.step-item { counter-increment: step; display: flex; gap: var(--gap); margin-bottom: var(--gap); align-items: flex-start; }
.step-num { flex-shrink: 0; width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.step-content { padding-top: 4px; }

/* SVG Animation */
@keyframes gridPulse {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.svg-node { fill: var(--color-brand); opacity: 0.15; transition: opacity 0.3s, transform 0.3s; }
.svg-node.active { animation: gridPulse 3s ease-in-out infinite; }
.svg-node:nth-child(odd) { animation-delay: 0.4s; }
.svg-node:nth-child(even) { animation-delay: 1.1s; }
.svg-line { stroke: var(--color-brand); stroke-width: 1.5; fill: none; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.svg-line.animate { animation: drawLine 2s ease forwards; }

@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; }
  .svg-node { opacity: 0.6; transform: scale(1); animation: none; }
  .svg-line { stroke-dashoffset: 0; animation: none; }
}

@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 12px; }
  nav { flex-wrap: wrap; justify-content: center; }
  h1 { font-size: 2rem; }
  .hero-layout { flex-direction: column-reverse !important; }
}
