/* ============================================
   BASE / RESET
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    padding: 0;
    margin: 0;
    min-height: 100%;
    color: var(--text);

    /* Gradient background */
    background:
            radial-gradient(circle at top left, var(--grad-pink), transparent 10%),
            radial-gradient(circle at bottom right, var(--grad-mustard), transparent 50%),
            linear-gradient(180deg, var(--grad-start) 0%, var(--grad-mid) 40%, var(--grad-end) 100%);
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

html, body, input, textarea, button {
    font-family: "Gill Sans", sans-serif;
}

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
    /* Color Palette */
    --bg: #00343A;
    --card: #065867;
    --text: #ffffff;
    --muted: #b6b9d6;
    --brand: #F09300;
    --accent: #FD3866;
    --accent-light: #FD6484;
    --secondary: #078E92;

    /* Layout Tokens */
    --maxw: 1080px;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .2);

    /* Spacing Tokens */
    --space-1: .5rem;   /* 8px */
    --space-2: 1rem;    /* 16px */
    --space-3: 1.5rem;  /* 24px */
    --space-4: 2rem;    /* 32px */

    /* Background gradient tokens */
    --grad-pink: rgba(253, 56, 102, 0.25);
    --grad-mustard: rgba(240, 147, 0, 0.25);
    --grad-start: #00343A;
    --grad-mid: #065867;
    --grad-end: #078E92;
}

/* ============================================
   LIGHT THEME
   ============================================ */

.theme-light {
    --bg: #f7fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --brand: #F09300;
    --accent: #FD3866;
    --accent-light: #FD6484;
    --secondary: #0EA5A3;

    /* Softer, light gradient */
    --grad-pink: rgba(253, 56, 102, 0.12);
    --grad-mustard: rgba(240, 147, 0, 0.12);
    --grad-start: #f6f8fb;
    --grad-mid: #eef3f7;
    --grad-end: #e9eff5;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
    margin-left: .5rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
    font-size: 18px;
    line-height: 1;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
}

/* ============================================
   TOP BAR / NAVIGATION
   ============================================ */

.topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    z-index: 100;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: .8rem var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.nav__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(.4rem, 2.5vw, 1.2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav__links a {
    color: var(--muted);
    font-weight: 500;
    transition: color .2s, background .2s;
    padding: .3rem .6rem;
    border-radius: .4rem;
    font-size: clamp(.92rem, 1.8vw, 1.05rem);
}

.nav__links a:hover {
    color: var(--accent);
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

@media (max-width: 480px) {
    .nav {
        padding: .6rem var(--space-2);
        gap: .4rem;
    }

    .nav__links {
        gap: .25rem;
    }

    .nav__links a {
        font-size: 0.8rem;
        padding: .2rem .35rem;
    }

    .theme-toggle {
        width: 28px;
        height: 28px;
        font-size: 14px;
        margin-left: .2rem;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .nav__links {
        gap: .5rem;
    }

    .nav__links a {
        font-size: 0.9rem;
        padding: .25rem .4rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Light theme topbar */
.theme-light .topbar {
    background: rgba(255, 255, 255, .65);
    border-bottom-color: rgba(0, 0, 0, .08);
    backdrop-filter: blur(8px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    isolation: isolate;
    min-height: clamp(520px, 80vh, 760px);
    display: grid;
    align-items: center;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    max-width: var(--maxw);
    margin: 0 auto;
    padding: var(--space-4) var(--space-2);
    background: transparent;

}

/* Split hero layout: photo left, text right */
.hero.hero--split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: center;
    min-height: clamp(420px, 60vh, 620px);
    max-width: var(--maxw);
    margin-top: 2rem;
    place-items: center;
    text-align: center;
    padding-top: clamp(2rem, 10vh, 6rem);
    box-sizing: border-box;
}

/* Desktop: two columns */
@media (min-width: 768px) {
    .hero.hero--split {
        grid-template-columns: 1fr 1.15fr;
        place-items: center start;
        text-align: left;
        gap: clamp(1rem, 4vw, 3rem);
    }

    .hero__icons {
        justify-content: center;
        align-self: center;
    }

    .hero__content {
        justify-self: start;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: clamp(.4rem, 1.2vw, .9rem);
        margin: 0;
        max-width: 42ch;
    }

    .hero__photo {
        justify-self: end;
        transform: translateX(12px);
    }
}

/* ============================================
   HERO PHOTO (with rotating border)
   ============================================ */

.hero__photo {
    position: relative;
    display: inline-block;
    width: clamp(160px, 36vw, 320px);
    height: clamp(160px, 36vw, 320px);
    border-radius: 50%;
    overflow: visible;
}

.hero__photo img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

/* Rotating border */
.hero__photo::before {
    content: "";
    position: absolute;
    inset: clamp(-6px, -1.2vw, -10px);
    border-width: clamp(8px, 1.2vw, 12px);
    border-style: solid;
    border-radius: 50%;
    border-top-color: var(--accent);
    border-right-color: var(--brand);
    border-bottom-color: var(--secondary);
    border-left-color: var(--muted);
    animation: spin 5s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   HERO CONTENT
   ============================================ */

.hero__content--red h1,
.hero__content--red .eyebrow,
.hero__content--red .subtitle {
    color: var(--muted);
}

.hero__content--red h1 {
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 5.8vw, 3.2rem);
    line-height: 1.1;
    font-weight: 800;
}

.eyebrow {
    letter-spacing: .06em;
    text-transform: none;
    font-weight: 600;
    margin: 0 0 .5rem;
}

.subtitle {
    margin: 0 0 1.1rem;
    color: var(--accent);
    font-weight: 500;
}

/* ============================================
   HERO ICONS (Contact Icons)
   ============================================ */

.hero__icons {
    display: flex;
    gap: .8rem;
    margin-top: -0.5rem;
    justify-content: center;
}

.icon {
    width: clamp(44px, 8vw, 64px);
    height: clamp(44px, 8vw, 64px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, background .2s ease, border-color .2s ease;
}

.icon:hover {
    transform: translateY(-2px);
    background: rgba(253, 56, 102, .2);
    border-color: var(--brand);
}

.icon::before {
    content: "";
    display: block;
    width: 60%;
    height: 60%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.hero__icons a[aria-label="Email"]::before {
    background-image: url('../assets/images/contactIcons/1.png');
}

.hero__icons a[aria-label="GitHub"]::before {
    background-image: url('../assets/images/contactIcons/2.png');
}

.hero__icons a[aria-label="LinkedIn"]::before {
    background-image: url('../assets/images/contactIcons/3.png');
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--bg);
    text-align: center;
    color: var(--muted);
    padding: var(--space-3) var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.site-footer a {
    color: var(--accent);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none;
}

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ============================================
   DYNAMIC CONTENT (Greeting)
   ============================================ */

.hero-greeting {
    font-weight: 600;
    margin: .25rem 0 .5rem;
}

#usernameForm {
    display: flex;
    gap: .5rem;
    margin: .5rem 0;
}

#usernameInput {
    padding: .45rem .6rem;
    border-radius: .5rem;
    border: 1px solid #ddd;
}

#changeNameBtn {
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    padding: 0;
}

/* ============================================
   HERO MOBILE CENTERING
   ============================================ */

@media (max-width: 768px) {
    .hero__content {
        text-align: center;
        align-items: center;
    }

    .hero-greeting {
        text-align: center;
        width: 100%;
    }

    #usernameForm {
        justify-content: center;
        width: 100%;
    }

    #changeNameBtn {
        text-align: center;
    }

    .hero__icons {
        justify-content: center;
    }
}
/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */

#scrollProgress {
    position: fixed;
    left: 0;
    top: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, #f6b10a, #ff4d6d);
    border-radius: 0 2px 2px 0;
    z-index: 9999;
    pointer-events: none;
    transition: width .08s linear;
}

#scrollProgress.progress--bottom {
    top: auto;
    bottom: 0;
    border-radius: 2px 2px 0 0;
}

@media (prefers-reduced-motion: reduce) {
    #scrollProgress {
        transition: none;
    }
}

/* ============================================
   MINIMAL SECTION DIVIDERS
   ============================================ */

section { position: relative; }

/* Simple gradient line for all sections */
.hero::before,
.about-intro::after,
.skills::after,
.projects::after {
    content: '';
    position: absolute;
    bottom: -3rem;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary) 25%, var(--brand) 50%, var(--secondary) 75%, transparent);
    opacity: 0.3;
}

.hero::before { z-index: 1; }

/* Mobile */
@media (max-width: 768px) {
    .hero::before,
    .about::after,
    .projects::after,
    .volunteering::after {
        bottom: -2.5rem;
    }
}

/* Light Theme */
.theme-light .hero::before,
.theme-light .about::after,
.theme-light .projects::after,
.theme-light .volunteering::after {
    opacity: 0.4;
}