/* ========================================
   DESIGN TOKENS
======================================== */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #eef4fb;
    --surface-warm: #fffdf4;

    --navy: #0b1f3a;
    --navy-soft: #27415f;
    --muted: #64748b;

    --line: #dbe5ef;
    --line-blue: rgba(37, 99, 235, 0.14);
    --line-gold: rgba(250, 204, 21, 0.28);

    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #e8f0ff;

    --gold: #facc15;
    --gold-dark: #ca8a04;
    --gold-soft: #fff8db;

    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.1);
    --shadow-premium: 0 20px 52px rgba(15, 23, 42, 0.1);

    --radius: 8px;
    --radius-lg: 18px;

    --max-width: 1180px;
    --header-offset: 110px;
}

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

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.08), transparent 26%),
        radial-gradient(circle at 84% 18%, rgba(250, 204, 21, 0.08), transparent 24%),
        var(--bg);
    color: var(--navy);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

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

img {
    height: auto;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

section[id] {
    scroll-margin-top: var(--header-offset);
}

/* ========================================
   ACCESSIBILITY
======================================== */
.skip-link {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 9999;
    transform: translateY(-150%);
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--navy);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(250, 204, 21, 0.65);
    outline-offset: 3px;
}

/* ========================================
   GLOBAL BACKGROUND
======================================== */
.global-grid-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.1) 0.5px, transparent 0.5px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0.5px, transparent 0.5px);
    background-size: 42px 42px;
}

.site-background {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: -2;
    height: 110vh;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.95));
}

.site-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: grayscale(100%) contrast(0.5);
    -webkit-mask-image: linear-gradient(to bottom, #000000 0%, #000000 70%, rgba(0, 0, 0, 0.8) 82%, rgba(0, 0, 0, 0.25) 95%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000000 0%, #000000 70%, rgba(0, 0, 0, 0.8) 82%, rgba(0, 0, 0, 0.25) 95%, transparent 100%);
}

/* ========================================
   LAYOUT UTILITIES
======================================== */
.section-shell {
    width: min(calc(100% - 40px), var(--max-width));
    margin-inline: auto;
}

/* ========================================
   HEADER / NAVIGATION
======================================== */
.site-header {
    position: fixed;
    top: 18px;
    right: 0;
    left: 0;
    z-index: 1000;
    padding-inline: 20px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-links {
    margin-left: auto;
    margin-right: 24px;
}

.navbar {
    width: min(var(--max-width), 100%);
    min-height: 68px;
    margin-inline: auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--navy);
    font-weight: 800;
    text-decoration: none;
}

.brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    object-fit: contain;
    filter:
        brightness(1.08)
        drop-shadow(0 0 10px rgba(37, 100, 235, 0.8))
        drop-shadow(0 0 16px rgba(250, 204, 21, 0.22));
}

.brand span {
    white-space: nowrap;
}

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

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding-inline: 12px;
    border-radius: 999px;
    color: var(--navy-soft);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--accent);
    background:
        linear-gradient(135deg, var(--accent-soft), rgba(255, 248, 219, 0.75));
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.2);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 17px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--navy);
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding-block: 110px 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-grid {
    position: relative;
    z-index: 2;
}

.hero::before {
    content: "";
    position: absolute;
    top: -150px;
    left: -150px;
    width: min(700px, 80vw);
    aspect-ratio: 1;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(37, 99, 235, 0.14), rgba(250, 204, 21, 0.06), transparent 70%);
    filter: blur(80px);
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -90px;
    z-index: 1;
    height: 200px;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 0) 0%,
            rgba(248, 250, 252, 0.72) 38%,
            rgba(248, 250, 252, 0.96) 68%,
            rgba(248, 250, 252, 1) 100%
        );
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
    align-items: center;
    gap: clamp(28px, 4vw, 60px);
    max-width: 1050px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    margin-bottom: 18px;
    padding: 10px 18px;
    border: 1px solid rgba(250, 204, 21, 0.34);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(232, 240, 255, 0.86), rgba(255, 248, 219, 0.88));
    box-shadow:
        0 6px 18px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.hero-badge span:last-child {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.live-dot {
    position: relative;
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--gold);
}

.live-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: rgba(250, 204, 21, 0.28);
    animation: livePulse 2s infinite;
}

.hero h1 {
    max-width: 720px;
    margin-bottom: 10px;
    color: var(--navy);
    font-size: clamp(2.55rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.hero h1 > span {
    display: block;
}

.name-line {
    white-space: nowrap;
}

.accent-name {
    color: var(--accent);
    text-shadow:
        0 0 8px rgba(37, 100, 235, 0.15),
        0 0 18px rgba(250, 204, 21, 0.1);
}

.role-line {
    margin-bottom: 22px;
    color: var(--navy-soft);
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    font-weight: 800;
}

.capability-line {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    max-width: 100%;
    margin-bottom: 24px;
    padding: 8px 12px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 219, 0.52));
    box-shadow: var(--shadow-sm);
}

.capability-line span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.typing-text {
    min-width: 190px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 900;
}

.typing-text::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 4px;
    background: var(--gold);
    vertical-align: -2px;
    animation: caret 1s steps(1) infinite;
}

