/* Base Styles */
:root {
    --primary: #8be9fd;
    --secondary: #ff79c6;
    --accent: #bd93f9;
    --success: #50fa7b;
    --warning: #f1fa8c;
    --danger: #ff5555;
    --background: #121212;
    --surface: #1e1e2e;
    --surface-light: #282a36;
    --text: #f8f8f2;
    --text-secondary: #bbb;
    --text-muted: #888;
    --black: #242424;
    --black2: #393e46;
    --white: var(--text);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: all 0.3s ease;

    /* Code highlighting colors */
    --code-keyword: #ff79c6;
    --code-function: #8be9fd;
    --code-string: #f1fa8c;
    --code-number: #bd93f9;
    --code-comment: #6272a4;
    --code-operator: #ff79c6;
    --code-property: #50fa7b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

html {
    font-size: 16px; /* Base font size */
    -webkit-text-size-adjust: 100%; /* Prevent text size adjust after orientation change */
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--background), var(--surface));
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100vw;
}

main {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

section {
    padding: 6rem 2rem;
    position: relative;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Text Utilities */
.gradient-text {
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: gradient-text 5s ease infinite;
}

@keyframes gradient-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    padding: 1rem 0;
    -webkit-tap-highlight-color: transparent;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(18, 18, 18, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
}

.nav-logo span {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: 4px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-button {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    color: var(--surface);
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    gap: 4rem;
    min-height: 100vh;
    padding-top: 8rem;
    padding-bottom: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: var(--surface);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

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

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.hero-cards {
    display: flex;
    gap: 1.5rem;
}

.hero-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.hero-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.hero-card i {
    color: var(--primary);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.code-window {
    width: 100%;
    max-width: 550px;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: var(--transition);
}

.code-window:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.code-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.code-dot:nth-child(1) {
    background: #ff5f56;
}

.code-dot:nth-child(2) {
    background: #ffbd2e;
}

.code-dot:nth-child(3) {
    background: #27c93f;
}

.code-title {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.code-block {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
    font-size: 0.9rem;
    white-space: pre;
    tab-size: 2;
}

/* Syntax highlighting classes */
.code-keyword { color: var(--code-keyword); }
.code-function { color: var(--code-function); }
.code-string { color: var(--code-string); }
.code-number { color: var(--code-number); }
.code-comment { color: var(--code-comment); }
.code-operator { color: var(--code-operator); }
.code-property { color: var(--code-property); }

/* Stats Section - FIXED 3D CUBE */
.stats-section {
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(139, 233, 253, 0.05), transparent 60%);
    z-index: -1;
}

.stats-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
    margin-top: 3rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: rgba(30, 30, 46, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 240px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 233, 253, 0.3);
    background: rgba(30, 30, 46, 0.8);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

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

/* Features Section */
.features {
    padding: 8rem 2rem;
    position: relative;
    background: linear-gradient(to bottom, transparent, rgba(30, 30, 46, 0.3), transparent);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.feature-card {
    background: rgba(30, 30, 46, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(139, 233, 253, 0.1), rgba(189, 147, 249, 0.1));
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 233, 253, 0.3);
}

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

.feature-icon-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(139, 233, 253, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.feature-card:hover .feature-icon-container {
    background: rgba(139, 233, 253, 0.2);
    transform: scale(1.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* API Endpoints Section */
.endpoints {
    padding: 8rem 2rem;
    position: relative;
}

.endpoints-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.endpoint-card {
    background: rgba(30, 30, 46, 0.8);
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.endpoint-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.endpoint-method {
    background: var(--primary);
    color: var(--surface);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}

.endpoint-method.post {
    background: var(--secondary);
}

.endpoint-path {
    font-family: monospace;
    font-size: 1rem;
    color: var(--text);
}

.endpoint-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.endpoint-link {
    align-self: flex-start;
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.endpoint-link:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

/* Projects Section */
.projects {
    padding: 8rem 2rem;
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
}

.project-card {
    background: rgba(30, 30, 46, 0.7);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 121, 198, 0.3);
}

.project-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(30, 30, 46, 1), transparent);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(45deg, rgba(139, 233, 253, 0.1), rgba(189, 147, 249, 0.1));
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.project-link:hover {
    background: linear-gradient(45deg, rgba(139, 233, 253, 0.2), rgba(189, 147, 249, 0.2));
}

.project-link i {
    transition: var(--transition);
}

.project-link:hover i {
    transform: translateX(5px);
}

/* CTA Section */
.cta-section {
    padding: 8rem 2rem;
    position: relative;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(30, 30, 46, 0.5), transparent);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(189, 147, 249, 0.1), transparent 70%);
    z-index: -1;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cta-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    -webkit-tap-highlight-color: transparent;
}

/* Footer */
footer {
    padding: 5rem 2rem 2rem;
    background: linear-gradient(to bottom, transparent, rgba(18, 18, 18, 0.8));
    position: relative;
    width: 100%;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 4rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.social-link i {
    color: var(--text);
    font-size: 1.2rem;
}

.footer-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--text-secondary);
    transition: var(--transition);
}

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

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 1200px) {
    html {
        font-size: 15px;
    }

    .hero {
        flex-direction: column;
        gap: 4rem;
        padding-top: 6rem;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-cards {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 14px; 
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
        z-index: 999;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-toggle {
        display: flex;
        z-index: 1000;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

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

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

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

    .cta-title {
        font-size: 2.5rem;
    }

    .stat-card {
        min-width: 200px;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 3rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    section {
        padding: 5rem 1.5rem;
    }

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

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-cards {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        width: 100%;
    }

    .hero-card {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

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

    .section-subtitle {
        font-size: 1rem;
    }

    .features-grid, 
    .projects-grid, 
    .endpoints-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .stats-container {
        gap: 2rem;
    }

    .stat-card {
        width: 100%;
        max-width: 300px;
    }

    .code-window {
        transform: none;
        max-width: 100%;
    }

    .code-block {
        font-size: 0.8rem;
        white-space: pre-wrap;
        word-break: break-all;
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

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

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 1rem;
    }

    .feature-card, 
    .project-card, 
    .endpoint-card {
        padding: 1.5rem;
    }

    .feature-icon-container {
        width: 60px;
        height: 60px;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .code-block {
        font-size: 0.7rem;
        padding: 1rem;
    }

    .code-block code {
        display: block;
        tab-size: 2;
    }
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
    body {
        -webkit-text-size-adjust: 100%;
    }

    input, textarea, select, button {
        font-size: 16px;
    }

    .hero-title {
        -webkit-text-size-adjust: 100%;
    }

    .section-title, .cta-title {
        -webkit-text-size-adjust: 100%;
    }
}