/* =====================================================
   1. VARIABLES
===================================================== */
:root {
    --brand: #F04F18;
    --brand-dark: #d84312;
    --brand-glow: rgba(240, 79, 24, 0.35);
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --soft: #FDE3D9;
    --alt-bg: #FFF3EF;
    --text: #1f2933;
    --muted: #5b6672;
    --border: #ececec;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 18px 40px rgba(240, 79, 24, 0.22);
    --nav-height: 72px;
    --radius: 18px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --speed: 0.35s;
}

/* Theme class lives on <html> so it applies before first paint */
.dark {
    --bg: #141b22;
    --surface: #1f2933;
    --soft: #2e3a4a;
    --alt-bg: #18212a;
    --text: #F2F4F6;
    --muted: #b3bcc6;
    --border: #2c3845;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 18px 40px rgba(240, 79, 24, 0.25);
    color-scheme: dark;
}

/* =====================================================
   2. RESET & GLOBAL
===================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-top: var(--nav-height);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background var(--speed) ease, color var(--speed) ease;
}

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

a:focus-visible,
button:focus-visible,
.theme-toggle:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
    border-radius: 6px;
}

/* =====================================================
   3. NAVBAR
===================================================== */
header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-height);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease;
}

header.scrolled {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.navbar {
    height: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo {
    color: var(--brand);
    font-weight: 700;
    font-size: 1.8rem;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    position: relative;
    transition: color var(--speed) ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.nav-links a:hover {
    color: var(--brand);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 4px;
}

.menu-toggle span {
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background: var(--brand);
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* =====================================================
   4. THEME TOGGLE
===================================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 28px;
    background: var(--soft);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    border: 2px solid var(--brand);
    transition: background var(--speed) ease;
}

.theme-toggle span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.theme-toggle .sun { left: 6px; color: #f59e0b; }
.theme-toggle .moon { right: 6px; color: #94a3b8; }

.theme-toggle .toggle-circle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--brand);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s var(--ease);
}

.dark .theme-toggle .toggle-circle {
    transform: translateX(24px);
}

.mobile-theme { display: none; }
.desktop-toggle { display: flex; }

/* =====================================================
   5. HERO
===================================================== */
.hero-md {
    max-width: 1100px;
    margin: 0 auto;
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    padding: 3rem 2rem;
}

.hero-content {
    flex: 1;
    animation: fadeUp 0.8s var(--ease) both;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    background: var(--alt-bg);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.hero-description {
    font-family: 'Lexend', sans-serif;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    margin-bottom: 1.75rem;
    max-width: 540px;
    line-height: 1.7;
    color: var(--muted);
}

.hero-description strong {
    color: var(--text);
}

.hero-btn,
.admin-btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    background: linear-gradient(135deg, var(--brand), #ff7a45);
    color: #fff;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(240, 79, 24, 0.25);
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.hero-btn:hover,
.admin-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--brand-glow);
}

.admin-btn {
    padding: 0.6rem 1.4rem;
}

/* Circular portrait with gradient ring */
.hero-image {
    position: relative;
    flex-shrink: 0;
    padding: 6px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, var(--brand), #ffb08a, var(--brand));
    box-shadow: 0 25px 60px var(--brand-glow);
    animation: fadeIn 1s var(--ease) both;
}

.hero-image img {
    width: clamp(220px, 30vw, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 6px solid var(--bg);
    transition: transform 0.5s var(--ease);
}

.hero-image:hover img {
    transform: scale(1.03);
}

/* =====================================================
   6. SECTIONS
===================================================== */
.section {
    max-width: 1100px;
    margin: auto;
    padding: 5rem 1.5rem;
    text-align: center;
}

.section h2 {
    color: var(--brand);
    margin-bottom: 2.5rem;
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    margin: 0.75rem auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--brand), #ffb08a);
}

.alt {
    max-width: none;
    background: var(--alt-bg);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.active {
    opacity: 1;
    transform: none;
}

/* =====================================================
   7. CARDS (mission / admin / skills)
===================================================== */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.mission-card,
.admin-card,
.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.6rem;
    box-shadow: var(--shadow);
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.4s ease;
}

.mission-card:hover,
.admin-card:hover,
.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(240, 79, 24, 0.35);
}

.mission-card h3,
.admin-card h3,
.skill-card h3 {
    color: var(--brand);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.mission-card p,
.admin-card p,
.skill-card p {
    font-family: 'Lexend', sans-serif;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--muted);
}

.admin-card {
    text-align: left;
}

.admin-card p {
    margin-bottom: 1rem;
}

.admin-card p strong {
    color: var(--text);
}

/* =====================================================
   8. TEAM
===================================================== */
#team h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1rem 0 2rem;
}

#team h3 ~ h3 {
    margin-top: 4rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2rem;
}