.hero-description {
    max-width: 560px;
    margin-bottom: 32px;
    color: var(--navy-soft);
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.85;
}

.hero-actions,
.research-actions,
.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ========================================
   BUTTONS
======================================== */
.button,
.project-btn,
.contact-btn,
.modal-github {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding-inline: 18px;
    border: 1px solid var(--line-blue);
    border-radius: 999px;
    background: #ffffff;
    color: var(--navy);
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

.button:hover,
.project-btn:hover,
.contact-btn:hover,
.modal-github:hover {
    transform: translateY(-2px);
    border-color: rgba(250, 204, 21, 0.52);
    color: var(--accent);
    background:
        linear-gradient(135deg, #ffffff, rgba(255, 248, 219, 0.75));
    box-shadow: var(--shadow-sm);
}

.button-primary {
    border-color: var(--accent);
    background:
        linear-gradient(135deg, var(--accent), #1d4ed8);
    color: #ffffff;
}

.button-primary:hover {
    border-color: var(--gold);
    background:
        linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #ffffff;
}

/* ========================================
   PROFILE IMAGE
======================================== */
.hero-media {
    display: flex;
    justify-content: center;
    min-width: 0;
    transform: translateY(-20px);
}

.profile-shape {
    position: relative;
    width: clamp(180px, 32vw, 320px);
    aspect-ratio: 0.86;
    padding: 12px;
    border: 1px solid rgba(250, 204, 21, 0.26);
    border-radius: 38% 62% 54% 46% / 44% 38% 62% 56%;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(232, 240, 255, 0.72), rgba(255, 248, 219, 0.42));
    box-shadow:
        0 18px 42px rgba(15, 23, 42, 0.09),
        0 0 16px rgba(37, 100, 235, 0.1),
        0 0 28px rgba(250, 204, 21, 0.1);
    backdrop-filter: blur(6px);
    animation: organicFloat 15s ease-in-out infinite, photoDrift 5s ease-in-out infinite;
}

.profile-shape::before {
    content: "";
    position: absolute;
    top: -10%;
    left: -10%;
    z-index: -1;
    width: 120%;
    height: 120%;
    border-radius: inherit;
    background:
        radial-gradient(circle, rgba(37, 99, 235, 0.2), rgba(250, 204, 21, 0.1), transparent 75%);
    filter: blur(45px);
    opacity: 0.85;
}

.profile-shape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: inherit;
    filter: contrast(0.88) saturate(0.9) brightness(1.01) blur(0.18px);
    transform: translateZ(0);
    image-rendering: auto;
    animation: organicFloat 7s ease-in-out infinite;
}

/* ========================================
   SECTION SPACING
======================================== */
.about-section,
.arsenal-section,
.research-section,
.journey-section,
.projects-section,
.contact-section {
    padding-block: clamp(72px, 9vw, 120px);
}

/* ========================================
   SECTION HEADINGS
======================================== */
.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: start;
    gap: clamp(36px, 6vw, 82px);
}

.section-heading h2 {
    max-width: 720px;
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 3.45rem);
    font-weight: 900;
    line-height: 1.05;
}

.section-heading.centered {
    position: relative;
    z-index: 2;
    margin-bottom: 44px;
    text-align: center;
}

.section-heading.centered h2 {
    margin-inline: auto;
}

/* ========================================
   ABOUT SECTION
======================================== */
.about-section {
    position: relative;
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 1) 0%,
            rgba(248, 250, 252, 0.96) 18%,
            rgba(248, 250, 252, 0.78) 34%,
            rgba(248, 250, 252, 0) 58%
        );
}

.about-section::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.32), rgba(37, 99, 235, 0.18), transparent);
}

.about-text {
    display: grid;
    gap: 22px;
    color: var(--navy-soft);
    font-size: clamp(1.02rem, 1.5vw, 1.22rem);
    line-height: 1.9;
}

/* ========================================
   SKILLS SECTION
======================================== */

.arsenal-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-block: 1px solid rgba(37, 99, 235, 0.08);
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 1) 0%,
            rgba(242, 247, 253, 0.98) 48%,
            rgba(248, 250, 252, 1) 100%
        );
    box-shadow:
        inset 0 40px 80px rgba(255, 255, 255, 0.28),
        inset 0 -40px 80px rgba(255, 255, 255, 0.28);
}

.arsenal-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.58;
}

.arsenal-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 24% 38%, rgba(37, 99, 235, 0.13), transparent 34%),
        radial-gradient(circle at 68% 42%, rgba(250, 204, 21, 0.12), transparent 32%),
        linear-gradient(
            90deg,
            rgba(248, 250, 252, 0.84) 0%,
            rgba(248, 250, 252, 0.34) 46%,
            rgba(248, 250, 252, 0.72) 100%
        );
}

.arsenal-section .section-shell,
.projects-section .section-shell {
    position: relative;
    z-index: 1;
}

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

.arsenal-card {
    min-height: 120px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.96));
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.arsenal-card:hover,
.arsenal-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, 0.46);
    box-shadow: var(--shadow-md);
}

