:root {
    --font-display: 'Space Grotesk', 'Avenir Next', 'Segoe UI', sans-serif;
    --font-body: 'Manrope', 'Avenir Next', 'Segoe UI', sans-serif;

    --bg-color: #f2f5fa;
    --bg-elevated: rgba(255, 255, 255, 0.82);
    --surface-color: #ffffff;
    --surface-strong: #f8fbff;
    --text-primary: #0f172a;
    --text-secondary: #4b5563;
    --accent-color: #0ea5a8;
    --accent-hover: #0b8b8e;
    --accent: #0ea5a8;
    --accent-2: #f59e0b;
    --card-bg: #ffffff;
    --border-color: rgba(15, 23, 42, 0.12);
    --ring-color: rgba(14, 165, 168, 0.28);
    --navbar-bg: rgba(255, 255, 255, 0.72);
    --navbar-text: #0f172a;
    --shadow: 0 18px 45px -24px rgba(15, 23, 42, 0.45);
    --shadow-hover: 0 24px 60px -28px rgba(15, 23, 42, 0.5);
    --hero-gradient: radial-gradient(circle at 15% 15%, rgba(14, 165, 168, 0.24), transparent 42%),
        radial-gradient(circle at 85% 0%, rgba(245, 158, 11, 0.24), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #11324d 48%, #1c4968 100%);
    --header-height: 86px;
}

.dark {
    --bg-color: #071019;
    --bg-elevated: rgba(15, 28, 42, 0.66);
    --surface-color: #0f2233;
    --surface-strong: #11283b;
    --text-primary: #ebf4ff;
    --text-secondary: #a6bdcf;
    --accent-color: #31d3d6;
    --accent-hover: #6ce7e9;
    --accent: #31d3d6;
    --accent-2: #f8b54d;
    --card-bg: #0f2233;
    --border-color: rgba(167, 192, 214, 0.22);
    --ring-color: rgba(49, 211, 214, 0.3);
    --navbar-bg: rgba(7, 16, 25, 0.78);
    --navbar-text: #ebf4ff;
    --shadow: 0 20px 45px -24px rgba(0, 0, 0, 0.78);
    --shadow-hover: 0 26px 66px -28px rgba(0, 0, 0, 0.86);
    --hero-gradient: radial-gradient(circle at 12% 10%, rgba(49, 211, 214, 0.22), transparent 38%),
        radial-gradient(circle at 82% 8%, rgba(248, 181, 77, 0.22), transparent 34%),
        linear-gradient(142deg, #04101a 0%, #0b2133 45%, #14344f 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-color);
    line-height: 1.72;
    overflow-x: hidden;
    transition: background-color 0.35s ease, color 0.3s ease;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 500px;
    height: 500px;
    left: -190px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 168, 0.14), transparent 64%);
}

body::after {
    width: 560px;
    height: 560px;
    right: -240px;
    bottom: -220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.13), transparent 68%);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 18px;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 1.02rem;
}

a {
    color: var(--accent-color);
}

.section {
    max-width: 1140px;
    margin: 0 auto;
    padding: 88px 24px;
    position: relative;
    z-index: 2;
}

.alt-bg {
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(14, 165, 168, 0.06), transparent 48%);
}

.section-header {
    margin-bottom: 28px;
}

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

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

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(14px) saturate(170%);
    z-index: 1000;
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--navbar-text);
    text-decoration: none;
    background: #ffffff;
    border-radius: 16px;
    padding: 8px 14px 8px 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 24px -20px rgba(15, 23, 42, 0.45);
}

.logo-img {
    height: 46px;
    width: auto;
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.2));
}

.logo-text-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.02;
}

.logo-title {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f172a;
    font-family: var(--font-display);
    text-align: center;
}

.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 800;
    color: #0ea5a8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logo-subtitle::before,
.logo-subtitle::after {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: #2d62ff;
    opacity: 0.95;
}

.dark .logo-link {
    background: linear-gradient(180deg, rgba(17, 34, 52, 0.95), rgba(12, 25, 40, 0.95));
    border-color: rgba(112, 146, 177, 0.4);
    box-shadow: 0 14px 26px -18px rgba(0, 0, 0, 0.82);
}

.dark .logo-title {
    color: #f2f7ff;
}

.dark .logo-subtitle {
    color: #33d5d8;
}

.dark .logo-subtitle::before,
.dark .logo-subtitle::after {
    background: linear-gradient(90deg, #40d9dc, #78a4ff);
}

.dark .logo-img {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55)) brightness(1.06) saturate(1.12);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--navbar-text);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 7px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.mobile-menu-btn {
    display: none;
    border: none;
    background: transparent;
    color: var(--navbar-text);
    font-size: 1.65rem;
    cursor: pointer;
}

#modeToggle {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#modeToggle:hover {
    transform: translateY(-1px);
    border-color: var(--accent-color);
    background: rgba(14, 165, 168, 0.08);
}

.dark .icon-sun {
    display: inline;
}

