:root {
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  --color-border: #191523;
  --color-shadow: #191523;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-shadow);

  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  --font-sans: 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; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: var(--gap); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1.5rem; max-width: 38em; }
ul, ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.dark-panel { background-color: var(--color-dark); color: var(--color-paper); }
.dark-panel a { color: var(--color-accent); }
.light-paper { background-color: var(--color-paper); color: var(--color-text); }
.paper-card { background: var(--color-paper); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 1.5rem; }
.dark-panel .paper-card { border-color: rgba(255,255,255,0.2); box-shadow: 4px 4px 0 rgba(0,0,0,0.3); }

.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.paper .eyebrow { color: var(--color-brand); }
.dark-panel .eyebrow { color: var(--color-accent); }
.hl { font-weight: 800; }
.paper .hl { color: var(--color-brand); }
.dark-panel .hl { color: var(--color-accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; text-decoration: none; white-space: nowrap; }
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(110, 237, 210, 0.3); }
.btn-secondary { background: transparent; color: var(--color-text); border: 2px solid var(--color-text); }
.dark-panel .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0,0,0,0.1); backdrop-filter: blur(8px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.25rem; color: var(--color-text); text-decoration: none; }
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { color: var(--color-text); font-weight: 500; padding: 0.5rem 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
nav a[aria-current="page"]::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--color-brand); }

footer { background: var(--color-dark); color: var(--color-paper); padding: 3rem 0; margin-top: var(--section-y); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { color: var(--color-paper); opacity: 0.8; }
.footer-links a:hover { opacity: 1; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.text-center { text-align: center; }
.mt-lg { margin-top: var(--gap); }
.mb-md { margin-bottom: 1.5rem; }

table { width: 100%; min-width: 0; border-collapse: collapse; margin-bottom: 1.5rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); overflow-wrap: break-word; word-break: break-word; }
th { font-weight: 700; }
.dark-panel th, .dark-panel td { border-color: rgba(255,255,255,0.15); }

details { margin-bottom: 1rem; border: 1px solid rgba(0,0,0,0.1); 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.25rem; }
details[open] summary::after { content: '-'; }
details > div { padding: 0 1rem 1rem; line-height: 1.6; }
.dark-panel details { border-color: rgba(255,255,255,0.15); }

/* SVG Animation Base */
svg { width: 100%; height: auto; }
svg path, svg circle, svg rect, svg line, svg polyline { transition: stroke-dashoffset .3s ease; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 4s ease-out forwards; }
.breathe { animation: breathe 4s ease-in-out infinite; }
.float { animation: float 6s ease-in-out infinite; }
.slide-in { animation: slideIn 0.6s ease-out forwards; }

@keyframes draw { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes slideIn { 0% { opacity: 0; transform: translateX(-10px); } 100% { opacity: 1; transform: translateX(0); } }

svg g { transform-box: fill-box; transform-origin: center; }

@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; }
  .draw, .breathe, .float, .slide-in { animation: none !important; opacity: 1 !important; transform: none !important; }
}

@media (max-width: 768px) {
  nav ul { display: none; }
  .hero-grid { flex-direction: column-reverse; }
  .magazine-layout { grid-template-columns: 1fr; }
  .scenario-row { flex-direction: column; }
}
