/* ============ THEME VARIABLES ============ */
:root {
    --bg: #0b0f14;
    --surface: #11161d;
    --elev: #18202b;
    --text: #e8edf2;
    --muted: #a7b3c2;
    --accent: #0f766e;
    /* emerald */
    --berry: #6b1d3d;
    /* deep berry */
    --navy: #0b2545;
    /* deep navy */
    --cream: #f3eee7;
    --ring: rgba(15, 118, 110, .35);
    --shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

html {
    color-scheme: dark light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background .25s, color .25s;
}

/* Light theme */
body.light {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --elev: #ffffff;
    --text: #1c1f23;
    --muted: #5a6b7b;
    --accent: #0f766e;
    --shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

/* ============ GLOBAL ============ */
h1,
h2,
h3 {
    text-align: center;
    margin: 0 0 12px;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    letter-spacing: .2px;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    line-height: 1.8;
    margin: 10px auto;
    max-width: 760px;
    color: var(--muted);
}

.section {
    padding: 64px 18px;
}

.lead {
    text-align: center;
    margin-bottom: 24px;
}

/* ============ NAV ============ */
nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: color-mix(in lab, var(--bg) 70%, transparent);
    border-bottom: 1px solid color-mix(in lab, var(--text) 10%, transparent);
}

.nav-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 14px 16px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color .2s, background .2s;
    font-weight: 600;
}

nav a:hover,
nav a.active {
    color: var(--text);
    background: color-mix(in lab, var(--accent) 18%, transparent);
}

/* ============ HERO ============ */
.hero {
    padding: 96px 18px 52px;
    text-align: center;
}

.subtitle {
    margin-top: 6px;
    font-weight: 700;
    color: var(--text);
}

.role-rotator {
    color: var(--accent);
    transition: opacity .18s;
}

.tagline {
    margin-top: 8px;
}

.hero-ctas {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid color-mix(in lab, var(--text) 14%, transparent);
    color: var(--text);
    background: transparent;
    transition: transform .15s, background .2s, border-color .2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    background: var(--accent);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.btn.ghost {
    background: color-mix(in lab, var(--navy) 20%, transparent);
}

/* ============ ABOUT ============ */
.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 36px;
    max-width: 980px;
    margin: 22px auto 0;
}

.about-container img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

/* ============ CHIPS ============ */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0 22px;
}

.chip {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid color-mix(in lab, var(--text) 14%, transparent);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: background .2s, color .2s, border-color .2s, transform .1s;
}

.chip:hover {
    transform: translateY(-1px);
}

.chip.active {
    color: var(--text);
    background: color-mix(in lab, var(--accent) 18%, transparent);
    border-color: color-mix(in lab, var(--accent) 45%, transparent);
}

/* ============ PROJECTS ============ */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8px;
}

.project-card {
    background: var(--surface);
    border: 1px solid color-mix(in lab, var(--text) 8%, transparent);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, .35);
}

.project-card img {
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.project-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px 0 4px;
}

.badge {
    font-size: .75rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in lab, var(--navy) 25%, transparent);
    color: var(--cream);
    border: 1px solid color-mix(in lab, var(--text) 10%, transparent);
}

.actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.btn.small {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: .9rem;
}

/* ============ SKILLS ============ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 12px auto 0;
    padding: 0 8px;
}

.skill-card {
    background: var(--surface);
    border: 1px solid color-mix(in lab, var(--text) 8%, transparent);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, .35);
}

/* ============ ORGANIZATIONS ============ */
.organization-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 30px;
    justify-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 8px;
}

.organization-card {
    text-align: center;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    transition: transform .2s;
}

.organization-card img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.organization-card:hover {
    transform: translateY(-3px) scale(1.02);
}

/* ============ MODAL ============ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
    z-index: 60;
}

.modal-content {
    background: var(--elev);
    color: var(--text);
    width: min(640px, 92vw);
    margin: 10vh auto;
    padding: 22px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    position: relative;
    animation: pop .18s ease-out;
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.75rem;
    cursor: pointer;
}

@keyframes pop {
    from {
        transform: scale(.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============ FOOTER ============ */
footer {
    background: var(--surface);
    border-top: 1px solid color-mix(in lab, var(--text) 8%, transparent);
    padding: 56px 18px;
    text-align: center;
    margin-top: 48px;
}

footer .socials {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

footer a {
    color: var(--text);
    text-decoration: none;
    opacity: .9;
}

footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============ REVEAL ON SCROLL ============ */
.reveal {
    opacity: 0;
    transform: translateY(12px);
}

.reveal.visible {
    opacity: 1;
    transform: none;
    transition: opacity .5s ease, transform .5s ease;
}

/* Particles: colors adapt to theme */
:root {
    /* particles are subtle in dark mode */
    --particle: rgba(255, 255, 255, 0.12);
    --particle-2: rgba(255, 255, 255, 0.06);
}

body.light {
    /* slightly darker dots in light mode for contrast */
    --particle: rgba(0, 0, 0, 0.10);
    --particle-2: rgba(0, 0, 0, 0.05);
}

/* Ensure hero is the animation container */
.hero {
    position: relative;
    overflow: hidden;
    /* optional: a soft base so the dots read well in both themes */
    background: transparent;
}

/* Layer 1: fine dot grid drifting upward */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--particle) 1px, transparent 1.6px);
    background-size: 22px 22px;
    animation: particleDrift 55s linear infinite;
    transform: translateZ(0);
    pointer-events: none;
    z-index: 0;
}

/* Layer 2: larger, lighter dots for depth, slower drift */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--particle-2) 1.5px, transparent 2.2px);
    background-size: 34px 34px;
    animation: particleDriftSlow 95s linear infinite;
    transform: translateZ(0);
    pointer-events: none;
    z-index: 0;
}

.hero * {
    position: relative;
    z-index: 1;
}

@keyframes particleDrift {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-800px);
    }
}

@keyframes particleDriftSlow {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-600px);
    }
}