:root {
    --bg-main: #f8fafc;          /* space white */
    --bg-alt: #eef2ff;           /* soft indigo */
    --text-main: #0f172a;        /* deep space text */
    --text-muted: #475569;       /* muted slate */
    --accent: #06b6d4;           /* neon cyan */
    --accent-secondary: #6366f1; /* violet */
    --card-bg: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(99, 102, 241, 0.25);
}


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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top, #e0f2fe, #f8fafc);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1920px;
    margin: 0 auto;
}

/* ================= HEADER ================= */

.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 92px;
    font-weight: bold;
}

.logo {
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ================= DARK MODE (SYNC WITH CODE BLOCK) ================= */

body.is-dark-mode .header {
    background: rgba(2, 6, 23, 0.9); /* same as code block */
    border-bottom: 1px solid rgba(148,163,184,0.2);
    backdrop-filter: blur(12px);
}

body.is-dark-mode .logo {
    background: none;
    color: #ffffff;
    -webkit-text-fill-color: unset;
}

body.is-dark-mode .nav-links a {
    color: #ffffff;
}

body.is-dark-mode .nav-links a::after {
    background: linear-gradient(90deg, #38bdf8, #c084fc);
}


/* ================= HERO ================= */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 30%, #e0f2fe 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, #eef2ff 0%, transparent 45%);
}

/* ===== DECORATIVE BACKGROUND ELEMENTS ===== */
.hero::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    left: -160px;
    top: 50%;
    transform: translateY(-50%) rotate(15deg);
    background:
        linear-gradient(
            rgba(99,102,241,0.18) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(99,102,241,0.18) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    border-radius: 36px;
    z-index: 0;
}



.hero::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    right: -220px;
    bottom: -220px;
    background: linear-gradient(
        135deg,
        rgba(14,165,233,0.35),
        rgba(99,102,241,0.35)
    );
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

.hero-content::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 300px;
    right: -40px;
    bottom: 60px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;

    background:
        linear-gradient(to top, rgba(6,182,212,.6) 70%, transparent 70%)   0   100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(99,102,241,.5) 45%, transparent 45%)  40px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(6,182,212,.7) 85%, transparent 85%)   80px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(99,102,241,.45)67%, transparent 67%) 120px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(6,182,212,.55)80%, transparent 80%)  160px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(99,102,241,.6) 30%, transparent 30%)  200px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(6,182,212,.45)75%, transparent 75%)  240px 100% / 28px 100% no-repeat,
        linear-gradient(to top, rgba(99,102,241,.4) 100%, transparent 50%)  280px 100% / 28px 100% no-repeat;
}



/* ===== CONTENT LAYOUT ===== */
.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 80px;
    align-items: center;
}

/* ===== AVATAR ===== */
.hero-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* decorative square behind avatar */
.hero-avatar::before {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 28px;
    transform: rotate(30deg);
    z-index: -1;
}

/* small accent square */
.hero-avatar::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 100px;
    top: 40px;
    right: -395px;
    border: 1px solid rgba(14,165,233,0.6);
    border-radius: 14px;
}

.hero-avatar img {
    width: 450px;
    height: 450px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 4px solid rgba(99,102,241,0.45);
    box-shadow: 0 30px 60px rgba(99,102,241,0.25);
    background-color: #ffffff;

}

/* ================= ABOUT ME ================= */

