/* ==========================================
   BASE RESET & GLOBALS
   ========================================== */
* {
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* ==========================================
   BACKGROUND
   ========================================== */
.gradient-bg {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
    background-attachment: fixed;
}

/* ==========================================
   GLOW
   ========================================== */
.glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.glow-hover {
    transition: box-shadow 0.3s ease;
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

/* ==========================================
   GRADIENT TEXT
   ========================================== */
.gradient-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

/* ==========================================
   FADE-IN SCROLL ANIMATION
   ========================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar            { width: 8px; }
::-webkit-scrollbar-track      { background: #0f172a; }
::-webkit-scrollbar-thumb      { background: #6366f1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover{ background: #8b5cf6; }

/* ==========================================
   VIDEO CONTAINER
   ========================================== */
.video-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   PROJECT CAROUSEL
   ========================================== */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(139,92,246,0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.project-carousel-container:hover .project-overlay { opacity: 1; }

.project-carousel { position: relative; width: 100%; height: 100%; }

.carousel-slide            { display: none; width: 100%; height: 100%; }
.carousel-slide.active     { display: block; animation: fadeIn 0.3s ease-in; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }

.carousel-indicators { z-index: 20; }

.indicator {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover  { background: rgba(255,255,255,0.8); }
.indicator.active { background: #6366f1; width: 24px; border-radius: 4px; }

.carousel-prev,
.carousel-next {
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.project-carousel-container:hover .carousel-prev,
.project-carousel-container:hover .carousel-next { opacity: 1; }

/* ==========================================
   PERFORMANCE & TRANSITIONS
   ========================================== */
.service-card,
.skill-badge,
.glow-hover {
    will-change: transform;
    transition: transform 0.3s ease;
}

button, a { transition: all 0.3s ease; }

/* ==========================================
   FORM FOCUS
   ========================================== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* ==========================================
   SPIN ANIMATION (submit button)
   ========================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* ==========================================
   ACCESSIBILITY
   ========================================== */
*:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   MOBILE — CORE FIXES
   ========================================== */
@media (max-width: 768px) {
    html { -webkit-overflow-scrolling: touch; }

    .fade-in { transform: translateY(20px); }

    /* Always show carousel controls on touch devices */
    .carousel-prev,
    .carousel-next { opacity: 1; }

    /* Hero section: kill transform/opacity overrides that can glitch on scroll */
    #home {
        position: relative;
        will-change: auto;
        transform: none !important;
    }

    #home > div { position: relative; z-index: 10; }
}

/* ─────────────────────────────────────────
   !! IMPORTANT !!
   Do NOT add "h1 span { display: block }"
   here — the hero spans already have the
   Tailwind "block" class; adding it again
   causes double spacing + conflict.
   ───────────────────────────────────────── */


/* ==========================================
   HERO — DECORATIVE ORBS
   ========================================== */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    animation: orbFloat 9s ease-in-out infinite;
    z-index: 0;
}

.hero-orb-left {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    top: 5%;
    left: -10%;
    animation-delay: 0s;
}

.hero-orb-right {
    width: 440px; height: 440px;
    background: radial-gradient(circle, rgba(236,72,153,0.14) 0%, transparent 70%);
    bottom: 8%;
    right: -8%;
    animation-delay: -4.5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0)   scale(1);    }
    50%       { transform: translateY(-26px) scale(1.04); }
}

/* ==========================================
   HERO — DOT-GRID PATTERN
   ========================================== */
.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(99,102,241,0.12) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 15%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 15%, transparent 100%);
}

/* ==========================================
   HERO — HEADING RESPONSIVE FIXES
   ========================================== */

/* Prevent the hyphen in "Production-Ready" from
   acting as a soft-wrap opportunity */
#home h1 {
    hyphens: none;
    -webkit-hyphens: none;
    overflow-wrap: normal;
    word-break: keep-all;
}

/* Clamp font size smoothly between 28px (small phone)
   and 72px (large desktop) using fluid scaling.
   This overrides Tailwind's static text-4xl / text-7xl
   with a single continuous ramp — no abrupt jumps. */
