/* ============================================
   Deep Joy Digital — Main Stylesheet
   ============================================ */

:root {
    --bg-primary: #060a13;
    --bg-secondary: #0c1220;
    --bg-card: #0f1729;
    --bg-card-hover: #141e33;
    --border: rgba(201, 168, 76, 0.1);
    --border-hover: rgba(201, 168, 76, 0.25);

    --gold: #c9a84c;
    --gold-light: #f0d678;
    --gold-glow: rgba(201, 168, 76, 0.15);
    --blue: #3a7bd5;
    --blue-light: #5a9bf5;

    --text-primary: #e8eaf0;
    --text-secondary: #8892a8;
    --text-muted: #556178;

    --font-main: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

    --nav-height: 72px;
    --container-width: 1200px;
    --radius: 12px;
    --radius-sm: 8px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ============================================
   Background Canvas
   ============================================ */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
    background: rgba(6, 10, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

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

.logo-text {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    letter-spacing: 0.02em;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: rgba(201, 168, 76, 0.2);
    color: var(--gold);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 100;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(5px) translateX(5px);
}
.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-5px) translateX(5px);
}

/* ============================================
   Hero
   ============================================ */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
}

.hero-content {
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #c0c8d8 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-main);
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b8943c 100%);
    color: #0a0e17;
    box-shadow: 0 4px 24px rgba(201, 168, 76, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 8px 40px rgba(201, 168, 76, 0.35);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.03);
}

.btn-full {
    width: 100%;
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: scroll-fade 2s ease-in-out infinite;
}

@keyframes scroll-fade {
    0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
    100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* ============================================
   Sections (shared)
   ============================================ */
.section {
    position: relative;
    z-index: 1;
    padding: 120px 0;
}

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

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   Services
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    transition: all 0.5s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px var(--gold-glow);
}

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

.service-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    color: var(--gold);
}

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

.service-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.service-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(58, 123, 213, 0.08);
    color: var(--blue-light);
    border: 1px solid rgba(58, 123, 213, 0.12);
}

/* Last two cards: centered */
.services-grid .service-card:nth-child(4) {
    grid-column: 1 / 2;
    justify-self: end;
    max-width: calc(100% - 0px);
}

/* ============================================
   Why Us
   ============================================ */
.why {
    background: linear-gradient(180deg, transparent 0%, rgba(201, 168, 76, 0.02) 50%, transparent 100%);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.why-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    transition: all 0.4s var(--ease-out);
}

.why-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.why-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, rgba(201, 168, 76, 0.2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}

.why-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.why-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   About
   ============================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 64px;
    align-items: center;
}

.about-content .section-label {
    text-align: left;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 24px;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.stat {
    text-align: center;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.4s var(--ease-out);
}

.stat:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px var(--gold-glow);
}

.stat-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ============================================
   Contact
   ============================================ */
.contact {
    background: linear-gradient(180deg, transparent, rgba(201, 168, 76, 0.015));
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 12px;
    color: var(--gold);
}

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

.contact-item h4 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.contact-item a,
.contact-item span {
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--gold);
}

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 16px 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    resize: vertical;
}

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

.form-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s var(--ease-out);
}

.form-group textarea ~ label {
    top: 18px;
    transform: none;
}

.form-group input:focus ~ label,
.form-group input:valid ~ label {
    top: 8px;
    transform: none;
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
    top: 4px;
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Captcha */
.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.captcha-image-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-img {
    width: 200px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    object-fit: cover;
}

.captcha-refresh {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.captcha-refresh:hover {
    color: var(--gold);
    border-color: var(--border-hover);
}

.captcha-refresh svg {
    width: 18px;
    height: 18px;
}

.captcha-input-group {
    width: 100%;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.captcha-row .captcha-input-group {
    flex: 1;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Form messages */
.form-msg {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.4s ease;
}

.form-msg-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.25);
    color: #81c784;
}

.form-msg-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.25);
    color: #e57373;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-tagline {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   Popup
   ============================================ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.visible {
    opacity: 1;
}

.popup-box {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    padding: 40px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s var(--ease-out);
}

.popup-overlay.visible .popup-box {
    transform: scale(1);
}

.popup-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #e57373;
}

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

.popup-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.popup-btn {
    min-width: 120px;
}

/* ============================================
   Scroll Animations
   ============================================ */
[data-anim] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-anim].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Language switching transition
   ============================================ */
.lang-transitioning [data-i18n] {
    transition: opacity 0.2s ease;
    opacity: 0.4;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .services-grid .service-card:nth-child(4) {
        grid-column: auto;
        justify-self: auto;
    }
    .services-grid .service-card:nth-child(5) {
        grid-column: 1 / -1;
        max-width: 50%;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        background: rgba(6, 10, 19, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 99;
        overflow-y: auto;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        font-size: 1.4rem;
    }

    .nav-hamburger {
        display: flex;
    }

    .hero {
        padding: 100px 24px 60px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .section {
        padding: 80px 0;
    }

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

    .services-grid .service-card:nth-child(5) {
        max-width: 100%;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        flex-direction: row;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

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

    .captcha-img {
        width: 100%;
        height: auto;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .about-stats {
        flex-direction: column;
    }
}
