:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-accent-text: #140E25;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --line-height-body: 1.55;

  --font-weight-title: 500;
  --font-weight-h1: 500;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding: 12px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 24px; }
nav a { font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--color-accent); color: var(--color-accent-text);
  padding: 0 20px; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn-primary:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn-primary svg { width: 20px; height: 20px; }

.site-footer {
  background: var(--color-dark); color: var(--color-paper);
  padding: 48px 0; margin-top: 64px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer-col h3 { font-size: 1rem; margin-bottom: 16px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { opacity: 0.85; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.copyright { text-align: center; margin-top: 40px; font-size: 0.85rem; opacity: 0.7; }

/* Typography */
.section-label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 12px; text-transform: uppercase;
}
.paper-face .section-label { color: var(--color-brand); }
.dark-face .section-label { color: var(--color-accent); }

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: var(--font-weight-h1);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--font-weight-title);
  line-height: 1.25;
  margin-bottom: 24px;
}
h3 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-title);
  line-height: 1.3;
  margin-bottom: 12px;
}
p { margin-bottom: 16px; max-width: 38em; }
.hl { font-weight: 600; }
.paper-face .hl { color: var(--color-brand); }
.dark-face .hl { color: var(--color-accent); }

/* Layout Sections */
.section { padding: var(--section-y) 0; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
.dark-face { background: var(--color-dark); color: var(--color-paper); }
.dark-face p, .dark-face li { color: var(--color-paper); }
.dark-face .hl { color: var(--color-accent); }
.paper-face { background: var(--color-paper); color: var(--color-text); }
.paper-face .hl { color: var(--color-brand); }

.checker-wrapper { display: flex; flex-direction: column; gap: var(--section-y); }
.checker-row { display: flex; align-items: center; gap: var(--gap); }
.checker-row:nth-child(even) { flex-direction: row-reverse; }
.text-col { flex: 1; min-width: 0; }
.visual-col { flex: 1; min-width: 0; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.card {
  background: #fff; border: var(--card-border); border-radius: var(--radius-card);
  padding: 24px; box-shadow: var(--card-shadow);
}
.paper-face .card { background: #fff; }
.dark-face .card { background: var(--color-paper); }
.card-icon { width: 40px; height: 40px; margin-bottom: 16px; color: var(--color-brand); }
.dark-face .card-icon { color: var(--color-brand); }

/* Flow Bar */
.flow-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.flow-node {
  flex: 1; min-width: 120px; background: #fff; border: var(--card-border);
  border-radius: var(--radius-card); padding: 16px; text-align: center;
  font-weight: 600; font-size: 0.9rem;
}
.flow-arrow { width: 40px; height: 24px; color: var(--color-brand); }
.dark-face .flow-node { background: var(--color-dark); border-color: rgba(247, 245, 243, 0.2); }

/* Timeline */
.timeline { position: relative; padding-left: 32px; border-left: 2px solid rgba(25, 21, 35, 0.1); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: attr(data-step);
  position: absolute; left: -44px; top: 0;
  width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark);
  border-radius: 6px; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
}
.dark-face .timeline-item::before { background: var(--color-accent); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
.data-table th { font-weight: 600; width: 40%; }
.dark-face .data-table th, .dark-face .data-table td { border-color: rgba(247, 245, 243, 0.1); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  background: #fff; border: var(--card-border); border-radius: var(--radius-card);
  padding: 16px; transition: background 0.2s;
}
.dark-face details { background: var(--color-dark); border-color: rgba(247, 245, 243, 0.15); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
summary::marker { display: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-weight: 700; color: var(--color-brand); }
details[open] summary::before { content: "-"; }
details p { margin-top: 12px; font-size: 0.95rem; }

/* News Grid */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card {
  background: #fff; border: var(--card-border); border-radius: var(--radius-card);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.dark-face .news-card { background: var(--color-dark); border-color: rgba(247, 245, 243, 0.15); }
.news-date { font-size: 0.8rem; opacity: 0.7; }

/* Buttons Secondary */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 0.95rem; border: 1px solid currentColor;
  transition: background 0.2s, transform 0.2s;
}
.paper-face .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.dark-face .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); transform: translateY(-1px); }
.dark-face .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }

/* SVG & Animations */
.svg-container { width: 100%; aspect-ratio: 4 / 3; max-height: 400px; }
.anim-draw-line {
  pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: draw-line 8s ease-in-out infinite;
}
.anim-float {
  animation: float-slow 6s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center;
}
.anim-breathe {
  animation: breathe 4s ease-in-out infinite;
}
.anim-spin {
  animation: spin-slow 12s linear infinite;
  transform-box: fill-box; transform-origin: center;
}
.anim-slide-in {
  animation: slide-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0; transform: translateY(12px);
}

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes slide-in {
  to { opacity: 1; transform: translateY(0); }
}

@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-draw-line, .anim-float, .anim-breathe, .anim-spin, .anim-slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .checker-row, .checker-row:nth-child(even) { flex-direction: column; }
  .flow-bar { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
