/* =====================================================
   PROJECT DISPLAY — iOS GLASSY THEME
   MakeProjects.in
   ===================================================== */

/* ===== TOKENS ===== */
:root {
    --accent:        #059669;
    --accent-dark:   #047857;
    --accent-glow:   rgba(5, 150, 105, 0.45);
    --accent-light:  rgba(5, 150, 105, 0.12);

    --text-1:  #0f172a;
    --text-2:  #334155;
    --text-3:  #64748b;

    /* iOS glass */
    --glass-bg:      rgba(255, 255, 255, 0.72);
    --glass-bg-deep: rgba(255, 255, 255, 0.55);
    --glass-border:  rgba(255, 255, 255, 0.85);
    --glass-shadow:  0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --glass-blur:    blur(24px) saturate(200%) brightness(1.05);

    --radius-card:   22px;
    --radius-btn:    12px;
    --radius-pill:   99px;

    --nav-h:         80px;
}

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

/* ===== SCROLL GRADIENT (dynamic background) ===== */
html {
    font-size: clamp(14px, 1vw + 0.6rem, 17px);
    min-height: 100vh;
    scroll-behavior: smooth;
    /* Dynamic gradient shifts as user scrolls */
    background:
        linear-gradient(
            150deg,
            hsl(calc(160 + var(--scroll-p, 0) * 80),  70%, 95%) 0%,
            hsl(calc(200 + var(--scroll-p, 0) * 60),  65%, 94%) 40%,
            hsl(calc(130 + var(--scroll-p, 0) * 100), 60%, 95%) 100%
        ) fixed !important;
}

/* ===== SCROLL-DRIVEN TITLE GRADIENT ===== */
.hero-banner h1,
.hero-title,
.section-title,
.domain-title,
.logo-text h1 {
    background: linear-gradient(
        135deg,
        hsl(calc(15  + var(--scroll-p, 0) * 160), 90%, 25%) 0%,
        hsl(calc(160 + var(--scroll-p, 0) * 140), 85%, 35%) 100%
    ) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    transition: background 0.1s ease-out;
}

/* ===== BODY ===== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: transparent;
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

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

/* =====================================================
   NAVBAR — Floating iOS pill
   ===================================================== */
.site-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 94%;
    max-width: 1380px;
    height: var(--nav-h);
    border-radius: 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

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

/* Logo */
.logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    color: var(--text-1);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Nav links pill container */
.main-nav ul {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(5, 150, 105, 0.2);
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    position: relative;
}

.main-nav ul li {
    position: relative;
    z-index: 2;
}

.main-nav a {
    display: block;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

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

/* Hamburger */
.mobile-menu-btn {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-1);
    cursor: pointer;
    padding: 8px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: background 0.2s;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.9); }

/* Hover pill — JS-driven */
.hover-pill {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.3, 1);
    background: rgba(5, 150, 105, 0.12);
    border-radius: var(--radius-pill);
    opacity: 0;
    top: 0;
    left: 0;
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero-section {
    position: relative;
    padding: 11rem 0 4.5rem;
    text-align: center;
    overflow: hidden;
}

