@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    /* New palette (clean + modern) */
    --primary: #4f46e5;   /* indigo */
    --accent: #10b981;    /* emerald */
    --primary-rgb: 79 70 229;
    --accent-rgb: 16 185 129;
    --secondary: #f3f4f6; /* light gray */
    --text: #111827;      /* near-black */
    --bg: #ffffff;

    --radius: 14px;
    --header-height: 70px;

    /* Solid full-screen section backgrounds (light mode) */
    --section-hero: #0b1020;
    --section-about: #eef2ff;
    --section-skills: #ecfeff;
    --section-focus: #f0fdf4;
    --section-portfolio: #fffbeb;
    --section-contact: #fce7f3;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

img { max-width: 100%; display: block; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--bg);
    padding: 0.8rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    z-index: 1000;
}

nav.container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-width: 220px;
    justify-content: flex-start;
    order: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    order: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    order: 2;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover { color: var(--primary); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(.77,0,.18,1), box-shadow 0.18s, background 0.3s ease, color 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.18);
}

.btn.small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn.secondary {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--primary);
}

.btn.secondary:hover {
    background: var(--primary);
    color: #fff;
}

.cta-btn {
    background: var(--accent);
}

.cta-btn:hover {
    background: #e06d3b;
    box-shadow: 0 10px 20px rgba(255, 127, 80, 0.22);
}

/* Hero */
#hero { padding-top: var(--header-height); }

.hero-image {
    background: var(--section-hero);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
    box-shadow: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    overflow: hidden;
}

.hero-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23060a1a'/%3E%3Cg fill='white' opacity='0.85'%3E%3Ccircle cx='110' cy='140' r='1.4'/%3E%3Ccircle cx='260' cy='90' r='1.0'/%3E%3Ccircle cx='360' cy='250' r='1.2'/%3E%3Ccircle cx='520' cy='150' r='1.6'/%3E%3Ccircle cx='640' cy='320' r='1.1'/%3E%3Ccircle cx='780' cy='120' r='1.3'/%3E%3Ccircle cx='910' cy='260' r='1.0'/%3E%3Ccircle cx='1040' cy='80' r='1.7'/%3E%3Ccircle cx='1180' cy='210' r='1.1'/%3E%3Ccircle cx='1320' cy='130' r='1.4'/%3E%3Ccircle cx='1470' cy='260' r='1.0'/%3E%3Ccircle cx='150' cy='520' r='1.1'/%3E%3Ccircle cx='290' cy='640' r='1.6'/%3E%3Ccircle cx='430' cy='520' r='1.0'/%3E%3Ccircle cx='560' cy='720' r='1.2'/%3E%3Ccircle cx='700' cy='560' r='1.5'/%3E%3Ccircle cx='840' cy='700' r='1.1'/%3E%3Ccircle cx='980' cy='520' r='1.3'/%3E%3Ccircle cx='1120' cy='660' r='1.0'/%3E%3Ccircle cx='1260' cy='540' r='1.7'/%3E%3Ccircle cx='1400' cy='720' r='1.1'/%3E%3C/g%3E%3Cg fill='%23a5b4fc' opacity='0.55'%3E%3Ccircle cx='980' cy='180' r='2.2'/%3E%3Ccircle cx='320' cy='420' r='2.6'/%3E%3Ccircle cx='1240' cy='420' r='2.0'/%3E%3Ccircle cx='720' cy='780' r='2.4'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    filter: saturate(1.05) contrast(1.05);
    transform: scale(1.02);
    z-index: 0;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px circle at 18% 15%, rgb(var(--primary-rgb) / 0.28), transparent 60%),
        radial-gradient(900px circle at 82% 22%, rgb(var(--accent-rgb) / 0.20), transparent 55%),
        linear-gradient(180deg, rgba(5,7,19,0.72) 0%, rgba(11,16,32,0.90) 100%);
    z-index: 1;
}

.hero-text {
    z-index: 2;
    max-width: 820px;
    padding: 0 18px;
}

.hero-text p {
    font-size: 1.15rem;
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.86);
}

.highlight { color: var(--accent); }

/* Typewriter */
#typewriter {
    min-height: 1.6em;
    font-size: 2.4rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.96);
    white-space: nowrap;
    overflow: hidden;
    border-right: .12em solid rgba(255,255,255,.35);
    letter-spacing: .02em;
    margin: 0 0 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 1s ease-out forwards; }
.fade-in-slow { animation: fadeIn 2s ease-out forwards; }

/* Section titles */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin: 0 0 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    height: 3px;
    width: 60px;
    background: var(--primary);
}

/* Section patterned backgrounds */
.section-pattern {
    position: relative;
    overflow: hidden;
    padding-top: 3rem;
    padding-bottom: 3rem;
    min-height: 100vh;
    z-index: 0;
    isolation: isolate;
}

/* Full-width section backgrounds, even when the section also has .container */
.section-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    z-index: -1;
    background-color: var(--section-bg, var(--bg));
}

