:root {
    --color-primary: #128C7E;
    --color-primary-hover: #0f7a6e;
    --color-secondary: #25D366;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F7F9FA;
    --color-text: #111B21;
    --color-text-muted: #54656f;
    --color-border: #E0E0E0;
    --color-accent-light: #E6FCF5;
    --container-width: 1140px;
    --font-serif: "Georgia", "Noto Serif SC", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --spacing-base: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --transition: all 0.2s ease-in-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-text);
    text-wrap: balance;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.25rem, 5vw + 1rem, 3.75rem);
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
    line-height: 1.2;
    margin-bottom: var(--spacing-base);
}

h3 {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    max-width: 70ch;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-base);
}

section {
    padding: var(--spacing-lg) 0;
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Header & Nav */
.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(--color-border);
    height: 64px;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
}

.brand img {
    height: 36px;
    width: auto;
}

.brand-name {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.125rem;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav a {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0;
    text-decoration: none;
    position: relative;
}

.nav a:hover, .nav a[aria-current="page"] {
    color: var(--color-text);
    text-decoration: none;
}

.nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px; /* Adjusted for header border */
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-accent-light);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Cards */
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: #cfd8dc;
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--color-accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card p {
    font-size: 0.9375rem;
    flex-grow: 1;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9375rem;
    min-width: 600px;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

th {
    background-color: var(--color-bg-alt);
    font-weight: 600;
    color: var(--color-text);
}

td {
    color: var(--color-text-muted);
}

tr:last-child th, tr:last-child td {
    border-bottom: none;
}

/* FAQ */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

details {
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 0;
    cursor: pointer;
}

summary {
    list-style: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text);
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--color-primary);
    transition: transform 0.2s;
}

details[open] summary::after {
    content: "-";
    transform: rotate(0deg);
}

details p {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    padding-right: 1rem;
}

/* SVG Animations */
svg.hero-graphic {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
    display: block;
}

svg.hero-graphic path.contour {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: contourFlow 8s linear infinite;
}

svg.hero-graphic path.contour:nth-child(2) {
    animation-delay: -2s;
    opacity: 0.6;
}

svg.hero-graphic path.contour:nth-child(3) {
    animation-delay: -4s;
    opacity: 0.3;
}

svg.hero-graphic path.node {
    animation: nodePulse 4s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes contourFlow {
    0% { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 0; }
}

@keyframes nodePulse {
    0% { r: 3; opacity: 0.8; }
    100% { r: 5; opacity: 1; }
}

@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;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    
    .nav {
        position: fixed;
        top: 64px;
        right: 0;
        width: 100%;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .nav li {
        border-bottom: 1px solid var(--color-bg-alt);
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-md { margin-bottom: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.bg-alt { background-color: var(--color-bg-alt); }
.border-top { border-top: 1px solid var(--color-border); }
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
}
.link-arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

footer {
    background-color: var(--color-bg-alt);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
