:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #4f46e5;
    /* Indigo/Blue for tech feel */
    --accent-glow: rgba(79, 70, 229, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --nav-height: 80px;
    --font-main: 'Outfit', sans-serif;
}

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

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

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Utilities */
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section {
    padding: 100px 0;
    position: relative;
    /* Ensure it sits above the fixed robot layer */
    z-index: 10;
}

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

.dark-bg {
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: center;
}

/* Glassmorphism */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}

/* Navigation */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.cta-button {
    padding: 10px 24px;
    background: var(--text-color);
    color: var(--bg-color) !important;
    border-radius: 30px;
    font-weight: 600;
}

.cta-button:hover {
    background: var(--accent-color);
    color: white !important;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
/* Hero Section */
.hero-section {
    min-height: 100vh;
    /* Allow it to grow if text is long */
    display: flex;
    align-items: center;
    padding: 120px 5%;
    /* Top padding for nav */
    position: relative;
    overflow: visible;
    /* Allow robot to be seen */
}

/* 
   New Robot Layer 
   Initial State: Top Right (Sidekick mode)
*/
#robot-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    /* Re-enabled for mouse tracking */
}

/* Ensure Spline viewer takes full space of layer */
#robot-layer spline-viewer {
    width: 100%;
    height: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

.hero-content {
    z-index: 10;
    width: 75%;
    /* Widened as requested */
    max-width: 1000px;
    /* Increased cap */
    padding-right: 0;
    background: radial-gradient(circle at center, rgba(5, 5, 5, 0.5), transparent 70%);
    /* Legibility */
    border-radius: 20px;
}

.hero-about-text {
    margin-top: 30px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-about-text h3 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.hero-about-text p {
    font-size: 1rem;
    color: #d4d4d8;
    margin-bottom: 15px;
    line-height: 1.7;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: #818cf8;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 90%;
    /* Allow it to fill the container */
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: var(--text-color);
    color: var(--bg-color);
}

.btn.primary:hover {
    background: var(--accent-color);
    color: white;
}

.btn.secondary {
    border: 1px solid var(--text-secondary);
    color: var(--text-color);
}

.btn.secondary:hover {
    border-color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}



spline-viewer {
    width: 100%;
    height: 100%;
    /* Override spline default limits if needed */
}

/* Services - Split Layout for Robot */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 400px;
    /* Huge gap in the middle for the robot */
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1000px) {
    .services-grid {
        gap: 30px;
        grid-template-columns: 1fr;
    }
}

.icon-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-card h3 {
    margin-bottom: 10px;
}

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

