:root {
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --color-border: rgba(25, 21, 35, 0.16);
  --color-border-light: rgba(219, 212, 237, 0.3);
  --radius-card: 0;
  --radius-btn: 0;
  --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;
  --line-height-base: 1.75;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --h3-size: 1.25rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  overflow-x: hidden;
  font-size: 16px;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Typography */
h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
}

h2 {
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 1.25;
  margin-block: 0.8em;
}

h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.3;
  margin-block: 0.6em;
}

p {
  max-width: 38em;
  margin-bottom: 1em;
}

mark, .hl {
  font-weight: 700;
}

.paper-bg .hl { color: var(--color-brand); }
.dark-bg .hl { color: var(--color-accent); }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
}

.paper-bg .badge { color: var(--color-brand); }
.dark-bg .badge { color: var(--color-accent); }

/* Layout */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section {
  padding-block: var(--section-y);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding-inline: 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.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: 1px solid var(--color-text);
  color: var(--color-text);
}

.dark-bg .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(0,0,0,0.05);
}

.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.card {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  padding: 1.5em;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

th {
  font-weight: 600;
  white-space: nowrap;
}

td {
  color: var(--color-text);
}

.dark-bg td, .dark-bg th {
  color: var(--color-paper);
}

dl.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
  gap: 1em;
}

dt {
  font-weight: 600;
  margin-bottom: 0.25em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

dd {
  margin-left: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.step-list {
  counter-reset: step;
  list-style: none;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 3em;
  margin-bottom: 1.5em;
}

.step-list li::before {
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2em;
  height: 2em;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

details {
  border: 1px solid var(--color-border);
  margin-bottom: 0.75em;
  padding: 1em;
  background: var(--color-paper);
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5em;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

details p {
  margin-top: 0.75em;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* Header & Footer */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 1.5em;
  align-items: center;
}

nav a {
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 3em 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75em;
  color: var(--color-paper);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.footer-col a {
  color: var(--color-paper);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-bottom {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

/* SVG & Animations */
svg {
  width: 100%;
  height: auto;
  shape-rendering: geometricPrecision;
}

.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLineAnim 5s ease-in-out infinite alternate;
}

.float-anim {
  animation: floatAnim 6s ease-in-out infinite;
}

.breathe-anim {
  animation: breatheAnim 2.5s ease-in-out infinite;
}

.slide-anim {
  animation: slideInAnim 0.8s ease-out forwards;
}

.pulse-dot {
  animation: pulseDot 1.8s ease-in-out infinite;
}

.rotate-anim {
  animation: rotateAnim 12s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes drawLineAnim {
  0% { stroke-dashoffset: 1; }
  50%, 100% { stroke-dashoffset: 0; }
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breatheAnim {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slideInAnim {
  0% { opacity: 0; transform: translateX(-12px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes pulseDot {
  0%, 100% { r: 3; opacity: 0.5; }
  50% { r: 4.5; opacity: 1; }
}

@keyframes rotateAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
  .draw-line { stroke-dashoffset: 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1em 0; }
  nav { margin-top: 0.75em; flex-wrap: wrap; justify-content: center; }
  .hero-layout { flex-direction: column-reverse; }
  .hero-svg-wrap { width: 100%; max-width: 400px; margin: 0 auto; }
}
