:root {
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --line-height-body: 1.75;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-dark); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; margin-top: 0; margin-bottom: 0.5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 0; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { max-width: 38em; margin-bottom: 1em; }
.hl { color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent); }
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 6px;
}
.bg-paper .badge { color: var(--color-brand); background: rgba(158, 19, 221, 0.08); }
.bg-dark .badge { color: var(--color-accent); background: rgba(110, 237, 168, 0.12); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.grid-magazine { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-magazine { grid-template-columns: 2fr 1fr; }
}
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Header / Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(246, 243, 247, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--card-border); }
.bg-dark header { background: rgba(45, 20, 56, 0.95); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--gap); }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; color: var(--color-body); }
.bg-dark .logo { color: var(--color-paper); }
.logo img { width: 28px; height: 28px; }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 600; }
.bg-dark nav a { color: var(--color-paper); }
.bg-dark nav a[aria-current="page"] { color: var(--color-accent); }
.mobile-menu-btn { display: none; background: none; border: none; color: inherit; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 767px) {
  nav { display: none; }
  .mobile-menu-btn { display: block; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-btn); font-weight: 600;
  cursor: pointer; transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  text-decoration: none; border: none; font-size: 1rem; line-height: 1;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { background: #5de098; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(110, 237, 168, 0.3); }
.btn-secondary { background: transparent; border: 1px solid var(--color-body); color: var(--color-body); }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.05); transform: translateY(-2px); }

/* Cards & Panels */
.card {
  background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card);
  padding: 1.5rem; box-shadow: var(--card-shadow); transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.panel {
  background: var(--color-dark); border-radius: var(--radius-card); padding: 1.5rem;
  position: relative; overflow: hidden;
}
.bg-dark .panel { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.bg-dark .card { background: var(--color-paper); color: var(--color-body); border-color: rgba(31, 21, 35, 0.16); }

/* Table */
table { width: 100%; min-width: 0; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--card-border); word-break: break-word; }
th { font-weight: 600; background: rgba(0,0,0,0.02); }
td:first-child { font-weight: 500; width: 40%; }

/* FAQ */
details { margin-bottom: 1rem; border: var(--card-border); border-radius: var(--radius-card); padding: 1rem; background: var(--color-paper); }
summary { 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; font-weight: 400; }
details[open] summary::after { content: '−'; }
details[open] summary { margin-bottom: 0.5rem; color: var(--color-brand); }
.bg-dark details { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.bg-dark details[open] summary { color: var(--color-accent); }

/* Timeline & Steps */
.timeline { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--color-brand); margin: 2rem 0; }
.bg-dark .timeline { border-left-color: var(--color-accent); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.75rem; top: 0.3rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--color-brand);
  border: 2px solid var(--color-paper);
}
.bg-dark .timeline-item::before { background: var(--color-accent); border-color: var(--color-dark); }
.step-grid { display: grid; gap: 1.5rem; counter-reset: step; }
.step-card { counter-increment: step; position: relative; padding-top: 2.5rem; }
.step-card::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
@media (min-width: 768px) { .step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* SVG Animation Utilities */
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-delayed { animation: float 6s ease-in-out infinite 2s; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 4s ease forwards; }
.anim-draw-loop { animation: draw 8s ease-in-out infinite alternate; }
.svg-group { transform-box: fill-box; transform-origin: center; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #1f1523 !important;
    -webkit-text-fill-color: #1f1523 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #1f1523 !important;
    -webkit-text-fill-color: #1f1523 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #1f1523 !important;
    -webkit-text-fill-color: #1f1523 !important;
  }
}
