/* ===== Local Fonts ===== */
@import url('fonts.css');

/* ===== CSS Variables ===== */
:root {
    --purple: #7B6CB5;
    --purple-light: #9585D0;
    --purple-dark: #5A4E8C;
    --teal: #009080;
    --teal-light: #00b8a3;
    --teal-dark: #006e62;
    --bg-base: #f0f0f5;
    --bg-light: #fafafc;
    --bg-card: rgba(255, 255, 255, 0.55);
    --text-primary: #1a1a2e;
    --text-secondary: #555577;
    --text-muted: #8888aa;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(144, 144, 208, 0.25);
    --glass-shadow: rgba(100, 100, 140, 0.1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Background Effects ===== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(123, 108, 181, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 144, 128, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(123, 108, 181, 0.05) 0%, transparent 50%),
        var(--bg-base);
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(123, 108, 181, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 108, 181, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ===== Floating Orbs ===== */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(123, 108, 181, 0.15);
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(0, 184, 163, 0.12);
    bottom: -100px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(123, 108, 181, 0.10);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.03); }
}

/* ===== Glass Card ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.glass-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-hover:hover {
    transform: translateY(-6px);
    border-color: rgba(123, 108, 181, 0.45);
    box-shadow: 0 20px 60px rgba(100, 100, 140, 0.15), 0 0 40px rgba(123, 108, 181, 0.06);
}

/* ===== Navigation ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(240, 240, 245, 0.80);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 20px rgba(100, 100, 140, 0.08);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-logo img {
    width: 40px;
    height: 32px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--teal));
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

.nav-links a:hover::after {
    width: 100%;
}

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

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 5rem;
}

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

.hero-logo {
    width: 140px;
    height: auto;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
    filter: drop-shadow(0 0 30px rgba(123, 108, 181, 0.25));
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--purple-dark);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.1s both;
    background: rgba(123, 108, 181, 0.10);
    border: 1px solid rgba(123, 108, 181, 0.20);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--teal-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    color: var(--text-primary);
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--teal));
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(123, 108, 181, 0.30);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(123, 108, 181, 0.40);
}

.btn-secondary {
    background: rgba(123, 108, 181, 0.10);
    color: var(--purple-dark);
    border: 1px solid rgba(123, 108, 181, 0.25);
}

.btn-secondary:hover {
    background: rgba(123, 108, 181, 0.18);
    transform: translateY(-2px);
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    display: block;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* ===== Services Section ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.service-card {
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

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

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

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.service-icon.purple {
    background: rgba(123, 108, 181, 0.12);
}

.service-icon.teal {
    background: rgba(0, 144, 128, 0.12);
}

.service-icon.mixed {
    background: linear-gradient(135deg, rgba(123, 108, 181, 0.12), rgba(0, 144, 128, 0.12));
}

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

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

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    background: rgba(123, 108, 181, 0.08);
    color: var(--purple-dark);
    border: 1px solid rgba(123, 108, 181, 0.15);
}

/* ===== Tech Stack Section ===== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tech-item {
    padding: 1.5rem;
    text-align: center;
    border-radius: 16px;
}

.tech-item .tech-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.tech-item span:last-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Code Preview ===== */
.code-section {
    padding: 4rem 0;
}

.code-window {
    max-width: 700px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(144, 144, 208, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: rgba(20, 20, 35, 0.9);
    border-bottom: 1px solid rgba(144, 144, 208, 0.1);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #28c840; }

.code-title {
    margin-left: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #8888aa;
}

.code-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
    color: #e0e0f0;
}

.code-body .keyword { color: #a8a8e0; }
.code-body .function { color: #00b8a3; }
.code-body .string { color: #f0c674; }
.code-body .comment { color: #555577; }
.code-body .number { color: #e08070; }

/* ===== Stats Section ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Contact Section ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.contact-info {
    padding: 2.5rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--purple);
}

.contact-link-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(123, 108, 181, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-form {
    padding: 2.5rem;
}

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

.hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(123, 108, 181, 0.20);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(123, 108, 181, 0.10);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

/* ===== Footer ===== */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand img {
    width: 28px;
    height: 22px;
    object-fit: contain;
}

.footer-brand span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.footer-socials a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(123, 108, 181, 0.08);
    border: 1px solid rgba(123, 108, 181, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.footer-socials a:hover {
    color: var(--purple);
    border-color: rgba(123, 108, 181, 0.40);
    background: rgba(123, 108, 181, 0.12);
    transform: translateY(-2px);
}

/* ===== Back To Top ===== */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    cursor: pointer;

    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 40px var(--glass-shadow);
    backdrop-filter: blur(16px);

    color: var(--text-primary);
    font-size: 1.15rem;
    line-height: 1;

    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: rgba(123, 108, 181, 0.40);
}

.back-to-top:focus-visible {
    outline: 2px solid rgba(123, 108, 181, 0.55);
    outline-offset: 3px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 1.5rem 2rem;
        background: rgba(240, 240, 245, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
        gap: 1rem;
    }

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

    .nav-toggle {
        display: flex;
    }

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

    section {
        padding: 4rem 0;
    }

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

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

    .hero h1 {
        font-size: 2rem;
    }

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