:root {
  --bg-dark: #141838;
  --bg-paper: #F7F5F3;
  --text-color: #151723;
  --brand: #142CEB;
  --accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--text-color);
  --card-shadow: 4px 4px 0 var(--text-color);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-paper);
  color: var(--text-color);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 20px; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(247,245,243,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(21,23,35,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; color: var(--text-color); }
.brand img { height: 32px; width: auto; }
nav { display: flex; gap: 24px; }
nav a { font-weight: 500; color: var(--text-color); }
nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }
footer { padding: 48px 0; border-top: 1px solid rgba(21,23,35,0.08); margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer-col h4 { font-weight: 700; margin-bottom: 12px; }
.footer-col a { display: block; margin-bottom: 8px; color: var(--text-color); opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.copyright { text-align: center; margin-top: 48px; font-size: 0.85rem; opacity: 0.6; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 0 24px; height: 48px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, background 0.2s, border-color 0.2s; border: none; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #5a9ad4; }
.btn-secondary { background: transparent; border: 2px solid var(--text-color); color: var(--text-color); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(21,23,35,0.04); }

/* Dark Surface & Paper Card Overrides */
.dark-surface { background: var(--bg-dark); color: var(--bg-paper); }
.dark-surface a { color: var(--accent); }
.dark-surface .btn-primary { background: var(--accent); color: var(--bg-dark); }
.dark-surface .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.paper-card { background: var(--bg-paper); color: var(--text-color); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 24px; }
.paper-card a { color: var(--brand); }

/* Typography */
h1, h2, h3 { line-height: 1.2; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: var(--gap); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; font-weight: 700; margin-top: var(--gap); margin-bottom: 12px; }
.marker { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; color: var(--brand); }
.dark-surface .marker { color: var(--accent); }
.hl { color: var(--brand); }
.dark-surface .hl { color: var(--accent); }

/* Layout & Sections */
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-header { margin-bottom: var(--gap); }
.section-number { font-size: 3rem; font-weight: 800; color: var(--brand); opacity: 0.15; line-height: 1; margin-bottom: -1rem; display: block; }
/* Light background contrast fix */
body .section-number { color: #142ceb; opacity: 1; }
.dark-surface .section-number { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; gap: var(--gap); align-items: flex-start; flex-wrap: wrap; }
.flex-col { flex: 1 1 0; min-width: 0; }

/* Hero */
.hero { min-height: 90vh; display: flex; align-items: center; }
.hero-content { max-width: 50%; }
.hero-svg-container { max-width: 50%; display: flex; justify-content: center; align-items: center; }

/* Magazine Layout */
.magazine-layout { display: grid; grid-template-columns: 1fr 240px; gap: 48px; align-items: start; }
.toc { position: sticky; top: 80px; }
.toc ul { list-style: none; padding-left: 0; border-left: 2px solid var(--brand); }
.toc li { margin-bottom: 12px; }
.toc a { color: var(--text-color); font-size: 0.9rem; }
.toc a:hover { color: var(--brand); font-weight: 600; }

/* Features DL */
.feature-list dt { font-weight: 700; margin-bottom: 4px; }
.feature-list dd { margin-left: 0; margin-bottom: 24px; color: var(--text-color); opacity: 0.85; }

/* Steps */
.step-item { display: flex; gap: 16px; margin-bottom: 24px; }
.step-badge { flex-shrink: 0; width: 40px; height: 40px; background: var(--accent); color: var(--bg-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; border-radius: 6px; }

/* Table */
table { width: 100%; border-collapse: collapse; margin: 24px 0; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(21,23,35,0.1); }
th { font-weight: 700; background: rgba(20,44,235,0.05); }

/* News Cards */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { background: var(--bg-paper); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 24px; }
.news-date { font-size: 0.8rem; color: var(--brand); font-weight: 600; margin-bottom: 8px; display: block; }
.news-card h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 8px; }
.news-card p { font-size: 0.95rem; line-height: 1.6; }

/* FAQ */
details { margin-bottom: 16px; border: 1px solid rgba(21,23,35,0.15); border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 16px; 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.5rem; font-weight: 300; }
details[open] summary::after { content: '−'; }
details p { padding: 0 16px 16px; line-height: 1.7; color: var(--text-color); }

/* SVG Responsive & Animations */
.svg-responsive { width: 100%; height: auto; max-width: 100%; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s ease-in-out infinite; }
@keyframes drawLine { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
.float-slow { animation: floatSlow 8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.twinkle { animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.breathe { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.slide-in { animation: slideIn 5s ease-out infinite alternate; }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .draw-line, .float-slow, .twinkle, .breathe, .slide-in { animation: none !important; }
}

@media (max-width: 768px) {
  .hero { flex-direction: column; text-align: center; }
  .hero-content, .hero-svg-container { max-width: 100%; }
  .magazine-layout { grid-template-columns: 1fr; }
  .toc { position: static; border-left: none; padding-left: 0; }
}
