/* ===========================
   Design Tokens & Reset
   =========================== */
:root {
  --c-brand-dark: #0A5C51;
  --c-brand-mid: #128C7E;
  --c-brand-light: #25D366;
  --c-bg: #FFFFFF;
  --c-surface: #F4F9F8;
  --c-surface-alt: #E9EFEF;
  --c-text: #111B21;
  --c-text-secondary: #54656F;
  --c-border: #D1D7DB;
  --c-accent: #00A884;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ff-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --max-w: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-main);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ===========================
   Typography
   =========================== */
h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem); line-height: 1.25; font-weight: 600; margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.15rem, 2vw + 0.25rem, 1.5rem); line-height: 1.35; font-weight: 600; }
p { margin-bottom: var(--space-sm); color: var(--c-text); }
.mono { font-family: var(--ff-mono); }
.text-muted { color: var(--c-text-secondary); }
.text-center { text-align: center; }
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; }
.section-alt { background: var(--c-surface); }
.grid-auto { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ===========================
   Components
   =========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s; border: none; font-size: 1rem;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--c-brand-light); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--c-brand-dark) 0%, var(--c-brand-light) 100%); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; border: 1.5px solid var(--c-brand-mid); color: var(--c-brand-dark); }
.btn-outline:hover { background: var(--c-surface-alt); }

.card {
  background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md);
  padding: var(--space-md); transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--c-surface);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-sm);
  color: var(--c-brand-mid);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: var(--space-xs); }

table { width: 100%; border-collapse: collapse; margin: var(--space-md) 0; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--c-border); }
th { background: var(--c-surface); font-weight: 600; color: var(--c-text-secondary); }
tr:last-child th, tr:last-child td { border-bottom: none; }

details { border: 1px solid var(--c-border); border-radius: var(--radius-sm); margin-bottom: var(--space-sm); overflow: hidden; }
summary { padding: var(--space-sm) var(--space-md); cursor: pointer; font-weight: 500; background: var(--c-surface); user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
summary:focus-visible { outline: 3px solid var(--c-brand-light); outline-offset: -3px; }
details[open] summary { border-bottom: 1px solid var(--c-border); }
details p { padding: var(--space-sm) var(--space-md); margin: 0; }

.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.8rem;
  background: var(--c-surface-alt); color: var(--c-brand-dark); font-weight: 500; margin-bottom: var(--space-xs);
}

/* ===========================
   Header & Footer
   =========================== */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-group { display: flex; align-items: center; gap: 0.75rem; }
.logo-group img { width: 120px; height: 35px; object-fit: contain; }
.logo-text { font-weight: 700; font-size: 1.1rem; color: var(--c-brand-dark); }
nav ul { display: flex; gap: var(--space-md); }
nav a { font-weight: 500; color: var(--c-text-secondary); padding: 0.4rem 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--c-brand-dark); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px; background: var(--c-brand-light); }
.footer { background: var(--c-surface); padding: var(--space-xl) 0 var(--space-md); margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-lg); }
.footer-col h4 { margin-bottom: var(--space-sm); font-size: 0.95rem; color: var(--c-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--c-border); padding-top: var(--space-md); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); font-size: 0.9rem; color: var(--c-text-secondary); }

/* ===========================
   SVG Animations
   =========================== */
.svg-flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 3.5s ease-in-out infinite; }
.svg-flow-dot { animation: moveDotAlong 4s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes moveDotAlong {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  45% { transform: translate(120px, -25px); }
  50% { transform: translate(120px, -25px); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translate(240px, 0); opacity: 0; }
}
.dot-pulse { animation: pulse 2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svg-flow-line, .svg-flow-dot, .dot-pulse { animation: none; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header-inner nav { display: none; }
  table { display: block; overflow-x: auto; }
}
