.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

@font-face {
    font-family: 'Archivo';
    src: url('/assets/fonts/Archivo-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Instrument Serif';
    src: url('/assets/fonts/InstrumentSerif-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Instrument Serif';
    src: url('/assets/fonts/InstrumentSerif-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-gray-50: #f9f9f9;
    --color-gray-100: #ececec;
    --color-gray-200: #e3e3e3;
    --color-gray-300: #cdcdcd;
    --color-gray-400: #b4b4b4;
    --color-gray-500: #9b9b9b;
    --color-gray-600: #676767;
    --color-gray-700: #4e4e4e;
    --color-gray-800: #333333;
    --color-gray-850: #262626;
    --color-gray-900: #171717;
    --color-gray-950: #0d0d0d;
    --transition-fast: 100ms;
    --transition-base: 150ms;
    --transition-slow: 300ms;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Archivo', 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.font-serif {
    font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

/* Hero gradient orb */
.hero-gradient {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(99, 102, 241, 0.3) 0%,
        rgba(139, 92, 246, 0.2) 30%,
        rgba(59, 130, 246, 0.1) 60%,
        transparent 70%
    );
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: gradient-shift 8s ease-in-out infinite;
    background-size: 200% 200%;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Glassmorphism card */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.dark .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Service status dot */
.service-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.service-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.service-dot--green {
    background-color: #22c55e;
}

.service-dot--green::after {
    background-color: rgba(34, 197, 94, 0.3);
}

.service-dot--yellow {
    background-color: #eab308;
}

.service-dot--yellow::after {
    background-color: rgba(234, 179, 8, 0.3);
}

.service-dot--red {
    background-color: #ef4444;
}

.service-dot--red::after {
    background-color: rgba(239, 68, 68, 0.3);
}

/* Uptime grid cell */
.uptime-cell {
    width: 8px;
    height: 24px;
    border-radius: 2px;
    display: inline-block;
    transition: transform var(--transition-fast) var(--transition-easing);
}

.uptime-cell:hover {
    transform: scaleY(1.3);
}

/* Scroll reveal */
.scroll-reveal,
.fly-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed,
.fly-in.fly-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Floating navigation wrapper */
#nav-wrapper {
    padding-top: 12px;
    padding-bottom: 4px;
    transition: padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#nav-wrapper.scrolled {
    padding-top: 8px;
    padding-bottom: 2px;
}

/* Floating navigation bar */
.nav-floating {
    max-width: 920px !important;
    margin: 0 auto !important;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.1);
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark .nav-floating {
    background: rgba(38, 38, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Scrolled state */
#nav-wrapper.scrolled .nav-floating {
    max-width: 840px !important;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 2px 6px rgba(0, 0, 0, 0.04);
}

html.dark #nav-wrapper.scrolled .nav-floating {
    background: rgba(38, 38, 38, 0.95);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Nav link smooth transitions */
#main-nav a {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

/* Mobile menu slide */
#mobile-menu {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Mobile menu link stagger */
#mobile-menu a,
#mobile-menu .pt-2 {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#mobile-menu.menu-open a,
#mobile-menu.menu-open .pt-2 {
    opacity: 1;
    transform: translateY(0);
}
#mobile-menu.menu-open a:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.menu-open a:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.menu-open a:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.menu-open a:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.menu-open a:nth-child(5) { transition-delay: 0.25s; }
#mobile-menu.menu-open .pt-2 { transition-delay: 0.3s; }

/* Hamburger icon transition */
@media (max-width: 767px) {
    #mobile-menu-btn {
        display: grid;
        place-items: center;
    }
}
#menu-icon-open,
#menu-icon-close {
    grid-area: 1 / 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* Feature card */
.feature-card {
    transition: transform var(--transition-slow) var(--transition-easing),
                box-shadow var(--transition-slow) var(--transition-easing);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.dark .feature-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Stat counter */
.stat-counter {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' on;
    letter-spacing: -0.02em;
}

/* Connector logo */
.connector-logo {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter var(--transition-slow) var(--transition-easing),
                opacity var(--transition-slow) var(--transition-easing);
}

.connector-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Pricing card popular */
.pricing-card-popular {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.pricing-card-popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #6366f1);
    z-index: -1;
    border-radius: 18px;
}

/* Gradient shimmer text */
.gradient-shimmer {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #6366f1, #3b82f6);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.font-instrument {
    font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--color-gray-700);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-600);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-400) transparent;
}

.dark * {
    scrollbar-color: var(--color-gray-700) transparent;
}

.article-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-gray-700);
}

html.dark .article-content {
    color: var(--color-gray-200);
}

.article-content h2 {
    font-family: 'Archivo', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-gray-900);
}

html.dark .article-content h2 {
    color: #ffffff;
}

.article-content h3 {
    font-family: 'Archivo', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-gray-900);
}

html.dark .article-content h3 {
    color: #ffffff;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content strong {
    font-weight: 600;
    color: var(--color-gray-900);
}

html.dark .article-content strong {
    color: #ffffff;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.article-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast) var(--transition-easing);
}

.article-content a:hover {
    color: #2563eb;
}