/* Orbit Layout System */
.orbit-container {
    position: relative;
    width: 1000px;
    /* Massive Scale */
    height: 1000px;
    margin: 100px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Solar System "Orbit Line" */
.orbit-container::before {
    content: '';
    position: absolute;
    width: 900px;
    /* 2 * 450px radius */
    height: 900px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.orbit-center {
    position: absolute;
    width: 650px;
    /* Robot is dominant */
    height: 650px;
    z-index: 10;
    pointer-events: auto;
    /* Re-enabled interaction for Spline robot */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The rotating ring */
.orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate 30s linear infinite;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through the ring area to the robot/cards */
}

/* Interaction: Pause on hover */
.orbit-container:hover .orbit-ring,
.orbit-container:hover .project-card {
    animation-play-state: paused;
}

/* Orbit Items (Wrapper for positioning only) */
.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 160px;
    margin-left: -110px;
    margin-top: -80px;
    pointer-events: auto;
    /* Re-enable clicks on cards */
}

/* Positioning items on the circle */
.item-1 {
    transform: rotate(0deg) translate(450px);
}

.item-2 {
    transform: rotate(90deg) translate(450px);
}

.item-3 {
    transform: rotate(180deg) translate(450px);
}

.item-4 {
    transform: rotate(270deg) translate(450px);
}

/* The CARD handles Counter-Rotation (Ferris Wheel Effect) */
.project-card {
    width: 100%;
    height: 100%;
    /* Premium Dark Glass Effect */
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    /* Subtle Accent Border */
    border-radius: 20px;

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;

    /* Soft Glow Shadow */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;

    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Vital for keeping text upright */
    animation: counter-rotate 30s linear infinite;
    overflow: hidden;
    /* For inner effects */
}

/* Hover Effect: "Active" State */
.project-card:hover {
    transform: scale(1.05);
    /* Slight grow */
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(79, 70, 229, 0.4),
        0 0 0 2px rgba(99, 102, 241, 0.1) inset;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.project-info {
    padding: 15px;
    z-index: 2;
}

.project-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-info p {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    line-height: 1.4;
}

.project-link {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(79, 70, 229, 0.1);
    transition: background 0.3s;
}

.project-card:hover .project-link {
    background: rgba(79, 70, 229, 0.25);
    color: #fff;
}

/*
   SYNC THE COUNTER-ROTATION
   We use negative delays so the animation starts at the correct "offset"
   to match the item's position on the ring.
   Duration: 30s.
*/
.item-1 .project-card {
    animation-delay: 0s;
}

/* 0 deg */
.item-2 .project-card {
    animation-delay: -7.5s;
}

/* 90 deg = 1/4 of 30s */
.item-3 .project-card {
    animation-delay: -15s;
}

/* 180 deg = 1/2 of 30s */
.item-4 .project-card {
    animation-delay: -22.5s;
}

/* 270 deg = 3/4 of 30s */

/* Hover effect on cards */
.orbit-item .project-card:hover {
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.6);
    border-color: var(--accent-color);
    background: rgba(10, 10, 10, 0.95);
    z-index: 20;
    transform: scale(1.05);
    /* Slight zoom on hover */
    /* Note: transform here might conflict with counter-rotate animation. 
       We leave it out or wrap content inside card for zoom. 
       Let's skip scale on card root to avoid breaking counter-rotate. */
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes counter-rotate {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* Mobile Fallback */
.mobile-projects-grid {
    display: none;
}

@media (max-width: 900px) {
    .orbit-container {
        display: none;
        /* Hide complex orbit on mobile */
    }

    .mobile-projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Reuse project styles for mobile */
    .mobile-projects-grid .project-card {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        padding: 0;
        border-radius: 20px;
    }
}

/* Contact */
.contact-section {
    display: flex;
    justify-content: center;
}

.contact-box {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.contact-form input,
.contact-form textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 10px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: #0f0f0f;
    /* Solid dark for readability */
    border: 1px solid var(--accent-color);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal h2 {
    color: var(--accent-color);
    margin-bottom: 5px;
}

/* Modal Image Style */
.modal-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-content ul {
    margin-top: 15px;
    margin-left: 20px;
    color: #d1d5db;
}

.modal-content li {
    margin-bottom: 8px;
}

/* Modal Details Styling */
.tech-stack,
.skills-acquired {
    margin-top: 15px;
    text-align: left;
}

.tech-stack h4,
.skills-acquired h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    display: inline-block;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tags span {
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    color: #a5b4fc;
    padding: 4px 10px;
    border-radius: 15px;
    /* Pill shape */
    font-size: 0.8rem;
    font-weight: 500;
}

.skills-acquired ul {
    list-style: none;
    /* Remove default bullets */
    padding: 0;
    margin: 0;
}

.skills-acquired li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #d1d5db;
}

.skills-acquired li::before {
    content: '▹';
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.hacked-mode .glass-nav,
.hacked-mode .glass-card,
.hacked-mode .modal,
.hacked-mode .project-card {
    background: #000 !important;
    border: 1px solid #00ff00 !important;
    box-shadow: 0 0 10px #00ff00 !important;
    color: #00ff00 !important;
}

.hacked-mode h1,
.hacked-mode h2,
.hacked-mode h3,
.hacked-mode span,
.hacked-mode p {
    color: #00ff00 !important;
    text-shadow: 0 0 5px #00ff00;
    background: none !important;
    -webkit-text-fill-color: #00ff00 !important;
}

.hacked-mode .orbit-ring {
    border-color: #00ff00 !important;
}

.hacked-mode img,
.hacked-mode spline-viewer {
    filter: hue-rotate(90deg) contrast(1.5) grayscale(0.2);
}

/* =========================================
   💻 FAKE TERMINAL STYLES
   ========================================= */
.terminal-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 600px;
    height: 400px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    /* Above everything */
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Hacked Mode Override */
.hacked-mode .terminal-window {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

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

.terminal-action.close {
    background: #ff5f56;
}

.terminal-action.minimize {
    background: #ffbd2e;
}

.terminal-action.expand {
    background: #27c93f;
}

.terminal-title {
    margin-left: 15px;
    color: #888;
    font-size: 0.8rem;
    flex-grow: 1;
    text-align: center;
}

.terminal-body {
    padding: 15px;
    color: #ccc;
    font-size: 0.9rem;
    flex-grow: 1;
    overflow-y: auto;
}

.hacked-mode .terminal-body {
    color: #00ff00;
}

.success {
    color: #27c93f;
}

.input-line {
    display: flex;
    margin-top: 5px;
}

.prompt {
    color: #27c93f;
    margin-right: 10px;
}

.blink-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Responsive Terminal */
@media (max-width: 650px) {
    .terminal-window {
        width: 90%;
        left: 5%;
        right: auto;
    }



    .hero-section {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        padding-top: 100px;
        padding-bottom: 50px;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 50px;
        order: 1;
        /* Content first */
    }



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

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple hide for now, would prefer hamburger menu logic in JS */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}