@import url('variables.css');

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text-dark);
    background: var(--gradient-hero);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.6s ease, color 0.6s ease;
    opacity: 0;
}

body::before {
    content: '';
    position: fixed;
    inset: -20vh -30vw -10vh;
    pointer-events: none;
    background: radial-gradient(circle at 20% 30%, rgba(132, 92, 255, 0.18), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(26, 232, 255, 0.14), transparent 55%),
                radial-gradient(circle at 40% 75%, rgba(78, 59, 255, 0.14), transparent 60%);
    z-index: -2;
    filter: blur(0);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 0),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 0);
    background-size: 80px 80px;
    opacity: 0.35;
    z-index: -3;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-shadow: 0 0 12px rgba(26, 232, 255, 0.7);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-md);
}

h1, h2, h3, h4 {
    font-family: var(--font-family-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

main {
    position: relative;
    z-index: 1;
}

section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

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

/* ====== Grid System ====== */
.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 1024px) {
    .row {
        gap: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .row {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        grid-column: span 1;
    }
}

/* ====== Header & Navigation ====== */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 1380px);
    margin: 0 auto;
    height: var(--header-height);
    padding: 0 var(--spacing-md);
    background: linear-gradient(120deg, rgba(10, 12, 34, 0.92) 0%, rgba(7, 10, 28, 0.92) 100%);
    border: var(--glass-border);
    border-radius: calc(var(--border-radius-lg) * 0.8);
    box-shadow: var(--box-shadow-sm);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.header::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid rgba(26, 232, 255, 0.08);
    box-shadow: inset 0 0 20px rgba(132, 92, 255, 0.12);
    opacity: 0.6;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: var(--spacing-md);
    flex-wrap: nowrap;
}

.header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-light);
    letter-spacing: 0.08em;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding-left: 0;
    white-space: nowrap;
    position: relative;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-sm) * 0.45);
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.95rem;
    line-height: 1;
    border-radius: 999px;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.96rem;
    letter-spacing: 0.03em;
    transition: all 0.35s ease;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-light);
    text-shadow: 0 0 10px rgba(132, 92, 255, 0.6);
}

.nav-link:hover::after,
.nav-link.active::after {
    border-color: rgba(132, 92, 255, 0.5);
    opacity: 1;
    box-shadow: 0 0 18px rgba(26, 232, 255, 0.35);
}

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 18px);
    left: 0;
    min-width: 220px;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    background: var(--gradient-surface);
    border: var(--glass-border);
    box-shadow: var(--box-shadow-md);
    list-style: none;
    z-index: 1010;
    animation: dropdownFade 0.3s ease;
    pointer-events: auto;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 24px;
    width: 16px;
    height: 16px;
    background: inherit;
    transform: rotate(45deg);
    border-left: var(--glass-border);
    border-top: var(--glass-border);
}

.nav-item:hover > .dropdown-menu,
.nav-item:focus-within > .dropdown-menu {
    display: block;
}

.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown .dropdown-menu {
    pointer-events: none;
}

.nav-item.has-dropdown.menu-open .dropdown-menu,
.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item.has-dropdown:focus-within .dropdown-menu {
    pointer-events: auto;
}

.nav-item.has-dropdown.menu-open > .dropdown-menu {
    display: block;
}

.dropdown-item a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--color-text-dark);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
}

.dropdown-item a:hover {
    background: rgba(132, 92, 255, 0.15);
    color: var(--color-text-light);
    box-shadow: inset 0 0 0 1px rgba(132, 92, 255, 0.25);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 6px 8px;
}

.menu-toggle.open {
    color: var(--color-accent);
}

/* Header placeholder */
.content-placeholder {
    height: calc(var(--header-height) + 20px);
}

/* ====== Sections & Components ====== */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title h2 {
    display: inline-block;
    padding: 0.4rem 1.4rem;
    background: rgba(12, 17, 40, 0.75);
    border: 1px solid rgba(132, 92, 255, 0.25);
    border-radius: 999px;
    box-shadow: 0 0 25px rgba(132, 92, 255, 0.2);
}

.section-title p {
    margin-top: var(--spacing-xs);
    color: var(--color-text-muted);
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.section-title .subtitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-accent);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.section-title .subtitle::before,
.section-title .subtitle::after {
    content: '';
    width: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(26, 232, 255, 0.6));
}

.card {
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    border: var(--glass-border);
    box-shadow: var(--box-shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border 0.4s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(132, 92, 255, 0.08), rgba(10, 15, 40, 0.7));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
    border-color: rgba(26, 232, 255, 0.35);
}

