/* ==========================================================
   PORTFOLIO – Youssef Radwan
   1. Design tokens (dark + light)      6. Cards (shared)
   2. Base                               7. Section styles
   3. Theme switching                    8. Contact + footer
   4. Navbar                             9. Motion / reveal
   5. Hero                               10. Responsive
   ========================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */
:root,
[data-theme="dark"] {
    color-scheme: dark;

    /* Surfaces */
    --bg: #0B1120;
    --bg-alt: #0E1628;
    --surface: #111827;
    --surface-2: #162033;
    --nav-bg: rgba(17, 24, 39, 0.86);
    --bg-glass: rgba(11, 17, 32, 0.38);
    --bg-alt-glass: rgba(14, 22, 40, 0.62);
    --input-bg: #0B1120;

    /* Text */
    --text: #F8FAFC;
    --muted: #94A3B8;
    --placeholder: #7D8CA3;
    --link-blue: #65A8FF;

    /* Accent */
    --accent: #06B6D4;
    --accent-text: #22D3EE;
    --accent-soft: rgba(6, 182, 212, 0.10);
    --grad-from: #0891B2;
    --grad-to: #2563EB;
    --grad-text-from: #22D3EE;
    --grad-text-to: #60A5FA;

    /* Lines + depth */
    --border: rgba(6, 182, 212, 0.22);
    --border-strong: #06B6D4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 34px rgba(6, 182, 212, 0.16);
    --danger: #F87171;

    /* Brand / icon colours */
    --c-github: #F0F6FC;
    --c-linkedin: #4C9BE8;
    --c-whatsapp: #25D366;
    --c-email: #F2665A;
    --c-csharp: #B07CC6;
    --c-cpp: #5AA7E6;
    --c-java: #F89820;
    --c-javablue: #6FA3C7;
    --c-js: #F7DF1E;
    --c-dotnet: #9A7DF5;
    --c-html: #F06529;
    --c-css: #33A9DC;
    --c-bootstrap: #A67BF0;
    --c-sql: #F0605D;
    --c-cisco: #1BB6E8;
    --c-gold: #F5B301;
    --c-silver: #B6C0CE;
    --c-bronze: #D98A4A;
    --c-hackerrank: #2EC866;
    --c-icpc: #E0574A;
    --c-pdf: #F0605D;
    --c-blue: #60A5FA;
    --c-amber: #FBBF24;
    --c-teal: #2DD4BF;
    --c-orange: #FB923C;
    --c-green: #4ADE80;
    --c-violet: #A78BFA;
    --c-sky: #38BDF8;
}

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

    --bg: #F4F7FB;
    --bg-alt: #E9EFF7;
    --surface: #FFFFFF;
    --surface-2: #F1F5F9;
    --nav-bg: rgba(255, 255, 255, 0.88);
    --bg-glass: rgba(244, 247, 251, 0.45);
    --bg-alt-glass: rgba(233, 239, 247, 0.72);
    --input-bg: #FFFFFF;

    --text: #0F172A;
    --muted: #475569;
    --placeholder: #64748B;
    --link-blue: #1D4ED8;

    --accent: #0891B2;
    --accent-text: #0E7490;
    --accent-soft: rgba(8, 145, 178, 0.10);
    --grad-from: #0E7490;
    --grad-to: #1D4ED8;
    --grad-text-from: #0E7490;
    --grad-text-to: #1D4ED8;

    --border: rgba(15, 23, 42, 0.13);
    --border-strong: #0891B2;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 14px 30px rgba(14, 116, 144, 0.16);
    --danger: #DC2626;

    --c-github: #181717;
    --c-linkedin: #0A66C2;
    --c-whatsapp: #1DA851;
    --c-email: #D93025;
    --c-csharp: #68217A;
    --c-cpp: #00599C;
    --c-java: #E76F00;
    --c-javablue: #5382A1;
    --c-js: #F7DF1E;
    --c-dotnet: #512BD4;
    --c-html: #E34F26;
    --c-css: #1572B6;
    --c-bootstrap: #7952B3;
    --c-sql: #CC2927;
    --c-cisco: #0A8FC2;
    --c-gold: #C98B00;
    --c-silver: #7C8798;
    --c-bronze: #B06A28;
    --c-hackerrank: #0B9F55;
    --c-icpc: #B3261E;
    --c-pdf: #D32F2F;
    --c-blue: #2563EB;
    --c-amber: #D97706;
    --c-teal: #0D9488;
    --c-orange: #EA580C;
    --c-green: #16A34A;
    --c-violet: #7C3AED;
    --c-sky: #0284C7;
}

