:root {
    --sd-bg: #0B1020;
    --sd-surface: #111827;
    --sd-card: #172033;
    --sd-blue: #3B82F6;
    --sd-blue-hover: #60A5FA;
    --sd-text: #F8FAFC;
    --sd-muted: #94A3B8;
    --sd-border: #263247;
    --sd-cyan: #22D3EE;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 28%),
        linear-gradient(180deg, var(--sd-bg) 0%, var(--sd-bg) 35%, var(--sd-surface) 100%);
    color: var(--sd-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
}

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

:focus-visible {
    outline: 2px solid var(--sd-cyan);
    outline-offset: 3px;
}

.navbar {
    width: 100%;
    padding: 20px 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 16, 32, 0.8);
    border-bottom: 1px solid rgba(38, 50, 71, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--sd-text);
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--sd-border);
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.18);
}

.brand span {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.7px;
    color: var(--sd-text);
    white-space: nowrap;
}

.navbar nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
}

.navbar nav ul li a {
    color: var(--sd-muted);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease, transform 0.25s ease;
}

.navbar nav ul li a:hover,
.navbar nav ul li a.active {
    color: var(--sd-blue-hover);
}

.navbar nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    background: var(--sd-blue);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.navbar nav ul li a:hover::after,
.navbar nav ul li a.active::after {
    transform: scaleX(1);
}

main {
    flex: 1;
}

.projects-hero {
    padding: 90px 7% 36px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.14), transparent 40%);
}

.projects-hero-content {
    max-width: 980px;
    margin: 0 auto;
}

.eyebrow {
    color: var(--sd-cyan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.projects-hero h1 {
    font-size: clamp(42px, 6vw, 72px);
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 16px;
    color: var(--sd-text);
}

.projects-subtitle {
    color: var(--sd-muted);
    font-size: 18px;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

.project-showcase {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 7% 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 28px;
    align-items: center;
}

.project-info,
.project-gallery {
    position: relative;
    z-index: 1;
}

.project-info {
    background: linear-gradient(180deg, rgba(18, 26, 39, 0.9), rgba(17, 24, 39, 0.8));
    border: 1px solid rgba(38, 50, 71, 0.9);
    border-radius: 22px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(96, 165, 250, 0.08);
    padding: 32px 28px;
}

.project-info h2 {
    font-size: clamp(30px, 4vw, 46px);
    margin-bottom: 18px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.project-description {
    color: var(--sd-muted);
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 22px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.tech-stack span {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(17, 24, 39, 0.75);
    color: var(--sd-text);
    font-size: 12px;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cta-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.cta-button {
    background: var(--sd-blue);
    color: var(--sd-text);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.secondary-button {
    background: transparent;
    border: 1px solid rgba(96, 165, 250, 0.5);
    color: var(--sd-text);
}

.cta-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.cta-button:hover {
    background: var(--sd-blue-hover);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.32);
}

.secondary-button:hover {
    border-color: var(--sd-blue-hover);
    background: rgba(59, 130, 246, 0.08);
}

.project-gallery {
    overflow: hidden;
    border: 1px solid rgba(38, 50, 71, 0.9);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(11, 16, 32, 0.74));
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(59, 130, 246, 0.08);
    padding: 16px;
}

.project-track {
    display: flex;
    gap: 16px;
    width: max-content;
    min-width: 100%;
    animation: marqueeHorizontal 26s linear infinite;
}

.project-gallery:hover .project-track {
    animation-play-state: paused;
}

.project-track img {
    width: min(320px, 46vw);
    height: 220px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(38, 50, 71, 0.9);
    background: #0B1020;
}

@keyframes marqueeHorizontal {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.project-grid-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 7% 80px;
}

.section-heading {
    text-align: center;
    margin-bottom: 30px;
}

.section-heading h2 {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--sd-text);
}

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

.project-card {
    background: linear-gradient(180deg, rgba(23, 32, 51, 0.96), rgba(17, 24, 39, 0.92));
    border: 1px solid rgba(38, 50, 71, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(96, 165, 250, 0.04);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 24px 46px rgba(59, 130, 246, 0.13), 0 0 28px rgba(96, 165, 250, 0.1);
}

.project-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: #111827;
    border-bottom: 1px solid rgba(38, 50, 71, 0.9);
}

.project-card-body {
    padding: 22px 20px 20px;
}

.project-card-body h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.project-card-body p {
    color: var(--sd-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.tech-stack.compact {
    margin-bottom: 18px;
}

.project-actions.small {
    gap: 10px;
}

.project-actions.small .cta-button,
.project-actions.small .secondary-button {
    min-height: 42px;
    padding: 0 16px;
    font-size: 13px;
}

footer {
    padding: 22px 7% 26px;
    text-align: center;
    background: rgba(17, 24, 39, 0.95);
    border-top: 1px solid var(--sd-border);
    color: var(--sd-muted);
    font-size: 13px;
}

@media (max-width: 1040px) {
    .project-showcase {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
        padding: 16px 5%;
    }

    .navbar nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 9px 18px;
    }

    .navbar nav ul li a {
        font-size: 14px;
    }

    .projects-hero {
        padding-top: 70px;
    }

    .project-showcase,
    .project-grid-section {
        padding-left: 5%;
        padding-right: 5%;
    }

    .project-info {
        padding: 26px 20px;
    }

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

    .project-track img {
        height: 200px;
    }
}

@media (max-width: 560px) {
    .brand span {
        font-size: 20px;
    }

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

    .project-actions,
    .project-actions.small {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-button,
    .secondary-button {
        width: 100%;
    }

    .project-gallery {
        padding: 12px;
    }

    .project-track {
        gap: 12px;
        animation-duration: 22s;
    }

    .project-track img {
        width: min(270px, 70vw);
        height: 180px;
    }
}

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

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .project-track {
        animation: none;
    }
}