.card:hover::before {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

.glow-card {
    padding: calc(var(--spacing-md) + 10px);
    background: linear-gradient(140deg, rgba(132, 92, 255, 0.18), rgba(9, 13, 35, 0.85));
    border: 1px solid rgba(132, 92, 255, 0.35);
    box-shadow: 0 0 65px rgba(132, 92, 255, 0.25);
}

.holo-card {
    background: linear-gradient(130deg, rgba(12, 17, 40, 0.92), rgba(14, 20, 45, 0.92));
    border: 1px solid rgba(26, 232, 255, 0.25);
    box-shadow: 0 20px 40px rgba(9, 15, 45, 0.55), 0 0 40px rgba(26, 232, 255, 0.2);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(26, 232, 255, 0.16);
    color: var(--color-text-light);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge.purple {
    background: rgba(132, 92, 255, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.8rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: none;
    position: relative;
    z-index: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: rgba(5, 7, 20, 0.9);
    z-index: -1;
    transition: background 0.35s ease, opacity 0.35s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #04040c;
    box-shadow: 0 0 25px rgba(132, 92, 255, 0.4);
}

.btn-primary::before {
    background: transparent;
}

.btn-outline {
    background: rgba(10, 14, 38, 0.9);
    color: var(--color-text-light);
    border: 1px solid rgba(26, 232, 255, 0.45);
}

.btn-ghost {
    background: rgba(12, 17, 40, 0.65);
    color: var(--color-accent);
    border: 1px dashed rgba(26, 232, 255, 0.35);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px rgba(26, 232, 255, 0.35);
}

.btn:hover::before {
    opacity: 0;
}

.btn-large {
    padding: 1rem 2.8rem;
    font-size: 1.05rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(132, 92, 255, 0.25);
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.gradient-text {
    background: linear-gradient(120deg, #fff 0%, rgba(26, 232, 255, 0.85) 60%, rgba(132, 92, 255, 0.95) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 45px rgba(132, 92, 255, 0.35);
}

.muted {
    color: var(--color-text-muted);
}

.cyber-grid {
    display: grid;
    gap: var(--spacing-md);
}

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

.cyber-grid.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cyber-grid.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.floating {
    animation: floating 6s ease-in-out infinite;
}

.floating.delay-2 {
    animation-delay: 1.5s;
}

.floating.delay-3 {
    animation-delay: 3s;
}

.divider {
    width: 90px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(132, 92, 255, 0.7), transparent);
    margin: var(--spacing-sm) auto;
}

.content-placeholder {
    height: calc(var(--header-height) + 40px);
}

/* ====== Footer ====== */
.footer {
    background: radial-gradient(circle at 50% 10%, rgba(78, 59, 255, 0.2), transparent 70%),
                linear-gradient(180deg, rgba(6, 8, 24, 0.9) 0%, rgba(4, 5, 16, 0.95) 100%);
    color: var(--color-text-muted);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(132, 92, 255, 0.2);
}

.footer::before {
    content: '';
    position: absolute;
    inset: -20% 10%;
    background: radial-gradient(circle, rgba(132, 92, 255, 0.18), transparent 65%);
    filter: blur(60px);
    opacity: 0.6;
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer-section h4 {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.12em;
}

.footer-links {
    list-style: none;
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: var(--color-text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
    transform: translateX(4px);
}

.footer-contact p {
    margin-bottom: 10px;
    color: var(--color-text-dark);
}

.footer .badge {
    margin-bottom: var(--spacing-sm);
}

.copyright {
    text-align: center;
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

/* ====== Back to top ====== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-primary);
    color: #04040c;
    border: none;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: var(--box-shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 40px rgba(26, 232, 255, 0.5);
}

/* ====== Animations ====== */
@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(132, 92, 255, 0.45);
    }
    50% {
        box-shadow: 0 0 35px rgba(26, 232, 255, 0.65);
    }
}

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

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(80%);
    }
    100% {
        transform: translateX(120%);
    }
}

/* ====== Responsive ====== */
@media (max-width: 1200px) {
    .header {
        width: calc(100% - 32px);
    }
}

@media (max-width: 1024px) {
    .header {
        padding: 0 var(--spacing-sm);
    }

    .nav-menu {
        gap: 8px;
    }

    .nav-link {
        font-size: 0.92rem;
    }
}

@media (max-width: 900px) {
    .header {
        width: calc(100% - 28px);
    }

    .nav-menu {
        position: fixed;
        top: calc(var(--header-height) + 12px);
        left: 50%;
        transform: translateX(-50%);
        width: min(92%, 460px);
        flex-direction: column;
        background: var(--gradient-surface);
        border: var(--glass-border);
        border-radius: var(--border-radius-lg);
        padding: var(--spacing-md);
        box-shadow: var(--box-shadow-lg);
        display: none;
        gap: var(--spacing-sm);
        overflow: visible;
        justify-content: flex-start;
        align-items: stretch;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.85rem 1rem;
        justify-content: flex-start;
        border-radius: var(--border-radius-md);
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        background: rgba(6, 8, 24, 0.9);
        border: 1px solid rgba(132, 92, 255, 0.2);
        box-shadow: none;
        border-radius: var(--border-radius-md);
        margin-top: -4px;
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown-item a {
        padding: 0.5rem 0.75rem;
    }

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

@media (max-width: 600px) {
    .header {
        width: calc(100% - 20px);
        padding: 0 var(--spacing-xs);
    }

    .logo a {
        font-size: 1.35rem;
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .btn-large {
        width: 100%;
    }

    .back-to-top {
        bottom: 18px;
        right: 18px;
    }
}
