:root {
    --bg: #f7f3ee;
    --bg-alt: #f0ebe4;
    --bg-gradient-start: #fffaf4;
    --bg-gradient-mid: #f7f3ee;
    --bg-gradient-end: #efe7df;
    --ink: #10131a;
    --muted: #5d6673;
    --primary: #1f3b5b;
    --accent: #f26430;
    --surface: #ffffff;
    --surface-strong: #fef8f1;
    --border: rgba(16, 19, 26, 0.12);
    --header-bg: rgba(247, 243, 238, 0.86);
    --header-border: rgba(16, 19, 26, 0.08);
    --shadow: 0 24px 60px rgba(17, 25, 40, 0.12);
    --card-shadow: 0 16px 30px rgba(16, 19, 26, 0.08);
    --focus-ring: rgba(31, 59, 91, 0.16);
    --radius: 20px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --container: 1120px;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --bg: #0d1320;
    --bg-alt: #141d2e;
    --bg-gradient-start: #111c2f;
    --bg-gradient-mid: #0d1320;
    --bg-gradient-end: #0b111c;
    --ink: #e9eef8;
    --muted: #b6c2d5;
    --primary: #7eb6ff;
    --accent: #ff9e80;
    --surface: #182235;
    --surface-strong: #202c41;
    --border: rgba(182, 194, 213, 0.24);
    --header-bg: rgba(13, 19, 32, 0.9);
    --header-border: rgba(182, 194, 213, 0.18);
    --shadow: 0 30px 65px rgba(0, 0, 0, 0.45);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    --focus-ring: rgba(126, 182, 255, 0.28);
}

[data-theme="dark"] .bg-orb {
    opacity: 0.3;
}

[data-theme="dark"] .orb-1 {
    background: radial-gradient(circle, rgba(88, 166, 255, 0.2), transparent 70%);
}

[data-theme="dark"] .orb-2 {
    background: radial-gradient(circle, rgba(255, 123, 114, 0.15), transparent 70%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left,
            var(--bg-gradient-start) 0%,
            var(--bg-gradient-mid) 45%,
            var(--bg-gradient-end) 100%);
    min-height: 100vh;
    line-height: 1.6;
}

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

a {
    color: inherit;
    text-decoration: none;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 20px;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 20px;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(0px);
    opacity: 0.55;
    z-index: -1;
}

.orb-1 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(242, 100, 48, 0.25), transparent 70%);
    top: -120px;
    right: -80px;
}

.orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(31, 59, 91, 0.22), transparent 70%);
    bottom: -160px;
    left: -80px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.nav {
    max-width: var(--container);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 14px;
    letter-spacing: 1px;
}

.brand-text {
    font-size: 18px;
}

.nav-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a:focus-visible {
    outline: none;
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

[dir="rtl"] .nav-menu {
    text-align: right;
}

.language-select {
    min-width: 120px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
}

.language-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.nav-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    margin: 5px 0;
    border-radius: 999px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.section {
    max-width: var(--container);
    margin: 0 auto;
    padding: 90px 24px;
}

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

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 12px;
}

.hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.6rem, 3.2vw, 3.6rem);
    line-height: 1.05;
    margin: 0 0 18px;
}

.lead {
    font-size: 18px;
    color: var(--muted);
    margin: 0 0 24px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 16px 30px rgba(31, 59, 91, 0.2);
}

.btn.ghost {
    border-color: var(--border);
    color: var(--primary);
    background: var(--surface);
}

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

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.social-icons {
    display: flex;
    gap: 16px;
    font-size: 20px;
    margin-bottom: 24px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface);
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    color: var(--primary);
    transition: background 0.2s ease, color 0.2s ease;
}

.social-icons a:hover {
    background: var(--primary);
    color: #fff;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px 18px;
    margin: 0;
}

