/**
 * Cyberplex Portal - Main Stylesheet
 * 
 * Imports:
 * 1. tokens.css - Design system tokens (--cp-*)
 * 2. token-bridge.css - Legacy variable mappings
 * 3. components/*.css - BEM component styles
 */

/* Design System Tokens */
@import url('tokens.css');
@import url('token-bridge.css');

/* Component Library - loaded via components.css in HTML */

/* CSS Variables - Layout only (colors/spacing from --cp-* tokens via bridge) */
:root {
    /* Layout */
    --container-max: 1200px;
    --container-padding: 20px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--cp-bg);
}

.cp-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

p {
    color: var(--text-light);
}

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

a:hover {
    color: var(--secondary-color);
}

/* Navigation */
.cp-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.cp-navbar__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
}

.cp-navbar__logo {
    display: inline-flex;
    align-items: center;
}

.cp-navbar__logo img,
.cp-navbar__logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.cp-navbar__logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.cp-navbar__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.cp-navbar__portal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--cp-surface);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background:
        radial-gradient(120% 140% at 20% 10%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, var(--cp-primary) 0%, var(--cp-primary-hover) 55%, var(--cp-deep) 100%);
    box-shadow:
        0 10px 18px rgba(var(--cp-deep-rgb), 0.18),
        0 2px 0 rgba(255, 255, 255, 0.12) inset;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.cp-navbar__portal-button::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -60%;
    width: 60%;
    height: 160%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(18deg);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.cp-navbar__portal-button:hover {
    color: var(--cp-surface);
    transform: translateY(-1px);
    box-shadow:
        0 14px 24px rgba(var(--cp-deep-rgb), 0.22),
        0 2px 0 rgba(255, 255, 255, 0.14) inset;
}

.cp-navbar__portal-button:hover::after {
    transform: translateX(260%) rotate(18deg);
}

.cp-navbar__portal-button:active {
    transform: translateY(0);
}

.cp-navbar__portal-button:focus-visible {
    outline: 3px solid rgba(var(--cp-accent-rgb), 0.55);
    outline-offset: 3px;
}

.cp-navbar__links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.cp-navbar__links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.cp-navbar__links a:hover {
    color: var(--accent-color);
}

.cp-language-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cp-language-switcher__button {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.5;
}

.cp-language-switcher__button:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.cp-language-switcher__button--active {
    opacity: 1;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--cp-primary-rgb), 0.2);
}

.cp-language-switcher__button svg {
    display: block;
    border-radius: 2px;
}

.cp-navbar__mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.cp-navbar__mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* Hero Section */
.cp-hero {
    position: relative;
    padding: 140px 0 100px;
    background: var(--cp-hero-grad);
    overflow: hidden;
}

.cp-hero .cp-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.cp-hero__content h1 {
    margin-bottom: 20px;
}

.cp-hero__content p {
    font-size: 1.125rem;
    margin-bottom: 32px;
    max-width: 540px;
}

.cp-hero__buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cp-hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cp-hero__server-rack {
    width: 200px;
    height: 280px;
    background: var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-lg);
}

.cp-hero__server-row {
    height: 50px;
    background: linear-gradient(135deg, var(--cp-deep) 0%, rgba(0, 50, 66, 0.8) 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.cp-hero__server-row::before {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--cp-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.cp-hero__wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
}

/* Section Header */
.cp-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.cp-section-header h2 {
    margin-bottom: 12px;
}

.cp-section-header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.cp-services {
    padding: 100px 0;
    background: var(--bg-white);
}

.cp-services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.cp-services__card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    transition: var(--transition);
}

.cp-services__card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.cp-services__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--accent-color);
}

.cp-services__icon svg {
    width: 100%;
    height: 100%;
}

.cp-services__card h3 {
    margin-bottom: 16px;
    color: var(--primary-color);
}

.cp-services__card p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* About Section */
.cp-about {
    padding: 100px 0;
    background: var(--bg-light);
}

.cp-about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.cp-about__content h2 {
    margin-bottom: 24px;
}

.cp-about__content > p {
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.cp-about__values {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cp-about__value {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cp-about__value-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.cp-about__value-icon svg {
    width: 24px;
    height: 24px;
}

.cp-about__value-text h4 {
    margin-bottom: 4px;
    color: var(--primary-color);
}

.cp-about__value-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cp-about__image {
    display: flex;
    justify-content: center;
}

.cp-about__image-placeholder {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-white) 0%, #e6f2ff 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.cp-about__server-icon-large {
    width: 200px;
    height: 200px;
    color: var(--secondary-color);
    opacity: 0.8;
}

.cp-about__server-icon-large svg {
    width: 100%;
    height: 100%;
}

/* Team Section */
.cp-team {
    padding: 100px 0;
    background: var(--bg-white);
}

.cp-team__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.cp-team__card {
    text-align: center;
}

.cp-team__avatar {
    margin-bottom: 16px;
}

.cp-team__avatar-placeholder {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.cp-team__card h4 {
    color: var(--primary-color);
    margin-bottom: 4px;
}

.cp-team__role {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Contact Section */
.cp-contact {
    padding: 100px 0;
    background: var(--bg-light);
}

.cp-contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.cp-contact__info h2 {
    margin-bottom: 16px;
}

.cp-contact__info > p {
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.cp-contact__details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cp-contact__item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cp-contact__icon {
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.cp-contact__icon svg {
    width: 24px;
    height: 24px;
}

.cp-contact__text span {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cp-contact__text a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.cp-contact__form-wrapper {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.cp-contact__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cp-contact__success {
    text-align: center;
    padding: 40px 20px;
}

.cp-contact__success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: #48bb78;
}

.cp-contact__success-icon svg {
    width: 100%;
    height: 100%;
}

.cp-contact__success h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.cp-contact__success p {
    color: var(--text-light);
}

/* Footer */
.cp-footer {
    background: var(--cp-deep);
    color: white;
    padding: 60px 0 30px;
}

.cp-footer__content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.cp-footer__main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
}

.cp-footer__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    display: block;
    margin-bottom: 16px;
}

.cp-footer__brand p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 300px;
}

.cp-footer__column h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1rem;
}

.cp-footer__column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cp-footer__column a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.cp-footer__column a:hover {
    color: white;
}

.cp-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 30px;
}

.cp-footer__bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cp-services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cp-team__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cp-about__grid,
    .cp-contact__grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .cp-about__image {
        order: -1;
    }
    
    .cp-footer__main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .cp-navbar__links {
        display: none;
    }

    .cp-navbar__portal-button {
        height: 38px;
        padding: 0 12px;
        font-size: 0.88rem;
    }
    
    .cp-navbar__mobile-toggle {
        display: flex;
    }
    
    .cp-hero .cp-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cp-hero__content p {
        max-width: 100%;
    }
    
    .cp-hero__buttons {
        justify-content: center;
    }
    
    .cp-hero__visual {
        order: -1;
        margin-bottom: 40px;
    }
    
    .cp-services__grid {
        grid-template-columns: 1fr;
    }
    
    .cp-team__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cp-footer__main {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .cp-footer__brand p {
        max-width: 100%;
    }
    
    .cp-contact__form-wrapper {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .cp-hero {
        padding: 120px 0 80px;
    }
    
    .cp-services,
    .cp-about,
    .cp-team,
    .cp-contact {
        padding: 60px 0;
    }
    
    .cp-team__grid {
        grid-template-columns: 1fr;
    }

    .cp-hero__buttons {
        flex-direction: column;
    }
}

/* Mobile Menu */
.cp-navbar__links.cp-navbar__links--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    gap: 16px;
}
