:root {
    --bg-dark: #0a0a0a;
    --text-light: #f4f4f4;
    --accent: #00d4ff; /* Electric Blue */
    --gray: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    padding: 2rem 5%;
    position: absolute;
    width: 100%;
    z-index: 10;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

/* Hero Section */
.hero {
    display: flex;
    height: 100vh;
    width: 100%;
    align-items: center;
}

.hero-left, .hero-right {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Slide-in (Left) */
.image-wrapper {
    width: 80%;
    height: 70%;
    background: var(--gray);
    overflow: hidden;
    animation: slideFromLeft 1.2s ease-out forwards;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

/* Content Slide-in (Right) */
.hero-content {
    padding: 0 10%;
    animation: slideFromRight 1.2s ease-out forwards;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.accent {
    color: var(--accent);
}

.cta-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    border: 2px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.4s;
}

.cta-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* Animations */
@keyframes slideFromLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideFromRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero { flex-direction: column; }
    .hero-left { display: none; } /* Hide image on small mobile for speed */
    h1 { font-size: 2.5rem; }
}
/* About Page Specific Styles */
.about-section {
    padding: 120px 10% 60px;
    text-align: center;
}

.about-section h2 {
    font-size: 3rem;
    margin-bottom: 50px;
    color: var(--accent);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* The Vertical Line */
.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--gray);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    text-align: right;
}

/* Alternate sides */
.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

/* Dots on the line */
.timeline-dot {
    height: 16px;
    width: 16px;
    position: absolute;
    background: var(--accent);
    border-radius: 50%;
    top: 25px;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}

.timeline-content {
    background: var(--gray);
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: scale(1.05);
    background: #222;
}

/* REVEAL ANIMATION OVERRIDE */
/* We want timeline items to slide in from the sides */
.timeline-item.reveal {
    opacity: 0;
    transition: all 1s ease-out;
}

.timeline-item:nth-child(odd).reveal {
    transform: translateX(-50px);
}

.timeline-item:nth-child(even).reveal {
    transform: translateX(50px);
}

.timeline-item.active {
    opacity: 1;
    transform: translateX(0) !important;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .timeline::before { left: 31px; }
    .timeline-item { width: 100%; text-align: left !important; padding-left: 70px; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-dot { left: 23px !important; }
}
/* Services Layout */
.services-container {
    padding: 120px 5% 60px;
    text-align: center;
    perspective: 1000px; /* Essential for 3D effect */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

/* The Tilt Card */
.tilt-card {
    background: var(--gray);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 40px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
}

.tilt-card:hover {
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
    border-color: var(--accent);
}

.card-content {
    transform: translateZ(50px); /* Pushes content "off" the card surface */
    pointer-events: none;
}

.icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.tilt-card h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.5rem;
}
/* Portfolio Grid */
.portfolio-section {
    padding: 120px 5% 60px;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 250px; /* Base row height */
    grid-auto-flow: dense; /* Fills in gaps automatically */
    gap: 20px;
    margin-top: 50px;
}

.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: var(--gray);
}

/* Size Variations */
.project-item.tall {
    grid-row: span 2;
}

.project-item.wide {
    grid-column: span 2;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover Effect: Zoom & Darken */
.project-item:hover img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-overlay h3 {
    color: var(--accent);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.project-item:hover .project-overlay h3 {
    transform: translateY(0);
}

/* Mobile Fix */
@media (max-width: 768px) {
    .project-item.wide {
        grid-column: span 1;
    }
}
.projects-grid .project-item:nth-child(1) { transition-delay: 0.1s; }
.projects-grid .project-item:nth-child(2) { transition-delay: 0.2s; }
.projects-grid .project-item:nth-child(3) { transition-delay: 0.3s; }
.projects-grid .project-item:nth-child(4) { transition-delay: 0.4s; }

/* Contact Page Layout */
.contact-section {
    padding: 150px 10% 60px;
    text-align: center;
}

.typewriter-text {
    font-size: 3.5rem;
    margin-bottom: 50px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Floating Label Form */
.form-group {
    position: relative;
    margin-bottom: 40px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px 0;
    font-size: 1.1rem;
    color: white;
    border: none;
    border-bottom: 1px solid #333;
    background: transparent;
    outline: none;
}

.form-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: #777;
    pointer-events: none;
    transition: 0.3s ease;
}

/* Label moves up on focus/content */
.form-group input:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--accent);
}

/* The Animated Bottom Line */
.line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 0.4s ease;
}

.form-group input:focus ~ .line,
.form-group textarea:focus ~ .line {
    width: 100%;
    left: 0;
}