/* Icon colour helpers: <i class="bi bi-x ic-java"> */
.ic-github { --ic: var(--c-github); }
.ic-linkedin { --ic: var(--c-linkedin); }
.ic-whatsapp { --ic: var(--c-whatsapp); }
.ic-email { --ic: var(--c-email); }
.ic-csharp { --ic: var(--c-csharp); }
.ic-cpp { --ic: var(--c-cpp); }
.ic-java { --ic: var(--c-java); }
.ic-javablue { --ic: var(--c-javablue); }
.ic-js { --ic: var(--c-js); }
.ic-dotnet { --ic: var(--c-dotnet); }
.ic-html { --ic: var(--c-html); }
.ic-css { --ic: var(--c-css); }
.ic-bootstrap { --ic: var(--c-bootstrap); }
.ic-sql { --ic: var(--c-sql); }
.ic-cisco { --ic: var(--c-cisco); }
.ic-gold { --ic: var(--c-gold); }
.ic-silver { --ic: var(--c-silver); }
.ic-bronze { --ic: var(--c-bronze); }
.ic-hackerrank { --ic: var(--c-hackerrank); }
.ic-icpc { --ic: var(--c-icpc); }
.ic-pdf { --ic: var(--c-pdf); }
.ic-blue { --ic: var(--c-blue); }
.ic-amber { --ic: var(--c-amber); }
.ic-teal { --ic: var(--c-teal); }
.ic-orange { --ic: var(--c-orange); }
.ic-green { --ic: var(--c-green); }
.ic-violet { --ic: var(--c-violet); }
.ic-sky { --ic: var(--c-sky); }

[class^="ic-"],
[class*=" ic-"] {
    color: var(--ic);
}


/* ---------- 2. BASE ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: clip;
    line-height: 1.6;
}

.bg {
    background-color: var(--bg);
}

img {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

a:focus-visible,
button:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

::selection {
    background: var(--accent);
    color: #fff;
}

.section {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(96px, 11vw, 120px) 0 clamp(56px, 8vw, 88px);
}

.section > .container {
    width: 100%;
}

.section-alt {
    background-color: var(--bg-alt-glass);
}

/* Shared surface for every card-like block */
.stat-card,
.skill-item,
.project-card,
.training-card,
.achievement-card,
.contact-info,
.contact-form,
#education .card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
}


/* ---------- 3. THEME SWITCHING ---------- */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease,
        box-shadow 0.4s ease, fill 0.4s ease !important;
}

.theme-toggle {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--text);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.theme-icon {
    position: absolute;
    font-size: 18px;
    transition: transform 0.45s cubic-bezier(.2, .8, .2, 1), opacity 0.3s ease;
}

/* Dark mode shows the moon, light mode shows the sun */
.theme-icon-moon { color: #A5B4FC; }
.theme-icon-sun { color: #F59E0B; }

[data-theme="dark"] .theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
[data-theme="dark"] .theme-icon-moon { opacity: 1; transform: none; }
[data-theme="light"] .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }
[data-theme="light"] .theme-icon-sun { opacity: 1; transform: none; }
[data-theme="light"] .theme-icon-moon { color: #6366F1; }


/* ---------- 4. NAVBAR ---------- */
#navbar {
    background-color: var(--nav-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.brand-name {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-right: 0;
    font-size: clamp(1.15rem, 4.2vw, 1.5rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text);
    white-space: nowrap;
}

.brand-name > span:not(.brand-logo) {
    margin-left: -4px;
    color: var(--accent-text);
}

.brand-logo {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    border-radius: 10px;
    color: var(--accent-text);
    font-size: 0.9rem;
    font-weight: 800;
    transition: all 0.3s ease;
}

.navbar-brand:hover .brand-logo {
    background-color: var(--accent);
    color: #fff;
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.45);
}

.navbar-toggler {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
}

.navbar-toggler:focus {
    box-shadow: none;
    border-color: var(--border-strong);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23cbd5e1' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#links li a {
    position: relative;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

#links li a::after {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--grad-from), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

#links li a:hover,
#links li a.active {
    color: var(--accent-text);
}

#links li a:hover::after,
#links li a.active::after {
    transform: scaleX(1);
}

.nav-actions {
    margin-left: auto;
}

@media (min-width: 1200px) {
    .nav-actions { margin-left: 1rem; }
}

@media (max-width: 1199.98px) {
    #navbarNav {
        margin-top: 10px;
        padding: 8px 0 6px;
        border-top: 1px solid var(--border);
    }

    #links li a {
        display: block;
        padding: 0.7rem 0.5rem;
    }

    #links li a::after { left: 0.5rem; right: auto; width: 36px; bottom: 6px; }
}


