/**
 * layout.css
 * Layout styles for header, nav, sections, and components
 */

/* HEADER */
header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(7.5rem, 14vw, 10rem) 1.75rem 4.25rem;
    background: linear-gradient(180deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

header>* {
    position: relative;
    z-index: 1;
}

header::before,
header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

header::before {
    background-image: radial-gradient(circle, rgba(79, 131, 255, 0.16) 1px, transparent 1px);
    background-size: 68px 68px;
    opacity: 0.35;
}

header::after {
    inset: -15%;
    background:
        radial-gradient(circle 180px at 18% 22%, rgba(79, 131, 255, 0.18) 0, transparent 70%),
        radial-gradient(circle 240px at 82% 28%, rgba(122, 165, 255, 0.12) 0, transparent 70%),
        radial-gradient(circle 200px at 46% 82%, rgba(79, 131, 255, 0.16) 0, transparent 70%);
    filter: blur(0);
    opacity: 0.55;
    animation: heroParticleDrift 28s ease-in-out infinite alternate;
}

@keyframes heroParticleDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-2%, -1%, 0) scale(1.04);
    }

    100% {
        transform: translate3d(2%, 2%, 0) scale(1);
    }
}

body[data-theme="light"] header::before {
    background-image: radial-gradient(circle, rgba(239, 121, 165, 0.22) 1px, transparent 1px);
    opacity: 0.28;
}

body[data-theme="light"] header::after {
    background:
        radial-gradient(circle 180px at 18% 22%, rgba(239, 121, 165, 0.28) 0, transparent 70%),
        radial-gradient(circle 240px at 82% 28%, rgba(228, 133, 178, 0.22) 0, transparent 70%),
        radial-gradient(circle 200px at 46% 82%, rgba(236, 116, 170, 0.24) 0, transparent 70%);
    opacity: 0.45;
}

header h1 {
    font-size: clamp(3rem, 3.5vw + 1.8rem, 4.3rem);
    color: var(--text);
    margin-bottom: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero-name {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-weight: 800;
    background: linear-gradient(120deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body[data-theme="light"] .hero-name {
    background: linear-gradient(120deg, var(--primary), rgba(197, 85, 127, 0.85));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-name.typing-active::after {
    content: "";
    display: inline-block;
    width: 0.035em;
    height: 1.1em;
    margin-left: 0.1em;
    background: var(--primary);
    animation: heroCursorBlink 0.8s steps(1) infinite;
}

@keyframes heroCursorBlink {
    0%, 50% {
        opacity: 1;
    }

    50.01%, 100% {
        opacity: 0;
    }
}

header h2 {
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.8rem;
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    z-index: 100;
    border-bottom: 1px solid var(--nav-border);
    transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Add shadow on scroll */
nav.scrolled {
    padding: 0.65rem 2rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    background: var(--nav-bg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: .01em;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* Nav links with indicator */
.nav-links a {
    position: relative;
    padding: 0.4rem 0;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 0.85;
    text-decoration: none;
    transition: all .25s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* Active link indicator */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links__header {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.75rem;
}

.nav-links__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.26em;
    color: var(--muted);
    display: none;
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 8px;
    border: 1px solid var(--button-border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, transform .25s ease, color .25s ease;
}

.theme-toggle:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
}

.theme-toggle i {
    pointer-events: none;
}

/* Mobile navigation */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ABOUT SECTION */
.about p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

/* CONTACT SECTION */
.contact-wrapper {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.contact-info {
    margin-bottom: 1.5rem;
    text-align: center;
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.contact-info i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.contact-links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--button-bg);
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--button-hover-bg);
    color: var(--primary);
    transform: translateY(-2px);
}

.contact-link i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 1000;
    width: 0;
    transition: width 0.1s ease;
}

/* RESPONSIVE STYLES */
@media (max-width: 1024px) {

    header {
        padding: 6.5rem 1.5rem 3.85rem;
        min-height: auto;
    }

    header h1 {
        font-size: 2.8rem;
        line-height: 1.15;
    }

    header h2 {
        font-size: 1.15rem;
        max-width: 640px;
    }

    header p {
        max-width: 640px;
    }

    .projects-grid {
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    header {
        padding: 5.8rem 1.25rem 3.25rem;
        min-height: auto;
    }

    header h1 {
        font-size: 2.35rem;
        line-height: 1.15;
    }

    header h2 {
        font-size: 1.02rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .contact-links-container {
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: auto;
        background: var(--bg);
        flex-direction: column;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        opacity: 0;
        transform: translateY(-10px);
        transition: right 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
        z-index: 999;
    }

    .nav-links.show {
        right: 10%;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 0;
    }

    .nav-links__header {
        order: -1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links__label {
        display: inline-flex;
        font-size: 0.7rem;
        letter-spacing: 0.24em;
        font-weight: 600;
        color: var(--muted);
    }

    .nav-links .theme-toggle {
        margin-top: 0;
    }

    .section-divider {
        width: 95%;
    }

    .projects-grid {
        padding: 0;
        gap: 1.1rem;
    }

    .project-card {
        padding: 2rem 0;
    }

    .project-card__header,
    .project-card__content {
        padding: 0;
    }

    .project-highlights {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {

    header {
        padding: 5.1rem 1rem 3rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header h2 {
        font-size: 0.96rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .nav-links {
        width: 88%;
        max-width: 320px;
    }
}

/* Print styles for resume */
@media print {

    .nav-links,
    .cta-buttons,
    .theme-toggle {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
}
