﻿/* CSS Reset and Variables */
:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-tertiary: #191919;
    --text-primary: #F5F5F5;
    --text-secondary: #A3A3A3;
    --text-tertiary: #737373;
    --accent-blue: #3B82F6;
    --accent-green: #10B981;
    --accent-orange: #F59E0B;
    --accent-purple: #8B5CF6;
    --border-color: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(23, 23, 23, 0.5);
    --card-hover: rgba(30, 30, 30, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

    /* Background Pattern */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.1), transparent 40%), radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.1), transparent 40%);
        z-index: -2;
        animation: slow-pan 20s linear infinite alternate;
    }

@keyframes slow-pan {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20px, 20px);
    }
}

.bg-grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 4rem 4rem;
    z-index: -1;
    opacity: 0.5;
}


/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    transition: opacity 0.3s ease;
}

    .logo:hover {
        opacity: 0.8;
    }

.logo-icon {
    height: 36px;
    width: auto;
}

.logo-text {
    font-weight: 800;
    font-size: 22px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #eafcef 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 40px;
    list-style: none;
    align-items: center;
}

    .nav-menu a {
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        font-size: 15px;
        transition: color 0.3s ease;
        position: relative;
        padding: 8px 0;
        cursor: pointer;
    }

        .nav-menu a:hover {
            color: var(--text-primary);
        }

        .nav-menu a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--accent-blue);
            transition: width 0.3s ease;
        }

        .nav-menu a:hover::after {
            width: 100%;
        }

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 0;
    margin-top: 16px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

    .dropdown-menu a:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        padding-left: 24px;
    }

    .dropdown-menu a::after {
        display: none;
    }

/* General Sections and Containers */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

    .section-header h2 {
        font-size: 42px;
        font-weight: 800;
        margin-bottom: 16px;
        letter-spacing: -1px;
    }

    .section-header p {
        font-size: 18px;
        color: var(--text-secondary);
        max-width: 600px;
        margin: 0 auto;
    }

.animated-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

    .animated-section.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Hero Section */
.hero {
    padding: 200px 0 120px;
    text-align: center;
    position: relative;
}

h1 {
    font-size: clamp(38px, 6vw, 70px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(180deg, #FFFFFF 0%, #A3A3A3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Services Section */
#services {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }

.service-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.service-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Projects Section */
.projects {
    padding: 120px 0;
}

.tab-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

    .tab-btn:hover {
        color: var(--text-primary);
    }

    .tab-btn.active {
        color: var(--accent-blue);
    }

        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--accent-blue);
        }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    display: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

    .project-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 50% 0, rgba(59, 130, 246, 0.15), transparent 70%);
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    .project-card:hover::before {
        opacity: 1;
    }

    .project-card.active {
        display: flex;
        flex-direction: column;
        animation: fadeIn 0.5s ease-in-out;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    z-index: 1;
}

.project-logo {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

    .project-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.project-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.project-type {
    font-size: 14px;
    color: var(--text-tertiary);
}

.project-status {
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

    .project-status.testnet {
        background: rgba(245, 158, 11, 0.1);
        color: var(--accent-orange);
    }

    .project-status.archive {
        background: rgba(148, 163, 184, 0.1);
        color: var(--text-tertiary);
    }

.status-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.project-status.testnet .status-dot {
    animation-name: pulse-orange;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.project-status.archive .status-dot {
    animation: none;
}

.project-links {
    z-index: 1;
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.project-link {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

    .project-link:hover {
        background: var(--accent-blue);
        color: white;
    }

/* CTA & Explainer Sections */
.cta, .explainer {
    padding: 100px 0;
}

.explainer {
    background: var(--bg-primary);
    position: relative;
}

    .cta h2, .explainer h2 {
        font-size: 42px;
        font-weight: 800;
        margin-bottom: 16px;
        letter-spacing: -1px;
    }

    .cta p, .explainer p {
        font-size: 18px;
        color: var(--text-secondary);
        margin-bottom: 32px;
        max-width: 600px;
        margin: 0 auto 32px;
    }

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.2);
}

    .btn-primary:hover {
        background: #2563EB;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.3);
    }

    .btn-primary:disabled {
        background-color: var(--text-tertiary);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

    .btn-outline:hover {
        border-color: var(--text-primary);
        color: var(--text-primary);
        background: var(--border-color);
    }

/* Footer */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 60px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

    .footer-logo img {
        height: 32px;
    }

    .footer-logo span {
        font-size: 20px;
        font-weight: 700;
    }

.footer-description {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 300px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .footer-links a {
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 14px;
        transition: color 0.2s;
    }

        .footer-links a:hover {
            color: var(--text-primary);
        }

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.footer-social {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

    .footer-social a {
        width: 40px;
        height: 40px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        transition: all 0.2s;
    }

        .footer-social a:hover {
            background: var(--accent-blue);
            border-color: var(--accent-blue);
            color: white;
        }

/* Mobile Navigation */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    z-index: 1001;
}

    .mobile-toggle:hover {
        background: var(--card-bg);
    }

    .mobile-toggle span {
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        transition: all 0.3s ease;
        border-radius: 2px;
        transform-origin: center;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

.mobile-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s;
    z-index: 999;
}

    .mobile-nav.active {
        transform: translateY(0);
        opacity: 1;
    }

.mobile-nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .mobile-nav-menu a {
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 8px;
        display: block;
        transition: all 0.3s ease;
    }

        .mobile-nav-menu a:hover {
            background: var(--card-bg);
            color: var(--text-primary);
            padding-left: 24px;
        }

/* Blockchain Explainer Section */
.explainer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.explainer-form {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    max-width: 600px;
    margin: 24px auto 0;
}

.explainer-input {
    flex-grow: 1;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .explainer-input:focus {
        outline: none;
        border-color: var(--accent-blue);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

    .modal-header h3 {
        font-size: 20px;
        color: var(--text-primary);
    }

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

    .close-modal:hover {
        color: var(--text-primary);
    }

#explanation-result {
    color: var(--text-secondary);
    line-height: 1.7;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 10px;
}

    #explanation-result::-webkit-scrollbar {
        width: 4px;
    }

    #explanation-result::-webkit-scrollbar-thumb {
        background-color: var(--accent-blue);
        border-radius: 4px;
    }

    #explanation-result strong {
        color: var(--text-primary);
        font-weight: 600;
    }

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 24px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .dashboard-grid {
        flex-direction: column;
        gap: 24px;
    }

    .dashboard-divider {
        display: none;
    }
}

@media (max-width: 968px) {
    nav {
        height: 72px;
    }

    .logo-text {
        font-size: 20px;
    }

    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .hero {
        padding: 140px 0 60px;
    }

    h1 {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-brand, .footer-section {
        align-items: center;
        text-align: center;
    }

    .footer-description {
        max-width: 400px;
    }

    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    nav {
        padding: 0 24px;
    }

    .tab-nav {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

        .cta-buttons .btn {
            width: 200px;
        }

    .explainer-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0 16px;
    }

    .logo-icon {
        height: 32px;
    }

    .logo-text {
        display: none;
    }

    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: 36px;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-header h2, .cta h2, .explainer h2 {
        font-size: 28px;
    }

    .cta p, .explainer p {
        font-size: 16px;
    }
}
