:root {
    --bg-primary: #071312;
    --bg-secondary: #0d201e;
    --bg-card: rgba(13, 32, 30, 0.86);
    --primary: #14b8a6;
    --primary-dark: #0f766e;
    --secondary: #f59e0b;
    --accent: #38bdf8;
    --accent-green: #22c55e;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(45, 212, 191, 0.24);
    --border-hover: rgba(56, 189, 248, 0.45);
    --glass: rgba(13, 32, 30, 0.76);
    --glass-border: rgba(226, 232, 240, 0.12);
    --glow-blue: rgba(20, 184, 166, 0.24);
    --glow-purple: rgba(245, 158, 11, 0.18);
    --glow-cyan: rgba(56, 189, 248, 0.22);
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bg: #071312;
    --bg2: #0d201e;
    --text: #f8fafc;
    --text2: #cbd5e1;
    --text3: #94a3b8;
}

html {
    text-size-adjust: 100%;
}

body {
    background:
        linear-gradient(135deg, rgba(7, 19, 18, 0.98), rgba(10, 29, 28, 0.98)),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
}

img,
svg,
video {
    max-width: 100%;
}

:where(h1, h2, h3, h4, h5, h6, .nav-logo, .footer-logo, .logo-text, .login-title, .page-title, .section-title, .hero-name, .hero-role, .project-title, .service-title, .skill-name, .author-name, .table-title, .form-card-header, .widget-title, .section-heading, .stat-num, .stat-number, .empty-title, .highlight-title) {
    font-family: var(--font-display) !important;
    letter-spacing: 0 !important;
}

:where(.section-label, .hero-badge, .float-label, .timeline-year, .skill-level-text, .project-category-badge, .project-featured-badge, .tech-tag, .form-label, .info-label, .tech-chip, .project-breadcrumb, .nav-section-label, .logo-sub, .nav-badge, .stat-change, .data-table th, .badge, .range-val, .hint-code) {
    font-family: var(--font-body) !important;
    letter-spacing: 0.01em !important;
}

::selection {
    background: rgba(20, 184, 166, 0.32);
    color: var(--text-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
}

.bg-gradient-mesh,
.bg-gradient,
.bg {
    background:
        radial-gradient(circle at 12% 12%, rgba(20, 184, 166, 0.15), transparent 34%),
        radial-gradient(circle at 86% 18%, rgba(56, 189, 248, 0.12), transparent 32%),
        linear-gradient(135deg, rgba(7, 19, 18, 0.94), rgba(15, 50, 45, 0.82)) !important;
}

.bg-grid {
    background-image:
        linear-gradient(rgba(45, 212, 191, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 212, 191, 0.055) 1px, transparent 1px) !important;
}

.section-container,
.nav-container,
.container {
    width: min(calc(100% - 2rem), 1180px);
    max-width: 1180px !important;
    padding-inline: 0 !important;
}

:where(.section-container, .nav-container, .container, .hero-grid, .hero-content, .about-grid, .contact-grid, .project-hero-grid, .project-content, .project-card, .service-card, .skill-card, .contact-form, .topbar, .topbar-left, .topbar-right) {
    min-width: 0;
}

:where(.hero-name, .hero-role, .hero-desc, .section-title, .section-subtitle, .project-title, .project-desc, .service-desc, .testimonial-text, .contact-info-value, p, h1, h2, h3) {
    overflow-wrap: break-word;
}

.navbar {
    padding: 0.9rem 0 !important;
}

.navbar.scrolled,
.navbar {
    background: rgba(7, 19, 18, 0.9) !important;
    border-bottom-color: var(--glass-border) !important;
}

.nav-container {
    gap: 1rem;
}

.nav-logo,
.footer-logo,
.logo-text {
    background: linear-gradient(135deg, var(--text-primary), var(--primary) 58%, var(--accent)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.nav-links {
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary) !important;
    font-size: 0.94rem !important;
    font-weight: 600 !important;
}

.nav-links a:hover,
.nav-back:hover,
.footer-links a:hover {
    color: var(--primary) !important;
    background: rgba(20, 184, 166, 0.1) !important;
}

.nav-toggle,
.mobile-close,
.scroll-top,
.slider-btn,
.sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
}

.nav-toggle,
.mobile-close,
.sidebar-toggle {
    position: relative;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045) !important;
    color: var(--text-primary) !important;
}

.nav-toggle i,
.mobile-close i,
.sidebar-toggle i {
    display: none;
}

.nav-toggle::before,
.sidebar-toggle::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.mobile-close::before {
    content: "x";
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
}