.arsenal-card i {
    color: var(--accent);
    font-size: 1.75rem;
    transition: transform 180ms ease, color 180ms ease, filter 180ms ease;
}

.arsenal-card span {
    color: var(--navy);
    font-size: 0.93rem;
    font-weight: 800;
    text-align: center;
}

.arsenal-card:hover i,
.arsenal-card:focus-visible i {
    color: var(--accent);
    transform: scale(1.1);
    filter:
        drop-shadow(0 0 8px rgba(37, 100, 235, 0.35))
        drop-shadow(0 0 10px rgba(250, 204, 21, 0.24));
}

/* ========================================
   RESEARCH SECTION
======================================== */
.research-section {
    position: relative;
}

.research-subtitle,
.projects-subtitle {
    max-width: 700px;
    margin: 16px auto 0;
    color: var(--navy-soft);
    line-height: 1.8;
}

.research-card {
    position: relative;
    max-width: 900px;
    margin: 60px auto 0;
    padding: clamp(28px, 4vw, 40px);
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.96));
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.research-card::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 350px;
    height: 350px;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(37, 99, 235, 0.13), rgba(250, 204, 21, 0.08), transparent 70%);
}

.research-card > * {
    position: relative;
    z-index: 1;
}

.research-badge {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 14px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(232, 240, 255, 0.9), rgba(255, 248, 219, 0.86));
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.research-card h3 {
    margin-bottom: 18px;
    color: var(--navy);
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.1;
}

.research-card p {
    color: var(--navy-soft);
    line-height: 1.85;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-block: 28px 32px;
}

.research-tags span {
    padding: 8px 12px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.04);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ========================================
   LEADERSHIP & EXPERIENCE
======================================== */
.journey-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 110px 0;
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 1) 0%,
            rgba(242, 247, 253, 0.98) 48%,
            rgba(248, 250, 252, 1) 100%
        );
    border-top: 1px solid rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.journey-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.075) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.7;
}

.journey-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 28%, rgba(37, 99, 235, 0.13), transparent 32%),
        radial-gradient(circle at 82% 72%, rgba(250, 204, 21, 0.13), transparent 30%),
        linear-gradient(90deg, rgba(248, 250, 252, 0.72), rgba(248, 250, 252, 0.28), rgba(248, 250, 252, 0.72));
}

.journey-section .section-shell {
    position: relative;
    z-index: 1;
}

.timeline {
    position: relative;
    width: min(100%, 980px);
    margin: 66px auto 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 50%;
    width: 3px;
    border-radius: 999px;
    background:
        linear-gradient(
            to bottom,
            transparent,
            rgba(37, 99, 235, 0.35),
            rgba(250, 204, 21, 0.55),
            rgba(37, 99, 235, 0.35),
            transparent
        );
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    display: flex;
    align-items: center;
    margin-bottom: 42px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item.left {
    justify-content: flex-end;
    padding-right: 48px;
}

.timeline-item.right {
    margin-left: 50%;
    justify-content: flex-start;
    padding-left: 48px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 18px;
    height: 18px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: var(--gold);
    box-shadow:
        0 0 0 7px rgba(250, 204, 21, 0.16),
        0 0 18px rgba(250, 204, 21, 0.55),
        0 10px 24px rgba(250, 204, 21, 0.25);
    transform: translateY(-50%);
    animation: timelineLiveDot 1.8s ease-out infinite;
}

.timeline-item.left::before {
    right: -9px;
}

.timeline-item.right::before {
    left: -9px;
}

.timeline-card {
    position: relative;
    width: min(100%, 390px);
    min-height: 210px;
    padding: 26px;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 14px 34px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translate3d(var(--reveal-x, 0), 26px, 0) scale(0.96);
    transition:
        opacity 0.78s ease,
        transform 0.78s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.22s ease,
        box-shadow 0.22s ease;
    will-change: transform, opacity;
}

.timeline-card::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 26px;
    width: 44px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.timeline-item.left .timeline-card {
    --reveal-x: -44px;
}

.timeline-item.right .timeline-card {
    --reveal-x: 44px;
}

.timeline-card.show {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: auto;
}

.timeline-item:nth-child(2) .timeline-card {
    transition-delay: 90ms;
}

.timeline-item:nth-child(3) .timeline-card {
    transition-delay: 150ms;
}

.timeline-item:nth-child(4) .timeline-card {
    transition-delay: 210ms;
}

.timeline-item.left .timeline-card::before,
.timeline-item.right .timeline-card::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 48px;
    height: 2px;
    background: rgba(37, 99, 235, 0.24);
    transform: translateY(-50%);
}

.timeline-item.left .timeline-card::before {
    right: -48px;
}

.timeline-item.right .timeline-card::before {
    left: -48px;
}

.timeline-card.show:hover {
    transform: translateY(-6px);
    border-color: rgba(250, 204, 21, 0.48);
    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.timeline-card h3 {
    margin: 14px 0 14px;
    color: var(--navy);
    font-size: clamp(1.45rem, 1.8vw, 1.85rem);
    line-height: 1.25;
}

.timeline-tag {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(232, 240, 255, 0.9), rgba(255, 248, 219, 0.86));
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.timeline-card p {
    color: var(--navy-soft);
    font-size: 0.98rem;
    line-height: 1.78;
}

/* ========================================
   PROJECTS SECTION
======================================== */
.projects-section {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.95));
}

