:root {
    color-scheme: dark;
}

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

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 30%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 26%),
        linear-gradient(180deg, #020617 0%, #0f172a 55%, #020617 100%);
}

.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.navbar.hide {
    transform: translateY(-100%);
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.10), transparent 24%),
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.10), transparent 22%),
        linear-gradient(to right, #f8fafc, #eef2ff);
    color: #111827;
}

img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.page-shell {
    position: relative;
}

.hamburger {
    position: relative;
    z-index: 55;
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    color: #f8fafc;
}

.hamburger:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.16);
}

.hamburger:active {
    transform: scale(1.0);
}

.hamburger-line {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.hamburger.is-open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(6px);
}

    .mobile-menu .flex > a,
    .mobile-menu .flex > button {
        padding: 12px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        font-size: 0.95rem !important;
        transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    }

    .mobile-menu .flex > a:hover,
    .mobile-menu .flex > button:hover {
        background: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
    }

    .mobile-menu .flex > a:active,
    .mobile-menu .flex > button:active {
        transform: scale(0.99);
    }
.project-card:active {
    transform: scale(0.99);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.20), transparent 20%),
        radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.16), transparent 26%);
    pointer-events: none;
}

html[data-theme="light"] .hero::before {
    background:
        radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.10), transparent 18%),
        radial-gradient(circle at 82% 0%, rgba(14, 165, 233, 0.10), transparent 24%);
}

.project-card img {
    transition: transform 0.4s ease;
}

.project-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.project-card:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.7);
    outline-offset: 4px;
}

.project-card:hover img {
    transform: scale(1.03);
}

.project-card,
.rounded-\[2rem\],
.rounded-3xl {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.project-card:hover,
.rounded-\[2rem\]:hover,
.rounded-3xl:hover {
    transform: translateY(-5px);
}

.action-btn.is-active {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.12);
}

#search-results a:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .page-shell {
    color: #111827;
}

