/* =========================================
   Design Variables & Reset
   ========================================= */
:root {
  --bg-paper: #fafaf9;
  --bg-paper-alt: #f5f5f4;
  --ink-black: #18181b;
  --ink-muted: #52525b;
  --ink-subtle: #a1a1aa;
  --brand-green: #25D366;
  --brand-green-dark: #1EBE57;
  --border-light: #e4e4e7;
  --border-medium: #d4d4d8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --radius-base: 0.5rem;
  --radius-lg: 0.75rem;
  --max-width: 1200px;
  --font-main: 'Inter', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--ink-black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
button, [role="button"] { cursor: pointer; font-family: inherit; }

/* =========================================
   Typography & Layout Utilities
   ========================================= */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1rem, 5vw, 3rem); }
.section { padding: clamp(3rem, 8vw, 6rem) 0; border-bottom: 1px solid var(--border-light); }
.section:last-child { border-bottom: none; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.125rem, 2vw, 1.35rem); margin-bottom: 0.5rem; }
p { color: var(--ink-muted); margin-bottom: 1rem; max-width: 65ch; }
.text-center { text-align: center; }
.grid { display: grid; gap: 2rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 249, 0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.5rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { height: 2.5rem; width: auto; object-fit: contain; }
.brand-text { font-weight: 700; font-size: 1.1rem; color: var(--ink-black); }

nav ul { display: flex; list-style: none; gap: 1.5rem; }
nav a { font-size: 0.95rem; font-weight: 500; color: var(--ink-muted); padding: 0.5rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink-black); border-bottom-color: var(--brand-green); }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--ink-black); }

/* =========================================
   Components: Buttons & Cards
   ========================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-weight: 600; border-radius: var(--radius-base);
  border: 1px solid transparent; transition: all 0.2s ease; font-size: 1rem;
}
.btn-primary { background: var(--ink-black); color: #fff; border-color: var(--ink-black); }
.btn-primary:hover { background: #27272a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: #fff; color: var(--ink-black); border-color: var(--border-medium); }
.btn-secondary:hover { border-color: var(--ink-black); background: var(--bg-paper-alt); }
.btn-download { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }
.btn-download:hover { background: var(--brand-green-dark); border-color: var(--brand-green-dark); }

.card {
  background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 1.5rem; transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-medium); }
.card-icon { width: 3rem; height: 3rem; background: var(--bg-paper-alt); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.card-icon svg { width: 1.5rem; height: 1.5rem; stroke: var(--ink-black); stroke-width: 1.5; fill: none; }

/* =========================================
   Forms, Tables & FAQ
   ========================================= */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { font-weight: 600; color: var(--ink-black); background: var(--bg-paper-alt); }
tr:last-child td { border-bottom: none; }

details { margin-bottom: 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-base); overflow: hidden; }
summary {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
  background: #fff; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-weight: 400; font-size: 1.25rem; color: var(--ink-subtle); }
details[open] summary::after { content: '−'; }
details > div { padding: 0 1.25rem 1rem; color: var(--ink-muted); line-height: 1.7; }

/* =========================================
   SVG Animations
   ========================================= */
@keyframes node-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes dash-flow {
  to { stroke-dashoffset: -20; }
}
.node { animation: node-pulse 4s ease-in-out infinite; transform-origin: center; }
.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 0.4s; }
.node-3 { animation-delay: 0.8s; }
.node-4 { animation-delay: 1.2s; }
.node-5 { animation-delay: 1.6s; }
.node-6 { animation-delay: 2.0s; }
.flow-line { stroke-dasharray: 10 10; animation: dash-flow 2s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .node, .flow-line { animation: none !important; opacity: 0.6; }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  nav ul { display: none; position: absolute; top: 4.5rem; left: 0; right: 0; background: #fff; flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow-md); }
  nav ul.active { display: flex; }
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  th, td { padding: 0.5rem; font-size: 0.85rem; }
}
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; } }