.projects-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.06), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(250, 204, 21, 0.08), transparent 35%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
}

.project-card {
    height: 100%;
    min-width: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.96));
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}

.project-card:hover h3,
.project-card:focus-visible h3 {
    color: var(--accent);
}

.project-card h3 {
    margin-bottom: 2px;
    color: var(--navy);
    font-size: clamp(1.45rem, 2.4vw, 2.25rem);
    font-weight: 900;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.project-card p {
    color: var(--navy-soft);
    line-height: 1.75;
}

.projects-footer {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.project-status {
    width: max-content;
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.implemented,
.completed {
    background: var(--accent-soft);
    color: var(--accent);
}

.research {
    background: #eef2ff;
    color: #4f46e5;
}

.finalist {
    background: #fff7ed;
    color: #ea580c;
}

.building {
    background: #ecfdf5;
    color: #059669;
}

.upcoming {
    background: #f3f4f6;
    color: #475569;
}

.project-index {
    color: rgba(37, 100, 235, 0.9);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
}

.project-kicker,
.modal-number {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-layers,
.tech-stack,
.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-stack {
    margin-top: auto;
    gap: 8px;
}

.tech-stack span,
.modal-tech-stack span {
    padding: 6px 10px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.04);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
}

.tech-stack span {
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.tech-stack span:hover {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold-dark);
}

/* ========================================
   MODAL SYSTEM
======================================== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(11, 31, 58, 0.58);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(10px);
    transition: opacity 180ms ease, visibility 180ms ease;
}

.project-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.project-modal[hidden] {
    display: none;
}

.modal-box {
    position: relative;
    width: min(1120px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.26);
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--navy);
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.close-modal:hover {
    border-color: var(--gold);
    background: var(--accent);
    color: #ffffff;
}

.modal-header {
    margin-bottom: 28px;
    padding-right: 48px;
}

.modal-header h2 {
    margin-bottom: 18px;
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 900;
    line-height: 1.06;
    overflow-wrap: anywhere;
}

.modal-description {
    display: grid;
    gap: 14px;
    max-width: 900px;
    color: var(--navy-soft);
    line-height: 1.85;
}

.modal-description h3,
.detail-block h3 {
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 900;
}

.project-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-block: 30px;
}

.detail-block {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: var(--radius);
    background: #fbfdff;
}

.detail-block ul {
    margin-top: 14px;
    list-style: none;
}

.detail-block li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 20px;
    color: var(--navy-soft);
}

.detail-block li:last-child {
    margin-bottom: 0;
}

.detail-block li::before {
    content: "";
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
}

.modal-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-block: 28px;
}

.modal-images a {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.modal-images img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 220ms ease;
}

.modal-images a:hover img {
    transform: scale(1.035);
}

.modal-github {
    border-radius: var(--radius);
}

/* ========================================
   CONTACT SECTION
======================================== */
.contact-section {
    position: relative;
}

.contact-panel {
    padding: clamp(32px, 6vw, 58px);
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.96));
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.contact-panel h2 {
    margin-bottom: 14px;
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
}

.contact-panel p {
    max-width: 620px;
    margin: 0 auto 28px;
    color: var(--navy-soft);
    font-size: 1.05rem;
}

.contact-buttons {
    justify-content: center;
}

.contact-btn i {
    color: var(--accent);
}

/* ========================================
   FOOTER
======================================== */
.footer {
    margin-top: 0;
    padding: 32px 20px 42px;
    border-top: 1px solid rgba(37, 99, 235, 0.12);
    background:
        linear-gradient(180deg, #eef4fb, #f8fafc);
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes caret {
    50% {
        opacity: 0;
    }
}

@keyframes organicFloat {
    0% {
        border-radius: 38% 62% 54% 46% / 44% 38% 62% 56%;
    }

    25% {
        border-radius: 42% 58% 50% 50% / 48% 42% 58% 52%;
    }

    50% {
        border-radius: 35% 65% 58% 42% / 40% 36% 64% 60%;
    }

    75% {
        border-radius: 40% 60% 48% 52% / 46% 40% 60% 54%;
    }

    100% {
        border-radius: 38% 62% 54% 46% / 44% 38% 62% 56%;
    }
}

@keyframes photoDrift {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes livePulse {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }

    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

@keyframes timelineLiveDot {
    0% {
        box-shadow:
            0 0 0 0 rgba(250, 204, 21, 0.42),
            0 0 18px rgba(250, 204, 21, 0.55),
            0 10px 24px rgba(250, 204, 21, 0.25);
    }

    70% {
        box-shadow:
            0 0 0 15px rgba(250, 204, 21, 0),
            0 0 24px rgba(250, 204, 21, 0.65),
            0 10px 24px rgba(250, 204, 21, 0.25);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(250, 204, 21, 0),
            0 0 18px rgba(250, 204, 21, 0.55),
            0 10px 24px rgba(250, 204, 21, 0.25);
    }
}

@keyframes timelineLiveDotMobile {
    0% {
        box-shadow:
            0 0 0 0 rgba(250, 204, 21, 0.4),
            0 0 14px rgba(250, 204, 21, 0.5);
    }

    70% {
        box-shadow:
            0 0 0 11px rgba(250, 204, 21, 0),
            0 0 20px rgba(250, 204, 21, 0.62);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(250, 204, 21, 0),
            0 0 14px rgba(250, 204, 21, 0.5);
    }
}

/* ========================================
   RESPONSIVE: LARGE TABLET / SMALL LAPTOP
======================================== */
@media (max-width: 1100px) {
    .arsenal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

/* ========================================
   RESPONSIVE: TABLET
======================================== */
@media (max-width: 980px) {
    .hero {
        min-height: auto;
        padding-block: 118px 76px;
    }

    .hero-grid,
    .split-section {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        order: 2;
        align-items: flex-start;
    }

    .hero-media {
        order: 1;
        transform: none;
    }

    .profile-shape {
        width: min(310px, 72vw);
    }

    .project-details,
    .modal-images {
        grid-template-columns: 1fr;
    }

    .modal-images img {
        height: auto;
        max-height: 360px;
        object-fit: contain;
    }
}

/* ========================================
   RESPONSIVE: MOBILE
======================================== */
@media (max-width: 720px) {
    :root {
        --header-offset: 92px;
    }

    .section-shell {
        width: min(calc(100% - 28px), var(--max-width));
    }

    .site-header {
        top: 10px;
        padding-inline: 12px;
    }

    .navbar {
        min-height: 62px;
        align-items: center;
        flex-wrap: wrap;
        border-radius: 24px;
    }

    .brand img {
        width: 34px;
        height: 34px;
    }

    .theme-toggle {
        order: 2;
        margin-left: auto;
        margin-right: 4px;
    }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .nav-toggle{
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        padding-block: 10px 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

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

    .hero {
        min-height: 100svh;
        padding-block: 112px 64px;
        align-items: center;
        overflow: hidden;
    }

    .hero::before {
        width: 520px;
        height: 520px;
        top: -120px;
        left: -180px;
        filter: blur(72px);
        opacity: 1;
    }

    .site-background {
        height: 115svh;
    }

    .site-background img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        opacity: 0.15;
    }

    .hero h1 {
        font-size: clamp(2.35rem, 13vw, 4rem);
        line-height: 1.02;
    }

    .name-line {
        white-space: normal;
    }

    .hero-badge {
        padding-inline: 14px;
    }

    .capability-line {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        border-radius: var(--radius);
    }

    .typing-text {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .hero-actions .button {
        width: 100%;
        min-width: 0;
        padding-inline: 12px;
        text-align: center;
        white-space: nowrap;
    }

    .hero-actions .button span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .research-actions,
    .contact-buttons {
        width: 100%;
    }

    .research-actions .button,
    .contact-btn,
    .project-btn {
        width: 100%;
    }

    .arsenal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .arsenal-card {
        min-height: 108px;
        padding: 14px 10px;
    }

    .arsenal-card i {
        font-size: 1.55rem;
    }

    .arsenal-card span {
        font-size: 0.86rem;
        line-height: 1.25;
    }

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

    .journey-section {
        padding: 72px 0;
    }

    .timeline {
        width: 100%;
        margin-top: 50px;
        padding-left: 34px;
    }

    .timeline::before {
        top: 8px;
        bottom: 8px;
        left: 10px;
        width: 2px;
    }

    .timeline-item,
    .timeline-item.left,
    .timeline-item.right {
        width: 100%;
        margin-left: 0;
        margin-bottom: 32px;
        padding: 0;
        justify-content: flex-start;
    }

    .timeline-item::before {
        top: 30px;
        left: 10px !important;
        right: auto !important;
        width: 14px;
        height: 14px;
        border-width: 3px;
        transform: translate(-50%, 0);
        animation: timelineLiveDotMobile 1.8s ease-out infinite;
    }

    .timeline-card,
    .timeline-item.left .timeline-card,
    .timeline-item.right .timeline-card {
        width: 100%;
        min-height: auto;
        padding: 24px 20px;
        border-radius: 16px;
        transform: translate3d(0, 22px, 0) scale(0.97);
        --reveal-x: 0;
    }

    .timeline-card.show {
        transform: translate3d(0, 0, 0) scale(1);
    }

    .timeline-item.left .timeline-card::before,
    .timeline-item.right .timeline-card::before {
        top: 36px;
        left: -24px;
        right: auto;
        width: 24px;
    }

    .timeline-card.show:hover {
        transform: none;
    }

    .timeline-card h3 {
        font-size: 1.35rem;
    }

    .timeline-tag {
        font-size: 0.76rem;
    }

    .timeline-card p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .project-card {
        padding: 24px 18px;
    }

    .project-modal {
        padding: 12px;
    }

    .modal-box {
        max-height: 90vh;
        padding: 24px 18px;
        border-radius: 14px;
    }

    .modal-header {
        padding-right: 42px;
    }
}

/* ========================================
   RESPONSIVE: SMALL MOBILE
======================================== */
@media (max-width: 420px) {
    .section-shell {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .hero::before {
        width: 460px;
        height: 460px;
        top: -110px;
        left: -210px;
        filter: blur(70px);
    }

    .site-background {
        height: 120svh;
    }

    .site-background img {
        opacity: 0.15;
    }

    .hero h1 {
        font-size: 2.45rem;
    }

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

    .hero-actions .button {
        min-height: 44px;
        padding-inline: 8px;
        font-size: 0.84rem;
        gap: 6px;
    }

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

    .hero-description,
    .about-text {
        line-height: 1.75;
    }

    .contact-panel,
    .research-card,
    .timeline-card,
    .project-card {
        border-radius: 14px;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATION
======================================== */
@media (hover: none) {
    .project-card:hover,
    .arsenal-card:hover,
    .timeline-card:hover,
    .button:hover,
    .project-btn:hover,
    .contact-btn:hover,
    .modal-github:hover {
        transform: none;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .typing-text::after {
        display: none;
    }
}  

/* ========================================
   THEME TOGGLE
======================================== */
.theme-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.theme-toggle-track {
    position: relative;
    width: 56px;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 3px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.96),
            rgba(232,240,255,0.9)
        );
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.9),
        0 4px 12px rgba(15,23,42,0.08);
}

.theme-toggle-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--accent);
    transform: translateX(0);
    box-shadow:
        0 2px 8px rgba(15,23,42,0.12);
    transition:
        transform 260ms ease,
        background 260ms ease,
        color 260ms ease,
        box-shadow 260ms ease;
}

.theme-toggle-thumb i {
    font-size: 0.78rem;
}

/* ========================================
   DARK THEME SYSTEM
======================================== */
:root {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #07111f;
    --surface: #0d1b2f;
    --surface-soft: #12233a;
    --surface-warm: #171a12;

    --navy: #eaf2ff;
    --navy-soft: #b9c8dc;
    --muted: #8fa3bd;

    --line: rgba(148, 163, 184, 0.24);
    --line-blue: rgba(96, 165, 250, 0.24);
    --line-gold: rgba(250, 204, 21, 0.28);

    --accent: #60a5fa;
    --accent-dark: #3b82f6;
    --accent-soft: rgba(96, 165, 250, 0.14);

    --gold: #facc15;
    --gold-dark: #fde047;
    --gold-soft: rgba(250, 204, 21, 0.12);

    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.26);
    --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.34);
    --shadow-premium: 0 22px 58px rgba(0, 0, 0, 0.38);
}

/* ========================================
   SMOOTH THEME TRANSITION
======================================== */
body,
.navbar,
.hero,
.hero::after,
.hero-badge,
.capability-line,
.profile-shape,
.about-section,
.arsenal-section,
.research-section,
.research-card,
.journey-section,
.projects-section,
.project-card,
.timeline-card,
.contact-section,
.contact-panel,
.footer,
.modal-box,
.detail-block,
.button,
.contact-btn,
.modal-github,
.nav-links a,
.arsenal-card,
.tech-stack span,
.modal-tech-stack span,
.research-tags span,
.timeline-tag,
.research-badge,
.theme-toggle-track,
.theme-toggle-thumb {
    transition:
        background-color 260ms ease,
        background 260ms ease,
        color 260ms ease,
        border-color 260ms ease,
        box-shadow 260ms ease,
        filter 260ms ease,
        opacity 260ms ease;
}

html.theme-changing body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: var(--bg);
    opacity: 0;
    animation: themeFade 420ms ease;
}

@keyframes themeFade {
    0% {
        opacity: 0;
    }

    35% {
        opacity: 0.16;
    }

    100% {
        opacity: 0;
    }
}

/* ========================================
   DARK GLOBAL BACKGROUND
======================================== */
html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 18% 8%, rgba(96, 165, 250, 0.14), transparent 26%),
        radial-gradient(circle at 84% 18%, rgba(250, 204, 21, 0.1), transparent 24%),
        var(--bg);
}

html[data-theme="dark"] .global-grid-bg {
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.08) 0.5px, transparent 0.5px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.08) 0.5px, transparent 0.5px);
}

