:root {
    --bg: #120914;
    --bg-soft: #1c0e20;
    --text: #fcf9f8;
    --muted: #d4bec2;
    --accent: #fd6c9c;
    --accent-2: #b0004a;
    --card: rgba(255, 255, 255, 0.06);
    --border: rgba(227, 189, 195, 0.15);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* LIGHT MODE THEME OVERRIDES */
body.light-mode {
    --bg: #fff9fb;
    --bg-soft: #f9ecf2;
    --text: #2b141e;
    --muted: #6d4c57;
    --accent: #d81b60;
    --accent-2: #b0004a;
    --card: #ffffff;
    --border: rgba(227, 189, 195, 0.45);
    --card-shadow: 0 8px 24px rgba(176, 0, 74, 0.08);

    background: linear-gradient(135deg, #fff9fb, #fcedf3);
    color: var(--text);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode .card-header h3,
body.light-mode .info-label,
body.light-mode .skill-card h3,
body.light-mode .work-card h3,
body.light-mode .contact-info h3,
body.light-mode .form-group label {
    color: #2b141e;
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(227, 189, 195, 0.5);
    box-shadow: 0 10px 30px rgba(176, 0, 74, 0.12);
}

body.light-mode .nav-link {
    color: #5a3a46;
}

body.light-mode .nav-link:hover {
    background: rgba(216, 27, 96, 0.08);
    color: #d81b60;
}

body.light-mode .nav-link.active {
    color: white;
}

body.light-mode .skill-card,
body.light-mode .achievement-card,
body.light-mode .work-card,
body.light-mode .info-item {
    background: #ffffff;
    border-color: rgba(227, 189, 195, 0.4);
    box-shadow: 0 8px 24px rgba(176, 0, 74, 0.08);
}

body.light-mode .form-group input,
body.light-mode .form-group textarea {
    background: #ffffff;
    border-color: rgba(227, 189, 195, 0.5);
    color: #2b141e;
}

body.light-mode .form-group input::placeholder,
body.light-mode .form-group textarea::placeholder {
    color: #a08287;
}

body.light-mode #loader {
    background: #fff9fb;
}

body.light-mode .loader-content h2 {
    color: #2b141e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg), #240f28);
    color: var(--text);
    line-height: 1.6;
    padding-top: 110px;
    max-width: 100vw;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* UNIFIED CONTAINER ALIGNMENT SYSTEM */
.container,
.hero-content,
.section,
footer {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    box-sizing: border-box;
}

.hero {
    min-height: calc(100vh - 110px);
    padding-bottom: 3rem;
    display: flex;
    align-items: center;
}

.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 12px;
    background: rgba(18, 9, 20, 0.75);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(227, 189, 195, 0.18);
    border-radius: 999px;
    z-index: 9999;
    max-width: calc(100vw - 32px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: navFade .6s ease;
}

@keyframes navFade {
    from {
        opacity: 0;
        transform: translate(-50%, -30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-link { 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    color: #e5d2d6;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: .3s;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, #b0004a, #d81b60);
    color: white;
    box-shadow: 0 0 18px rgba(216, 27, 96, 0.45);
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.08);
}

/* STRICT TOGGLE ICON VISIBILITY - PREVENTS STACKING */
.theme-toggle-btn .icon-sun {
    display: none !important;
}

.theme-toggle-btn .icon-moon {
    display: inline-block !important;
}

body.light-mode .theme-toggle-btn .icon-sun {
    display: inline-block !important;
    color: #e65100;
}

body.light-mode .theme-toggle-btn .icon-moon {
    display: none !important;
}

.eyebrow {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.1rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.hero h2 {
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero-text p {
    color: var(--muted);
    max-width: 650px;
    margin-bottom: 1.4rem;
}

.cta-buttons,
.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 1.8rem;
}

.hero .social-icons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 2.2rem;
}

.hero .social-icons a {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #d81b60;
    border-radius: 50%;
    color: #fd6c9c;
    text-decoration: none;
    font-size: 18px;
    flex-shrink: 0;
    transition: all .35s ease;
}

.hero .social-icons a:hover {
    background: #d81b60;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 0 15px rgba(216, 27, 96, .5), 0 0 35px rgba(216, 27, 96, .3);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-width: fit-content;
    height: 48px;
    padding: 0 24px;
    border: 2px solid #d81b60;
    border-radius: 999px;
    background: transparent;
    color: #fd6c9c;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: all .35s ease;
    box-sizing: border-box;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
    background: #d81b60;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 0 15px rgba(216, 27, 96, .5), 0 0 35px rgba(216, 27, 96, .3);
}

.avatar,
.hero-avatar {
    position: relative;
    width: min(300px, 65vw);
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(216, 27, 96, .45);
    box-shadow: 0 0 30px rgba(216, 27, 96, .35), 0 0 80px rgba(176, 0, 74, .2);
    animation: floating 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    transition: box-shadow .35s ease;
    margin: 0 auto;
}

.avatar::before,
.hero-avatar::before {
    content: "";
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 108, 156, .35), rgba(216, 27, 96, .15), transparent 70%);
    filter: blur(30px);
    z-index: -1;
}

.avatar img,
.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.avatar:hover,
.hero-avatar:hover {
    animation-play-state: paused;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 40px rgba(216, 27, 96, .55), 0 0 100px rgba(176, 0, 74, .3);
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section {
    padding: 5rem 0;
    opacity: 1;
    transform: none;
}

.section-title {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-title p {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.section-title h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
}

.home-skills,
.home-achievements {
    margin-top: 4rem;
}

.skill-grid,
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.skill-card,
.work-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.6rem;
    backdrop-filter: blur(10px);
    transition: all .3s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.skill-card:hover,
.work-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(216, 27, 96, .2), 0 0 20px rgba(253, 108, 156, .25);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.6rem;
    text-align: left;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.achievement-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(216, 27, 96, 0.2), 0 0 20px rgba(253, 108, 156, 0.25);
}

.section-button {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3.5rem;
    width: 100%;
}

.preview-container {
    position: fixed;
    display: none;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(216, 27, 96, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(216, 27, 96, 0.4);
    max-width: 250px;
}

.preview-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    margin-top: 2.5rem;
}

.contact-info {
    text-align: left;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: var(--card);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.info-item i {
    font-size: 1.6rem;
    color: var(--accent);
    min-width: 28px;
    display: flex;
    align-items: flex-start;
    padding-top: 0.2rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.2rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(216, 27, 96, 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 0.95rem 1.1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--card);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--muted);
}

footer .social-icons {
    display: flex;
    gap: 14px;
    margin-top: 1.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

footer .social-icons a {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #d81b60;
    border-radius: 50%;
    color: #fd6c9c;
    text-decoration: none;
    font-size: 20px;
    transition: all .35s ease;
}

footer .social-icons a:hover {
    background: #d81b60;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 0 15px rgba(216, 27, 96, .5), 0 0 35px rgba(216, 27, 96, .3);
}

#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #b0004a, #fd6c9c);
    z-index: 9999;
    box-shadow: 0 0 12px rgba(216, 27, 96, .7), 0 0 25px rgba(253, 108, 156, .5);
}

.popup {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    z-index: 9999;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    width: min(400px, 90vw);
    padding: 30px;
    text-align: center;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(216, 27, 96, .3);
}

.popup-content i {
    font-size: 60px;
    color: #fd6c9c;
    margin-bottom: 16px;
}

.popup-content button {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    background: #d81b60;
    color: white;
    transition: .3s;
}