/*
    Modern Portfolio Styles
    Author: Muhammed Fasil PV
*/

:root {
    /* Modern Color System */
    --bg: #fafbfc;
    --panel: #ffffff;
    --panel-strong: #f5f7fa;
    --text: #0f172a;
    --text-strong: #020617;
    --muted: #64748b;
    --brand: #6366f1; /* indigo-500 */
    --brand-2: #0ea5e9; /* sky-500 */
    --accent: #10b981; /* emerald-500 */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Enhanced Design Tokens */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
    --blur: saturate(130%) blur(8px);

    /* Layout */
    --container: 1200px;
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 40px;
    --space-6: 64px;

    /* Typography */
    --font-base: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--text);
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.011em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding: 0 var(--space-4);
}

.row { display: flex; gap: var(--space-3); }
.between { justify-content: space-between; }
.center-y { align-items: center; }

/* Animated gradient background */
.bg.fx-gradient {
    position: fixed;
    inset: -30% -10% -10% -10%;
    background: radial-gradient(900px 600px at 8% -8%, rgba(99, 102, 241, 0.22), transparent 65%),
                radial-gradient(800px 500px at 92% 5%, rgba(14, 165, 233, 0.20), transparent 65%),
                radial-gradient(700px 450px at 50% 100%, rgba(16, 185, 129, 0.18), transparent 65%);
    filter: blur(45px) saturate(150%);
    pointer-events: none;
    z-index: 0;
    animation: float 22s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
@keyframes float {
    0%, 100% { transform: translateY(-2%) scale(1); }
    50% { transform: translateY(2%) scale(1.02); }
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; transition: opacity .2s ease; }
.brand:hover { opacity: 0.85; }
.brand__logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow); font-size: 0.875rem; font-weight: 700; color: white; }
.brand__name { letter-spacing: -0.01em; }

.nav { display: flex; gap: .6rem; }
.nav__link {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .65rem .9rem;
    color: var(--muted);
    border-radius: 999px;
    transition: .25s ease;
}
.nav__link:hover { color: var(--text); background: #f3f4f6; }

.nav-toggle { display: none; background: transparent; color: var(--text); border: 0; font-size: 1.4rem; padding: .6rem; border-radius: 10px; }

/* Hero */
.hero { position: relative; z-index: 1; padding: calc(var(--space-6) + 32px) var(--space-4) var(--space-6); }
.eyebrow { color: var(--brand-2); font-weight: 600; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: .5rem; opacity: .95; font-size: 0.9375rem; }
.hero__title { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); line-height: 1.15; margin: .8rem 0 1.2rem; background: linear-gradient(135deg, var(--text-strong) 0%, var(--text) 50%, var(--muted) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: -0.03em; }
.hero__subtitle { color: var(--muted); max-width: 860px; font-size: 1.125rem; line-height: 1.7; }
.cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0 0; }
.social { display: flex; gap: .6rem; margin-top: 1.2rem; }

.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.2rem; border-radius: 11px; font-weight: 600; letter-spacing: -0.01em;
    border: 1px solid transparent;
    transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow .25s ease, background .2s ease;
    cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .20), 0 1px 3px rgba(99, 102, 241, .15);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .30), 0 2px 6px rgba(99, 102, 241, .20);
}
.btn--ghost { background: #ffffff; color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: var(--panel-strong); border-color: var(--border-strong); }

/* small button variant */
.btn.btn--sm { padding: .55rem .8rem; font-size: .9rem; border-radius: 10px; }

.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #ffffff; color: var(--text); border: 1px solid var(--border); transition: .25s ease; }
.icon-btn:hover { transform: translateY(-2px); background: #f3f4f6; }

/* Sections */
.section { position: relative; z-index: 1; padding: var(--space-6) 0; }
.section__header { display: flex; align-items: end; gap: 1rem; justify-content: space-between; margin-bottom: 1.5rem; }
.section__title { font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem); display: flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.section__subtitle { color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }
.lead { color: var(--text); max-width: 920px; font-size: 1.0625rem; line-height: 1.7; }

.chips { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { padding: .45rem .7rem; border-radius: 999px; background: #f3f4f6; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.skill { background: var(--panel); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 1rem; display: flex; gap: .8rem; align-items: center; box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: .25s ease; }
.skill i { font-size: 1.5rem; color: var(--brand-2); }
.skill:hover { transform: translateY(-3px); background: var(--panel-strong); }

/* Cards / Projects */
.grid { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); overflow: hidden; transition: all .3s cubic-bezier(0.4, 0, 0.2, 1); }
.card:hover { transform: translateY(-6px); background: var(--panel-strong); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(14,165,233,.08)); color: var(--brand); margin-bottom: .7rem; font-size: 1.5rem; }
.card__title { margin: .3rem 0 .5rem; font-size: 1.0625rem; font-weight: 600; color: var(--text-strong); letter-spacing: -0.01em; }
.card__text { color: var(--muted); line-height: 1.6; }

.tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
.tag { font-size: .8rem; padding: .25rem .55rem; color: #ffffff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 999px; }

/* Modern Portfolio Projects Gallery */
.projects-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.project-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: all .35s cubic-bezier(.4,0,.2,1);
    padding: 1.35rem;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .35s ease;
}

.project-card:hover::before { opacity: 1; }
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }

.project-card__content {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.project-card__title {
    margin: 0 0 .5rem;
    font-size: 1.3rem;
    background: linear-gradient(90deg, #fff, var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.project-card__text {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 0;
}

.project-card__screenshots {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.project-screenshot {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    box-shadow: inset 0 1px 4px rgba(2,6,23,.06), 0 4px 14px rgba(2,6,23,.06);
    transition: all .4s ease;
}

.project-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.project-card:hover .project-screenshot { border-color: #d1d5db; box-shadow: inset 0 1px 6px rgba(2,6,23,.08), 0 8px 24px rgba(2,6,23,.12); }

.project-screenshot--small {
    max-width: 180px;
    height: 240px;
}

.project-screenshot--medium {
    max-width: 280px;
    height: 240px;
}

.project-screenshot--large {
    max-width: 400px;
    height: 240px;
}

.screenshot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(124,77,255,.10), transparent 70%);
    position: relative;
    padding: 1rem;
}

.screenshot-placeholder::before {
    content: '';
    position: absolute;
    inset: 20%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand), var(--brand-2));
    opacity: .15;
    filter: blur(40px);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: .15; }
    50% { transform: scale(1.2); opacity: .25; }
}