/* ---------- 5. HERO ---------- */
#home {
    background: transparent;
}

.hero-row {
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 96px;
    padding-bottom: 56px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 600;
    font-size: 0.95rem;
}

#intro_cover {
    font-size: clamp(2rem, 6.4vw, 3.4rem);
    line-height: 1.15;
    letter-spacing: 0.5px;
    color: var(--text);
}

#intro_cover span {
    display: block;
    background: linear-gradient(90deg, var(--grad-text-from), var(--grad-text-to));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    overflow-wrap: anywhere;
}

#about_cover {
    margin-top: 12px;
    font-size: clamp(1.15rem, 3.6vw, 1.75rem);
    font-weight: 600;
    color: var(--accent-text);
}

#about_cover span {
    color: var(--c-dotnet);
}

#paar_cover {
    max-width: 550px;
    margin: 15px auto 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--muted);
}

@media (min-width: 992px) {
    #paar_cover { margin-left: 0; }
}

.cover-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

@media (min-width: 992px) {
    .cover-buttons { justify-content: flex-start; }
}

/* Buttons */
.btn-solid,
.btn-ghost,
.back-to-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
        border-color 0.25s ease, color 0.25s ease;
}

.btn-solid,
.back-to-home {
    color: #fff;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    border: 1px solid transparent;
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.28);
}

.btn-solid:hover,
.back-to-home:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(8, 145, 178, 0.4);
}

.btn-solid:active,
.btn-ghost:active,
.contact-btn:active,
.back-to-home:active {
    transform: translateY(0) scale(0.98);
}

.btn-ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
    color: var(--accent-text);
    background: var(--accent-soft);
    transform: translateY(-3px);
}

.btn-solid i,
.btn-ghost i {
    transition: transform 0.25s ease;
}

.btn-solid:hover i,
.btn-ghost:hover i {
    transform: scale(1.15);
}

/* Social icons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

@media (min-width: 992px) {
    .social-links { justify-content: flex-start; }
}

.social-links a {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.social-github i { color: var(--c-github); }
.social-linkedin i { color: var(--c-linkedin); }

.social-links a i { transition: color 0.25s ease; }

.social-links a:hover {
    transform: translateY(-4px);
    border-color: transparent;
}

.social-github:hover { background: var(--c-github); }
.social-linkedin:hover { background: var(--c-linkedin); }
.social-links a:hover i { color: var(--surface); }
.social-linkedin:hover i { color: #fff; }
.social-codeforces:hover i { color: #fff; }
.social-codeforces:hover { background: var(--c-linkedin); }

/* Cover image */
#image_cover {
    width: min(350px, 72vw);
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 50%;
    border: 4px solid var(--accent);
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.35), 0 0 60px rgba(37, 99, 235, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#image_cover:hover {
    transform: scale(1.04);
    box-shadow: 0 0 36px rgba(6, 182, 212, 0.55), 0 0 70px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] #image_cover {
    box-shadow: 0 14px 40px rgba(14, 116, 144, 0.28);
}


/* ---------- 6/7. SECTION TITLES (one consistent pattern) ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(24px, 4vw, 40px);
}

.section-title > i {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    font-size: 28px;
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(1.7rem, 4.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    overflow-wrap: anywhere;
}

.section-title::after {
    content: "";
    flex: 1 1 24px;
    min-width: 24px;
    height: 1px;
    margin-left: 6px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
    opacity: 0.5;
}

.section-title--sub > i {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 12px;
}

.section-title--sub h2 {
    font-size: clamp(1.4rem, 3.4vw, 1.9rem);
}

/* About */
.about-sub {
    color: var(--accent-text);
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 600;
}