.dark .icon-moon {
    display: none;
}

body:not(.dark) .icon-sun {
    display: none;
}

body:not(.dark) .icon-moon {
    display: inline;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 11px 20px;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(120deg, var(--accent-color), #1e8dc2);
    box-shadow: 0 12px 24px -18px rgba(14, 165, 168, 0.85);
}

.dark .btn-primary {
    color: #032633 !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px -20px rgba(14, 165, 168, 0.95);
    background: linear-gradient(120deg, var(--accent-hover), #2dbed4);
}

.nav-links .btn-primary {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: linear-gradient(120deg, #2cd7e9, #1496d3 55%, #1e6bde);
    color: #f7fcff !important;
    box-shadow: 0 16px 26px -18px rgba(34, 201, 246, 0.95);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.nav-links .btn-primary::after {
    display: none;
}

.nav-links .btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 32px -18px rgba(34, 201, 246, 1);
    background: linear-gradient(120deg, #48e2f2, #21a5e2 55%, #2a79ec);
}

.dark .nav-links .btn-primary {
    border-color: rgba(142, 210, 236, 0.44);
    color: #f7fcff !important;
    background: linear-gradient(120deg, #1cd2e0, #0e91cb 55%, #2d62ff);
}

.dark .nav-links .btn-primary:hover {
    background: linear-gradient(120deg, #37deea, #17a4d8 55%, #4d7bff);
}

.btn-secondary {
    color: #eff7ff;
    border: 1px solid rgba(239, 247, 255, 0.38);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
}

.hero {
    margin-top: var(--header-height);
    padding: 152px 24px 122px;
    background: var(--hero-gradient);
    position: relative;
    overflow: hidden;
    color: #eef8ff;
}

.hero::before {
    content: '';
    position: absolute;
    top: 54%;
    left: 50%;
    width: min(920px, 84vw);
    height: min(380px, 46vw);
    transform: translate(-50%, -50%);
    background-image: url('../assets/logo.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.08;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 15, 24, 0.05), rgba(7, 15, 24, 0.58));
}

.hero-content {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: riseIn 0.85s ease both;
}

.hero h1 {
    color: #f7fbff;
    font-size: clamp(2.2rem, 7vw, 4.3rem);
    margin-bottom: 20px;
    line-height: 1.07;
}

.hero p {
    color: rgba(239, 247, 255, 0.94);
    font-size: clamp(1.04rem, 2.2vw, 1.28rem);
    max-width: 760px;
    margin: 0 auto 34px;
}

.hero-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

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

.service-card,
.project-card,
.skill-category,
.about-card,
.contact-item {
    position: relative;
    overflow: hidden;
}

.service-card::before,
.project-card::before,
.skill-category::before,
.about-card::before,
.contact-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14, 165, 168, 0.08), transparent 42%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.service-card:hover::before,
.project-card:hover::before,
.skill-category:hover::before,
.about-card:hover::before,
.contact-item:hover::before {
    opacity: 1;
}

.about-card p:last-child,
.card p:last-child {
    margin-bottom: 0;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--accent-color);
    background: rgba(14, 165, 168, 0.12);
    border: 1px solid rgba(14, 165, 168, 0.18);
}

.dark .project-tag {
    background: rgba(49, 211, 214, 0.15);
    border-color: rgba(49, 211, 214, 0.22);
}

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

.skill-category h4 {
    font-size: 1.06rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 34px;
}

.contact-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 26px;
    text-align: center;
    box-shadow: var(--shadow);
}

.contact-icon {
    display: block;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.contact-label {
    display: block;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    font-weight: 800;
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 800;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

.footer {
    margin-top: 72px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(10, 26, 39, 0.97), rgba(7, 15, 25, 0.98));
    color: #e8f3ff;
    padding: 56px 24px;
}

.footer-content {
    max-width: 1120px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    height: 56px;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.footer p {
    color: #b7c8d8;
    margin-bottom: 0;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 22px;
}

.social-links a {
    color: #9fbed4;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
    color: #e9f6ff;
    border-color: currentColor;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: var(--header-height);
        left: 14px;
        right: 14px;
        padding: 16px;
        border-radius: 16px;
        background: var(--navbar-bg);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        gap: 10px;
    }

    .nav-links a {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .nav-links .btn-primary {
        width: 100%;
        justify-content: center;
        margin-top: 2px;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover {
        background: rgba(14, 165, 168, 0.12);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .section {
        padding: 74px 20px;
    }

    .hero {
        padding: 132px 20px 104px;
    }

    .hero::before {
        width: 88vw;
        height: 74vw;
        opacity: 0.09;
    }
}

@media (max-width: 640px) {
    .logo-img {
        height: 40px;
    }

    .logo-title {
        font-size: 0.9rem;
    }

    .logo-subtitle {
        font-size: 0.68rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 9vw, 2.8rem);
    }

    .card {
        padding: 24px;
        border-radius: 16px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .hero-btns {
        align-items: stretch;
    }
}
