/* =============================================================
   Rahul Patil — Portfolio (2026 redesign)
   Dark, modern, techy. Pure CSS, no framework. S3-friendly.
   ============================================================= */

:root {
    --bg:        #070a14;
    --bg-2:      #0b0f1e;
    --surface:   rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border:    rgba(255, 255, 255, 0.09);
    --border-2:  rgba(255, 255, 255, 0.16);
    --text:      #e8ecf5;
    --muted:     #97a1b8;
    --faint:     #6b7690;
    --grad-a:    #667eea;
    --grad-b:    #7c4dff;
    --grad-c:    #06b6d4;
    --accent:    #7c8cff;
    --radius:    18px;
    --maxw:      1180px;
    --ease:      cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient gradient mesh + grid backdrop */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60vw 60vw at 12% -10%, rgba(102, 126, 234, .22), transparent 60%),
        radial-gradient(50vw 50vw at 100% 0%, rgba(6, 182, 212, .16), transparent 55%),
        radial-gradient(55vw 55vw at 50% 120%, rgba(124, 77, 255, .18), transparent 60%),
        var(--bg);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Typography helpers ---------- */
h1, h2, h3, h4 {
    font-family: 'Sora', 'Inter', sans-serif;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -.02em;
}
.grad-text {
    background: linear-gradient(100deg, var(--grad-a), var(--grad-c) 50%, var(--grad-b));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: grad-shift 7s linear infinite;
}
@keyframes grad-shift { to { background-position: 200% center; } }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--accent);
    opacity: .6;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
    will-change: transform;
}
.btn-primary {
    background: linear-gradient(100deg, var(--grad-a), var(--grad-b));
    color: #fff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, .35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(124, 77, 255, .5); }
.btn-ghost {
    background: var(--surface);
    border-color: var(--border-2);
    color: var(--text);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-2); }

