/* --- CSS Variables & Reset --- */
:root {
    --bg-primary: #0a1118;
    --bg-secondary: #121f2b;
    --bg-tertiary: #1a2c3d;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent-color: #00d4ff;     /* Cyan */
    --accent-platform: #ff00d4;  /* Pink */
    --accent-contact: #00ff88;   /* Green */
    --border-color: #2d3748;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape on iOS */
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.5px; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease-in-out; }

/* Responsive images and media */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent overflow issues */
svg {
    max-width: 100%;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
}

/* Responsive tables */
table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
        table-layout: fixed;
    }

    .container {
        overflow-x: hidden;
        max-width: 100%;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HEADER & NAVIGATION --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: rgba(10, 17, 24, 0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.brand-text {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s;
}

.brand-text:hover {
    color: var(--accent-color);
}

.tab-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover {
    color: var(--accent-color);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- HERO SECTION --- */
.hero-wrapper {
    position: relative;
    padding: 60px 0 40px 0;
    text-align: center;
}

.logo-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.logo-container img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-wrapper--compact {
    padding: 40px 0;
}

/* --- CTA BUTTONS --- */
.cta-btn {
    display: inline-block;
    padding: 12px 32px;
    margin: 0 10px 10px 0;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.cta-primary {
    background: var(--accent-color);
    color: var(--bg-primary);
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.cta-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.cta-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
}

.cta-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.disabled-link {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: not-allowed;
}

.section-spacer {
    margin-bottom: 80px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title-lg {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-title-md {
    font-size: 2rem;
    margin-bottom: 50px;
    text-align: center;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.hero-accent {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* --- CONTENT CARDS --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 80px;
}

.card {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

.card.services-card:hover {
    border-color: var(--accent-color);
}

.card.platform-card:hover {
    border-color: var(--accent-platform);
}

.card.case-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.icon-box {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-blue {
    stroke: var(--accent-color);
    filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.4));
}

.icon-pink {
    stroke: var(--accent-platform);
    filter: drop-shadow(0 0 5px rgba(255, 0, 212, 0.4));
}

.feature-item {
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 12px;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tech-tag {
    display: inline-block;
    background: rgba(255, 0, 212, 0.1);
    color: var(--accent-platform);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* --- CONTACT FORM --- */
.contact-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 6px;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-contact);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- FOOTER --- */
footer {
    background-color: var(--bg-secondary);
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

footer a {
    transition: 0.3s;
}

/* --- BREADCRUMB --- */
.breadcrumb {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* --- RESPONSIVE --- */

/* Tablet styles */
@media (max-width: 1024px) {
    .container {
        width: 92%;
    }

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

    .section-title-lg {
        font-size: 2.2rem;
    }

    .section-spacer {
        margin-bottom: 60px;
    }

    /* Handle inline two-column grids */
    main > section > div[style*="grid-template-columns: 1fr 1fr"],
    section > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
}

/* Mobile landscape and smaller tablets */
@media (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 15px 5%;
    }

    .brand-text {
        font-size: 1.3rem;
        text-align: left;
        width: auto;
    }

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

    .tab-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        background-color: rgba(10, 17, 24, 0.98);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
        backdrop-filter: blur(10px);
        z-index: 999;
        -webkit-overflow-scrolling: touch;
    }

    .tab-nav.active {
        max-height: calc(100vh - 60px);
        padding: 15px 0;
    }

    .tab-btn {
        width: 90%;
        margin: 5px auto;
        padding: 12px 20px;
        font-size: 0.92rem;
        text-align: center;
        border-radius: 6px;
        min-height: 44px;
    }

    .tab-btn.active {
        background: rgba(0, 212, 255, 0.1);
        border-bottom: none;
    }

    .hero-wrapper {
        padding: 40px 0 30px 0;
    }

    .logo-container {
        max-width: 450px;
    }

    .section-title-lg {
        font-size: 2rem;
    }

    .section-title-md {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .section-spacer {
        margin-bottom: 50px;
    }

    .section-header {
        margin-bottom: 35px;
    }

    .cta-btn {
        padding: 12px 28px;
        margin: 5px 8px 5px 0;
        font-size: 0.9rem;
        min-height: 44px; /* Better touch target */
    }

    .grid-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 50px;
    }

    .card {
        padding: 25px;
    }

    .contact-card {
        padding: 30px 20px;
    }

    .form-group input,
    .form-group textarea {
        padding: 14px; /* Larger touch target */
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .btn-submit {
        min-height: 48px; /* Better touch target */
        font-size: 1rem;
    }

    footer {
        padding: 30px 0;
    }

    /* Footer grid responsive */
    footer .container > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }

    /* Handle inline two-column grids */
    main > section > div[style*="grid-template-columns: 1fr 1fr"],
    section > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }

    /* Responsive padding for sections with inline styles */
    section[style*="padding: 80px"] {
        padding: 50px 0 !important;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    header {
        padding: 12px 4%;
    }

    .container {
        width: 95%;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .tab-nav {
        gap: 3px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .logo-container {
        max-width: 320px;
    }

    .hero-wrapper {
        padding: 30px 0 20px 0;
    }

    .section-title-lg {
        font-size: 1.75rem;
    }

    .section-title-md {
        font-size: 1.6rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .hero-accent {
        font-size: 1.05rem;
    }

    /* Override inline font sizes */
    h1,
    h1[style*="font-size"] {
        font-size: 2rem !important;
    }

    h2,
    h2[style*="font-size"] {
        font-size: 1.6rem !important;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    p[style*="font-size: 1.1rem"],
    p[style*="font-size: 1.05rem"] {
        font-size: 1rem !important;
    }

    .section-spacer {
        margin-bottom: 40px;
    }

    .cta-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0 0 10px 0;
        padding: 14px 20px;
    }

    .card {
        padding: 20px;
    }

    .contact-card {
        padding: 25px 15px;
    }

    .icon-box {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }

    footer {
        padding: 25px 0;
    }

    footer h4 {
        font-size: 1.1rem;
    }

    footer p,
    footer li {
        font-size: 0.9rem;
    }

    /* Responsive section padding overrides */
    section[style*="padding: 80px"],
    section[style*="padding: 50px"] {
        padding: 40px 0 !important;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .brand-text {
        font-size: 1rem;
    }

    .tab-btn {
        padding: 7px 8px;
        font-size: 0.78rem;
    }

    .section-title-lg {
        font-size: 1.5rem;
    }

    .card {
        padding: 18px;
    }
}