.about-intro {
    max-width: 100%;
    margin-bottom: 40px;
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* ================= CODE BLOCK ================= */

.code-block {
    position: relative;
    overflow: hidden;

    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    color: #1e293b;
    padding: 32px;
    border-radius: 20px;

    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.65;

    width: 100%;
    margin: 0 auto;

    transform: scaleX(0.95);
    transform-origin: center;

    border: 1px solid rgba(99,102,241,0.35);
    box-shadow:
        0 20px 40px rgba(99,102,241,0.18),
        inset 0 1px 0 rgba(255,255,255,0.6);

    transition:
        transform 0.9s cubic-bezier(.4,0,.2,1),
        background-color 0.6s ease,
        color 0.6s ease,
        box-shadow 0.6s ease;
}

/* ================= ACTIVE STATE ================= */

.code-block.is-active {
    transform: scaleX(1);
    background: #020617;
    color: #ffffff;
    border-radius: 0;
    box-shadow: 0 40px 90px rgba(15,23,42,0.6);
}

/* ================= BLUR ACCENT ================= */

.code-block.is-active::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -120px;

    width: 520px;
    height: 520px;

    background: linear-gradient(
        135deg,
        rgba(14,165,233,0.35),
        rgba(99,102,241,0.35)
    );

    border-radius: 50%;
    filter: blur(90px);

    transform: translateY(-50%);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

/* ================= GRID ================= */

.code-block.is-active::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -40px;

    width: 420px;
    height: 420px;

    background:
        linear-gradient(rgba(99,102,241,0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.22) 1px, transparent 1px);

    background-size: 64px 64px;
    border-radius: 36px;

    transform: translateY(-50%) rotate(12deg);
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

/* ================= CODE TEXT ================= */

.code-block code {
    position: relative;
    z-index: 3;
    color: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ================= SYNTAX – COMMON ================= */

.code-block .function {
    color: #f500bb;
    font-weight: 600;
}

.code-block .variable {
    color: #5f7bf6;
    font-weight: 500;
}

/* class */
.code-block .keyword:first-child,
.code-block .keyword.class {
    color: #a78bfa;
}

.code-block .keyword.kw-def {
    color: #ffe133;
}

/* ================= DECORATION – FORMULA ================= */

.code-block.is-active code::after {
    content: "LBCE = −(1/n) ∑ [ yᵢ log(ŷᵢ) + (1 − yᵢ) log(1 − ŷᵢ) ]";

    position: absolute;
    left: 8%;
    top: 58%;

    transform: translateY(-50%) rotate(-4deg);

    font-family: "JetBrains Mono", monospace;
    font-size: 64px;
    font-weight: 600;
    letter-spacing: 1px;

    color: rgba(255,255,255,0.14);
    white-space: nowrap;
    pointer-events: none;

    z-index: 2;
}

/* ===== TEXT ===== */
.hero-text {
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 22px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 36px;
    font-size: 1.08rem;
    max-width: 520px;
}


/* ===== TEXT ===== */
.hero h1 {
    font-size: 3rem;
    margin-bottom: 22px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 36px;
    font-size: 1.08rem;
    max-width: 520px;
}

.hero-text {
    max-width: 600px;
}



/* ================= BUTTON ================= */

.btn-primary {
    display: inline-block;
    padding: 14px 34px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 45px rgba(99, 102, 241, 0.45);
}

/* ================= SECTIONS ================= */

.section {
    padding: 110px 0;
}

.section-alt {
    background: linear-gradient(180deg, #eef2ff, #f8fafc);
}

.section h2 {
    font-size: 2.1rem;
    margin-bottom: 30px;
}

.section p {
    max-width: 720px;
    color: var(--text-muted);
}

/* ================= SKILLS GRID ================= */

.skills-grid {
    display: grid;
    /* Гъвкави колони според наличната ширина */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 48px;

    transition:
        grid-template-columns 0.8s cubic-bezier(.4,0,.2,1);
}

/* ================= SKILL CARD ================= */

.skill-card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    padding: 32px;
    border-radius: 20px;

    transform:
        scale(0.92)
        translateY(30px);

    opacity: 0;

    transition:
        transform 0.8s cubic-bezier(.4,0,.2,1),
        opacity 0.6s ease,
        box-shadow 0.4s ease;
}

/* stagger illusion */
.skill-card:nth-child(2) {
    transition-delay: 0.08s;
}

.skill-card:nth-child(3) {
    transition-delay: 0.16s;
}

.skill-card h3 {
    margin-bottom: 12px;
    font-size: 1.15rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ================= ACTIVE STATE ================= */

.skills-grid.is-active {
    /* Запазваме класа за възможни анимации; базата вече е responsive */
}

.skills-grid.is-active .skill-card {
    transform: none;
    opacity: 1;
}

/* ================= HOVER ================= */

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(99,102,241,0.25);
}

/* ================= SKILLS ENHANCEMENTS ================= */

.section-lead {
    color: var(--text-muted);
    margin-top: -8px;
}

.skill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.skill-head h3 {
    margin: 0;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    background: rgba(99,102,241,0.12);
    color: var(--accent);
    border: 1px solid rgba(99,102,241,0.25);
}

.skill-badge.is-secondary {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border-color: rgba(16,185,129,0.25);
}

.skill-badge.is-tertiary {
    background: rgba(234,88,12,0.12);
    color: #ea580c;
    border-color: rgba(234,88,12,0.25);
}

.skill-chips {
    list-style: none;
    padding: 0;
    margin: 12px 0 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, rgba(255,255,255,0.7));
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.86rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.meter {
    position: relative;
    height: 10px;
    background: rgba(15,23,42,0.06);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    overflow: hidden;
}

.meter span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-right: 1px solid rgba(255,255,255,0.6);
    box-shadow: inset 0 0 12px rgba(255,255,255,0.3);
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

.skills-grid.is-active .meter span {
    width: var(--value);
}


/* ================= PROJECTS GRID ================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 36px;
    margin-top: 48px;
}

/* ================= PROJECT CARD ================= */

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    padding: 32px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition:
        transform 0.45s cubic-bezier(.4,0,.2,1),
        box-shadow 0.45s ease,
        border-color 0.45s ease;
}

/* subtle lift */
.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 70px rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.45);
}

/* ================= META ================= */

.project-meta {
    margin-bottom: 16px;
}

.project-tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;

    color: #0ea5e9;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(14,165,233,0.35);
    border-radius: 999px;
}

/* ================= TEXT ================= */

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 14px;

    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ================= FOOTER ================= */

