:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-2: #eef4ff;
    --text: #172033;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #14b8a6;
    --border: #dbe4f0;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --radius: 24px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, #dbeafe 0, transparent 32rem), var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
}

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 999;
    background: var(--secondary);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 999px;
}

.skip-link:focus {
    top: 1rem;
}

.topbar {
    background: var(--secondary);
    color: #e2e8f0;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    font-weight: 700;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-donate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-share {
    display: flex;
    align-items: center;
}

.btn-donate {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.78rem;
    transition: transform 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.btn-donate:hover {
    transform: translateY(-1px);
}

.btn-paypal {
    background: #0070ba;
    color: #fff;
}

.btn-paypal:hover {
    background: #005ea6;
    color: #fff;
}

.btn-coffee {
    background: #ffdd00;
    color: #000;
}

.btn-coffee:hover {
    background: #ffc800;
    color: #000;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.social-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    transition: background 0.2s ease, color 0.2s ease;
}

.social-share a:hover {
    background: var(--primary);
    color: #fff;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(219, 228, 240, 0.9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.primary-nav > a,
.primary-nav button,
.language-form select {
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.primary-nav > a:hover,
.primary-nav > a.active,
.primary-nav button:hover,
.language-form select:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 220px;
    display: none;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    display: grid;
    gap: 0.25rem;
}

.dropdown-menu a {
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
}

.dropdown-menu a:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.language-form select {
    border: 1px solid var(--border);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
    border-radius: 999px;
}

.ad-slot {
    margin: 1.5rem 0;
}

.ad-box {
    display: grid;
    place-items: center;
    min-height: 90px;
    border: 1px dashed #b8c7db;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fbff, #eef6ff);
    color: var(--muted);
    text-align: center;
    padding: 1rem;
    overflow: hidden;
}

.ad-placeholder {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    opacity: 0.6;
}

.hero {
    width: min(100% - 2rem, var(--container));
    margin: 2rem auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 2rem;
    align-items: center;
}

.hero-content,
.page-hero,
.card,
.service-card,
.speed-meter,
.policy-card,
.form-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(219, 228, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-content,
.page-hero {
    padding: clamp(2rem, 5vw, 4.5rem);
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

h1, h2, h3 {
    line-height: 1.15;
    margin: 0.25rem 0 0.75rem;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
}

h3 {
    font-size: 1.1rem;
}

.hero-content p,
.page-hero p,
.card p,
.service-card p,
.policy-card p,
.form-card p {
    color: var(--muted);
}

.hero-actions,
.donation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1.1rem;
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
    color: var(--primary);
    background: var(--surface-2);
}

.btn-small {
    min-height: 36px;
    padding: 0.5rem 0.85rem;
}

.hero-panel {
    padding: 1rem;
    border-radius: calc(var(--radius) + 8px);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(219, 228, 240, 0.9);
}

.speed-meter {
    padding: 1.5rem;
    text-align: center;
}

.meter-ring {
    --score: 0deg;
    position: relative;
    display: grid;
    place-items: center;
    width: min(260px, 72vw);
    aspect-ratio: 1;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background:
        conic-gradient(var(--accent) var(--score), #e2e8f0 0),
        radial-gradient(circle, #fff 58%, transparent 59%);
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}

.meter-ring span {
    display: block;
    font-size: 4rem;
    font-weight: 950;
    letter-spacing: -0.08em;
}

.meter-ring small {
    display: block;
    margin-top: -0.5rem;
    color: var(--muted);
    font-weight: 800;
}

.speed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.speed-grid div {
    padding: 1rem;
    border-radius: 18px;
    background: var(--surface-2);
}

.speed-grid strong {
    display: block;
    font-size: 1.45rem;
}

.speed-grid span {
    color: var(--muted);
    font-weight: 800;
}

.status-text {
    min-height: 1.5rem;
    color: var(--primary);
    font-weight: 900;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    margin: 2rem auto;
    align-items: start;
}

.main-column {
    min-width: 0;
}

.services-grid,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.service-card,
.card,
.policy-card,
.form-card {
    padding: 1.25rem;
}

.service-card a {
    color: var(--primary);
    font-weight: 900;
}

.text-link {
    display: inline-flex;
    margin-top: 0.75rem;
    color: var(--primary);
    font-weight: 900;
}

.sidebar {
    display: grid;
    gap: 1rem;
}

.card {
    display: grid;
    gap: 0.6rem;
}

.card a,
.sidebar a {
    color: var(--muted);
    font-weight: 800;
}

.card a:hover,
.sidebar a:hover {
    color: var(--primary);
}

.tips-section {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #ffffff, #eff6ff);
    border: 1px solid var(--border);
    margin-top: 1.5rem;
}

.tips-list {
    display: grid;
    gap: 0.75rem;
    padding-left: 1.25rem;
    margin: 1rem 0 0;
    color: var(--muted);
}

.notice {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    margin: 1rem 0;
    font-weight: 800;
}

.notice-success {
    color: #065f46;
    background: #d1fae5;
}

.notice-error {
    color: #991b1b;
    background: #fee2e2;
}

.page-hero {
    width: min(100% - 2rem, var(--container));
    margin: 2rem auto 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-weight: 800;
}

.breadcrumb a {
    color: var(--primary);
}

.policy-card {
    margin-bottom: 1.5rem;
}

.form-card {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-weight: 900;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    padding: 0.85rem 1rem;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
    resize: vertical;
}

.site-footer {
    margin-top: 3rem;
    padding: 3rem 0 1rem;
    background: #0f172a;
    color: #e2e8f0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 1.5rem;
}

.footer-brand small,
.site-footer p {
    color: #94a3b8;
}

.site-footer h3 {
    color: #fff;
    margin-bottom: 0.75rem;
}

.site-footer a {
    display: block;
    color: #cbd5e1;
}

.site-footer a:hover {
    color: #fff;
}

.copyright {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.copyright a {
    color: var(--accent);
    display: inline;
    font-weight: 800;
}

.copyright a:hover {
    color: #fff;
}

.site-footer .social-share a {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.site-footer .social-share a:hover {
    background: var(--primary);
    color: #fff;
}

.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 60;
    display: none;
    width: min(100% - 2rem, 720px);
    transform: translateX(-50%);
    padding: 1rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-banner.is-visible {
    display: flex;
}

@media (max-width: 980px) {
    .menu-toggle {
        display: inline-block;
    }

    .primary-nav {
        position: absolute;
        top: 76px;
        left: 1rem;
        right: 1rem;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .primary-nav.is-open {
        display: flex;
    }

    .primary-nav > a,
    .primary-nav button,
    .language-form select {
        width: 100%;
        text-align: left;
    }

    .dropdown-menu {
        position: static;
        display: grid;
        min-width: 0;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar-inner {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .container,
    .hero,
    .page-hero {
        width: min(100% - 1rem, var(--container));
    }

    .hero-content,
    .page-hero {
        padding: 1.25rem;
    }

    .services-grid,
    .cards-grid,
    .speed-grid,
    .form-row,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .speed-grid div,
    .service-card,
    .card,
    .policy-card,
    .form-card {
        padding: 1rem;
    }

    .cookie-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-donate,
    .topbar-share {
        justify-content: center;
    }
}