/* ---------- Header / Nav ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    transition: background .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    background: rgba(7, 10, 20, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
}
.brand {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(var(--grad-a), var(--grad-c));
    box-shadow: 0 0 14px var(--accent);
}
.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0; padding: 0;
}
.nav-links a {
    padding: 9px 14px;
    border-radius: 10px;
    font-size: .92rem;
    color: var(--muted);
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 42px; height: 42px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ---------- Section scaffolding ---------- */
section { padding: 110px 0; position: relative; }
.section-head { max-width: 640px; margin: 0 0 56px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin: 14px 0 0; }
.section-head p { color: var(--muted); margin: 14px 0 0; font-size: 1.05rem; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.center .eyebrow::before { display: none; }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    position: relative;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 18px 0 10px; }
.hero .role { font-size: clamp(1.1rem, 2.4vw, 1.6rem); color: var(--text); font-weight: 600; min-height: 1.6em; }
.hero .role .grad-text { font-weight: 700; }
.hero p.lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.hero-socials { display: flex; gap: 12px; }
.hero-socials a {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 1.05rem;
    transition: transform .25s var(--ease), color .25s, border-color .25s, background .25s;
}
.hero-socials a:hover { transform: translateY(-4px); color: #fff; border-color: var(--accent); background: var(--surface-2); }

/* Hero portrait */
.hero-portrait { position: relative; justify-self: center; }
.hero-portrait .frame {
    width: min(360px, 78vw);
    aspect-ratio: 1 / 1.08;
    border-radius: 26px;
    padding: 8px;
    background: linear-gradient(150deg, rgba(102,126,234,.55), rgba(6,182,212,.35), transparent);
    border: 1px solid var(--border-2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    animation: float 7s ease-in-out infinite;
}
.hero-portrait .frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.hero-portrait .badge {
    position: absolute;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(11, 15, 30, .75);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: .85rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.hero-portrait .badge b { font-family: 'Sora', sans-serif; }
.hero-portrait .badge.b1 { top: 22px; left: -28px; animation: float 6s ease-in-out infinite; }
.hero-portrait .badge.b2 { bottom: 30px; right: -26px; animation: float 8s ease-in-out infinite .5s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.scroll-cue {
    position: absolute;
    bottom: 28px; left: 50%; transform: translateX(-50%);
    color: var(--faint);
    font-size: 1.4rem;
    animation: bob 1.8s infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ---------- Stats ---------- */
.stats { padding-top: 0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.stat {
    text-align: center;
    padding: 26px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}
.stat .num { font-family: 'Sora', sans-serif; font-size: 2.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .9rem; letter-spacing: .04em; }

/* ---------- Glass card ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.card:hover {
    transform: translateY(-6px);
    border-color: var(--border-2);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .4);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 54px; align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.about-photo img { width: 100%; }
.about p { color: var(--muted); }
.about .sign { width: 150px; margin-top: 18px; opacity: .85; filter: invert(1) brightness(1.6); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tag {
    font-size: .82rem;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; }
.skill .skill-top { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: .95rem; }
.skill .skill-top b { font-weight: 600; }
.skill .skill-top span { color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i {
    display: block; height: 100%; width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--grad-a), var(--grad-c));
    transition: width 1.2s var(--ease);
}

/* ---------- Services / What I do ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service .ico {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 1.35rem;
    margin-bottom: 16px;
    background: linear-gradient(140deg, rgba(102,126,234,.25), rgba(6,182,212,.18));
    border: 1px solid var(--border-2);
    color: #fff;
}
.service h3 { font-size: 1.2rem; margin-bottom: 10px; }
.service p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- Timeline (experience) ---------- */
.timeline { position: relative; margin-left: 8px; }
.timeline::before {
    content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(var(--grad-a), var(--grad-c), transparent);
}
.tl-item { position: relative; padding: 0 0 36px 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: ""; position: absolute; left: 0; top: 6px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(124,140,255,.15);
}
.tl-item .when { font-size: .82rem; color: var(--accent); letter-spacing: .05em; text-transform: uppercase; font-weight: 600; }
.tl-item h3 { font-size: 1.25rem; margin: 6px 0 2px; }
.tl-item .where { color: var(--text); font-weight: 600; margin-bottom: 8px; }
.tl-item p { color: var(--muted); margin: 0; font-size: .96rem; }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cert .cert-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cert .cert-top .ico {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.2rem; flex: none;
    background: linear-gradient(140deg, rgba(124,77,255,.3), rgba(6,182,212,.2));
    border: 1px solid var(--border-2);
}
.cert .issuer { color: var(--faint); font-size: .85rem; }
.cert h3 { font-size: 1.05rem; line-height: 1.3; }
.cert .meta { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.cert .status {
    font-size: .76rem; padding: 4px 11px; border-radius: 999px;
    background: rgba(34, 197, 94, .14); color: #4ade80; border: 1px solid rgba(34,197,94,.3);
}
.cert .when { color: var(--muted); font-size: .85rem; }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.edu h3 { font-size: 1.15rem; margin-bottom: 4px; }
.edu .school { color: var(--muted); font-size: .94rem; margin: 8px 0 0; }
.edu .edu-meta { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.edu .pill { font-size: .8rem; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 50px; align-items: start; }
.contact-info .ci-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.contact-info .ci-item .ico {
    width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); font-size: 1.1rem;
}
.contact-info .ci-item .label { color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.contact-info .ci-item a, .contact-info .ci-item span.v { color: var(--text); font-weight: 500; }
.contact-info .socials { display: flex; gap: 12px; margin-top: 26px; }
.contact-info .socials a {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border); color: var(--muted);
    transition: transform .25s var(--ease), color .25s, border-color .25s;
}
.contact-info .socials a:hover { transform: translateY(-4px); color: #fff; border-color: var(--accent); }

.contact-form .field { margin-bottom: 16px; }
.contact-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 7px; }
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    transition: border-color .2s, background .2s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--accent); background: var(--surface-2);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: .82rem; color: var(--faint); margin-top: 14px; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer p { color: var(--faint); font-size: .9rem; margin: 0; }
.footer .brand { font-size: 1rem; }

/* ---------- Back to top ---------- */
.to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
    color: #fff; border: none; cursor: pointer;
    box-shadow: 0 12px 30px rgba(102, 126, 234, .4);
    opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none;
    transition: opacity .3s, transform .3s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].d1 { transition-delay: .08s; }
[data-reveal].d2 { transition-delay: .16s; }
[data-reveal].d3 { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-actions, .hero-socials, .eyebrow { justify-content: center; }
    .hero .eyebrow { display: inline-flex; }
    .hero-portrait { order: -1; margin-bottom: 10px; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .about-photo { max-width: 360px; }
    .services-grid, .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .nav-links { display: none; }
    .nav-toggle { display: grid; place-items: center; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 74px; left: 0; right: 0;
        background: rgba(7,10,20,.96); backdrop-filter: blur(14px);
        padding: 14px 24px 22px; gap: 4px; border-bottom: 1px solid var(--border);
    }
    .nav-cta .btn { display: none; }
    section { padding: 80px 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .skills-grid, .services-grid, .cert-grid, .edu-grid, .form-row { grid-template-columns: 1fr; }
    .hero-portrait .badge.b1 { left: 0; }
    .hero-portrait .badge.b2 { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    [data-reveal] { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