.project-footer {
    margin-top: 28px;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;

    color: var(--accent-secondary);
    position: relative;
}

.project-link::after {
    content: "→";
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.project-link:hover::after {
    transform: translateX(6px);
}



/* ================= GLOBAL ENHANCEMENTS ================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ================= SITE FOOTER v2 (Professional, Cyan on Deep Navy) ================= */
.footer {
    /* Color system localized to the footer */
    --footer-bg-1: #0f172a; /* requested deep navy */
    --footer-bg-2: #0f172a; /* uniform base for subtle gradient */
    --footer-text: #bff4fb; /* cyan 200–300 */
    --footer-muted: rgba(191, 244, 251, 0.78);
    --footer-border: rgba(191, 244, 251, 0.18);
    --footer-surface: rgba(255, 255, 255, 0.05);
    --accent: #67e8f9;          /* cyan */
    --accent-secondary: #06b6d4; /* deeper cyan */

    /* Background dynamics */
    --glow-a: rgba(56, 189, 248, 0.12); /* cyan glow */
    --glow-b: rgba(99, 102, 241, 0.10); /* indigo glow */
    --grid-alpha: 0.06;                /* grid visibility */
    --grid-speed: 32s;                 /* slow drift */

    position: relative;
    /* Remove gap above footer so Contact section sits flush */
    margin-top: 0;
    padding: 84px 0 28px;
    color: var(--footer-text);
    background:
        radial-gradient(120% 140% at 15% 0%, var(--glow-a) 0%, rgba(0,0,0,0) 60%),
        radial-gradient(100% 120% at 85% 6%, var(--glow-b) 0%, rgba(0,0,0,0) 55%),
        linear-gradient(180deg, var(--footer-bg-2), var(--footer-bg-1));
    border-top: 1px solid var(--footer-border);
    overflow: hidden;
}

/* Make the Contact section stick to the footer with no extra gap */
#contact.section {
    padding-bottom: 0;
}

/* Elegant curved top divider */
.footer::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -48px; height: 96px;
    background:
      radial-gradient(120% 100% at 50% 100%, rgba(103,232,249,0.18) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

/* Subtle cyan grid overlay */
.footer::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(103,232,249,var(--grid-alpha)) 0 1px, transparent 1px 40px),
        repeating-linear-gradient(90deg, rgba(103,232,249,var(--grid-alpha)) 0 1px, transparent 1px 40px);
    opacity: 0.6;
    mix-blend-mode: overlay;
    transform: translateZ(0);
    animation: footer-grid-pan var(--grid-speed) linear infinite;
}

@keyframes footer-grid-pan {
    from { transform: translate3d(0,0,0); }
    to   { transform: translate3d(40px,0,0); }
}
@media (prefers-reduced-motion: reduce) { .footer::after { animation: none; } }

.footer .container { position: relative; z-index: 1; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 32px;
}

.footer-brand .logo {
    font-weight: 700;
    letter-spacing: 1px;
}

.footer-brand .tagline {
    color: var(--footer-muted);
    margin-top: 8px;
}

.footer-badges { list-style: none; margin: 14px 0 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--footer-border);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: var(--footer-text);
    font-size: 0.8rem;
    letter-spacing: 0.2px;
}
.badge.is-available {
    border-color: rgba(16,185,129,0.35);
    background: linear-gradient(180deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04));
    color: #86efac;
}

.footer-nav h4,
.footer-contact h4 {
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    margin: 0 0 12px;
    color: var(--footer-text);
}

.footer-nav ul,
.footer-contact ul { list-style: none; padding: 0; margin: 0; }

.footer-nav li + li { margin-top: 8px; }

.footer a { color: var(--footer-text); text-decoration: none; }
.footer a:hover { color: var(--accent); }

.social-list { display: flex; flex-direction: column; gap: 10px; }
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--footer-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    color: var(--footer-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.38);
    border-color: rgba(6,182,212,0.5);
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
}
.social-link .icon { width: 1.1em; display: inline-flex; align-items: center; justify-content: center; }

.footer .availability { color: var(--footer-muted); margin-top: 12px; font-size: 0.92rem; }

.legal-bar {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--footer-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--footer-muted);
    font-size: 0.94rem;
}

.to-top {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--footer-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
    color: var(--accent-secondary);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.to-top:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.36); color: var(--accent); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Chevron icon */
.to-top-icon {
    width: 10px; height: 10px; display: inline-block;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg) translateY(2px);
}

@media (max-width: 900px) {
    .footer { padding: 68px 0 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
}

@media (max-width: 640px) {
    .footer { padding: 48px 0 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 18px; }
    .legal-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 360px) { .to-top { padding: 8px 12px; } }

/* ================= CASE STUDIES (distinct from Skills) ================= */

.projects-list {
    display: grid;
    gap: 36px;
    margin-top: 42px;
    grid-template-columns: 1fr; /* mobile-first */
}

/* Section header + eyebrow inspired by premium product sites */
.section-header { display: grid; gap: 10px; }
.projects-header { text-align: center; margin-bottom: 18px; }
.eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    justify-self: center;
}
.projects-header .section-lead { max-width: 900px; margin: 0 auto; color: var(--text-muted); }

