:root {
  --bg-dark: #19102D;
  --bg-paper: #F4F3F7;
  --bg-paper-alt: #EAE8EF;
  --bg-dark-card: rgba(255, 255, 255, 0.06);
  --text-body: #191523;
  --text-on-dark: #F4F3F7;
  --brand: #5214EB;
  --accent: #D66EED;
  --content-max: 1120px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  background-color: var(--bg-paper);
  text-rendering: optimizeLegibility;
}

img, svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

section.dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

section.light {
  background-color: var(--bg-paper);
  color: var(--text-body);
}

section.dark .card-paper {
  background-color: var(--bg-paper);
  color: var(--text-body);
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 0.6em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4em;
}

p {
  max-width: 38em;
  margin-bottom: 1em;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--brand);
}

section.dark .eyebrow {
  color: var(--accent);
}

.hl {
  color: var(--brand);
}

section.dark .hl {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-body);
  color: var(--text-body);
}

section.dark .btn-secondary {
  border-color: var(--text-on-dark);
  color: var(--text-on-dark);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Cards */
.card {
  background-color: var(--bg-paper-alt);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
  min-width: 0;
}

.card-paper {
  background-color: var(--bg-paper);
  border: 1px solid #dcdce0;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-paper);
  border-bottom: 1px solid #dcdce0;
  padding: 16px 0;
}

section.dark .site-header {
  background-color: var(--bg-dark);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  height: 32px;
  width: auto;
  margin-right: 10px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav a {
  text-decoration: none;
  color: var(--text-body);
  font-weight: 500;
  transition: color 0.2s;
}

section.dark nav a {
  color: var(--text-on-dark);
}

nav a:hover {
  color: var(--brand);
}

section.dark nav a:hover {
  color: var(--accent);
}

nav a[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

section.dark nav a[aria-current="page"] {
  color: var(--accent);
}

/* Footer */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 64px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-on-dark);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--accent);
}

.copyright {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table */
.data-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}
.data-table thead,
.data-table tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #dcdce0;
}

.data-table th {
  font-weight: 600;
  background-color: var(--bg-paper-alt);
}

section.dark .data-table th,
section.dark .data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  background-color: transparent;
}

/* FAQ */
.faq-item {
  margin-bottom: 1.5em;
  border-bottom: 1px solid #dcdce0;
  padding-bottom: 1.5em;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.faq-item[open] summary::before {
  transform: rotate(45deg);
}

section.dark .faq-item {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

section.dark .faq-item summary::before {
  border-color: var(--accent);
}

/* Layout Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.step-bar {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.step-item {
  flex: 1;
  min-width: 200px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  margin-right: 12px;
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.tag-problem { background-color: rgba(214, 110, 237, 0.15); color: var(--accent); }
.tag-action { background-color: rgba(82, 20, 235, 0.1); color: var(--brand); }
.tag-result { background-color: rgba(20, 140, 80, 0.1); color: #148C50; }
section.dark .tag-problem { background-color: rgba(214, 110, 237, 0.2); color: var(--accent); }
section.dark .tag-action { background-color: rgba(82, 20, 235, 0.2); color: #8B5CF6; }
section.dark .tag-result { background-color: rgba(20, 140, 80, 0.2); color: #34D399; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card {
  background-color: var(--bg-paper-alt);
  padding: var(--gap);
}

.news-date {
  font-size: 0.8rem;
  color: var(--brand);
  margin-bottom: 8px;
  display: block;
}

section.dark .news-date {
  color: var(--accent);
}

/* SVG Animation Classes */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes breatheOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes flowDash {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.anim-float-1 { animation: floatY 6s ease-in-out infinite; }
.anim-float-2 { animation: floatY 7s ease-in-out infinite 1.2s; }
.anim-float-3 { animation: floatY 5.5s ease-in-out infinite 0.6s; }
.anim-breathe { animation: breatheOpacity 3s ease-in-out infinite; }
.anim-slide { animation: slideInRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 2s ease forwards;
}

.svg-transform-box {
  transform-box: fill-box;
  transform-origin: center;
}

/* Accessibility & Reduced Motion */
@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;
  }
  .anim-float-1, .anim-float-2, .anim-float-3, .anim-breathe, .anim-slide, .anim-draw {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .step-bar { flex-direction: column; }
  .step-item { min-width: unset; }
  .news-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
