:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-white: #FFFFFF;
  --color-light-gray: #E8E5E1;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 0; list-style: none; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.dark-section { background: var(--color-dark); color: var(--color-paper); }
.dark-section .hl { color: var(--color-accent); }
.dark-section a:not(.btn) { color: var(--color-accent); }

h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: 0; margin: 0 0 var(--gap); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin: 0 0 var(--gap); }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; opacity: 0.9; max-width: 65ch; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5rem; }
.paper-badge { color: var(--color-brand); }
.dark-badge { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-btn); font-weight: 600; cursor: pointer; transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  border: 2px solid transparent; min-height: 48px; font-size: 1rem;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(200, 237, 110, 0.4); }
.btn-secondary { background: transparent; border-color: var(--color-text); color: var(--color-text); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.dark-section .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.card {
  background: var(--color-white); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: 1.5rem; transition: transform 0.2s, box-shadow 0.2s;
  border: var(--card-border);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(0, 1fr), 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(0, 1fr), 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--color-light-gray); }
th { font-weight: 600; }
.dark-section th, .dark-section td { border-color: rgba(247, 245, 243, 0.2); }

details { margin-bottom: var(--gap); border: 1px solid var(--color-light-gray); border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 1rem; 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; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 1rem 1rem; line-height: 1.6; }
.dark-section details { border-color: rgba(247, 245, 243, 0.2); }
.dark-section summary { color: var(--color-paper); }

header { position: sticky; top: 0; z-index: 100; background: rgba(247, 245, 243, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-light-gray); }
.dark-section header { background: rgba(20, 14, 37, 0.95); border-color: rgba(247, 245, 243, 0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.25rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; }
nav a { font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.dark-section nav a:hover, .dark-section nav a[aria-current="page"] { color: var(--color-accent); }

footer { background: var(--color-dark); color: var(--color-paper); padding: 3rem 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { color: var(--color-accent); margin-bottom: 1rem; }
.footer-col a { display: block; margin-bottom: 0.5rem; opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }

/* SVG Animations */
@keyframes lightUp {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-node { animation: lightUp 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.6s ease-out forwards; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 1.2s ease-out forwards; }
@keyframes flowDash {
  to { stroke-dashoffset: -10; }
}
.anim-flow { stroke-dasharray: 10; animation: flowDash 1.5s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