/* Category filters — progressive enhancement; without JS they are inert buttons */
.projects-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}
.filter-btn {
    appearance: none;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.9);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(99,102,241,0.16); }
.filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filter-btn.is-active, .filter-btn[aria-selected="true"] {
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    color: #fff;
    border-color: rgba(99,102,241,0.4);
}

/* Hidden state used by filters; visibility is never gated by JS on initial load */
.case-study.is-hidden { display: none; }

.case-study {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;

    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(15,23,42,0.08);

    /* Visible by default for reliability in production (progressive enhancement) */
    transition: transform 0.8s cubic-bezier(.4,0,.2,1), opacity 0.6s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.projects-reveal.is-active .case-study {
    transform: none;
    opacity: 1;
}

/* Optional animation when JS is available: start offset state only when reveal container is present */
.projects-reveal .case-study { transform: translateY(0); opacity: 1; }
.projects-reveal.is-active .case-study { transform: none; opacity: 1; }

/* Staggered reveal for multiple cards (lightweight, CSS-only) */
.projects-reveal.is-active .case-study { transition-delay: 60ms; }
.projects-reveal.is-active .case-study:nth-child(2) { transition-delay: 120ms; }
.projects-reveal.is-active .case-study:nth-child(3) { transition-delay: 180ms; }
.projects-reveal.is-active .case-study:nth-child(4) { transition-delay: 240ms; }
.projects-reveal.is-active .case-study:nth-child(5) { transition-delay: 300ms; }

/* ================= MODERN REDESIGN FOR ACTIVE PROJECTS LIST ================= */
/*
   A fresh, cleaner visual style applied ONLY when the list is active
   (#projects > .container > .projects-list.projects-reveal.is-active)
   Keeps HTML and JS intact while fully refreshing the look.
*/
.projects-list.projects-reveal.is-active {
  gap: 28px;
}

.projects-list.projects-reveal.is-active .case-study {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.9));
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow:
    0 10px 24px rgba(15,23,42,0.06),
    0 2px 0 rgba(255,255,255,0.8) inset,
    0 0 0 1px rgba(255,255,255,0.6) inset;
  transform: translateY(0);
  transition:
    transform .28s cubic-bezier(.2,.8,.2,1),
    box-shadow .28s ease,
    background .28s ease,
    border-color .28s ease;
}

.projects-list.projects-reveal.is-active .case-study::before {
  /* Subtle gradient border glow */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(103,232,249,0.45), rgba(6,182,212,0.25), rgba(99,102,241,0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: .6;
}

.projects-list.projects-reveal.is-active .case-study:hover {
  box-shadow: 0 30px 70px rgba(15,23,42,0.14);
}

.projects-list.projects-reveal.is-active .case-media {
  aspect-ratio: auto;
  height: 190px;
  border-radius: 16px;
  margin: 16px 16px 0;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(103,232,249,0.18), rgba(99,102,241,0.12)),
              radial-gradient(120% 80% at 10% 0%, rgba(103,232,249,0.18), transparent 60%),
              #f1f5f9;
}

.case-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
}

.projects-list.projects-reveal.is-active .case-art {
  /* Crisp geometric shimmer */
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.65) 50%, rgba(255,255,255,0) 100%) 0 0/220% 100%,
    radial-gradient(40% 60% at 70% 30%, rgba(6,182,212,0.18), transparent),
    linear-gradient(160deg, rgba(99,102,241,0.18), transparent 40%);
  animation: art-pan-x 10s linear infinite;
  filter: saturate(1.05) contrast(1.02);
}

.projects-list.projects-reveal.is-active .case-body {
  padding: 16px 18px 18px;
  gap: 12px;
}

.projects-list.projects-reveal.is-active .case-header { gap: 4px; }
.projects-list.projects-reveal.is-active .case-title {
  font-size: 1.12rem;
  letter-spacing: .2px;
}
.projects-list.projects-reveal.is-active .case-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
}

.projects-list.projects-reveal.is-active .case-summary {
  font-size: .96rem;
  line-height: 1.6;
  color: var(--text-main);
}

.projects-list.projects-reveal.is-active .tech-tags {
  gap: 6px;
}
.projects-list.projects-reveal.is-active .tag {
  height: 26px;
  padding: 0 10px;
  font-size: .8rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.08);
}

.projects-list.projects-reveal.is-active .case-metrics {
  gap: 8px;
}
.projects-list.projects-reveal.is-active .case-metrics li {
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.projects-list.projects-reveal.is-active .case-cta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.projects-list.projects-reveal.is-active .btn-case {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.projects-list.projects-reveal.is-active .btn-case.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: #fff;
  border-color: rgba(99,102,241,0.25);
}
.projects-list.projects-reveal.is-active .btn-case:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(15,23,42,0.12); }