#paar_about {
    max-width: 640px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

/* Stat + service cards */
.stat-card {
    height: 100%;
    min-height: 160px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 15px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card > i {
    font-size: 30px;
    transition: transform 0.3s ease;
}

.stat-card h3 {
    margin-top: 15px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card p {
    margin: 5px 0 0;
    color: var(--muted);
}

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

.stat-card:hover > i {
    transform: scale(1.12);
}

.service-card {
    justify-content: flex-start;
}

.service-card p {
    flex-grow: 1;
    margin: 14px 0 0;
    color: var(--text);
    font-weight: 500;
}

.get-started-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 9px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.get-started-btn i {
    font-size: 15px;
    color: inherit;
    transition: transform 0.25s ease;
}

.get-started-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(8, 145, 178, 0.35);
}

.get-started-btn:hover i {
    transform: translateX(4px);
}

/* Education */
#education .card {
    width: min(520px, 100%);
    margin: 0;
    padding: clamp(24px, 4vw, 35px);
    border-radius: 20px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#education .card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

#education .card-title {
    color: var(--link-blue);
    font-weight: 700;
}

#education .card h5 {
    color: var(--accent-text) !important;
    font-weight: 600;
}

#education p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

#pear_edecation span {
    color: var(--link-blue);
    font-weight: 600;
}

/* Skills */
.skill-category {
    margin: 32px 0 15px;
    padding-left: 12px;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
    border-left: 3px solid var(--accent);
}

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

.skill-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    z-index: 2;
}

.skill-info i {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    font-size: 19px;
    border-radius: 10px;
    background: var(--accent-soft);
    background: color-mix(in srgb, var(--ic, var(--accent)) 14%, transparent);
    transition: transform 0.3s ease;
}

/* JavaScript's yellow needs a dark tile to stay visible on a light page */
[data-theme="light"] .skill-info i.ic-js {
    background: #1F2430;
}

.skill-info span {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.skill-percent {
    flex-shrink: 0;
    z-index: 2;
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.skill-line {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--grad-to), var(--accent));
    transition: width 0.8s ease;
}

.skill-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.skill-item:hover .skill-line { width: var(--level); }
.skill-item:hover .skill-percent { opacity: 1; transform: none; }
.skill-item:hover .skill-info i { transform: scale(1.12) rotate(-4deg); }

/* Touch screens have no hover, so show the levels permanently */

.soft-title {
    margin-top: 56px;
}

/* Projects */
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card::before,
.training-card::before,
.achievement-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg, var(--grad-to), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover::before,
.training-card:hover::before,
.achievement-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover,
.training-card:hover,
.achievement-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.project-logo {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
}

.project-logo i {
    font-size: 70px;
    transition: transform 0.3s ease;
}

.project-card:hover .project-logo i { transform: scale(1.12) rotate(-3deg); }

.project-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.project-body h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
}

.project-title-icon { font-size: 19px; }

.project-body p {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 22px;
}