html[data-theme="light"] header.sticky {
    background: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(229, 231, 235, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] body,
html[data-theme="light"] .text-white {
    color: #111827 !important;
}

html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200,
html[data-theme="light"] .text-slate-300,
html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500 {
    color: #374151 !important;
    opacity: 1 !important;
}

html[data-theme="light"] .text-cyan-200,
html[data-theme="light"] .text-cyan-300,
html[data-theme="light"] .text-violet-200 {
    color: #4f46e5 !important;
    opacity: 1 !important;
}

html[data-theme="light"] .bg-slate-950,
html[data-theme="light"] .bg-slate-900\/70,
html[data-theme="light"] .bg-slate-900\/60,
html[data-theme="light"] .bg-white\/5,
html[data-theme="light"] .bg-white\/10 {
    background: rgba(255, 255, 255, 0.82) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .border-white\/10,
html[data-theme="light"] .border-cyan-400\/20 {
    border-color: #e5e7eb !important;
}

html[data-theme="light"] .rounded-\[2rem\],
html[data-theme="light"] .rounded-3xl,
html[data-theme="light"] .rounded-2xl,
html[data-theme="light"] .project-card {
    border-color: #e5e7eb !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .project-card,
html[data-theme="light"] .rounded-\[2rem\] {
    background: rgba(255, 255, 255, 0.82) !important;
}

html[data-theme="light"] .shadow-neon {
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.14) !important;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    color: #111827 !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
}

html[data-theme="light"] .hero h1 {
    color: #111827 !important;
    text-shadow: none;
}

html[data-theme="light"] .hero p {
    opacity: 1 !important;
}

html[data-theme="light"] a.rounded-full.bg-white,
html[data-theme="light"] button.rounded-full.bg-white,
html[data-theme="light"] input.rounded-full.bg-white,
html[data-theme="light"] .rounded-full.bg-white {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 16px 32px rgba(99, 102, 241, 0.24) !important;
}

html[data-theme="light"] a.rounded-full.bg-white:hover,
html[data-theme="light"] button.rounded-full.bg-white:hover,
html[data-theme="light"] input.rounded-full.bg-white:hover,
html[data-theme="light"] .rounded-full.bg-white:hover {
    transform: scale(1.05);
}

html[data-theme="light"] .hero a.rounded-full.border,
html[data-theme="light"] nav a,
html[data-theme="light"] button#theme-toggle,
html[data-theme="light"] form button.rounded-full.border {
    color: #374151 !important;
}

html[data-theme="light"] .hero a.rounded-full.border,
html[data-theme="light"] .rounded-full.border,
html[data-theme="light"] .action-btn {
    border-color: #d1d5db !important;
    background: rgba(255, 255, 255, 0.72) !important;
}

html[data-theme="light"] .hero a.rounded-full.border:hover,
html[data-theme="light"] .rounded-full.border:hover,
html[data-theme="light"] .action-btn:hover,
html[data-theme="light"] #search-results a:hover {
    background: rgba(238, 242, 255, 0.95) !important;
    border-color: #c7d2fe !important;
}

html[data-theme="light"] .action-btn.is-active {
    background: rgba(99, 102, 241, 0.10) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #312e81 !important;
}

html[data-theme="light"] .page-shell main {
    padding-bottom: 2rem;
}

html[data-theme="light"] section {
    animation: fade-in-up 0.45s ease;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .mobile-menu {
        background: #111827;
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    }
}

html[data-theme="light"] .mobile-menu {
    background: rgba(255, 255, 255, 0.96);
    border-color: #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .mobile-menu a {
    color: #374151;
}

html[data-theme="light"] .mobile-menu a:hover {
    background: rgba(238, 242, 255, 0.95);
    color: #111827;
}

@media (max-width: 768px) {
    .theme-btn {
        display: none !important;
    }

    body {
        -webkit-tap-highlight-color: transparent;
    }

    .mx-auto.max-w-7xl,
    .mx-auto.max-w-6xl,
    .mx-auto.max-w-5xl {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    section {
        margin-bottom: 16px;
    }

    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
    }

    p,
    li,
    input,
    textarea,
    select,
    button,
    a {
        line-height: 1.5;
    }

    body,
    p,
    li,
    input,
    textarea,
    select,
    button {
        font-size: 0.95rem;
    }

    .hero .max-w-4xl,
    .hero .max-w-2xl {
        max-width: 100%;
    }

    .hero .space-y-8 {
        gap: 1.25rem;
    }

    .hero a.rounded-full,
    .rounded-full.bg-white,
    .rounded-full.border,
    .action-btn,
    form button,
    form input[type="submit"] {
        width: 100%;
        justify-content: center;
    }

    .grid,
    .md\:grid-cols-2,
    .lg\:grid-cols-\[1\.15fr_0\.85fr\],
    .lg\:grid-cols-\[1\.1fr_0\.9fr\],
    .lg\:grid-cols-\[360px_1fr\] {
        grid-template-columns: 1fr !important;
    }

    .grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .container,
    .mx-auto,
    .max-w-7xl,
    .max-w-6xl,
    .max-w-5xl,
    .main-content,
    .page-shell,
    .project-list {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    html,
    body,
    section,
    article,
    .project-card,
    .container {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    * {
        min-width: 0 !important;
    }

    [class*="absolute"],
    [style*="position:absolute"] {
        max-width: 100vw !important;
    }

    .project-card {
        width: 100%;
    }

    .project-card .p-5,
    .rounded-\[2rem\].p-8,
    .rounded-\[2rem\].p-6,
    .rounded-3xl.p-5,
    .rounded-3xl.p-4 {
        padding: 1rem !important;
    }

    .project-card .flex.items-start.justify-between,
    .project-card .flex.items-center.justify-between,
    .flex.items-center.justify-between,
    .flex.flex-wrap.items-start.justify-between {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .project-card .rounded-2xl {
        align-self: flex-start;
    }

    .project-card .text-lg {
        font-size: 1rem !important;
    }

    .h-\[340px\] {
        height: auto !important;
        min-height: 220px;
    }

    .h-52 {
        height: 200px !important;
    }

    form.space-y-6 > *,
    form.space-y-5 > *,
    form.space-y-4 > * {
        margin-top: 0 !important;
    }

    form.space-y-6,
    form.space-y-5,
    form.space-y-4 {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    #mobileMenu a,
    #mobileMenu button,
    #menuToggle {
        min-height: 44px;
    }

    #search-results {
        max-height: 50vh;
        overflow-y: auto;
    }
}