#home h1 {
    font-size: clamp(1.75rem, 5.5vw + 0.5rem, 4.5rem);
    line-height: 1.15;
}

/* The gradient span ("Scalable, Production-Ready") should
   never break mid-word at a hyphen on any viewport */
#home h1 .gradient-text {
    white-space: nowrap;
    display: inline-block; /* allows nowrap to work while staying "block-ish" */
}

/* On very small phones (< 400px) allow it to wrap if truly necessary
   but keep hyphens off */
@media (max-width: 400px) {
    #home h1 .gradient-text {
        white-space: normal;
    }
}

/* ==========================================
   HERO — AVAILABILITY BADGE
   ========================================== */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.22);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #86efac;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.availability-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
    animation: availPulse 2.2s ease-out infinite;
    flex-shrink: 0;
}

@keyframes availPulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,197,94,0.6); }
    70%  { box-shadow: 0 0 0 9px rgba(34,197,94,0);   }
    100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);   }
}

/* ==========================================
   HERO — TECH STACK PILLS
   ========================================== */
.tech-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.tech-pill {
    padding: 5px 15px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.02em;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
    white-space: nowrap;
}

.tech-pill:hover {
    border-color: rgba(99,102,241,0.45);
    color: #a5b4fc;
    background: rgba(99,102,241,0.07);
}

/* ==========================================
   ABOUT — STAT CARDS
   ========================================== */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 28px;
}

.about-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 18px 10px;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.about-stat:hover {
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-3px);
}

.about-stat-num {
    font-size: 1.85rem;
    font-weight: 800;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 5px;
}

.about-stat-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ==========================================
   NAV — HIRE ME BUTTON
   ========================================== */
.hire-me-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff !important;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    white-space: nowrap;
}

.hire-me-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 22px rgba(99,102,241,0.5);
}

/* ==========================================
   SERVICE CARD — TOP ACCENT ON HOVER
   ========================================== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before { opacity: 1; }

/* ==========================================
   CONTACT — QUICK-LINK BUTTONS
   ========================================== */
.contact-direct {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.contact-direct-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-direct-link:hover { transform: translateY(-2px); }

.contact-direct-whatsapp {
    background: rgba(37,211,102,0.08);
    border: 1px solid rgba(37,211,102,0.22);
    color: #4ade80;
}

.contact-direct-whatsapp:hover {
    box-shadow: 0 0 18px rgba(37,211,102,0.18);
    border-color: rgba(37,211,102,0.45);
}

.contact-direct-email {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.22);
    color: #a5b4fc;
}

.contact-direct-email:hover {
    box-shadow: 0 0 18px rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.45);
}

/* ==========================================
   RESPONSIVE — TABLET (max 768px)
   ========================================== */
@media (max-width: 768px) {
    /* Shrink orbs so they don't create layout pressure */
    .hero-orb-left  { width: 320px; height: 320px; left: -20%; top: 2%; }
    .hero-orb-right { width: 280px; height: 280px; right: -20%; }

    /* About stats stay 3-col on tablet */
    .about-stat-num   { font-size: 1.6rem; }

    /* Hide hire-me button in nav on mobile — contact link still in mobile menu */
    .hire-me-btn { display: none; }
}

/* ==========================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   ========================================== */
@media (max-width: 480px) {
    /* Further shrink orbs */
    .hero-orb-left  { width: 220px; height: 220px; left: -30%; }
    .hero-orb-right { width: 200px; height: 200px; right: -30%; }

    /* Availability badge smaller on tiny screens */
    .availability-badge { font-size: 0.75rem; padding: 6px 14px; }

    /* Tech pills tighter */
    .tech-pill { font-size: 0.72rem; padding: 4px 12px; }

    /* About stats switch to 2+1 layout on tiny phones */
    .about-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Keep the "100% Ownership" card full-width on 2-col */
    .about-stat:last-child { grid-column: 1 / -1; }

    .about-stat-num   { font-size: 1.4rem; }
    .about-stat-label { font-size: 0.65rem; }
}