/* Featured card tweaks under new style */
@media (min-width: 900px) {
  .projects-list.projects-reveal.is-active .case-study.is-featured { grid-template-columns: 1.05fr 1fr; }
  .projects-list.projects-reveal.is-active .case-study.is-featured .case-media { height: auto; min-height: 100%; margin: 0; border-radius: 0; }
}

/* Responsive refinements */
@media (max-width: 759.98px) {
  .projects-list.projects-reveal.is-active .case-media { height: 170px; margin: 12px 12px 0; border-radius: 14px; }
  .projects-list.projects-reveal.is-active .case-body { padding: 14px 16px 16px; }
}

/* Projects grid responsive columns */
@media (min-width: 760px) {
  .projects-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .projects-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Featured card spans two columns on desktop */
@media (min-width: 1200px) {
  .case-study.is-featured { grid-column: span 2; }
}

/* Featured card internal layout: media left, content right (desktop) */
@media (min-width: 900px) {
  .case-study.is-featured { grid-template-columns: 1.1fr 1fr; align-items: stretch; }
  .case-study.is-featured .case-media { aspect-ratio: auto; min-height: 100%; }
}

/* Card elevation and hover */
.case-study:hover { box-shadow: 0 24px 64px rgba(15,23,42,0.12); }
.case-study:focus-within { box-shadow: 0 28px 72px rgba(15,23,42,0.18); }

.case-media {
    position: relative;
    overflow: hidden;
    will-change: auto;
}

/* CSS Decorative Art (replaces images) */
.case-art {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    /* Subtle depth */
    transform: translateZ(0) scale(1.02);
    transition: transform 0.8s cubic-bezier(.4,0,.2,1), filter 0.8s ease;
}

.case-art,
.case-study:hover .case-art {
    transform: none !important;
}

/* Shared layers via CSS variables */
.case-art {
    --art-bg1: #eef2ff;
    --art-bg2: #f8fafc;
    --c-accent: var(--accent);
    --c-accent-2: var(--accent-secondary);
    --c-info: #0284c7;
    --c-success: #10b981;
    --c-warn: #d97706;
}

/* Base animated shimmer (very subtle) */
@keyframes art-pan-x { from { background-position-x: 0%; } to { background-position-x: 100%; } }
@keyframes art-pan-y { from { background-position-y: 0%; } to { background-position-y: 100%; } }

/* Case body and content */
.case-body { padding: 20px 22px 24px; display: grid; gap: 14px; }
.case-header { display: grid; gap: 6px; }
.case-title { font-size: 1.35rem; line-height: 1.25; }
.case-subtitle { color: var(--text-muted); font-size: 0.98rem; }
.case-summary { color: var(--text-main); }

/* Tech tags */
.tech-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(99,102,241,0.25);
  background: rgba(255,255,255,0.8); font-size: 0.82rem; color: var(--text-main);
}
.tag.is-info { border-color: rgba(2,132,199,0.35); background: rgba(224,242,254,0.6); }
.tag.is-success { border-color: rgba(16,185,129,0.35); background: rgba(209,250,229,0.6); }
.tag.is-warning { border-color: rgba(217,119,6,0.35); background: rgba(254,243,199,0.6); }

/* Meta info */
.case-meta { list-style: none; display: grid; gap: 6px; color: var(--text-muted); font-size: 0.92rem; }
.case-meta li span { color: var(--text-main); font-weight: 600; margin-right: 6px; }

