@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@300;400;600;700;800;900&display=swap');

:root {
    --brand-blue: #2563eb;
    --brand-blue-dark: #1d4ed8;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-400: #94a3b8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Mulish', sans-serif;
    background-color: var(--surface);
    color: #1e293b;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

section {
    padding: 80px 20px;
}

section[id] {
    scroll-margin-top: 96px;
}

.glass {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.hero-shell {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 30%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #f8fafc 54%, #ffffff 100%);
}

.blue-gradient-text {
    color: var(--brand-blue);
    background: linear-gradient(90deg, var(--brand-blue), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.proxy-card {
    background: var(--surface-soft);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.proxy-card:hover {
    border-color: #3b82f6;
    background: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.1);
}

.news-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: #93c5fd;
    box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
}

.btn-primary {
    background: var(--brand-blue);
    color: white;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--brand-blue-dark);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.status-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

.font-black {
    font-weight: 900;
}

.typing-cursor::after {
    content: "|";
    animation: blink 0.7s infinite;
    margin-left: 4px;
    color: var(--brand-blue);
}

.safe-top {
    padding-top: max(1rem, env(safe-area-inset-top));
}

.safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.break-safe {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.focus-ring:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.news-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.news-modal.hidden {
    display: none;
}

.news-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}

.news-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(90vh, 980px);
    overflow: hidden;
    border-radius: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 40px 80px -40px rgba(15, 23, 42, 0.55);
}

.news-modal-scroll {
    max-height: min(90vh, 980px);
    overflow-y: auto;
    padding: 2rem;
}

.news-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    color: var(--slate-900);
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
}

.news-modal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-right: 3.5rem;
}

.news-modal-tag {
    display: inline-flex;
    border-radius: 9999px;
    background: #eff6ff;
    color: var(--brand-blue);
    padding: 0.45rem 0.8rem;
    font-size: 0.625rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.news-modal-date {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--slate-400);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.news-modal-title {
    margin-top: 1.25rem;
    color: var(--slate-900);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.05;
    font-weight: 900;
}

.news-modal-excerpt {
    margin-top: 1rem;
    max-width: 48rem;
    color: var(--slate-600);
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 600;
}

.news-markdown {
    margin-top: 2rem;
    color: var(--slate-700);
    font-size: 1rem;
    line-height: 1.85;
}

.news-markdown h1,
.news-markdown h2,
.news-markdown h3 {
    color: var(--slate-900);
    font-weight: 900;
    line-height: 1.15;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.news-markdown h1 {
    font-size: 2rem;
}

.news-markdown h2 {
    font-size: 1.55rem;
}

.news-markdown h3 {
    font-size: 1.2rem;
}

.news-markdown p {
    margin: 0.9rem 0;
}

.news-markdown ul,
.news-markdown ol {
    margin: 1rem 0 1rem 1.25rem;
}

.news-markdown li + li {
    margin-top: 0.45rem;
}

.news-markdown strong {
    color: var(--slate-900);
}

.news-markdown a {
    color: var(--brand-blue);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.news-markdown code {
    background: #eff6ff;
    border-radius: 0.4rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.92em;
    color: var(--brand-blue-dark);
}

.news-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    color: var(--slate-400);
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    .glass {
        background: rgba(255, 255, 255, 0.98);
    }
}

@media (max-width: 767px) {
    .safe-top {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }

    section {
        padding: 64px 16px;
    }

    .news-modal {
        padding: 0;
    }

    .news-modal-dialog {
        width: 100%;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .news-modal-scroll {
        max-height: 100vh;
        padding: 1.25rem 1rem 2rem;
        padding-top: calc(1.25rem + env(safe-area-inset-top));
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }

    .news-modal-close {
        top: calc(0.75rem + env(safe-area-inset-top));
        right: 0.75rem;
    }
}

@media (max-width: 639px) {
    .hero-shell {
        padding-top: 7.75rem;
        padding-bottom: 4rem;
    }

    .hero-title {
        font-size: 2.15rem;
        line-height: 1.04;
        min-height: 0;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        line-height: 1.65;
        margin-bottom: 2rem;
    }

    .hero-shell .inline-block {
        margin-bottom: 1rem;
    }

    .mobile-panel {
        max-height: calc(100vh - 5rem);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .typing-cursor::after,
    .status-pulse {
        animation: none;
    }
}