html[data-theme="dark"] .site-background {
    background:
        linear-gradient(
            to bottom,
            rgba(7, 17, 31, 0.96),
            rgba(7, 17, 31, 0.9)
        );
}

html[data-theme="dark"] .site-background img {
    opacity: 0.1;
    filter: grayscale(100%) contrast(0.82) invert(1);
}

/* ========================================
   DARK NAVBAR
======================================== */
html[data-theme="dark"] .navbar {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(10, 24, 42, 0.76);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .brand {
    color: var(--navy);
}

html[data-theme="dark"] .brand img {
    filter:
        brightness(1.12)
        drop-shadow(0 0 10px rgba(96, 165, 250, 0.75))
        drop-shadow(0 0 16px rgba(250, 204, 21, 0.22));
}

html[data-theme="dark"] .nav-links a {
    color: var(--navy-soft);
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a.is-active {
    color: var(--accent);
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(250, 204, 21, 0.1));
}

/* ========================================
   DARK TOGGLE
======================================== */
html[data-theme="dark"] .theme-toggle-track {
    border-color: rgba(96, 165, 250, 0.26);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(11, 31, 58, 0.96));
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.12),
        inset 0 -1px 2px rgba(0, 0, 0, 0.28),
        0 8px 20px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(26px);
    background: #f8fafc;
    color: var(--gold);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.32),
        0 0 14px rgba(250, 204, 21, 0.22);
}