.mobile-menu {
    z-index: 1200 !important;
    overflow-y: auto;
}

.mobile-menu a {
    font-family: var(--font-body) !important;
    font-size: clamp(1rem, 4.8vw, 1.2rem) !important;
    font-weight: 700 !important;
}

.glass-card,
.project-card,
.service-card,
.testimonial-card,
.contact-form,
.contact-info-card,
.skill-card,
.highlight-card,
.project-info-card,
.sidebar-widget,
.project-stat,
.related-card,
.feature-item,
.gallery-item,
.form-card,
.data-table-wrap,
.stat-card,
.login-card {
    background: linear-gradient(180deg, rgba(15, 41, 38, 0.86), rgba(9, 24, 23, 0.84)) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2) !important;
}

.glass-card:hover,
.project-card:hover,
.service-card:hover,
.skill-card:hover,
.contact-info-card:hover,
.related-card:hover,
.stat-card:hover {
    border-color: var(--border-hover) !important;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28), 0 0 28px rgba(20, 184, 166, 0.12) !important;
}

.btn,
.topbar-btn,
.btn-login,
.filter-btn,
.skill-tab,
.action-btn,
.nav-back {
    border-radius: 8px !important;
}

.btn,
.topbar-btn,
.btn-login {
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.topbar-btn.primary,
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 34px rgba(20, 184, 166, 0.26) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03) !important;
}

.filter-btn.active,
.filter-btn:hover,
.skill-tab.active,
.skill-tab:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.section-label,
.hero-badge,
.project-category-tag,
.project-category-badge,
.tech-tag,
.tech-chip,
.badge-blue {
    background: rgba(20, 184, 166, 0.12) !important;
    border-color: rgba(20, 184, 166, 0.28) !important;
    color: var(--primary) !important;
}

.project-featured-badge,
.badge-yellow {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.hero-name {
    font-size: clamp(2.7rem, 8vw, 5.2rem) !important;
    line-height: 1.05 !important;
    background: linear-gradient(180deg, #ffffff, #d9fff8 52%, rgba(203, 213, 225, 0.78)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.hero-role {
    align-items: flex-start !important;
    flex-wrap: wrap;
    line-height: 1.25 !important;
}

.typed-text,
.cursor {
    color: var(--primary) !important;
}

.hero-desc,
.section-subtitle,
.project-desc,
.service-desc,
.testimonial-text,
.highlight-desc,
.project-full-desc,
.related-desc,
.empty-desc,
.contact-info-label,
.footer-copy {
    color: var(--text-secondary) !important;
}

#hero {
    min-height: auto !important;
    padding: clamp(7rem, 9vw, 9.5rem) 0 clamp(4rem, 7vw, 6rem) !important;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr) !important;
    gap: clamp(2rem, 5vw, 4rem) !important;
}

.hero-desc {
    max-width: 62ch !important;
    font-size: clamp(1rem, 2vw, 1.12rem) !important;
}

.hero-actions {
    gap: 0.85rem !important;
}

.hero-stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem !important;
    border-top: 0 !important;
    padding-top: 0 !important;
}

.stat-item {
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.hero-avatar-wrap {
    width: min(100%, 360px) !important;
    height: auto !important;
    aspect-ratio: 1;
}

.hero-avatar-ring {
    background: conic-gradient(from 0deg, var(--primary), var(--accent), var(--secondary), var(--primary)) !important;
}

.avatar-placeholder,
.about-image-container,
.project-thumb,
.gallery-item {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(56, 189, 248, 0.1)) !important;
}

.hero-float-card {
    border-radius: 8px !important;
    background: rgba(13, 32, 30, 0.86) !important;
}

#about,
#skills,
#projects,
#services,
#testimonials,
#contact {
    padding-block: clamp(4rem, 8vw, 7rem) !important;
}

.projects-list-page #projects {
    padding-top: clamp(7rem, 10vw, 8.5rem) !important;
}

.projects-list-page .navbar {
    min-height: 74px;
    display: flex;
    align-items: center;
}

.projects-list-page .nav-container {
    min-height: 48px;
}

.about-grid,
.contact-grid {
    gap: clamp(2rem, 5vw, 4rem) !important;
}

.about-highlights,
.project-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

.skills-grid,
.services-grid,
.projects-grid,
.project-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
}

.project-card,
.service-card,
.skill-card,
.testimonial-card {
    overflow: hidden;
}

.project-thumb {
    height: auto !important;
    aspect-ratio: 16 / 10;
}

.project-body,
.service-card,
.testimonial-card,
.contact-form {
    padding: clamp(1rem, 3vw, 2rem) !important;
}

