:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22d3ee;
    --success: #10b981;
    --danger: #ef4444;
    --font-main: 'Inter', sans-serif;
    --gradient-main: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: transparent;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 5px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    min-width: 0;
}

.logo {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 1001;
}

.logo img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 1;
    min-width: 0;
    padding: 0 1rem 0 0.5rem;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.cta-btn {
    background: white;
    color: var(--bg-dark);
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.15);
    background: #f1f5f9;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    padding: clamp(120px, 15vh, 180px) 0 clamp(60px, 10vh, 100px);
    text-align: center;
    background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 70%);
}

.hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.8rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

/* Services Grid */
.section-title {
    text-align: center;
    margin-bottom: clamp(40px, 8vh, 80px);
}

.section-title h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 15px;
}

.services {
    padding: clamp(60px, 10vh, 120px) 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(30px);
}

.service-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-12px);
    border-color: rgba(0, 210, 255, 0.4);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Article pages (MT4/MT5) */
.article-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(100px, 12vh, 140px) 0 80px;
}

.article-card {
    background: var(--bg-card);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-wrap: anywhere;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.article-card--cta {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.08), rgba(58, 123, 213, 0.08));
    border: 1px solid rgba(0, 210, 255, 0.15);
    text-align: center;
}

.article-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 992px) {
    .article-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Forms */
.contact-section {
    padding: 80px 0;
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.15);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    min-width: 600px;
}

th, td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Footer */
footer {
    background: var(--bg-card);
    padding: 80px 0 30px;
    margin-top: 100px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.footer-col h4 {
    margin-bottom: 25px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-col a {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.footer-col a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
@media (max-width: 1400px) {
    .nav-links {
        gap: 0.7rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .nav-links .cta-btn {
        padding: 7px 14px;
        font-size: 0.82rem;
    }
}

@media (max-width: 1200px) {
    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        font-size: 0.75rem;
    }

    .nav-links .cta-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .logo {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    }

    .logo img {
        height: 30px;
    }
}

@media (max-width: 1100px) {
    .nav-links {
        gap: 0.3rem;
    }

    .nav-links a {
        font-size: 0.68rem;
    }

    .nav-links .cta-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .logo {
        font-size: clamp(0.85rem, 2.2vw, 1rem);
    }

    .logo img {
        height: 26px;
    }
}

@media (max-width: 992px) {
    body.no-scroll {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 340px;
        height: 100dvh;
        height: -webkit-fill-available;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 100px 28px 40px;
        transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        overflow-x: hidden;
        gap: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1rem;
        width: 100%;
        text-align: center;
        padding: 13px 0;
    }

    .nav-links li {
        width: 100%;
        flex-shrink: 0;
    }

    .nav-links .cta-btn {
        margin-top: 8px;
        text-align: center;
        width: 100%;
        padding: 12px 0;
        font-size: 1rem;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    nav {
        height: 72px;
    }

    .logo {
        gap: 10px;
    }

    .logo img {
        height: 30px;
    }

    .container,
    .container-wide {
        padding: 0 1rem;
    }

    .article-page {
        padding: 100px 1rem 40px;
    }

    .article-card {
        padding: 1.5rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }
    
    .hero {
        padding-top: 140px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-col a {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        width: 100%;
        max-width: none;
        padding: 90px 20px 30px;
    }

    .nav-links a {
        font-size: 0.95rem;
        padding: 12px 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-col a {
        font-size: 0.9rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

/* Mobile-first layout utilities */
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    text-align: center;
}

.content-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-box--raised {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ui-grid {
    display: grid;
    gap: 20px;
}
.ui-grid--2 { grid-template-columns: 1fr 1fr; }
.ui-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.ui-grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    list-style: none;
}

.calc-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: start;
}

.calc-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-grid {
    display: grid;
    gap: 15px;
}
.calc-grid--2 { grid-template-columns: 1fr 1fr; }
.calc-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.calc-grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Tap targets + form ergonomics on phones */
button,
.cta-btn,
.read-more-btn,
.download-btn {
    min-height: 44px;
}

input,
select,
textarea {
    max-width: 100%;
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

pre,
code {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .content-box {
        padding: 22px;
        border-radius: 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .ui-grid--2,
    .ui-grid--3,
    .ui-grid--4 {
        grid-template-columns: 1fr;
    }

    .hero-cta .cta-btn {
        width: min(420px, 100%);
        text-align: center;
    }

    .calc-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calc-grid--2,
    .calc-grid--3,
    .calc-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}