.stats div {
    background: var(--surface);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.stats dt {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stats dd {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.hero-media {
    display: grid;
    gap: 20px;
}

.hero-card {
    background: var(--surface-strong);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(242, 100, 48, 0.2);
    box-shadow: var(--shadow);
}

.hero-card h3 {
    margin: 8px 0 8px;
    font-size: 20px;
}

.hero-card p {
    margin: 0;
    color: var(--muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border);
}

.hero-creative {
    position: relative;
    background: linear-gradient(145deg, var(--surface), var(--surface-strong));
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    isolation: isolate;
}

.hero-creative::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 14%, rgba(242, 100, 48, 0.16), transparent 44%),
        radial-gradient(circle at 86% 84%, rgba(31, 59, 91, 0.16), transparent 52%);
    z-index: -2;
}

.hero-creative::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: repeating-linear-gradient(90deg,
            transparent 0 26px,
            rgba(31, 59, 91, 0.05) 26px 27px);
    opacity: 0.7;
    z-index: -1;
}

.creative-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 14px;
}

.creative-panel {
    border-radius: 18px;
    border: 1px solid rgba(148, 177, 214, 0.38);
    box-shadow: 0 16px 32px rgba(5, 10, 20, 0.28);
}

.creative-editor {
    background: rgba(6, 16, 34, 0.94);
    color: #e6efff;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.creative-topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(230, 239, 255, 0.7);
}

.creative-topbar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(230, 239, 255, 0.42);
}

.creative-topbar p {
    margin: 0 0 0 auto;
}

.creative-code {
    display: grid;
    gap: 8px;
}

.code-line {
    display: block;
    height: 7px;
    border-radius: 999px;
}