/* Per-section solid backgrounds */
#about.section-pattern { --section-bg: var(--section-about); }
#skills.section-pattern { --section-bg: var(--section-skills); }
#focus.section-pattern { --section-bg: var(--section-focus); }
#portfolio.section-pattern { --section-bg: var(--section-portfolio); }
#contact.section-pattern { --section-bg: var(--section-contact); }

/* Cards (glass-ish) */
.project-card,
.focus-card,
.about-extra {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* About */
.about-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    justify-content: center;
}

.about-photo img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary);
    box-shadow: 0 14px 35px rgba(0,0,0,0.10);
}

.about-actions { display:flex; gap: .8rem; flex-wrap: wrap; }

.about-extra {
    margin-top: 1.5rem;
    padding: 1.2rem 1.2rem;
}

.about-details { margin: 0.6rem 0 0.8rem; padding-left: 1.2rem; }

/* Skills & Stack */
.stack-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); }
.stack-group h3 { margin: 0 0 .5rem; font-size: 1.05rem; letter-spacing: .5px; }

.inline-tags { list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:.4rem; }
.inline-tags li { background: var(--secondary); padding:.35rem .6rem; border-radius:20px; font-size:.8rem; }
.inline-tags.fancy li { position:relative; overflow:hidden; }
.inline-tags.fancy li::after { content:""; position:absolute; inset:0; background:linear-gradient(145deg,rgba(255,255,255,.15),transparent); mix-blend-mode:overlay; }

.skill-bars { list-style: none; padding: 0; margin: 0; }
.skill-bars li { display: flex; align-items: center; gap: .6rem; margin-bottom: 0.7em; }
.skill-bars i { font-size: 1.9em; min-width: 1.9em; }
.skill-bars span { width: 90px; font-weight: 500; }

.bar-bg {
    flex: 1;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(.77,0,.18,1);
}

/* Focus */
.focus-cards { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.focus-card { padding:1rem; transition: transform 0.25s cubic-bezier(.77,0,.18,1), box-shadow 0.25s; }
.focus-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.10); }
.focus-card h3 { margin-top:0; font-size:1rem; }
.focus-card p { margin-bottom:0; font-size:.9rem; line-height:1.4; }

/* Projects */
.filters { display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center; margin:0 0 1.5rem; }
.filter-btn {
    background: var(--secondary);
    border:1px solid var(--primary);
    color:var(--primary);
    padding:.45rem .9rem;
    border-radius:999px;
    cursor:pointer;
    font-size:.75rem;
    letter-spacing:.5px;
    text-transform:uppercase;
    transition: transform 0.18s, background 0.25s, color 0.25s;
}
.filter-btn:hover { transform: translateY(-1px); }
.filter-btn.active, .filter-btn:hover { background:var(--primary); color:#fff; }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    padding: 1rem;
    transition: transform 0.25s cubic-bezier(.77,0,.18,1), box-shadow 0.25s;
    will-change: transform;
}

.project-card:hover {
    transform: perspective(700px) rotateY(3deg) translateY(-4px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}

.project-card .tags { margin:.6rem 0 .8rem; display:flex; flex-wrap:wrap; gap:.4rem; }
.badge { background: var(--primary); color:#fff; padding:.25rem .5rem; border-radius:6px; font-size:.65rem; letter-spacing:.5px; }

/* Contact */
.contact-text {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

/* Scroll-to-top button */
#scrollTopBtn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 100;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.7em;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.22);
}

#scrollTopBtn.show {
    opacity: 1;
    pointer-events: auto;
}

/* Section reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(.77,0,.18,1), transform 0.7s cubic-bezier(.77,0,.18,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0;
    background: var(--secondary);
    margin-top: 2rem;
}

.footer-social { margin-top: 0.5em; }
.footer-social a {
    margin: 0 0.5em;
    color: var(--text);
    font-size: 2em;
    vertical-align: middle;
    transition: color 0.2s;
}
.footer-social a:hover { color: var(--primary); }

/* Dark mode */
body.dark {
    --bg: #0b1020;
    --text: #e5e7eb;
    --secondary: #111827;

    /* Solid full-screen section backgrounds (dark mode) */
    --section-hero: #050713;
    --section-about: #0b1020;
    --section-skills: #0f172a;
    --section-focus: #0a1628;
    --section-portfolio: #071a14;
    --section-contact: #0b1020;
}

body.dark .logo { color: var(--accent); }
body.dark .project-card,
body.dark .focus-card,
body.dark .about-extra {
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}
body.dark .inline-tags li { background:#242424; }
body.dark .filter-btn { background:#242424; }
body.dark #scrollTopBtn { background: var(--secondary); color: var(--text); }

/* Responsive */
@media (max-width: 768px) {
    .section-pattern { padding-top: 2.5rem; padding-bottom: 2.5rem; }

    .nav-toggle { display: block; }
    .nav-links {
        position: absolute;
        top: var(--header-height);
        right: 0;
        background: var(--bg);
        flex-direction: column;
        width: 220px;
        padding: 1rem;
        display: none;
        box-shadow: 0 14px 35px rgba(0,0,0,0.18);
        border-bottom-left-radius: var(--radius);
    }
    .nav-links.active { display: flex; }

    #typewriter {
        white-space: normal;
        border-right: none;
        font-size: 2.0rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}