html.dark .article-content a {
    color: #60a5fa;
}

html.dark .article-content a:hover {
    color: #93bbfd;
}

.article-content blockquote {
    border-left: 3px solid var(--color-gray-300);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-gray-600);
}

html.dark .article-content blockquote {
    border-left-color: var(--color-gray-700);
    color: var(--color-gray-400);
}

.article-content code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.875em;
    background: var(--color-gray-100);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

html.dark .article-content code {
    background: var(--color-gray-800);
}

/* Share toolbar */
.share-toolbar {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--color-gray-200);
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(6px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

html.dark .share-toolbar {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.share-toolbar.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.share-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--color-gray-500);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.share-toolbar-btn:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
}

html.dark .share-toolbar-btn:hover {
    background: var(--color-gray-700);
    color: #ffffff;
}

.share-toolbar-btn[data-share-to="x"]:hover { color: #000000; }
html.dark .share-toolbar-btn[data-share-to="x"]:hover { color: #ffffff; }
.share-toolbar-btn[data-share-to="linkedin"]:hover { color: #0A66C2; }
.share-toolbar-btn[data-share-to="facebook"]:hover { color: #1877F2; }
.share-toolbar-btn[data-share-to="whatsapp"]:hover { color: #25D366; }
.share-toolbar-btn[data-share-to="telegram"]:hover { color: #26A5E4; }
.share-toolbar-btn[data-share-to="email"]:hover { color: #6366f1; }
.share-toolbar-btn[data-share-to="copy"]:hover { color: #6366f1; }

.share-toolbar-btn[data-share-to="copy"].copied {
    color: #10b981;
}

.share-btn.active {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

html.dark .share-btn.active {
    background: var(--color-gray-800);
    border-color: var(--color-gray-600);
}

.share-btn.active .share-icon {
    transform: rotate(180deg);
}

.share-btn.pulse {
    animation: share-pulse 0.4s ease;
}

@keyframes share-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(0.92); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Toolbar items stagger animation */
.share-toolbar.open .share-toolbar-btn {
    animation: share-item-in 0.25s ease backwards;
}
.share-toolbar.open .share-toolbar-btn:nth-child(1) { animation-delay: 0.02s; }
.share-toolbar.open .share-toolbar-btn:nth-child(2) { animation-delay: 0.04s; }
.share-toolbar.open .share-toolbar-btn:nth-child(3) { animation-delay: 0.06s; }
.share-toolbar.open .share-toolbar-btn:nth-child(4) { animation-delay: 0.08s; }
.share-toolbar.open .share-toolbar-btn:nth-child(5) { animation-delay: 0.10s; }
.share-toolbar.open .share-toolbar-btn:nth-child(6) { animation-delay: 0.12s; }
.share-toolbar.open .share-toolbar-btn:nth-child(7) { animation-delay: 0.14s; }

@keyframes share-item-in {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.text-balance {
    text-wrap: balance;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s var(--transition-easing) forwards;
}

.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

@media print {
    nav,
    footer,
    button,
    .no-print,
    .hero-gradient,
    .nav-floating {
        display: none !important;
    }

    body {
        color: #000 !important;
        background: #fff !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline !important;
    }

    .glass-card {
        background: #fff !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
    }

    .gradient-text {
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
        background: none !important;
    }
}

/* Hero gradient scales down on small screens */
@media (max-width: 768px) {
    .hero-gradient {
        width: 400px;
        height: 400px;
        filter: blur(60px);
    }

    .feature-card:hover {
        transform: none;
    }

    .uptime-cell {
        width: 6px;
        height: 18px;
    }
}

/* Large screens: wider gradient */
@media (min-width: 1536px) {
    .hero-gradient {
        width: 1100px;
        height: 1100px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .animate-float,
    .animate-spin-slow {
        animation: none;
    }

    .hero-gradient {
        animation: none;
    }

    .service-dot::after {
        animation: none;
    }

    .feature-card {
        transition: none;
    }

    .connector-logo {
        transition: none;
    }

    .share-toolbar {
        transition: none;
    }

    .share-toolbar.open .share-toolbar-btn {
        animation: none;
    }

    .share-btn.pulse {
        animation: none;
    }
}

/* Light mode defaults */
html:not(.dark) body {
    background-color: #ffffff;
    color: var(--color-gray-700);
}

/* Dark mode */
html.dark body {
    background-color: var(--color-gray-900);
    color: var(--color-gray-100);
}

html.dark .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

html.dark .gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

html.dark .pricing-card-popular::before {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #818cf8);
}

/* Selection color */
::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: inherit;
}

/* Focus-visible ring for accessibility */
:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 4px;
}

#main-content {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#main-content.page-leaving {
    opacity: 0;
    transform: translateY(8px);
}

#main-content.page-entering {
    opacity: 0;
    transform: translateY(-8px);
}

.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #a78bfa, #818cf8);
    z-index: 9999;
    transition: width 0.3s ease;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    #main-content {
        transition: none;
    }
    #main-content.page-leaving,
    #main-content.page-entering {
        opacity: 1;
        transform: none;
    }
}
