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

/* ── Body ── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ── Sections (global) ── */
section {
    padding: 5rem 5%;
    scroll-margin-top: 80px;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

section:not(.hero) h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 0.5rem auto 0;
}

/* ── Utility ── */
.fade-in-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── Canvas overlays ── */
#darkveil-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    display: block;
    pointer-events: none;
}

#lightveil-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    display: none;
    pointer-events: none;
}

body.theme-light #darkveil-canvas  { display: none; }
body.theme-light #lightveil-canvas { display: none; }

/* ── Footer ── */
footer {
    background: var(--footer-bg);
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--footer-border);
    color: var(--footer-color);
}

/* ── Navigation ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 12%;
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border);
    transition: background 0.4s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.logo img {
    height: 25px;
    width: auto;
}

.logo span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
}

.logo-text {
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff, #4488ff, #297fc5, #ffffff);
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 5s linear infinite;
}

body.theme-light .logo-text {
    background: linear-gradient(90deg, #1a202c, #2563eb, #60a5fa, #1a202c);
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .logo img {
    filter: brightness(0.7) contrast(0.9);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 700;
    position: relative;
    padding-bottom: 4px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: none;
}

nav a:hover::after  { width: 0%; }
nav a.active::after { width: 100%; }

nav a:hover,
nav a.active { color: var(--accent); }

/* ── Theme toggle ── */
.hamburger { display: none; }

.theme-toggle {
    background: none;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.25s ease, transform 0.25s ease;
    flex-shrink: 0;
    padding: 0;
    opacity: 0.6;
}

.theme-toggle:hover {
    color: var(--accent);
    transform: rotate(20deg) scale(1.15);
    opacity: 1;
}

body.theme-light .theme-toggle       { color: var(--text-muted); }
body.theme-light .theme-toggle:hover { color: #2563eb; opacity: 1; }

/* ── Keyframes ── */
@keyframes gradientMove {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
/* ── Scroll Progress Bar ── */
#scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s linear;
    z-index: 1001;
}

/* ── Back to Top Button ── */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    z-index: 9999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(120,120,120,0.35);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
#back-to-top:hover {
    transform: translateY(-3px);
    background: rgba(120,120,120,0.55);
}
body.theme-light #back-to-top {
    background: rgba(100,100,100,0.2);
    color: rgba(0,0,0,0.5);
    border: 1px solid rgba(0,0,0,0.12);
}
body.theme-light #back-to-top:hover {
    background: rgba(100,100,100,0.35);
}

/* ── Copy Email Button ── */
.copy-email-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.3rem;
    vertical-align: middle;
    transition: color 0.2s ease;
}
.copy-email-btn:hover { color: var(--accent); }

/* ── Copy Toast ── */
#copy-toast {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    pointer-events: none;
}
#copy-toast.show {
    opacity: 1;
    visibility: visible;
}

/* ── Project Status Badge Legend ── */
.project-legend {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.3rem;
}
.legend-dot.completed  { background: #22c55e; }
.legend-dot.in-progress { background: #f59e0b; }

/* ── Light Mode: Frosted Glass Cards ── */
body.theme-light .about-card,
body.theme-light .about-bio-box,
body.theme-light .contact-card,
body.theme-light .project-card,
body.theme-light .tech-icon-card,
body.theme-light .timeline-card,
body.theme-light .detail-header,
body.theme-light .detail-sidebar,
body.theme-light .soft-skill-item {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.07), 0 1.5px 6px rgba(37,99,235,0.04);
}