.project-actions,
.hero-actions {
    align-items: stretch;
}

.testimonial-card {
    min-width: min(380px, calc(100vw - 2rem)) !important;
}

.testimonials-slider {
    overflow: hidden;
}

.contact-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
}

.contact-info-card {
    min-width: 0;
}

.contact-info-value {
    overflow-wrap: anywhere;
}

.form-control,
.table-search {
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.055) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-primary) !important;
}

.form-control:focus,
.table-search:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16) !important;
}

.form-control::placeholder {
    color: rgba(203, 213, 225, 0.58) !important;
}

.project-hero-grid,
.project-content {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
    gap: clamp(2rem, 5vw, 4rem) !important;
}

.project-detail-page main {
    padding-top: clamp(6.75rem, 9vw, 8rem) !important;
}

.project-detail-page .navbar {
    min-height: 74px;
    display: flex;
    align-items: center;
}

.project-detail-page .project-hero {
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2.25rem, 4vw, 3rem) !important;
}

.project-detail-page .nav-container {
    min-height: 48px;
}

.project-detail-page .nav-back {
    white-space: nowrap;
}

.project-detail-page .project-breadcrumb {
    row-gap: 0.35rem;
    line-height: 1.5;
    max-width: 100%;
}

.project-title {
    overflow-wrap: anywhere;
}

.project-card .project-title {
    font-size: 1.12rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
}

.project-hero .project-title {
    font-size: clamp(1.95rem, 3.4vw, 3.15rem) !important;
    line-height: 1.14 !important;
    max-width: 860px;
    text-wrap: balance;
}

.lightbox img {
    border-radius: 8px !important;
}

footer {
    background: rgba(6, 18, 17, 0.56);
}