html[data-theme="dark"] .nav-toggle {
    border-color: rgba(96, 165, 250, 0.22);
    background:
        linear-gradient(135deg, rgba(13, 27, 47, 0.96), rgba(250, 204, 21, 0.1));
}

html[data-theme="dark"] .nav-toggle span {
    background: var(--navy);
}

/* ========================================
   DARK HERO
======================================== */
html[data-theme="dark"] .hero::before {
    background:
        radial-gradient(circle, rgba(96, 165, 250, 0.18), rgba(250, 204, 21, 0.08), transparent 70%);
}

html[data-theme="dark"] .hero::after {
    background:
        linear-gradient(
            180deg,
            rgba(7, 17, 31, 0) 0%,
            rgba(7, 17, 31, 0.72) 38%,
            rgba(7, 17, 31, 0.96) 68%,
            rgba(7, 17, 31, 1) 100%
        );
}

html[data-theme="dark"] .hero-badge,
html[data-theme="dark"] .capability-line {
    border-color: rgba(250, 204, 21, 0.2);
    background:
        linear-gradient(135deg, rgba(13, 27, 47, 0.92), rgba(250, 204, 21, 0.1));
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .hero-badge span:last-child,
html[data-theme="dark"] .typing-text,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .accent-name {
    color: var(--accent);
}

html[data-theme="dark"] .live-dot {
    background: var(--gold);
}

html[data-theme="dark"] .live-dot::after {
    background: rgba(250, 204, 21, 0.28);
}

html[data-theme="dark"] .profile-shape {
    border-color: rgba(250, 204, 21, 0.26);
    background:
        linear-gradient(145deg, rgba(13, 27, 47, 0.96), rgba(24, 41, 68, 0.88), rgba(250, 204, 21, 0.1));
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.34),
        0 0 18px rgba(96, 165, 250, 0.12),
        0 0 28px rgba(250, 204, 21, 0.1);
}