.dev-team {
    grid-template-columns: repeat(auto-fit, minmax(210px, 260px));
    justify-content: center;
}

.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.4s ease;
}

.team-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.25rem 1.75rem;
    text-decoration: none;
    color: inherit;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(240, 79, 24, 0.35);
}

/* Circular avatar with gradient ring */
.team-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid var(--surface);
    box-shadow:
        0 0 0 3px var(--brand),
        0 12px 30px rgba(240, 79, 24, 0.25);
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease;
}

.team-card:hover img {
    transform: scale(1.06);
    box-shadow:
        0 0 0 3px var(--brand),
        0 0 0 9px rgba(240, 79, 24, 0.15),
        0 16px 36px rgba(240, 79, 24, 0.35);
}

.team-info {
    margin-top: 1.25rem;
}

.team-info h4 {
    font-size: 1.08rem;
    color: var(--text);
}

.team-info p {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    background: var(--alt-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
}

/* =====================================================
   9. PROFILE EXTRAS (skills, tags, stats, education)
===================================================== */
.about-text {
    max-width: 760px;
    margin: 0 auto;
    font-family: 'Lexend', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--muted);
    text-align: left;
}

.about-text p + p {
    margin-top: 1rem;
}

.about-text strong {
    color: var(--text);
}

.about-text blockquote {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--brand);
    background: var(--alt-bg);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1rem;
    box-shadow: var(--shadow);
}

.stat strong {
    display: block;
    font-size: 2rem;
    color: var(--brand);
    letter-spacing: -0.02em;
}

.stat span {
    font-size: 0.9rem;
    color: var(--muted);
}

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

.skill-card {
    text-align: left;
}

.skill-card h3 i {
    margin-right: 0.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tags li {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: var(--alt-bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.hero-content .tags {
    margin-bottom: 1.75rem;
}

/* =====================================================
   10. CONTACT
===================================================== */
.contact-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 1.35rem;
    text-decoration: none;
    transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.contact-icon:hover {
    background: var(--brand);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--brand-glow);
}

/* =====================================================
   11. FOOTER
===================================================== */
footer {
    text-align: center;
    padding: 1.75rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}

/* =====================================================
   12. ANIMATIONS
===================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* =====================================================
   13. RESPONSIVE
===================================================== */
@media (max-width: 900px) {
    .hero-md {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        gap: 2rem;
        padding: 2.5rem 1.5rem;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-content .tags {
        justify-content: center;
    }

    .mission-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        display: none;
        text-align: center;
    }

    .nav-links.show {
        display: flex;
        animation: fadeUp 0.3s var(--ease) both;
    }

    .nav-links li {
        padding: 1rem 0;
    }

    .desktop-toggle {
        display: none;
    }

    .mobile-theme {
        display: flex;
        justify-content: center;
    }

    .section {
        padding: 3.5rem 1.25rem;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .dev-team {
        grid-template-columns: minmax(0, 260px);
    }

    .team-card a {
        padding: 1.5rem 0.75rem;
    }

    .team-card img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .hero-image img {
        width: 200px;
    }

    .team-card img {
        width: 100px;
        height: 100px;
    }

    .team-info h4 {
        font-size: 0.95rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}
