/* ============================================
   DataNest — Modern Crypto-Analytics Theme
   Hybrid dark/light, Cyan + Gold palette
   ============================================ */

/* --- Color System --- */
:root {
    --primary: #0891b2;
    --primary-light: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.15);
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.25);

    --bg-hero: #0c1222;
    --bg-page: #ffffff;
    --bg-section: #f1f5f9;
    --bg-card: #ffffff;

    --text: #1e293b;
    --text-muted: #64748b;
    --text-on-dark: #e2e8f0;
    --text-on-dark-muted: rgba(255, 255, 255, 0.6);

    --border: #e2e8f0;
    --border-dark: rgba(6, 182, 212, 0.2);

    --header-bg: rgba(12, 18, 34, 0.85);
    --footer-bg: #080d19;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 32px rgba(6, 182, 212, 0.12);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 100px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-page);
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-light);
}

/* --- Skip to Content (a11y) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: var(--bg-hero);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.skip-link:focus {
    top: 16px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.header.scrolled {
    border-bottom-color: var(--border-dark);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: 64px;
}

/* Logo */
.logo {
    display: flex;
    align-items: baseline;
    gap: 0;
    text-decoration: none;
}

.logo-data {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.logo-nest {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav a {
    color: var(--text-on-dark-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: #ffffff;
}

.nav a.active {
    color: #ffffff;
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    padding: 3px;
}

.lang-toggle-btn {
    padding: 0.25rem 0.625rem;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-on-dark-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.lang-toggle-btn.active {
    background: var(--primary);
    color: #ffffff;
}

/* Hamburger (mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 18, 34, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
    opacity: 1;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2rem;
}

.mobile-nav a {
    color: var(--text-on-dark);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-nav a:hover {
    color: var(--accent);
}

.mobile-nav-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    background: var(--bg-hero);
    color: #ffffff;
    padding: 8rem 0 6rem;
    min-height: calc(100svh - 64px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Gradient mesh background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 70% 30%, rgba(6, 182, 212, 0.15), transparent),
        radial-gradient(ellipse 500px 500px at 30% 70%, rgba(245, 158, 11, 0.1), transparent),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(139, 92, 246, 0.08), transparent);
    animation: meshDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Dot grid overlay */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle 1px at center, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

@keyframes meshDrift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.02); }
    66% { transform: translate(-20px, 15px) scale(0.98); }
    100% { transform: translate(10px, -10px) scale(1.01); }
}

.hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-light);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.75);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* CTA Button (gold) */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: var(--bg-hero);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--accent-hover);
    color: var(--bg-hero);
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
}

/* Ghost Button */
.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all 0.3s ease;
}

.ghost-button:hover {
    background: rgba(6, 182, 212, 0.1);
    color: #ffffff;
    border-color: #ffffff;
    transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0;
    animation-delay: 2s;
    animation-fill-mode: forwards;
    transition: opacity 0.3s ease;
}

.scroll-indicator.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
}

@keyframes scrollBounce {
    0% { opacity: 0; }
    10% { opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.6; }
    100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* --- Sections --- */
.section {
    padding: 6rem 0;
}

.section-bg {
    background-color: var(--bg-section);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 1rem auto 3rem;
}

/* --- Service Cards --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    box-shadow: var(--shadow-card);
    text-align: left;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-top-color: var(--accent);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--primary-glow);
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.service-icon svg {
    width: 32px;
    height: 32px;
}

.service-card h3 {
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.service-card ul {
    margin-top: 1rem;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.service-card li {
    margin-bottom: 0.375rem;
}

/* --- About Content --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
}

.about-text h2,
.about-text h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    font-weight: 700;
}

.about-text h2:first-child,
.about-text h3:first-child {
    margin-top: 0;
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* --- Stats --- */
.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.stat-item {
    text-align: center;
    padding: 1.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.375rem;
}

/* --- Contact --- */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-info {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.contact-info h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    color: var(--primary);
}

.contact-icon svg {
    width: 20px;
    height: 20px;
}

.contact-item strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.contact-item div {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* --- Contact Form --- */
.contact-form {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.contact-form h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    background-color: var(--bg-page);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--bg-hero);
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.form-message {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
}

.form-message-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--footer-bg);
    color: var(--text-on-dark);
    padding: 4rem 0 1.5rem;
    border-top: 1px solid;
    border-image: linear-gradient(90deg, transparent, var(--primary), transparent) 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-info h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
}

.footer-logo-data {
    color: #ffffff;
}

.footer-logo-nest {
    color: var(--accent);
}

.footer-info p {
    color: var(--text-on-dark-muted);
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
}

.footer-links h4,
.footer-contact h4 {
    color: #ffffff;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-on-dark-muted);
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-contact p {
    color: var(--text-on-dark-muted);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.footer-contact a {
    color: var(--primary-light);
}

.footer-origin {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-on-dark-muted);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-children > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-children.revealed > *:nth-child(1) { transition-delay: 0ms; }
.reveal-children.revealed > *:nth-child(2) { transition-delay: 80ms; }
.reveal-children.revealed > *:nth-child(3) { transition-delay: 160ms; }
.reveal-children.revealed > *:nth-child(4) { transition-delay: 240ms; }
.reveal-children.revealed > *:nth-child(5) { transition-delay: 320ms; }
.reveal-children.revealed > *:nth-child(6) { transition-delay: 400ms; }

/* Hero content fade-in */
.hero-fade {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-content {
        min-height: 56px;
    }

    /* Hide desktop nav, show hamburger */
    .nav,
    .header .lang-toggle {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-nav-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-nav-overlay.open {
        pointer-events: auto;
    }

    .hero {
        padding: 6rem 0 4rem;
        min-height: auto;
    }

    .hero::before {
        background-size: 60%;
    }

    .section {
        padding: 4rem 0;
    }

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

    .services-grid {
        grid-template-columns: 1fr;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-card:hover {
        transform: none;
    }

    .stat-item:hover {
        transform: none;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .section {
        padding: 3rem 0;
    }

    .contact-info,
    .contact-form {
        padding: 1.5rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .reveal-children > * {
        opacity: 1;
        transform: none;
    }

    .hero-fade {
        opacity: 1;
        transform: none;
    }
}