.code-line-1 {
    width: 74%;
    background: linear-gradient(90deg, #58a6ff, #93c5ff);
}

.code-line-2 {
    width: 57%;
    background: linear-gradient(90deg, #f26430, #f9b295);
}

.code-line-3 {
    width: 80%;
    background: linear-gradient(90deg, #7bc3ff, #4f7cab);
}

.code-line-4 {
    width: 64%;
    background: linear-gradient(90deg, #7ce0c7, #1f7a70);
}

.code-line-5 {
    width: 43%;
    background: linear-gradient(90deg, #c4d8f2, #8bb0d8);
}

.creative-terminal {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(4, 10, 22, 0.78);
    border: 1px solid rgba(126, 182, 255, 0.24);
    color: #dce9ff;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.creative-terminal .prompt {
    color: #ffb089;
    margin-right: 8px;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    margin-left: 6px;
    border-radius: 2px;
    background: #7bc3ff;
    vertical-align: -2px;
    animation: creative-cursor-blink 0.9s steps(1) infinite;
}

.creative-status {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    padding: 16px;
}

.creative-label {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.creative-metric {
    margin: 0 0 12px;
    font-family: 'Fraunces', serif;
    font-size: 24px;
    line-height: 1.18;
}

.creative-progress {
    background: var(--bg-alt);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.creative-progress span {
    display: block;
    height: 100%;
    width: 68%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #ffbd9e, var(--primary));
    animation: creative-progress-loop 3.3s ease-in-out infinite;
}

.creative-badges {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.creative-badges li {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(31, 59, 91, 0.08);
    border: 1px solid rgba(31, 59, 91, 0.14);
}

.creative-tag {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    box-shadow: var(--card-shadow);
    pointer-events: none;
    animation: creative-float 5.8s ease-in-out infinite;
}

.creative-tag-1 {
    top: 12px;
    right: 16px;
    animation-delay: 0s;
}

.creative-tag-2 {
    bottom: 16px;
    left: 18px;
    animation-delay: 1.3s;
}

.creative-tag-3 {
    top: 58%;
    right: 22px;
    animation-delay: 2.6s;
}

@keyframes creative-cursor-blink {
    0%,
    52% {
        opacity: 1;
    }

    53%,
    100% {
        opacity: 0;
    }
}

@keyframes creative-progress-loop {
    0%,
    100% {
        width: 58%;
    }

    50% {
        width: 94%;
    }
}

@keyframes creative-float {
    0%,
    100% {
        transform: translateY(0);
    }

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

.section-head {
    margin-bottom: 32px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-family: 'Fraunces', serif;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    color: var(--muted);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.skill-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.skill-card h3 {
    margin: 0 0 8px;
}

.skill-card p {
    margin: 0;
    color: var(--muted);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--surface);
    border-radius: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    display: grid;
    gap: 12px;
    box-shadow: var(--card-shadow);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

.project-card h3 {
    margin: 0;
    font-size: 20px;
}

.project-card p {
    margin: 0;
    color: var(--muted);
}

.text-link {
    font-weight: 600;
    color: var(--primary);
}

.contact-card {
    background: var(--primary);
    color: #fff;
    padding: 32px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-card p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.8);
}

.contact-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-card .btn.ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .contact-card {
    background: linear-gradient(130deg, #29426d 0%, #1e3255 100%);
    border: 1px solid rgba(182, 194, 213, 0.3);
}

[data-theme="dark"] .contact-card p {
    color: rgba(233, 238, 248, 0.86);
}

[data-theme="dark"] .contact-card .btn.ghost {
    border-color: rgba(233, 238, 248, 0.48);
    background: rgba(255, 255, 255, 0.03);
}

.site-footer {
    padding: 30px 24px 50px;
    text-align: center;
    color: var(--muted);
}

[data-theme="dark"] .site-footer {
    color: #c4d0e3;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
    font-weight: 500;
}

.page-hero {
    padding-bottom: 40px;
}

.page-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.4rem, 3.4vw, 3.4rem);
    margin: 0 0 16px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.content-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.content-card h2 {
    margin: 0 0 12px;
}

.clean-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    color: var(--muted);
}

.clean-list li {
    padding-left: 16px;
    position: relative;
}

.clean-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.content-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.resume-card {
    background: var(--surface);
    color: var(--ink);
}

.resume-card p {
    color: var(--muted);
}

[data-theme="dark"] .chip {
    background: rgba(126, 182, 255, 0.14);
    color: #dce9ff;
    border-color: rgba(126, 182, 255, 0.32);
}

[data-theme="dark"] .hero-creative {
    background: linear-gradient(145deg, rgba(24, 34, 53, 0.95), rgba(31, 45, 67, 0.95));
    border-color: rgba(182, 194, 213, 0.3);
}

[data-theme="dark"] .hero-creative::after {
    background: repeating-linear-gradient(90deg,
            transparent 0 26px,
            rgba(126, 182, 255, 0.08) 26px 27px);
    opacity: 0.45;
}

[data-theme="dark"] .creative-status {
    background: rgba(15, 25, 41, 0.94);
    border-color: rgba(182, 194, 213, 0.3);
    color: #e9eef8;
}

[data-theme="dark"] .creative-progress {
    background: rgba(182, 194, 213, 0.16);
}

[data-theme="dark"] .creative-badges li {
    color: #dce9ff;
    background: rgba(126, 182, 255, 0.16);
    border-color: rgba(126, 182, 255, 0.34);
}

[data-theme="dark"] .creative-tag {
    background: rgba(16, 30, 50, 0.92);
    border-color: rgba(126, 182, 255, 0.34);
    color: #dce9ff;
}

[data-theme="dark"] .social-icons a,
[data-theme="dark"] .stats div,
[data-theme="dark"] .content-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .skill-card {
    border-color: rgba(182, 194, 213, 0.26);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
    background: #111a2a;
}

[data-theme="dark"] .filter-btn,
[data-theme="dark"] .copy-btn {
    color: #d5deec;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }

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

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

    .creative-tag-3 {
        top: auto;
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 820px) {
    .nav {
        padding: 14px 16px;
        gap: 10px;
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        order: 2;
    }

    .nav-menu {
        position: absolute;
        top: 58px;
        right: 0;
        background: var(--surface);
        border-radius: 16px;
        border: 1px solid var(--border);
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
        display: none;
        box-shadow: var(--shadow);
        min-width: 220px;
        max-width: calc(100vw - 32px);
    }

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

    [dir="rtl"] .nav-menu {
        right: auto;
        left: 24px;
    }

    .nav-right {
        gap: 10px;
        margin-left: auto;
    }

    .brand-text {
        font-size: 16px;
        max-width: 165px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .language-select {
        min-width: 110px;
        padding: 7px 10px;
        font-size: 13px;
        order: 1;
    }
}

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

    .hero h1 {
        font-size: clamp(2rem, 8.2vw, 2.45rem);
        line-height: 1.14;
    }

    .lead {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .hero-creative {
        padding: 16px;
    }

    .creative-panel {
        padding: 12px;
    }

    .creative-terminal {
        font-size: 12px;
    }

    .creative-tag {
        display: none;
    }

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

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

    .footer-links {
        flex-direction: column;
    }

    .content-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-text {
        display: none;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .language-select {
        min-width: 92px;
    }

}

/* ============================================
   NEW INTERACTIVE FEATURES
   ============================================ */

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 1000;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--accent);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 24px;
    color: var(--primary);
    transition: all 0.3s ease;
    z-index: 100;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .dark-mode-toggle {
    right: auto;
    left: 30px;
}

.dark-mode-toggle.is-rotating {
    transform: rotate(360deg);
}

/* Typing Animation */
.typing-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.typing-text::after {
    content: '';
    width: 3px;
    height: 1em;
    margin-inline-start: 0.35ch;
    background: var(--accent);
    animation: blink 0.7s steps(1, end) infinite;
    flex-shrink: 0;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 20px;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.timeline-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-content {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 4px var(--border);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.timeline-date {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.timeline-company {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-role {
    color: var(--muted);
    margin-bottom: 12px;
}

.timeline-description {
    color: var(--muted);
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tech-tag {
    background: var(--bg-alt);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* Skill Bars */
.skill-item {
    margin-bottom: 20px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--bg-alt);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-pill);
    width: 0;
    transition: width 1.5s ease;
    box-shadow: 0 0 10px var(--accent);
}

/* Project Filter */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.project-card {
    transition: all 0.3s ease;
}

/* Contact Form */
.contact-form {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ink);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.contact-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.contact-info-card {
    margin-bottom: 24px;
}

.contact-info-card:last-child {
    margin-bottom: 0;
}

.link-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.availability-pill {
    margin-top: 12px;
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.availability-pill .fa-circle {
    font-size: 8px;
}

.hidden-input {
    display: none;
}

.full-width-btn {
    margin-top: 16px;
    width: 100%;
}

.contact-email-copy {
    margin-top: 16px;
}

.success-banner {
    margin: 0 auto;
    max-width: var(--container);
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.32);
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.14));
    padding: 18px 22px;
    color: var(--ink);
    box-shadow: var(--card-shadow);
    transition: opacity 0.4s ease;
}

.success-banner h3 {
    margin: 0 0 6px;
    font-size: 19px;
}

.success-banner p {
    margin: 0;
    color: var(--muted);
}

.success-banner.fade {
    opacity: 0;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(31, 59, 91, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.loading {
    position: relative;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Notification System */
.notification {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--surface);
    color: var(--ink);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 320px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

/* 3D Card Tilt */
.tilt-card {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Copy Button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--muted);
}

.copy-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Loading Animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: grid;
    place-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Enhanced Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Enhanced Hover Effects */
.skill-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Parallax Orbs */
.bg-orb {
    transition: transform 0.3s ease;
}

/* Stats Animation */
.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

[dir="rtl"] .clean-list li {
    padding-right: 16px;
    padding-left: 0;
}

[dir="rtl"] .clean-list li::before {
    right: 0;
    left: auto;
}

[dir="rtl"] .notification {
    right: auto;
    left: 30px;
    transform: translateX(-400px);
}

[dir="rtl"] .notification.show {
    transform: translateX(0);
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    [dir="rtl"] .timeline::before {
        left: auto;
        right: 20px;
        transform: translateX(50%);
    }

    .timeline-item {
        grid-template-columns: 40px 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }

    /* Hide empty spacer divs (divs that are not content or dot) */
    .timeline-item>div:not(.timeline-content):not(.timeline-dot) {
        display: none;
    }

    /* Ensure content is always in the second column */
    .timeline-content {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
    }

    /* Ensure dot is always in the first column and centered */
    .timeline-dot {
        margin: 0 auto;
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        /* Center vertically relative to content if needed, though usually top aligned is better for timeline */
        align-self: start;
        /* Keep it at the top to match the date/title start */
        margin-top: 24px;
        /* Align with the content top padding/margin */
    }

    .dark-mode-toggle {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    [dir="rtl"] .dark-mode-toggle {
        right: auto;
        left: 20px;
    }
}

/* Enhanced Project Cards */
.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.project-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Achievement Badges */
.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gradient-1);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .achievement-badge {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}

/* Testimonial Card */
.testimonial-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial-quote {
    font-size: 18px;
    font-style: italic;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-info h4 {
    margin: 0;
    font-size: 16px;
}

.testimonial-info p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

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