/* =========================================
   Global Design Variables & Reset
   ========================================= */
:root {
  --c-brand-deep: #075E54;
  --c-brand-mid: #128C7E;
  --c-brand-bright: #25D366;
  --c-accent: #DCF8C6;
  
  --c-bg-body: #F0F2F5;
  --c-bg-surface: #FFFFFF;
  --c-bg-surface-alt: #E9EDEF;
  
  --c-text-primary: #1A1A1A;
  --c-text-secondary: #545B62;
  --c-text-muted: #8696A0;
  --c-border: #D1D7DB;
  
  --f-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'Courier New', Courier, monospace;
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--f-sans);
  color: var(--c-text-primary);
  background-color: var(--c-bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-brand-deep); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--c-brand-mid); }
ul, ol { list-style: none; }

/* Focus & Accessibility */
:focus-visible { outline: 2px solid var(--c-brand-bright); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* =========================================
   Layout Utilities
   ========================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.section { padding: var(--space-xl) 0; }
.section-alt { background-color: var(--c-bg-surface); }
.grid { display: grid; gap: var(--space-lg); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-md); color: var(--c-text-secondary); max-width: 65ch; }
.mono-badge { font-family: var(--f-mono); font-size: 0.75rem; color: var(--c-brand-mid); background: rgba(18,140,126,0.1); padding: 2px 8px; border-radius: var(--radius-sm); display: inline-block; margin-bottom: var(--space-sm); }

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
  padding: var(--space-sm) 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: var(--space-sm); font-weight: 700; font-size: 1.25rem; color: var(--c-text-primary); }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: var(--space-md); }
nav a { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-weight: 500; }
nav a[aria-current="page"], nav a:hover { background: var(--c-bg-surface-alt); color: var(--c-brand-deep); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }

/* =========================================
   Buttons & Components
   ========================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 12px 28px; border-radius: var(--radius-full); font-weight: 600; font-size: 1rem;
  border: none; cursor: pointer; transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-brand-deep), var(--c-brand-mid));
  color: #FFF; box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); background: linear-gradient(135deg, var(--c-brand-mid), var(--c-brand-bright)); color: #FFF; }
.btn-outline { background: transparent; border: 2px solid var(--c-brand-deep); color: var(--c-brand-deep); }
.btn-outline:hover { background: var(--c-brand-deep); color: #FFF; }

.card {
  background: var(--c-bg-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md);
  padding: var(--space-lg); transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--c-brand-bright); }
.card-icon { width: 48px; height: 48px; background: var(--c-accent); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--c-brand-deep); margin-bottom: var(--space-md); }
.card-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { background: var(--c-brand-deep); color: #FFF; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: var(--c-bg-surface-alt); }

/* FAQ Details/Summary */
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-item summary {
  padding: var(--space-md) 0; cursor: pointer; font-weight: 600; font-size: 1.1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.5rem; color: var(--c-brand-mid); transition: transform var(--transition-base); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: var(--space-sm); margin-bottom: var(--space-md); font-size: 0.95rem; }

/* News Cards */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-date { font-family: var(--f-mono); font-size: 0.8rem; color: var(--c-text-muted); margin-bottom: var(--space-xs); }
.news-card .btn-link { margin-top: auto; font-weight: 600; font-size: 0.9rem; }

/* Related Links */
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); }
.related-item { padding: var(--space-md); border: 1px solid var(--c-border); border-radius: var(--radius-md); transition: border-color var(--transition-fast); }
.related-item:hover { border-color: var(--c-brand-mid); }
.related-item strong { display: block; margin-bottom: 4px; color: var(--c-brand-deep); }
.related-item span { font-size: 0.9rem; color: var(--c-text-secondary); }

/* Footer */
.site-footer { background: var(--c-bg-surface-alt); border-top: 1px solid var(--c-border); padding: var(--space-xl) 0; margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); }
.footer-col h4 { margin-bottom: var(--space-md); color: var(--c-text-primary); }
.footer-col ul li { margin-bottom: var(--space-sm); }
.footer-col a { color: var(--c-text-secondary); }
.footer-col a:hover { color: var(--c-brand-deep); }
.copyright { text-align: center; margin-top: var(--space-xl); color: var(--c-text-muted); font-size: 0.9rem; border-top: 1px solid var(--c-border); padding-top: var(--space-lg); }

/* =========================================
   SVG Animations & Graphics
   ========================================= */
.graphic-svg { width: 100%; height: auto; overflow: visible; }
.flow-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  fill: none;
  stroke: var(--c-brand-bright);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
  animation: flowDash 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.flow-path:nth-child(2) { animation-delay: -1s; stroke: var(--c-brand-mid); }
.flow-path:nth-child(3) { animation-delay: -2.5s; stroke-width: 1; opacity: 0.5; }

@keyframes flowDash {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

.glow-circle {
  fill: var(--c-brand-bright);
  opacity: 0;
  animation: pulseGlow 3s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
.glow-circle:nth-child(odd) { animation-delay: 0.5s; }

@keyframes pulseGlow {
  0% { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: 0.6; transform: scale(1.2); }
}

/* Reduced Motion */
@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;
  }
  .flow-path { animation: none; opacity: 0.8; }
  .glow-circle { animation: none; opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  nav ul { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--c-bg-surface); flex-direction: column; padding: var(--space-md); border-bottom: 1px solid var(--c-border); box-shadow: var(--shadow-md); }
  nav.open ul { display: flex; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .grid { grid-template-columns: 1fr; }
}