/* Metrics */
.case-metrics { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.case-metrics li {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 12px; padding: 8px 12px; font-size: 0.9rem; color: var(--text-main);
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}

/* Case CTAs */
.case-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.btn-case {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border-glass); color: var(--text-main);
  background: rgba(255,255,255,0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn-case:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(99,102,241,0.18); }
.btn-case.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: #ffffff; border-color: rgba(99,102,241,0.4);
}
.btn-case.primary:hover { box-shadow: 0 14px 36px rgba(99,102,241,0.36); }
.btn-case:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Dark mode adjustments for project cards */
body.is-dark-mode .case-study { background: rgba(2,6,23,0.88); border-color: rgba(148,163,184,0.22); box-shadow: 0 28px 72px rgba(2,6,23,0.6); }
body.is-dark-mode .tag { background: rgba(2,6,23,0.7); border-color: rgba(148,163,184,0.25); color: #e2e8f0; }
body.is-dark-mode .case-subtitle, body.is-dark-mode .case-meta { color: #94a3b8; }
body.is-dark-mode .case-metrics li { background: rgba(2,6,23,0.9); border-color: rgba(148,163,184,0.18); color: #e2e8f0; box-shadow: 0 16px 40px rgba(2,6,23,0.6); }
body.is-dark-mode .btn-case { background: rgba(2,6,23,0.85); color: #e2e8f0; border-color: rgba(148,163,184,0.25); }
body.is-dark-mode .btn-case.primary { background: linear-gradient(90deg, #0ea5e9, #6366f1); color: #fff; }
body.is-dark-mode .filter-btn { background: rgba(2,6,23,0.85); color: #e2e8f0; border-color: rgba(148,163,184,0.25); }
body.is-dark-mode .filter-btn.is-active, body.is-dark-mode .filter-btn[aria-selected="true"] { background: linear-gradient(90deg, #0ea5e9, #6366f1); color: #fff; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .case-study, .case-art, .btn-case { transition: none; }
}

/* ================= MODAL ================= */
.modal { position: fixed; inset: 0; display: none; z-index: 9999;}
.modal.is-open { display: block; }

.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  max-width: 980px;
  margin: 16vh auto;
  background: var(--card-bg);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  box-shadow: 0 40px 120px rgba(15,23,42,0.35);
  overflow: hidden;
  z-index: 0;
}

.modal-content {
  padding: 24px;
}

.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.modal-close:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99,102,241,0.22); }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-header { display: grid; gap: 6px; padding-right: 44px; }
#case-modal-title { font-size: 1.4rem; }
.modal-subtitle { color: var(--text-muted); }

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

.modal-hero {
  height: 220px;
  background: linear-gradient(180deg, var(--art-bg1), var(--art-bg2));
}

.modal-section { display: grid; gap: 10px; }
.modal-section h4 { margin: 6px 0 0; font-size: 1rem; color: var(--text-main); }
.modal-section p { color: var(--text-muted); }

@media (min-width: 900px) {
  .modal-content { padding: 28px; }
  .modal-grid { grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
  .modal-hero { height: 260px; }
}

body.no-scroll { overflow: hidden; }

/* Dark mode for modal */
body.is-dark-mode .modal-dialog { background: rgba(2,6,23,0.92); border-color: rgba(148,163,184,0.22); }
body.is-dark-mode .modal-close { background: rgba(2,6,23,0.85); color: #e2e8f0; border-color: rgba(148,163,184,0.25); }

/* Theme: Risk Analysis – gridlines + heatmap dots + iso-waves */
.art--risk {
    background-image:
        /* iso-wave */
        radial-gradient(120% 80% at 0% 0%, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.00) 60%),
        radial-gradient(120% 100% at 100% 100%, rgba(139,92,246,0.10) 0%, rgba(139,92,246,0.00) 65%),
        /* heat dots */
        radial-gradient(6px 6px at 20% 30%, rgba(99,102,241,0.45) 0, rgba(99,102,241,0.45) 40%, transparent 45%),
        radial-gradient(7px 7px at 62% 58%, rgba(2,132,199,0.45) 0, rgba(2,132,199,0.45) 40%, transparent 45%),
        radial-gradient(5px 5px at 78% 24%, rgba(217,119,6,0.45) 0, rgba(217,119,6,0.45) 40%, transparent 45%),
        /* grid */
        linear-gradient(var(--art-bg1), var(--art-bg2)),
        repeating-linear-gradient(0deg, rgba(15,23,42,0.06) 0 1px, transparent 1px 40px),
        repeating-linear-gradient(90deg, rgba(15,23,42,0.06) 0 1px, transparent 1px 40px);
    background-size:
        100% 100%, 100% 100%,
        100% 100%, 100% 100%, 100% 100%,
        100% 100%, 100% 100%, 100% 100%;
    animation:
        art-pan-x 14s linear infinite;
}

/* Theme: Segmentation – layered masks/contours */
.art--seg {
    --layer1: radial-gradient(60% 80% at 20% 60%, rgba(16,185,129,0.18) 0%, rgba(16,185,129,0.00) 65%);
    --layer2: radial-gradient(70% 70% at 80% 30%, rgba(99,102,241,0.18) 0%, rgba(99,102,241,0.00) 70%);
    --layer3: radial-gradient(40% 50% at 60% 80%, rgba(2,132,199,0.16) 0%, rgba(2,132,199,0.00) 75%);
    --contours: repeating-conic-gradient(from 0deg, rgba(15,23,42,0.07) 0 6deg, transparent 6deg 12deg);
    background:
        var(--layer1), var(--layer2), var(--layer3),
        linear-gradient(180deg, var(--art-bg1), var(--art-bg2));
    -webkit-mask-image: var(--contours);
    mask-image: var(--contours);
    -webkit-mask-size: 200% 200%;
    mask-size: 200% 200%;
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
    animation: art-pan-y 18s linear infinite;
}

/* Theme: EDA – conic chart arcs + rings */
.art--eda {
    background-image:
        radial-gradient(closest-side, rgba(255,255,255,0.6), rgba(255,255,255,0.0) 70%),
        conic-gradient(from -90deg, var(--c-accent) 0 25%, transparent 25% 50%, var(--c-accent-2) 50% 75%, transparent 75% 100%),
        repeating-conic-gradient(from 0deg, rgba(15,23,42,0.08) 0 2deg, rgba(15,23,42,0.0) 2deg 6deg),
        radial-gradient(120% 100% at 100% 0%, rgba(2,132,199,0.12) 0%, rgba(2,132,199,0.00) 60%),
        linear-gradient(180deg, var(--art-bg1), var(--art-bg2));
    background-size: 40% 40%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    background-position: 10% 15%, center, center, center, center;
    animation: art-pan-x 20s linear infinite;
}

/* Reduced motion: stop decorative animations */
@media (prefers-reduced-motion: reduce) {
    .case-art, .art--risk, .art--seg, .art--eda { animation: none !important; }
    .case-study:hover .case-art { transform: none; }
}

.case-body {
    padding: 22px 22px 26px;
}

.case-title {
    font-size: 1.35rem;
    margin: 2px 0 10px;
    position: relative;
}

.case-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 52px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

.case-summary {
    color: var(--text-muted);
    margin: 16px 0 16px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 10px; /* square-ish ends to differ from fully rounded chips */
    font-size: 0.78rem;
    background: rgba(15,23,42,0.06);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.tag.is-info { color: #0284c7; background: rgba(2,132,199,0.12); border-color: rgba(2,132,199,0.25); }
.tag.is-success { color: #10b981; background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.25); }
.tag.is-warning { color: #d97706; background: rgba(217,119,6,0.12); border-color: rgba(217,119,6,0.25); }

.case-meta {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.case-meta li span {
    color: var(--text-main);
    font-weight: 600;
    margin-right: 6px;
}

.case-cta { margin-top: 16px; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-outline::after {
    content: "→";
    transition: transform 0.25s ease;
}

.btn-outline:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    box-shadow: 0 12px 30px rgba(99,102,241,0.18);
}

.btn-outline:hover::after { transform: translateX(6px); }

.btn-outline:focus-visible {
    outline: 3px solid rgba(99,102,241,0.45);
    outline-offset: 2px;
}

@media (min-width: 900px) {
    .case-study {
        grid-template-columns: 1.2fr 1fr;
        gap: 0;
    }

    .case-body { padding: 26px 28px; }

    /* alternate media/content to create rhythm distinct from grid cards */
    .case-study:nth-child(even) {
        grid-template-columns: 1fr 1.2fr;
    }
    .case-study:nth-child(even) .case-media { order: 2; }
    .case-study:nth-child(even) .case-body { order: 1; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .case-study { transition: none; transform: none !important; }
    .case-media img { transition: none; }
}



/* ================= CONTACT ================= */

.section-contact {
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    padding: 96px 0 0;
    overflow: hidden;
}

/* Header zone */
.contact-top {
    padding-bottom: 160px;
}

.contact-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.contact-header h2 {
    color: #e6fbff;
    margin-bottom: 12px;
}

.contact-header > .contact-subtitle {
    font-size: 1.05rem;
    font-style: italic;

    background: linear-gradient(135deg, #38bdf8, #2b2fea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;

    width: 90%;
    max-width: 1400px; /* или 1280px */
    margin: 0 auto 10px;

    transform: translateY(-120px);
}

/* Cards */
.contact-card {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.contact-card h3 {
    color: #f8fafc;
    margin-bottom: 12px;
}

.contact-card p {
    color: #cbd5e1;
    margin-bottom: 24px;
}

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

/* Buttons */
.btn {
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #0b1220;
}

.btn-secondary {
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #e6fbff;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Contact list */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    margin-bottom: 16px;
}

.contact-list span {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
}

.contact-list a {
    color: #38bdf8;
    text-decoration: none;
}

.contact-list a:hover {
    color: #7dd3fc;
}

/* Responsive */
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        margin-top: -96px;
    }
}



/* Better responsiveness for CTA buttons on narrower widths */
@media (max-width: 900px) {
    .cta-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .cta-buttons { grid-template-columns: 1fr; }
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.9);
    color: var(--text-main);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(99,102,241,0.22);
}

.btn-cta .icon { font-size: 1.1rem; }

/* Color accents */
.btn-cta.is-email {
    background: linear-gradient(180deg, #fff, #f8fafc);
    border-color: rgba(14,165,233,0.35);
}
.btn-cta.is-email:hover { border-color: rgba(14,165,233,0.55); }

.btn-cta.is-linkedin {
    background: linear-gradient(180deg, #fff, #eef2ff);
    border-color: rgba(99,102,241,0.35);
}
.btn-cta.is-linkedin:hover { border-color: rgba(99,102,241,0.55); }

.btn-cta.is-github {
    background: linear-gradient(180deg, #fff, #f1f5f9);
    border-color: rgba(15,23,42,0.2);
}
.btn-cta.is-github:hover { border-color: rgba(15,23,42,0.4); }

.btn-cta.is-copy {
    background: rgba(99,102,241,0.08);
    color: var(--accent-secondary);
    border-color: rgba(99,102,241,0.25);
}
.btn-cta.is-copy:hover { background: rgba(99,102,241,0.12); }
.btn-cta.is-copy.copied { background: rgba(22,163,74,0.15); border-color: rgba(22,163,74,0.5); color: #166534; }

.contact-note {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Secondary info card with direct links */
.contact-info { margin-top: 22px; }
.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(99,102,241,0.18);
}
.info-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.info-card ul {
    list-style: none;
    display: grid;
    gap: 8px;
}
.info-card li span { margin-right: 8px; }

/* Dark mode sync with code block */
body.is-dark-mode .contact-cta,
body.is-dark-mode .info-card {
    background: rgba(2, 6, 23, 0.9);
    border-color: rgba(148,163,184,0.25);
    box-shadow: 0 30px 70px rgba(2,6,23,0.6);
}
body.is-dark-mode .btn-cta {
    background: rgba(2, 6, 23, 0.85);
    color: #e2e8f0;
    border-color: rgba(148,163,184,0.25);
}
body.is-dark-mode .btn-cta:hover {
    box-shadow: 0 20px 45px rgba(2,6,23,0.6);
}


/* (Removed legacy light footer styles to avoid conflicts with the new Footer v2 defined above) */

/* =========================================================
   RESPONSIVE DESIGN – MOBILE & TABLET
   ========================================================= */

/* ---------- Large tablets / small laptops (≤ 1280px) ---------- */
@media (max-width: 1280px) {

    .hero-content {
        grid-template-columns: 360px 1fr;
        gap: 64px;
    }

    .hero-avatar img {
        width: 380px;
        height: 380px;
    }

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

/* ---------- Tablets (≤ 1024px) ---------- */
@media (max-width: 1024px) {

    .hero-content {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }

    .hero-avatar::before,
    .hero-avatar::after {
        display: none;
    }

    .hero-avatar img {
        width: 320px;
        height: 320px;
    }

    .hero-text {
        max-width: 100%;
    }

    /* Contact layout stacks on tablets */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .contact-card,
    .info-card {
        padding: 24px;
    }

}


/* ---------- Mobile (≤ 768px) ---------- */
@media (max-width: 768px) {

    /* ===== HEADER ===== */
    .nav {
        height: auto;
        padding: 18px 0;
        flex-direction: column;
        gap: 14px;
    }

    .nav-links {
        gap: 18px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 1rem;
    }

    /* ===== HERO ===== */
    .hero {
        height: auto;
        padding: 140px 0 80px;
    }

    .hero-avatar img {
        width: 260px;
        height: 260px;
    }

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

    .hero p {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    /* ===== CODE BLOCK ===== */
    .code-block {
        padding: 24px;
        font-size: 0.85rem;
        border-radius: 16px;
        overflow: hidden;
    }


    .code-block.is-active {
        border-radius: 16px;
    }


    /* ===== SECTIONS ===== */
    .section {
        padding: 80px 0;
    }

    .section h2 {
        font-size: 1.8rem;
        text-align: center;
    }

    .section p {
        text-align: center;
        max-width: 100%;
    }

    /* ===== SKILLS ===== */
    .skills-grid {
        gap: 20px;
    }


    .skill-card {
        padding: 24px;
    }

    /* ===== PROJECTS ===== */
    .projects-grid {
        gap: 24px;
    }

    .project-card {
        padding: 26px;
    }

    /* Contact: single column fields */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .form-actions {
        flex-wrap: wrap;
    }
    .btn-secondary {
        padding: 10px 18px;
    }
}


/* ---------- Small phones (≤ 480px) ---------- */
@media (max-width: 480px) {

    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        gap: 12px;
    }

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

    .btn-primary {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .project-card h3,
    .skill-card h3 {
        font-size: 1.05rem;
    }

    /* (Removed legacy mobile override for old footer) */
}

/* =========================================================
   TRUE FLUSH vertical card — no padding, no radius
   ========================================================= */

.case-study.is-vertical {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
    border-radius: 20px !important;
    overflow: hidden;
    cursor: pointer;
}

/* Full-bleed top image */
.case-study.is-vertical .case-media {
    width: 100%;
    height: 190px;

    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;

    aspect-ratio: auto;
    overflow: hidden;
    transition: none !important;
}

/* Image fills container */
.case-study.is-vertical .case-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
}

/* Text spacing ONLY below image */
.case-study.is-vertical .case-body {
    padding: 22px 22px 26px;
}

/* Order safety */
.case-study.is-vertical .case-media { order: 1 !important; }
.case-study.is-vertical .case-body  { order: 2 !important; }


.case-media {
    position: relative;
    height: 190px;
    overflow: hidden;
}

.case-media-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.case-media-frame img {
    object-position: 10%;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    /* HARD LOCK */
    transform: none !important;
    transition: none !important;
    will-change: auto;
}

.hero h1 {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h1 .ds-hero {
    -webkit-text-fill-color: #d59203;
}

.legal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legal-bar p {
    margin: 0;
    font-size: 14px;
}

.cv-counter {
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.4;
}
