/* Admin */
.sidebar {
    background: linear-gradient(180deg, #0d201e, #081715) !important;
    border-right-color: var(--glass-border) !important;
}

.logo-icon,
.user-avatar,
.service-icon-wrap,
.contact-icon {
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.topbar {
    background: rgba(13, 32, 30, 0.92) !important;
    border-bottom-color: var(--glass-border) !important;
    backdrop-filter: blur(18px);
}

.content-area {
    background:
        linear-gradient(135deg, rgba(7, 19, 18, 0.98), rgba(10, 29, 28, 0.96)),
        var(--bg) !important;
}

.sidebar-toggle {
    display: none;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.nav-item a {
    border-radius: 8px !important;
}

.nav-item a:hover,
.nav-item a.active {
    background: rgba(20, 184, 166, 0.12) !important;
    color: var(--text) !important;
}

.data-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    min-width: 720px;
}

.data-table th,
.data-table td {
    white-space: nowrap;
}

.data-table td:nth-child(2),
.data-table td:nth-child(3) {
    white-space: normal;
}

.action-btns {
    flex-wrap: nowrap;
}

.login-wrap {
    width: min(100%, 440px) !important;
}

.login-card {
    padding: clamp(1.4rem, 6vw, 2.5rem) !important;
}

.login-title {
    background: linear-gradient(135deg, #ffffff, #bffbf1) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.logo-mark {
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.whatsapp-float {
    position: fixed;
    right: 2rem;
    bottom: 5.5rem;
    z-index: 5000;
    min-width: 58px;
    width: auto;
    height: 58px;
    padding: 0 1.05rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 36px rgba(18, 140, 126, 0.34);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.whatsapp-float span {
    font-weight: 800;
    font-size: 0.95rem;
}

.whatsapp-float:hover {
    color: #ffffff;
    transform: translateY(-3px);
    filter: brightness(1.04);
    box-shadow: 0 20px 46px rgba(18, 140, 126, 0.42);
}

.whatsapp-float i {
    font-size: 1.85rem;
}

.whatsapp-float::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 1px solid rgba(37, 211, 102, 0.22);
}

@media (max-width: 1024px) {
    .section-container,
    .nav-container,
    .container {
        width: min(calc(100% - 1.5rem), 1180px);
    }

    .hero-grid,
    .about-grid,
    .contact-grid,
    .project-hero-grid,
    .project-content {
        grid-template-columns: 1fr !important;
    }

    .hero-visual {
        order: 0 !important;
    }

    .project-info-card {
        position: static !important;
    }
}

@media (max-width: 900px) {
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.32);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrap {
        margin-left: 0 !important;
    }

    .topbar {
        gap: 0.8rem;
        padding: 0.85rem 1rem !important;
    }

    .topbar-left {
        min-width: 0;
    }

    .topbar-right {
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .content-area {
        padding: 1rem !important;
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .bg-canvas,
    .navbar {
        left: 0 !important;
        right: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow: hidden;
    }

    .bg-gradient-mesh {
        animation: none !important;
        transform: none !important;
    }

    .section-container,
    .nav-container,
    .container {
        width: min(calc(100vw - 1rem), 1180px) !important;
        max-width: min(calc(100vw - 1rem), 1180px) !important;
    }

    @supports (width: 100dvw) {
        html,
        body {
            max-width: 100dvw;
        }

        .bg-canvas,
        .navbar,
        .mobile-menu {
            width: 100dvw !important;
            max-width: 100dvw !important;
        }

        .section-container,
        .nav-container,
        .container {
            width: min(calc(100dvw - 1rem), 1180px) !important;
            max-width: min(calc(100dvw - 1rem), 1180px) !important;
        }
    }

    .nav-links,
    .nav-cta {
        display: none !important;
    }

    .whatsapp-float {
        right: 1rem;
        bottom: 5rem;
        min-width: 54px;
        height: 54px;
        padding: 0 0.9rem;
    }

    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu {
        padding: 5rem 1.25rem 2rem !important;
        left: 0 !important;
        right: auto !important;
    }

    .hero-grid {
        text-align: left;
    }

    .hero-actions,
    .project-actions {
        flex-direction: column;
    }

    .hero-actions .btn,
    .project-actions .btn,
    .contact-form .btn {
        width: 100%;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero-avatar-wrap {
        width: min(100%, 260px) !important;
        margin-inline: auto;
    }

    .hero-float-card {
        display: none !important;
    }

    .about-highlights,
    .project-stats,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .contact-info-card {
        align-items: flex-start;
    }

    .project-card,
    .project-body,
    .project-thumb {
        max-width: 100%;
    }

    .project-card .project-title,
    .project-card .project-desc {
        white-space: normal !important;
        overflow-wrap: break-word;
    }

    #projects .project-card .project-title {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        font-weight: 800 !important;
        margin-bottom: 0.45rem !important;
    }

    .project-breadcrumb {
        flex-wrap: wrap;
    }

    .nav-back {
        padding-inline: 0.75rem !important;
    }

    .project-detail-page main {
        padding-top: 6.5rem !important;
    }

    .project-detail-page .navbar {
        min-height: 78px;
    }

    .project-detail-page .nav-container {
        align-items: center;
        gap: 0.75rem;
    }

    .project-detail-page .nav-logo {
        flex: 0 0 auto;
    }

    .project-detail-page .nav-back {
        max-width: calc(100vw - 5.75rem);
        justify-content: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .project-detail-page .project-hero {
        padding-top: 1.75rem !important;
    }

    .projects-list-page #projects {
        padding-top: 7rem !important;
    }

    .projects-list-page .navbar {
        min-height: 78px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    body {
        overflow-y: auto;
    }
}

@media (max-width: 520px) {
    .section-container,
    .nav-container,
    .container {
        width: min(calc(100% - 1rem), 1180px);
    }

    #hero {
        padding-top: 6.25rem !important;
    }

    .hero-name {
        font-size: clamp(2.35rem, 13vw, 3.25rem) !important;
    }

    .section-title {
        font-size: clamp(1.85rem, 10vw, 2.35rem) !important;
    }

    .section-title span {
        display: block;
    }

    #projects .project-card .project-title {
        font-size: 0.9rem !important;
        line-height: 1.28 !important;
        letter-spacing: 0 !important;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: break-word;
    }

    #projects .project-card .project-desc {
        font-size: 0.8rem !important;
        line-height: 1.55 !important;
    }

    .project-hero .project-title {
        font-size: clamp(1.55rem, 8vw, 2.05rem) !important;
        line-height: 1.18 !important;
    }

    .project-detail-page main {
        padding-top: 6.25rem !important;
    }

    .project-detail-page .nav-back {
        max-width: calc(100vw - 5.25rem);
        font-size: 0.82rem !important;
        padding-inline: 0.65rem !important;
    }

    .project-detail-page .project-hero {
        padding-top: 1.35rem !important;
    }

    .projects-list-page #projects {
        padding-top: 6.75rem !important;
    }

    .skills-tabs,
    .projects-filter {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .skill-tab,
    .filter-btn {
        width: 100%;
    }

    .topbar {
        align-items: flex-start !important;
    }

    .topbar-right .topbar-btn {
        padding-inline: 0.65rem !important;
    }

    .login-wrap {
        padding: 1rem !important;
    }
}
