:root {
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --bg: #07111f;
    --bg-soft: #0d1a2b;
    --bg-elevated: rgba(15, 24, 41, 0.78);
    --surface: rgba(17, 27, 46, 0.78);
    --surface-strong: #13233a;
    --text: #edf4ff;
    --muted: #98aac4;
    --border: rgba(148, 163, 184, 0.18);
    --primary: #69d2ff;
    --secondary: #79f2c0;
    --accent: #ff8f70;
    --shadow: 0 24px 80px rgba(3, 10, 22, 0.45);
    --gradient: linear-gradient(135deg, #69d2ff 0%, #79f2c0 52%, #ffb36d 100%);
}

body.theme-light {
    --bg: #f4f7fb;
    --bg-soft: #e9eef7;
    --bg-elevated: rgba(255, 255, 255, 0.78);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --text: #142033;
    --muted: #55657f;
    --border: rgba(20, 32, 51, 0.09);
    --primary: #0f6fff;
    --secondary: #00b894;
    --accent: #ff6f61;
    --shadow: 0 24px 60px rgba(116, 134, 168, 0.18);
    --gradient: linear-gradient(135deg, #0f6fff 0%, #00b894 55%, #ff9b71 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(105, 210, 255, 0.12), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(121, 242, 192, 0.12), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, #06101c 100%);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

#particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.55;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--gradient);
    z-index: 1200;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 112px 0;
    position: relative;
}

.section-heading {
    margin-bottom: 38px;
    max-width: 760px;
}

.section-kicker,
.eyebrow,
.panel-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 18px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.section-intro,
.hero-description,
.about-story p,
.info-panel p,
.skill-card p,
.project-description,
.contact-copy p {
    color: var(--muted);
}

.card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(105, 210, 255, 0.16), transparent 35%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1100;
    background: rgba(6, 12, 23, 0.58);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .site-header {
    background: rgba(244, 247, 251, 0.72);
    border-bottom-color: rgba(20, 32, 51, 0.08);
}

.nav-shell {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    text-decoration: none;
}

.logo-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--gradient);
    color: #06101c;
    font-family: var(--font-display);
}

.logo-text {
    color: var(--text);
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 18px;
}

.nav-links a,
.theme-toggle,
.mobile-toggle,
.filter-btn,
.copy-btn,
.contact-card,
.back-to-top {
    transition: all 0.25s ease;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(105, 210, 255, 0.1);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.theme-toggle:hover,
.copy-btn:hover,
.contact-card:hover,
.filter-btn:hover,
.back-to-top:hover {
    transform: translateY(-2px);
}

.mobile-toggle {
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
}

.hero {
    padding-top: 152px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-grid,
.about-grid,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px;
    align-items: center;
}

.hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 5.6rem);
    line-height: 0.98;
    margin-bottom: 18px;
    letter-spacing: -0.05em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 32px 0 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 16px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background: var(--gradient);
    color: #04101d;
    box-shadow: 0 16px 40px rgba(105, 210, 255, 0.18);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.hero-visual {
    position: relative;
}

.hero-card {
    border-radius: 32px;
    padding: 32px;
}

.profile-ring {
    width: min(320px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 22px;
    padding: 10px;
    border-radius: 50%;
    background: var(--gradient);
}

.profile-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid rgba(6, 12, 23, 0.35);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(121, 242, 192, 0.12);
    color: var(--text);
    margin-bottom: 24px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 8px rgba(121, 242, 192, 0.08);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hero-metrics article {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-metrics strong {
    display: block;
    font-size: 2rem;
    font-family: var(--font-display);
}

.hero-metrics span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    z-index: -1;
}

.orb-one {
    width: 180px;
    height: 180px;
    background: rgba(105, 210, 255, 0.18);
    top: -24px;
    right: -10px;
}

.orb-two {
    width: 220px;
    height: 220px;
    background: rgba(255, 143, 112, 0.14);
    bottom: -24px;
    left: -22px;
}

.about,
.code {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.about-story,
.info-panel,
.contact-form {
    border-radius: 28px;
    padding: 28px;
}

.about-story h3,
.info-panel h3 {
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.about-story p + p,
.info-panel p + p {
    margin-top: 14px;
}

.about-panels {
    display: grid;
    gap: 20px;
}

.skills-grid,
.projects-grid,
.code-grid {
    display: grid;
    gap: 24px;
}

.skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-card {
    border-radius: 28px;
    padding: 28px;
}

.skill-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(105, 210, 255, 0.1);
    margin-bottom: 18px;
    color: var(--primary);
    font-size: 1.5rem;
}

.skill-card h3 {
    margin-bottom: 12px;
}

.skill-meter {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 22px;
    overflow: hidden;
}

.skill-meter-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--gradient);
    transition: width 1.2s ease;
}

.projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.filter-btn.active {
    color: #04101d;
    border-color: transparent;
    background: var(--gradient);
}

.search-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: min(100%, 360px);
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.search-shell input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: none;
}

.projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.project-visual {
    padding: 28px;
    min-height: 180px;
    background: linear-gradient(135deg, rgba(105, 210, 255, 0.18), rgba(255, 143, 112, 0.14));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.project-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.35rem;
}

.project-category {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(6, 12, 23, 0.25);
    font-size: 0.82rem;
}

.project-content {
    padding: 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
    margin: 14px 0;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 24px;
}

.tech-tag {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
}

.project-links {
    margin-top: auto;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.empty-state,
.hidden {
    display: none;
}

.empty-state.show {
    display: block;
    margin-top: 24px;
    color: var(--muted);
}

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

.code-card {
    border-radius: 28px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.code-header p {
    color: var(--muted);
    font-size: 0.95rem;
}

.code-lang {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-weight: 700;
}

.copy-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
}

.code-block {
    padding: 24px;
    background: rgba(5, 12, 21, 0.85);
    color: #d7e5ff;
    overflow-x: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.92rem;
}

.code-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px 24px;
    color: var(--primary);
    text-decoration: none;
}

.contact-grid {
    align-items: start;
}

.contact-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.contact-card {
    border-radius: 20px;
    padding: 18px 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.contact-form .btn {
    width: 100%;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 16px;
    padding: 15px 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(105, 210, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(105, 210, 255, 0.1);
}

.field-error {
    display: block;
    min-height: 20px;
    margin-top: 7px;
    color: #ff9c87;
    font-size: 0.85rem;
}

.site-footer {
    padding: 36px 0 50px;
    border-top: 1px solid var(--border);
}

.footer-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-shell p,
.social-links a {
    color: var(--muted);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    font-size: 1.3rem;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(6, 12, 23, 0.88);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1300;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .skills-grid,
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-grid,
    .about-grid,
    .contact-grid,
    .code-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .nav-shell {
        flex-wrap: wrap;
    }

    .mobile-toggle {
        display: inline-block;
    }

    .theme-toggle span {
        display: none;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 12px);
        right: 16px;
        left: 16px;
        display: none;
        flex-direction: column;
        gap: 8px;
        padding: 14px;
        border-radius: 22px;
        background: var(--surface-strong);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding-top: 136px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .footer-shell {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .section {
        padding: 88px 0;
    }

    .hero-copy h1 {
        font-size: 2.7rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .btn,
    .search-shell,
    .theme-toggle {
        width: 100%;
    }

    .hero-actions,
    .contact-cards {
        flex-direction: column;
    }
}