html[data-theme="dark"] .profile-shape::before {
    background:
        radial-gradient(circle, rgba(96, 165, 250, 0.2), rgba(250, 204, 21, 0.1), transparent 75%);
}

/* ========================================
   DARK BUTTONS
======================================== */
html[data-theme="dark"] .button,
html[data-theme="dark"] .contact-btn,
html[data-theme="dark"] .modal-github {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(13, 27, 47, 0.96);
    color: var(--navy);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .contact-btn:hover,
html[data-theme="dark"] .modal-github:hover {
    border-color: rgba(250, 204, 21, 0.48);
    background:
        linear-gradient(135deg, rgba(13, 27, 47, 0.98), rgba(250, 204, 21, 0.1));
    color: var(--accent);
}

html[data-theme="dark"] .button-primary {
    border-color: rgba(96, 165, 250, 0.8);
    background:
        linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
}

html[data-theme="dark"] .button-primary:hover {
    border-color: rgba(250, 204, 21, 0.6);
    color: #ffffff;
}

/* ========================================
   DARK ABOUT
======================================== */
html[data-theme="dark"] .about-section {
    background:
        linear-gradient(
            180deg,
            rgba(7, 17, 31, 1) 0%,
            rgba(7, 17, 31, 0.96) 18%,
            rgba(7, 17, 31, 0.78) 34%,
            rgba(7, 17, 31, 0) 58%
        );
}

html[data-theme="dark"] .about-section::before {
    background:
        linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.2), rgba(96, 165, 250, 0.16), transparent);
}

/* ========================================
   DARK SKILLS SECTION
======================================== */
html[data-theme="dark"] .arsenal-section {
    background:
        linear-gradient(
            180deg,
            rgba(7, 17, 31, 1) 0%,
            rgba(10, 24, 42, 0.98) 48%,
            rgba(7, 17, 31, 1) 100%
        );
    border-color: rgba(96, 165, 250, 0.12);
}

html[data-theme="dark"] .arsenal-section::before {
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
}

html[data-theme="dark"] .arsenal-section::after {
    background:
        radial-gradient(circle at 24% 38%, rgba(96, 165, 250, 0.15), transparent 34%),
        radial-gradient(circle at 68% 42%, rgba(250, 204, 21, 0.12), transparent 32%),
        linear-gradient(
            90deg,
            rgba(7, 17, 31, 0.86) 0%,
            rgba(7, 17, 31, 0.3) 46%,
            rgba(7, 17, 31, 0.76) 100%
        );
}

html[data-theme="dark"] .arsenal-card {
    border-color: rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.96));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .arsenal-card:hover,
html[data-theme="dark"] .arsenal-card:focus-visible {
    border-color: rgba(250, 204, 21, 0.46);
}