.screenshot-placeholder i {
    font-size: 2.5rem;
    color: var(--brand-2);
    opacity: .5;
    position: relative;
    z-index: 1;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.screen-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    position: relative;
    z-index: 1;
    opacity: .7;
}

/* Project detail page */
.breadcrumbs { color: var(--muted); margin-bottom: .6rem; font-size: .9rem; }
.breadcrumbs a { color: var(--text); opacity: .8; }
.breadcrumbs a:hover { opacity: 1; text-decoration: underline; }
.breadcrumbs .sep { opacity: .5; margin: 0 .4rem; }

.project-hero { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.project-hero__icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: rgba(124,77,255,.15); color: var(--brand-2); box-shadow: var(--shadow); }
.project-hero__icon i { font-size: 1.8rem; }
.project-hero__title { margin: 0; font-size: clamp(1.4rem, 1.2vw + 1rem, 2rem); background: linear-gradient(90deg, #fff, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.project-hero__meta .tags { margin-top: .5rem; }
.project-hero__links { margin-top: .8rem; display: flex; gap: .6rem; flex-wrap: wrap; }

.project-section__subtitle { font-size: 1.1rem; margin-bottom: .8rem; }

.hint { margin-top: .8rem; font-size: .9rem; color: var(--muted); }

/* Additional screenshots section */
.additional-screenshots { margin-top: 2rem; }
.additional-screenshots__title { font-size: 1.2rem; margin-bottom: 1rem; }
.additional-screenshots__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.additional-screenshot {
    max-width: 100%;
    height: 300px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f9fafb;
    box-shadow: var(--shadow);
    transition: all .3s ease;
}
.additional-screenshot:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(2,6,23,.12);
}
.additional-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Analytics section */
.analytics-section { margin-top: 2rem; }
.analytics-section__title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.analytics-section__subtitle { margin-bottom: 1rem; }
.analytics-section__iframe-wrapper {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.analytics-iframe {
    width: 100%;
    height: 800px;
    border: none;
    border-radius: 8px;
    display: block;
}

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-left: 36px; margin: 1.1rem 0; }
.timeline__dot { position: absolute; left: 0; top: .35rem; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 4px rgba(124,77,255,.12); }
.timeline__content { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.timeline h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.timeline ul { margin: .4rem 0 0; padding-left: 1rem; }
.timeline li { color: var(--muted); margin: .2rem 0; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.contact__info a { color: var(--text); }
.contact__info a:hover { color: #111827; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1rem 0; background: #ffffff; position: relative; z-index: 1; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 960px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-card__screenshots {
        gap: .6rem;
    }
    .project-screenshot--small {
        max-width: 140px;
        height: 200px;
    }
    .project-screenshot--medium {
        max-width: 220px;
        height: 200px;
    }
    .project-screenshot--large {
        max-width: 320px;
        height: 200px;
    }
    .screenshot-placeholder i {
        font-size: 2rem;
    }
}
@media (max-width: 720px) {
    .brand__name { display: none; }
    .nav-toggle { display: inline-grid; }
    .nav { position: absolute; right: var(--space-4); top: 64px; background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: .5rem; box-shadow: var(--shadow); display: none; flex-direction: column; }
    .nav.open { display: flex; }
    .cards { grid-template-columns: 1fr; }
    .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact { grid-template-columns: 1fr; }
    .project-card__screenshots {
        flex-direction: column;
        gap: .8rem;
    }
    .project-screenshot--small,
    .project-screenshot--medium,
    .project-screenshot--large {
        max-width: 100%;
        height: 180px;
    }
    .screenshot-placeholder i {
        font-size: 2.5rem;
    }
    .additional-screenshots__grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 440px) {
    .hero { padding-top: var(--space-6); }
    .project-card {
        padding: 1rem;
    }
    .project-card__title {
        font-size: 1.1rem;
    }
    .project-screenshot--small,
    .project-screenshot--medium,
    .project-screenshot--large {
        height: 160px;
    }
    .screenshot-placeholder i {
        font-size: 2rem;
    }
    .screen-label {
        font-size: .7rem;
    }
    .additional-screenshot {
        height: auto;
        min-height: 200px;
    }
}