.tech-stack span {
    padding: 5px 12px;
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.tech-stack span:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.project-btn,
.achievement-btn {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.project-btn:hover,
.achievement-btn:hover {
    color: var(--accent-text);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.project-btn i { font-size: 17px; }

/* Training */
.training-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.training-icon {
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.training-icon i {
    font-size: 30px;
    transition: transform 0.3s ease;
}

.training-card:hover .training-icon i { transform: scale(1.15); }

.training-content {
    flex: 1;
    min-width: 0;
}

.training-content h3 {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.training-org {
    display: block;
    margin-bottom: 15px;
    color: var(--link-blue);
    font-size: 14px;
}

.training-content h5 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.training-date,
.achievement-date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 15px;
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 500;
}

.training-date i,
.achievement-date i { font-size: 14px; color: inherit; }

.training-content p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.training-content strong { color: var(--accent-text); }

/* Achievements */
.achievement-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.achievement-icon {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
}

.achievement-icon i {
    font-size: 60px;
    transition: transform 0.3s ease;
}

.achievement-card:hover .achievement-icon i { transform: scale(1.12) rotate(-3deg); }

.achievement-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.achievement-body h3 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.achievement-category {
    margin-bottom: 15px;
    color: var(--link-blue);
    font-size: 13px;
}

.achievement-body p {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.achievement-btn { margin-top: auto; }
.achievement-btn i { font-size: 17px; }


/* ---------- 8. CONTACT + FOOTER ---------- */
.contact-info,
.contact-form {
    height: 100%;
    padding: 30px;
    border-radius: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-info:hover,
.contact-form:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.contact-info h3,
.contact-form h3 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
}

.contact-form h3 { margin-bottom: 25px; }

.contact-info > p {
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

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

.contact-item > i {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--accent-soft);
    background: color-mix(in srgb, var(--ic, var(--accent)) 12%, transparent);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: transform 0.25s ease;
}

.contact-item:hover > i { transform: scale(1.1) rotate(-4deg); }

.contact-item div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contact-item span {
    color: var(--muted);
    font-size: 12px;
}

.contact-item a {
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.3s ease;
}

.contact-item a:hover { color: var(--accent-text); }

/* Form */
.contact-form .form-control {
    padding: 12px 15px;
    color: var(--text);
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}

.contact-form .form-control::placeholder { color: var(--placeholder); opacity: 1; }

.contact-form .form-control:focus {
    color: var(--text);
    background-color: var(--input-bg);
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form .form-control:user-invalid {
    border-color: var(--danger);
}

.contact-form .form-control:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px var(--input-bg) inset;
}

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

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

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
        color 0.25s ease, border-color 0.25s ease;
}

.contact-btn i { font-size: 17px; }

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

.contact-btn--whatsapp {
    color: #fff;
    background: #0E7C6B;
    border: 1px solid #0E7C6B;
}

.contact-btn--whatsapp:hover {
    background: #0A6557;
    border-color: #0A6557;
    box-shadow: 0 10px 22px rgba(14, 124, 107, 0.35);
}

.contact-btn--email {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
}

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

.contact-btn--email:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.form-status {
    min-height: 1.5em;
    margin: 14px 0 0;
    color: var(--accent-text);
    font-size: 13.5px;
}

/* Footer */
.footer {
    padding: 70px 20px;
    text-align: center;
    background: var(--bg-glass);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content h2 {
    margin-bottom: 12px;
    font-size: clamp(1.9rem, 5vw, 2.4rem);
    font-weight: 600;
    color: var(--text);
}

.footer-content p {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 16px;
}

.back-to-home {
    padding: 12px 28px;
    font-size: 15px;
}


/* ---------- 9. MOTION / REVEAL ---------- */
/* Hidden state is applied only when JS is running, so the page never stays blank without it */
.js .reveal {
    opacity: 0;
    translate: 0 18px;
    transition-property: opacity, translate, transform, border-color, box-shadow, background-color, color;
    transition-duration: 0.6s, 0.6s, 0.3s, 0.3s, 0.3s, 0.4s, 0.4s;
    transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s, 0s, 0s, 0s;
    transition-timing-function: ease;
}

.js .reveal.is-visible {
    opacity: 1;
    translate: 0 0;
}

/* One orchestrated entrance for the hero */
@keyframes heroIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

.js #home .col-lg-6:first-child > * {
    animation: heroIn 0.7s ease both;
}

.js #home .col-lg-6:first-child > :nth-child(2) { animation-delay: 0.08s; }
.js #home .col-lg-6:first-child > :nth-child(3) { animation-delay: 0.16s; }
.js #home .col-lg-6:first-child > :nth-child(4) { animation-delay: 0.24s; }
.js #home .col-lg-6:first-child > :nth-child(5) { animation-delay: 0.32s; }
.js #home .col-lg-6:first-child > :nth-child(6) { animation-delay: 0.4s; }
.js #home .right-side { animation: heroIn 0.9s 0.15s ease both; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .js .reveal { opacity: 1; translate: none; }
}


/* ---------- 10. RESPONSIVE ---------- */
@media (max-width: 991.98px) {
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .contact-info,
    .contact-form { padding: 25px; }
}

@media (max-width: 767.98px) {
    .contact-info,
    .contact-form { padding: 20px; }

    .contact-info h3,
    .contact-form h3 { font-size: 21px; }

    .footer { padding: 56px 20px; }
    .footer-content p { font-size: 14px; }
}

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

    .hero-row { padding-top: 88px; }

    .section-title { gap: 12px; }
    .section-title > i { width: 46px; height: 46px; font-size: 23px; border-radius: 12px; }
    .section-title--sub > i { width: 40px; height: 40px; font-size: 20px; }
    .section-title::after { display: none; }

    .cover-buttons .btn { flex: 1 1 100%; }

    .training-card { flex-direction: column; gap: 15px; padding: 20px; }
    .training-icon { width: 55px; height: 55px; }
    .training-icon i { font-size: 25px; }
    .training-content h3 { font-size: 18px; }

    .project-logo { height: 130px; }
    .project-logo i { font-size: 60px; }
    .project-body { padding: 20px; }
    .project-body h3 { font-size: 19px; }

    .achievement-icon { height: 120px; }
    .achievement-icon i { font-size: 55px; }
    .achievement-body { padding: 20px; }
    .achievement-body h3 { font-size: 18px; }

    .contact-item > i { width: 40px; height: 40px; font-size: 18px; }
    .contact-item a { font-size: 13px; }
    .contact-actions .contact-btn { flex: 1 1 100%; }
}

@media (max-width: 359.98px) {
    .brand-name { font-size: 1.05rem; gap: 8px; }
    .brand-logo { width: 32px; height: 32px; font-size: 0.8rem; }
    .skill-item { padding: 12px; }
}

@media (min-width: 1600px) {
    .container { max-width: 1320px; }
}

.form-status a {
    color: var(--link-blue);
    font-weight: 600;
    text-decoration: underline;
}


/* ---------- 11. ANIMATED BACKGROUND ---------- */
#bgCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.bg-aurora span {
    position: absolute;
    border-radius: 50%;
    opacity: 0.38;
    will-change: transform;
}

.bg-aurora span:nth-child(1) {
    width: 52vmax; height: 52vmax; top: -18vmax; left: -14vmax;
    background: radial-gradient(circle, #06B6D4 0%, transparent 68%);
    animation: auroraA 26s ease-in-out infinite alternate;
}

.bg-aurora span:nth-child(2) {
    width: 46vmax; height: 46vmax; top: 22vh; right: -16vmax;
    background: radial-gradient(circle, #2563EB 0%, transparent 68%);
    animation: auroraB 32s ease-in-out infinite alternate;
}

.bg-aurora span:nth-child(3) {
    width: 40vmax; height: 40vmax; bottom: -16vmax; left: 24vw;
    background: radial-gradient(circle, #7C3AED 0%, transparent 68%);
    animation: auroraC 38s ease-in-out infinite alternate;
}

[data-theme="light"] .bg-aurora span { opacity: 0.22; }

@keyframes auroraA { to { transform: translate3d(22vw, 16vh, 0) scale(1.18); } }
@keyframes auroraB { to { transform: translate3d(-26vw, 20vh, 0) scale(0.9); } }
@keyframes auroraC { to { transform: translate3d(-20vw, -22vh, 0) scale(1.25); } }

@media (prefers-reduced-motion: reduce) {
    .bg-aurora span { animation: none !important; }
}

/* =========================
   Footer
========================= */

.footer {
    width: 100%;
    padding: 40px 20px;
    background: var(--footer-bg, #0b1120);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
}

.footer h3 {
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color, #ffffff);
}

.footer p {
    margin-bottom: 20px;
    color: var(--secondary-text, #94a3b8);
    font-size: 14px;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-home:hover {
    transform: translateY(-3px);
    background: #06b6d4;
    color: #ffffff;
}

.back-home i {
    font-size: 16px;
}

/* Light Mode */
body.light-mode .footer {
    --footer-bg: #f8fafc;
    --border-color: rgba(15, 23, 42, 0.1);
    --text-color: #0f172a;
    --secondary-text: #64748b;
}

/* Responsive */
@media (max-width: 576px) {
    .footer {
        padding: 30px 15px;
    }

    .footer h3 {
        font-size: 20px;
    }

    .footer p {
        font-size: 13px;
    }

    .back-home {
        padding: 9px 16px;
        font-size: 14px;
    }
}
.download-cv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    background: var(--c-dotnet);
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-cv:hover {
    transform: translateY(-3px);
    background: var(--c-dotnet);
    color: #ffffff;
}

.download-cv i {
    font-size: 17px;
}
