:root {
    --bg-start: #f8fbff;
    --bg-end: #eef4ff;
    --surface: #ffffff;
    --surface-soft: #f5f8ff;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --border: #dbe3f1;
    --accent: #f97316;
    --shadow: 0 20px 45px -28px rgba(37, 99, 235, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
    color: var(--text);
    background: linear-gradient(150deg, var(--bg-start), var(--bg-end));
    line-height: 1.75;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.container {
    width: min(1120px, calc(100% - 2.25rem));
    margin: 0 auto;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    min-height: 70px;
    flex-wrap: wrap;
    padding: 0.65rem 0;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand small {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* Navigation */
.site-nav {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.94rem;
}

.site-nav a {
    color: var(--muted);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a.active-nav {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

/* Mobile hamburger */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.15s;
}

.mobile-menu-btn:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.lang-link:hover {
    text-decoration: none;
    background: var(--surface-soft);
}

.lang-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Hero ── */
.hero {
    margin-top: 2rem;
    padding: 2.6rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at 84% 0%, rgba(37, 99, 235, 0.16), transparent 44%),
        linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.45rem);
    line-height: 1.2;
}

.hero p {
    margin: 0.9rem 0 0;
    color: var(--muted);
    max-width: 78ch;
}

/* Hero CTA - always show a back-to-home link */
.hero .cta-row {
    margin-top: 1.4rem;
}

.chips {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.chips span {
    border-radius: 999px;
    padding: 0.35rem 0.78rem;
    border: 1px solid #d9e5ff;
    background: #f4f8ff;
    font-size: 0.85rem;
    color: #1f458f;
}

.cta-row {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ── Buttons ── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

.button:hover {
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button.primary:hover {
    background: var(--primary-hover);
}

.button.accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Content ── */
.grid {
    display: grid;
    gap: 1rem;
}

.grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    margin-top: 1rem;
    padding: 1.2rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.card h2,
.card h3 {
    margin-top: 0;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
}

.card p,
.card li {
    color: #334155;
}

.card ul,
.card ol {
    margin: 0.6rem 0 0;
    padding-left: 1.15rem;
}

.metric {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.9rem;
    background: var(--surface-soft);
}

.metric .label {
    font-size: 0.82rem;
    color: var(--muted);
}

.metric .value {
    margin-top: 0.2rem;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary);
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.35rem;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0.4rem;
    text-align: left;
    font-size: 0.92rem;
}

th {
    color: var(--muted);
    font-weight: 600;
}

/* ── Footer ── */
footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding: 1rem 0 2rem;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button, [role="button"], summary {
    cursor: pointer;
}

/* ── Touch targets ── */
@media (pointer: coarse) {
    .site-nav a, .lang-link, .button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ── Mobile ── */
@media (max-width: 720px) {
    .hero {
        padding: 1.35rem;
    }

    .site-header-inner {
        padding: 0.7rem 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .site-nav.main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1.125rem;
        flex-direction: column;
        gap: 0.25rem;
        z-index: 40;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .site-nav.main-nav.open {
        display: flex;
    }

    .site-nav.main-nav a {
        padding: 0.625rem 0.75rem;
        border-radius: 0.5rem;
    }
}

/* ── Ad Layout: 3-column grid with sidebars ── */
.page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-layout > main {
    min-width: 0;
}

@media (min-width: 1200px) {
    .page-layout {
        grid-template-columns: 180px 1fr 180px;
        gap: 1.5rem;
        width: min(1480px, calc(100% - 2rem));
    }
}

.page-sidebar {
    display: none;
}

@media (min-width: 1200px) {
    .page-sidebar {
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }
}

.page-sidebar-sticky {
    position: sticky;
    top: 5rem;
    width: 100%;
}

.page-sidebar img { max-width: 100% !important; height: auto !important; }
.page-sidebar iframe { max-width: 100% !important; }

/* Top banner ad area */
.ad-banner-top {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 0;
}

.ad-banner-top .container {
    display: flex;
    justify-content: center;
}

.ad-banner-desktop { display: none; }
.ad-banner-mobile { display: flex; justify-content: center; }

@media (min-width: 768px) {
    .ad-banner-desktop { display: flex; justify-content: center; }
    .ad-banner-mobile { display: none; }
}
