/* =========================
   FONTS
========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* =========================
   RESET + BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #06060b;
    --bg-elevated: rgba(14, 14, 22, 0.72);
    --bg-elevated-strong: rgba(22, 22, 34, 0.85);
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(79, 172, 254, 0.22);
    --text: #eaeaef;
    --muted: #8888a4;
    --accent1: #4facfe;
    --accent2: #00f2fe;
    --accent-glow: rgba(79, 172, 254, 0.12);
    --button: linear-gradient(135deg, rgba(79, 172, 254, 0.12), rgba(0, 242, 254, 0.08));
    --button-solid: rgba(79, 172, 254, 0.10);
    --button-hover: rgba(79, 172, 254, 0.20);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 40px rgba(79, 172, 254, 0.08), 0 4px 16px rgba(0, 0, 0, 0.5);
    --radius: 20px;
    --radius-sm: 12px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
}

body {
    position: relative;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}

/* Subtle noise texture overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* =========================
   BACKGROUND CANVAS
========================= */
#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Make sure content always sits above particles */
nav,
header,
section,
footer,
.card,
.repo-card,
.container,
img,
main {
    position: relative;
    z-index: 1;
}

/* =========================
   TYPOGRAPHY
========================= */
h1,
h2,
h3 {
    line-height: 1.15;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.3rem, 2.2vw, 1.65rem);
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: var(--text);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--muted);
    margin-bottom: 0.85rem;
    font-size: 1rem;
    line-height: 1.75;
}

.gradient {
    background: linear-gradient(135deg, var(--accent1) 0%, var(--accent2) 40%, var(--accent1) 80%, var(--accent2) 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 300% center; }
}

.muted {
    color: var(--muted);
}

/* =========================
   NAVBAR
========================= */
nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    padding: 14px 24px;
    background: rgba(6, 6, 11, 0.65);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 7px 18px;
    border-radius: 999px;
    transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 12px rgba(79, 172, 254, 0.06);
}

/* =========================
   HEADER
========================= */
header {
    text-align: center;
    padding: 100px 24px 24px;
    max-width: 900px;
    margin: 0 auto;
}

header p {
    color: var(--muted);
    font-size: 1.05rem;
    margin-top: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* =========================
   IMAGES
========================= */
img {
    display: block;
    background: transparent;
}

.profile {
    display: block;
    width: min(170px, 38vw);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin: 28px auto 20px;
    border-radius: 50%;
    border: 2px solid rgba(79, 172, 254, 0.18);
    box-shadow: 0 0 50px rgba(79, 172, 254, 0.10), 0 0 100px rgba(79, 172, 254, 0.04), var(--shadow);
    transition: transform 0.5s var(--ease-spring), box-shadow 0.5s ease;
}

.profile:hover {
    transform: scale(1.04);
    box-shadow: 0 0 70px rgba(79, 172, 254, 0.18), 0 0 120px rgba(79, 172, 254, 0.06), var(--shadow);
}

.hero {
    display: block;
    width: min(820px, 86vw);
    max-width: 820px;
    height: auto;
    margin: 34px auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* =========================
   GENERIC SECTION / CARD
========================= */
section,
.card,
.repo-card {
    background: var(--bg-elevated);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease-out), box-shadow 0.4s ease, border-color 0.35s ease;
}

section,
.card {
    width: min(780px, calc(100% - 48px));
    margin: 20px auto;
    padding: 32px 32px;
    border-radius: var(--radius);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-hover);
}

.card h2,
section h2 {
    margin-bottom: 0.65rem;
}

.card p:last-child,
section p:last-child {
    margin-bottom: 0;
}

/* CTA card styling */
.cta-card {
    text-align: center;
    padding: 44px 32px;
    background: linear-gradient(145deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.02) 50%, rgba(79, 172, 254, 0.04) 100%);
    border: 1px solid rgba(79, 172, 254, 0.08);
}

.cta-card:hover {
    border-color: rgba(79, 172, 254, 0.18);
    box-shadow: 0 0 60px rgba(79, 172, 254, 0.06), var(--shadow-hover);
}

.cta-card h2 {
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}

.cta-card p {
    font-size: 1.02rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================
   LISTS
========================= */
ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

ul li {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin: 10px 0;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

ul li:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(79, 172, 254, 0.10);
    transform: translateX(4px);
}

ul li strong {
    color: var(--text);
}

/* =========================
   BUTTONS + LINKS
========================= */
a {
    color: var(--accent1);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent2);
}

.button {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--button-solid);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid rgba(79, 172, 254, 0.12);
    transition: all 0.3s var(--ease-out);
    letter-spacing: 0.02em;
}

.button:hover {
    background: var(--button-hover);
    border-color: rgba(79, 172, 254, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(79, 172, 254, 0.14), 0 0 0 1px rgba(79, 172, 254, 0.06);
    color: white;
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(79, 172, 254, 0.10);
}

/* =========================
   PROJECTS PAGE
========================= */
.container {
    width: min(900px, calc(100% - 48px));
    margin: 26px auto 40px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.repo-card {
    padding: 26px 26px;
    border-radius: var(--radius);
    transition: transform 0.3s var(--ease-out), box-shadow 0.35s ease, border-color 0.3s ease;
}

.repo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-hover);
}

.repo-card p {
    margin-bottom: 0.7rem;
}

.repo-card .meta {
    color: var(--muted);
    font-size: 0.88rem;
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 0.01em;
}

/* =========================
   ANIMATIONS
========================= */
.hidden {
    opacity: 0;
    transform: translateY(28px);
}

.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

/* stagger child cards */
.show:nth-child(2) { transition-delay: 0.05s; }
.show:nth-child(3) { transition-delay: 0.1s; }
.show:nth-child(4) { transition-delay: 0.15s; }
.show:nth-child(5) { transition-delay: 0.2s; }
.show:nth-child(6) { transition-delay: 0.25s; }
.show:nth-child(7) { transition-delay: 0.3s; }
.show:nth-child(8) { transition-delay: 0.35s; }

/* =========================
   FOOTER
========================= */
footer {
    width: min(780px, calc(100% - 48px));
    margin: 32px auto 48px;
    text-align: center;
    color: var(--muted);
    font-size: 0.84rem;
    opacity: 0.6;
    letter-spacing: 0.03em;
}

/* =========================
   HORIZONTAL RULES
========================= */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 172, 254, 0.12), transparent);
    margin: 24px 0;
}

/* =========================
   FORMS
========================= */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-family: inherit;
    font-size: 0.98rem;
    line-height: 1.5;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
    opacity: 0.45;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent1);
    background: rgba(79, 172, 254, 0.03);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.06), 0 0 20px rgba(79, 172, 254, 0.04);
}

.form-group select option {
    background: #0e0e16;
    color: var(--text);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

form .button {
    cursor: pointer;
    font-size: 0.95rem;
    border: 1px solid rgba(79, 172, 254, 0.15);
    padding: 13px 32px;
}

form .button:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.18), rgba(0, 242, 254, 0.12));
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    nav {
        gap: 0.15rem;
        padding: 10px 12px;
    }

    nav a {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    header {
        padding-top: 60px;
    }

    section,
    .card,
    .repo-card {
        border-radius: 16px;
    }

    section,
    .card {
        padding: 24px 20px;
        width: min(780px, calc(100% - 32px));
    }

    .hero {
        width: min(94vw, 820px);
        border-radius: 14px;
    }

    .cta-card {
        padding: 32px 20px;
    }

    .container {
        width: min(900px, calc(100% - 32px));
    }
}

@media (min-width: 769px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