html[data-theme="dark"] .arsenal-card i {
    color: var(--accent);
}

/* ========================================
   DARK RESEARCH
======================================== */
html[data-theme="dark"] .research-card {
    border-color: rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.96));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .research-card::before {
    background:
        radial-gradient(circle, rgba(96, 165, 250, 0.14), rgba(250, 204, 21, 0.08), transparent 70%);
}

html[data-theme="dark"] .research-badge,
html[data-theme="dark"] .timeline-tag {
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(250, 204, 21, 0.1));
    color: var(--accent);
}

html[data-theme="dark"] .research-tags span {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(96, 165, 250, 0.08);
    color: var(--navy-soft);
}

/* ========================================
   DARK TIMELINE
======================================== */
html[data-theme="dark"] .journey-section {
    background:
        linear-gradient(
            180deg,
            rgba(7, 17, 31, 1) 0%,
            rgba(10, 24, 42, 0.98) 48%,
            rgba(7, 17, 31, 1) 100%
        );
    border-color: rgba(96, 165, 250, 0.12);
}

html[data-theme="dark"] .journey-section::before {
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
}

html[data-theme="dark"] .journey-section::after {
    background:
        radial-gradient(circle at 18% 28%, rgba(96, 165, 250, 0.15), transparent 32%),
        radial-gradient(circle at 82% 72%, rgba(250, 204, 21, 0.12), transparent 30%),
        linear-gradient(90deg, rgba(7, 17, 31, 0.86), rgba(7, 17, 31, 0.3), rgba(7, 17, 31, 0.76));
}

html[data-theme="dark"] .timeline-card {
    border-color: rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.96));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .timeline-card.show:hover {
    border-color: rgba(250, 204, 21, 0.48);
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ========================================
   DARK PROJECTS
======================================== */
html[data-theme="dark"] .projects-section {
    background:
        linear-gradient(180deg, rgba(7, 17, 31, 1), rgba(10, 24, 42, 0.96));
}

html[data-theme="dark"] .projects-section::before {
    background:
        radial-gradient(circle at 15% 20%, rgba(96, 165, 250, 0.08), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(250, 204, 21, 0.08), transparent 35%);
}

html[data-theme="dark"] .project-card {
    border-color: rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.96));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .project-card:hover,
html[data-theme="dark"] .project-card:focus-visible {
    border-color: rgba(250, 204, 21, 0.5);
}

html[data-theme="dark"] .implemented,
html[data-theme="dark"] .completed {
    background: rgba(96, 165, 250, 0.14);
    color: var(--accent);
}

html[data-theme="dark"] .research {
    background: rgba(99, 102, 241, 0.16);
    color: #a5b4fc;
}

html[data-theme="dark"] .finalist {
    background: rgba(234, 88, 12, 0.14);
    color: #fdba74;
}

html[data-theme="dark"] .building {
    background: rgba(5, 150, 105, 0.14);
    color: #6ee7b7;
}

html[data-theme="dark"] .upcoming {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

html[data-theme="dark"] .tech-stack span,
html[data-theme="dark"] .modal-tech-stack span {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(96, 165, 250, 0.08);
    color: var(--navy-soft);
}

html[data-theme="dark"] .tech-stack span:hover {
    border-color: var(--gold);
    background: rgba(250, 204, 21, 0.12);
    color: var(--gold-dark);
}

/* ========================================
   DARK MODALS
======================================== */
html[data-theme="dark"] .project-modal {
    background: rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .modal-box {
    border-color: rgba(96, 165, 250, 0.18);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.98));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

html[data-theme="dark"] .close-modal {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(13, 27, 47, 0.96);
    color: var(--navy);
}

html[data-theme="dark"] .close-modal:hover {
    border-color: var(--gold);
    background: var(--accent-dark);
    color: #ffffff;
}

html[data-theme="dark"] .detail-block {
    border-color: rgba(96, 165, 250, 0.16);
    background: rgba(10, 24, 42, 0.72);
}

html[data-theme="dark"] .detail-block li::before {
    background: var(--gold);
}

html[data-theme="dark"] .modal-images a {
    border-color: rgba(96, 165, 250, 0.16);
    background: rgba(15, 23, 42, 0.8);
}

/* ========================================
   DARK CONTACT
======================================== */
html[data-theme="dark"] .contact-panel {
    border-color: rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(13, 27, 47, 0.98), rgba(10, 24, 42, 0.96));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .contact-btn i {
    color: var(--accent);
}

/* ========================================
   DARK FOOTER
======================================== */
html[data-theme="dark"] .footer {
    border-color: rgba(96, 165, 250, 0.14);
    background:
        linear-gradient(180deg, #0a182a, #07111f);
    color: var(--muted);
}

/* ========================================
   DARK MOBILE NAV
======================================== */
@media (max-width: 720px) {
    html[data-theme="dark"] .nav-links {
        border-top: 1px solid rgba(96, 165, 250, 0.14);
    }

    html[data-theme="dark"] .site-background {
        height: 115svh;
    }

    html[data-theme="dark"] .site-background img {
        opacity: 0.1;
    }
}