:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.5em; margin-bottom: 1rem; }
li { margin-bottom: 0.5em; }

.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-paper { background-color: var(--color-paper); color: var(--color-body); }
.text-on-dark { color: var(--color-paper); }
.text-on-paper { color: var(--color-body); }
.accent-on-dark { color: var(--color-accent); }
.brand-on-paper { color: var(--color-brand); }
.hl { font-weight: 700; }
.bg-dark .hl { color: var(--color-accent); }
.bg-paper .hl { color: var(--color-brand); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.divider { height: 1px; background: rgba(23, 21, 35, 0.1); margin: 0 auto; max-width: var(--content-max); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(23, 21, 35, 0.08); transition: box-shadow 0.3s; }
header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { font-size: 0.95rem; 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); }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 1.5rem; 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-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary { background: transparent; border: 1px solid var(--color-body); color: var(--color-body); }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(23, 21, 35, 0.05); }
.bg-dark .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

.card { background: var(--color-paper); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: var(--gap); transition: transform 0.2s, box-shadow 0.2s; }
.bg-dark .card { background: rgba(247, 245, 243, 0.08); border: 1px solid rgba(247, 245, 243, 0.1); }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.35); }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.75rem; text-transform: uppercase; }
.bg-paper .tag { color: var(--color-brand); }
.bg-dark .tag { color: var(--color-accent); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); }
th { font-weight: 600; }
tr:last-child td { border-bottom: none; }

details { margin-bottom: 0.75rem; border: 1px solid rgba(23, 21, 35, 0.1); border-radius: 12px; overflow: hidden; }
summary { padding: 1rem 1.25rem; 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); }
details p { padding: 0 1.25rem 1rem; margin: 0; }
details:focus-within { outline: 2px solid var(--color-brand); outline-offset: 2px; }

.svg-anim { width: 100%; height: auto; max-width: 100%; }
.grid-node { opacity: 0.2; transition: opacity 0.3s; }
@keyframes gridLightUp {
  0%, 100% { opacity: 0.2; stroke-width: 1; }
  50% { opacity: 1; stroke-width: 2.5; }
}
.grid-node:nth-child(1) { animation: gridLightUp 4s ease-in-out 0s infinite; }
.grid-node:nth-child(2) { animation: gridLightUp 4s ease-in-out 0.4s infinite; }
.grid-node:nth-child(3) { animation: gridLightUp 4s ease-in-out 0.8s infinite; }
.grid-node:nth-child(4) { animation: gridLightUp 4s ease-in-out 1.2s infinite; }
.grid-node:nth-child(5) { animation: gridLightUp 4s ease-in-out 1.6s infinite; }
.grid-node:nth-child(6) { animation: gridLightUp 4s ease-in-out 2.0s infinite; }

@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.draw-path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 3s ease forwards; }

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-bubble { animation: floatBubble 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes slideInNotif {
  0%, 100% { transform: translateX(20px); opacity: 0; }
  20%, 80% { transform: translateX(0); opacity: 1; }
}
.slide-notif { animation: slideInNotif 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes breatheDot {
  0%, 100% { r: 3; opacity: 0.6; }
  50% { r: 5; opacity: 1; }
}
.breathe-dot { animation: breatheDot 3s ease-in-out infinite; 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; }
}

@media(max-width: 768px) {
  nav ul { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