/* Ambient glow blob */
.hero-bg {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    height: 700px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 68%);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    from { opacity: 0.25; transform: translateX(-50%) scale(1); }
    to   { opacity: 0.45; transform: translateX(-50%) scale(1.08); }
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
    /* Entrance animation */
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-content h1 {
    font-size: clamp(1.7rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 1.1rem;
    color: var(--text-1);
    letter-spacing: -0.02em;
    line-height: 1.15;
    word-break: break-word;
}

/* Subtitle — gradient text */
.hero-content p {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
    font-weight: 500;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 45%, var(--text-1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* =====================================================
   PROJECTS SECTION
   ===================================================== */
.projects-section {
    flex: 1;
    padding: 2rem 0 6rem;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 5rem 0;
    color: var(--text-3);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error-message {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    padding: 2rem;
    border-radius: var(--radius-card);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* =====================================================
   PROJECTS GRID
   ===================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.75rem;
}

/* =====================================================
   PROJECT CARD — iOS glass card
   ===================================================== */
.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: relative;
    overflow: hidden;
    cursor: default;

    /* ── Scroll-in animation defaults ── */
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity  0.55s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.35s ease,
        border-color 0.3s ease;
}

/* Top shimmer line */
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Animated in — added by JS IntersectionObserver */
.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(5, 150, 105, 0.35);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.10),
        0 0 28px rgba(5, 150, 105, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.project-card.animate-in:hover {
    transform: translateY(-6px);
}

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

/* Card header */
/* Project Card bubble overlay — JS sets --mx / --my on mousemove */
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        260px circle at var(--mx, 50%) var(--my, 50%),
        rgba(5, 150, 105, 0.14) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card.animate-in:hover::after {
    opacity: 1;
}

/* All card children stay above the bubble */
.project-card > * {
    position: relative;
    z-index: 1;
}

/* Ripple ring — created by JS on click */
.ripple-ring {
    position: absolute;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.22);
    transform: scale(0);
    animation: rippleExpand 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: none;
    z-index: 20;
}

@keyframes rippleExpand {
    to { transform: scale(4); opacity: 0; }
}

/* ===== CARD HEADER / CODE / TITLE ===== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-code {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 0.22rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* Title */
.project-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.35;
}

/* Base paper subtitle */
.paper-title {
    font-size: 0.8rem;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    line-height: 1.5;
}

/* Tech tags */
.tech-stack {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tag {
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    color: var(--accent-dark);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

/* Action buttons */
.card-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-btn);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.2px;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 6px 22px rgba(5, 150, 105, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(5, 150, 105, 0.07);
    color: var(--accent-dark);
    border: 1.5px solid rgba(5, 150, 105, 0.35);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-3);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes slideDownNav {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* =====================================================
   RESPONSIVE — 768px (tablet / mobile)
   ===================================================== */
@media (max-width: 768px) {
    .page-container {
        padding: 0 1.25rem;
    }

    /* Make header flush top on mobile */
    .site-header {
        top: 0;
        width: 100%;
        border-radius: 0;
        transform: none;
        left: 0;
        right: 0;
        padding-top: env(safe-area-inset-top, 0px);
    }

    /* Mobile drawer nav */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(32px) saturate(200%);
        -webkit-backdrop-filter: blur(32px) saturate(200%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.6);
        border-radius: 0 0 20px 20px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
        padding: 1.5rem 0 2rem;
        z-index: 99;
        width: 100%;
    }

    .main-nav.active,
    .main-nav.show {
        display: block;
        animation: slideDownNav 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        background: transparent;
        border: none;
        padding: 0;
    }

    .main-nav a {
        font-size: 1rem;
        padding: 0.6rem 2rem;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Hero */
    .hero-section {
        padding: 9.5rem 0 3rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-content h1 {
        font-size: clamp(1.5rem, 6vw, 2.4rem);
    }

    /* Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Buttons stay side by side on mobile */
    .card-actions {
        flex-direction: row;
        gap: 0.6rem;
    }
}

/* =====================================================
   RESPONSIVE — 480px (small phones)
   ===================================================== */
@media (max-width: 480px) {
    .hero-section {
        padding: 9.5rem 0 2.5rem;
    }

    .hero-content h1 {
        font-size: clamp(1.25rem, 5.5vw, 1.7rem);
    }

    .project-card {
        padding: 1.25rem 1rem;
        border-radius: 18px;
    }

    .project-title {
        font-size: 1rem;
    }

    .card-actions {
        gap: 0.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 0.5rem;
        font-size: 0.76rem;
    }
}


/* ==========================================================================
   GLOBAL RESPONSIVE RESET & SMOOTH SCALING
   Ensures no horizontal scroll, fluid images, and smooth transitions
   ========================================================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

img, picture, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

* {
    -webkit-tap-highlight-color: transparent;
}

