/* ============================================================
   ANIKET GUPTA — PORTFOLIO REDESIGN
   Glassmorphism · Animations · Premium Dark Theme
   ============================================================ */

/* ----------  CSS CUSTOM PROPERTIES  ---------- */
:root {
    /* — Dark palette — */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #787878;
    --accent-gold: #ffdb70;
    --accent-gold-dim: #d4a844;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 219, 112, 0.25);

    /* — Glass tokens — */
    --glass-bg: rgba(20, 20, 20, 0.45);
    --glass-bg-light: rgba(30, 30, 30, 0.35);
    --glass-blur: 16px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.10);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

    /* — Radius & spacing — */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* — Transitions — */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.15s var(--ease-out-quart);
    --transition-med: 0.3s var(--ease-out-quart);
    --transition-slow: 0.5s var(--ease-out-quart);
}

/* — Light palette override — */
body.light-theme {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ebebeb;
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-muted: #86868b;
    --accent-gold: #c99f24;
    --accent-gold-dim: #a67f1b;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(201, 159, 36, 0.25);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.5);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ----------  THEME TOGGLE BUTTON  ---------- */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-med);
    /* New prominent idle animation */
    animation: rotateIn 0.8s var(--ease-out-quart) both, glowPulseIdle 2s infinite alternate;
}

@keyframes glowPulseIdle {
    0% {
        box-shadow: 0 0 10px rgba(255, 219, 112, 0.2);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 219, 112, 0.6);
        transform: scale(1.05);
    }
}

.theme-toggle:hover {
    transform: scale(1.15) rotate(15deg);
    background: var(--glass-bg-light);
    box-shadow: 0 0 25px rgba(255, 219, 112, 0.8);
    /* Pause idle animation on hover so the transform takes over cleanly */
    animation-play-state: paused;
}

.theme-toggle .sun-icon {
    display: none;
}

body.light-theme .theme-toggle .moon-icon {
    display: none;
}

body.light-theme .theme-toggle .sun-icon {
    display: block;
}

/* Smooth theme transition */
body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

.sidebar,
.main-content,
.navbar,
.about-text,
.service-item,
.testimonials-item,
.skills-item,
.contact-item {
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* ----------  SCROLL ANIMATION CLASSES  ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out-quart), transform 0.6s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s var(--ease-out-quart), transform 0.6s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s var(--ease-out-quart), transform 0.6s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ----------  KEYFRAME ANIMATIONS  ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(36px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-36px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(36px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.88);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -80% center;
    }

    100% {
        background-position: 80% center;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(255, 219, 112, 0.25);
    }

    50% {
        box-shadow: 0 0 22px rgba(255, 219, 112, 0.45);
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg) scale(0);
        opacity: 0;
    }

    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(60px, -40px) scale(1.1);
    }

    50% {
        transform: translate(-30px, -80px) scale(0.95);
    }

    75% {
        transform: translate(-60px, 20px) scale(1.05);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-50px, 50px) scale(1.08);
    }

    66% {
        transform: translate(40px, -30px) scale(0.92);
    }
}

@keyframes orbFloat3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    20% {
        transform: translate(30px, 60px) scale(1.05);
    }

    60% {
        transform: translate(-70px, -20px) scale(0.9);
    }
}

@keyframes textFlash {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    50% {
        opacity: 1;
        transform: translateY(0);
        text-shadow: 0 0 40px rgba(255, 219, 112, 0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        text-shadow: 0 0 40px rgba(255, 219, 112, 0.8);
        /* Keep the glow bright */
    }
}

@keyframes loadingFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes skillFill {
    from {
        width: 0;
    }
}

@keyframes avatarRing {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(255, 219, 112, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 219, 112, 0.12);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* ----------  BASE RESET  ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html {
    scroll-behavior: smooth;
    height: auto;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 1.65;
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

li {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}

input,
textarea {
    font: inherit;
}

/* ----------  BACKGROUND ORBS  ---------- */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translateZ(0);
}

.bg-orb--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 219, 112, 0.5), transparent 70%);
    top: -80px;
    left: -100px;
    animation: orbFloat1 18s ease-in-out infinite;
}

.bg-orb--2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(40, 40, 40, 0.7), transparent 70%);
    top: 50%;
    right: -60px;
    animation: orbFloat2 22s ease-in-out infinite;
}

.bg-orb--3 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 219, 112, 0.3), transparent 70%);
    bottom: -60px;
    left: 40%;
    animation: orbFloat3 20s ease-in-out infinite;
}

/* ----------  LOADING SCREEN  ---------- */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
    animation: loadingFadeOut 0.6s ease forwards;
}

.loading-text {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 600;
    color: var(--accent-gold);
    animation: textFlash 0.3s ease-out forwards;
    text-shadow: 0 0 30px rgba(255, 219, 112, 0.35);
}

/* ----------  MAIN LAYOUT  ---------- */
main {
    position: relative;
    z-index: 1;
    max-width: 1260px;
    margin: 20px auto;
    padding: 15px 12px;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* ----------  SIDEBAR  ---------- */
.sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    width: 300px;
    min-width: 300px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--glass-shadow);
    z-index: 10;
    animation: fadeInLeft 0.8s var(--ease-out-quart) both;
    will-change: opacity;
}

.sidebar-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.avatar-box {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--glass-bg-light);
    margin-bottom: 18px;
    animation: avatarRing 3s ease-in-out infinite;
    transition: transform var(--transition-fast);
}

.avatar-box:hover {
    transform: scale(1.05);
}

.avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    background: linear-gradient(120deg,
            var(--text-primary) 40%,
            var(--accent-gold) 48%,
            var(--accent-gold) 52%,
            var(--text-primary) 60%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite alternate;
}

.sidebar .title {
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 6px;
    display: inline-block;
    position: relative;
    z-index: 1;

    background: linear-gradient(120deg,
            var(--text-primary) 40%,
            var(--accent-gold) 48%,
            var(--accent-gold) 52%,
            var(--text-primary) 60%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite alternate;

    /* Animation initial state */
    max-width: 0;
    opacity: 0;
    padding: 4px 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease, padding 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar .title::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-bg-light);
    border-radius: 30px;
    z-index: -1;
}

.sidebar .title.revealed {
    max-width: 300px;
    opacity: 1;
    padding: 4px 14px;
}

.golden-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 219, 112, 0.8);
    z-index: 10;
    opacity: 0;
    top: -40px;
}

@keyframes dropDot {
    0% {
        top: -40px;
        opacity: 0;
        transform: translateX(-50%) scale(1);
    }

    10% {
        opacity: 1;
    }

    70% {
        top: 48px;
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    100% {
        top: 48px;
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
        /* slight squash/pause effect */
    }
}

.golden-dot.drop {
    animation: dropDot 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes crackDot {
    0% {
        width: 6px;
        opacity: 1;
    }

    50% {
        width: 100px;
        opacity: 0.5;
        background: transparent;
        box-shadow: none;
        border-top: 2px solid var(--accent-gold);
        border-bottom: 2px solid var(--accent-gold);
    }

    100% {
        width: 200px;
        opacity: 0;
    }
}

.golden-dot.crack {
    animation: crackDot 0.6s ease-out forwards;
    top: 48px;
}

.info_more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.82rem;
    color: var(--accent-gold);
    background: var(--glass-bg-light);
    border: var(--glass-border);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    animation: glowPulseIdle 2s infinite alternate;
}

.info_more-btn:hover {
    background: rgba(255, 219, 112, 0.12);
    box-shadow: 0 0 25px rgba(255, 219, 112, 0.8);
    animation-play-state: paused;
}

.info_more-btn ion-icon {
    transition: transform var(--transition-fast);
}

.sidebar.active .info_more-btn ion-icon {
    transform: rotate(180deg);
}

/* — Sidebar Expandable Section — */
.sidebar-info_more {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s var(--ease-out-quart),
        opacity 0.4s ease,
        margin 0.4s ease;
    margin-top: 0;
}

.sidebar.active .sidebar-info_more {
    max-height: 800px;
    opacity: 1;
    margin-top: 10px;
}

.separator {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), var(--accent-gold-dim), var(--border-color), transparent);
    margin: 16px 0;
}

/* — Contacts — */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sidebar.active .contact-item {
    opacity: 1;
    transform: translateX(0);
}

.sidebar.active .contact-item:nth-child(1) {
    transition-delay: 0.05s;
}

.sidebar.active .contact-item:nth-child(2) {
    transition-delay: 0.10s;
}

.sidebar.active .contact-item:nth-child(3) {
    transition-delay: 0.15s;
}

.sidebar.active .contact-item:nth-child(4) {
    transition-delay: 0.20s;
}

.contact-item .icon-box {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    border: var(--glass-border);
    color: var(--accent-gold);
    font-size: 1.15rem;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-item:hover .icon-box {
    background: rgba(255, 219, 112, 0.15);
    box-shadow: 0 0 12px rgba(255, 219, 112, 0.2);
}

.contact-info {
    text-align: left;
}

.contact-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.contact-link,
.contact-info address,
.contact-info time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: normal;
    transition: color var(--transition-fast);
}

.contact-link:hover {
    color: var(--accent-gold);
}

/* — Social links — */
.social-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 4px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--glass-bg-light);
    border: var(--glass-border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    will-change: transform;
}

.social-link:hover {
    color: var(--accent-gold);
    background: rgba(255, 219, 112, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 219, 112, 0.18);
}

/* ----------  MAIN CONTENT AREA  ---------- */
.main-content {
    flex: 1;
    min-width: 0;
    animation: fadeInRight 0.8s var(--ease-out-quart) 0.15s both;
}

/* ----------  NAVBAR  ---------- */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 6px 8px;
    margin-bottom: 22px;
    box-shadow: var(--glass-shadow);
}

.navbar-list {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.navbar-link {
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width var(--transition-fast);
}

.navbar-link:hover {
    color: var(--text-primary);
}

.navbar-link:hover::after {
    width: 40%;
}

.navbar-link.active {
    color: var(--accent-gold);
    background: rgba(255, 219, 112, 0.1);
    animation: glowPulseIdle 2s infinite alternate;
}

.navbar-link.active::after {
    width: 50%;
}

/* ----------  ARTICLES (PAGES)  ---------- */
article {
    display: none;
    animation: fadeInUp 0.6s var(--ease-out-quart) both;
}

article.active {
    display: block;
}

.article-title {
    font-size: 1.55rem;
    font-weight: 600;
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 10px;
}

.article-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    border-radius: 3px;
}

/* ----------  ABOUT PAGE  ---------- */
.about-text {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
    box-shadow: var(--glass-shadow);
}

.about-text p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 14px;
    line-height: 1.75;
    text-align: justify;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* — Services Section — */
.service {
    margin-bottom: 28px;
}

.h3.service-title,
.h3.skills-title,
.h3.form-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.service-item {
    display: flex;
    gap: 16px;
    padding: 22px;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-med), border-color var(--transition-med), box-shadow var(--transition-med);
    cursor: default;
    will-change: transform;
}

.service-item:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 219, 112, 0.08);
}

.service-icon-box {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon-box img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 6px rgba(255, 219, 112, 0.3));
    transition: transform var(--transition-fast);
}

.service-item:hover .service-icon-box img {
    transform: scale(1.15) rotate(5deg);
}

.h4.service-item-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.service-item-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ----------  RESUME PAGE  ---------- */
.resume .article-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    padding: 8px 18px;
    border-radius: 30px;
    background: var(--glass-bg-light);
    border: var(--glass-border);
    color: var(--accent-gold);
    text-decoration: none;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.download-btn:hover {
    background: rgba(255, 219, 112, 0.15);
    box-shadow: 0 0 18px rgba(255, 219, 112, 0.2);
    transform: translateY(-2px);
}

/* — Timeline — */
.timeline {
    margin-bottom: 30px;
}

.timeline .title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.timeline .title-wrapper .icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    border: var(--glass-border);
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.timeline .h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.timeline-list {
    position: relative;
    padding-left: 28px;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-gold), var(--border-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 20px 22px;
    margin-bottom: 16px;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-med), border-color var(--transition-med);
    will-change: transform;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 26px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 10px rgba(255, 219, 112, 0.4);
    z-index: 2;
}

.timeline-item:hover {
    transform: translateX(6px);
    border-color: var(--border-glow);
}

.h4.timeline-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.timeline-item span {
    font-size: 0.78rem;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255, 219, 112, 0.1);
    color: var(--accent-gold);
    margin: 6px 0 8px;
    font-weight: 500;
}

.timeline-text {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
    text-align: justify;
}

/* — Skills — */
.skill {
    margin-bottom: 28px;
}

.skills-list.content-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.skills-item .title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.h5 {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.skills-item data {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.skill-progress-bg {
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
    box-shadow: 0 0 10px rgba(255, 219, 112, 0.3);
    transition: width 1.2s var(--ease-out-quart);
}

/* Skill bars start at 0 and animate in via JS */
.skill-progress-fill[data-animated="false"] {
    width: 0 !important;
}

/* ----------  PORTFOLIO PAGE  ---------- */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.project-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--glass-bg);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-med), border-color var(--transition-med), box-shadow var(--transition-med);
    cursor: pointer;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.project-item:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 219, 112, 0.1);
}

.project-item a {
    display: block;
}

.project-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-secondary);
}

.project-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.85) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.project-item:hover .project-img::after {
    opacity: 1;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-med);
    will-change: transform;
    pointer-events: none;
    /* Prevents all explicit interactions like copying */
}

.project-item:hover .project-img img {
    transform: scale(1.05);
}

.project-title {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 18px 4px;
}

.project-category {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0 18px 16px;
}

/* ----------  PROJECT MODAL (Professional Rebuild)  ---------- */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}


/* keep modal above everything, including sidebar expand */
.project-modal {
    z-index: 20000;
}

/* removed sheet logic */


.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal .modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.98), rgba(10, 10, 10, 1));
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}


.project-modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}


.modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto 8px;
    flex-shrink: 0;
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 500;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* — Fixed Header Layer — */
.modal-header-fixed {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-img-wrapper {
    margin: 60px 15px 0;
    width: calc(100% - 30px);
    height: 270px;
    background: #000;
    overflow: hidden;
    border-radius: 16px;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.4s var(--ease-out-quart), transform 0.4s var(--ease-out-quart);
}



.project-modal.active .modal-img-wrapper {
    opacity: 1;
    transform: scale(1);
}


.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    pointer-events: none;
    /* Prevents all explicit interactions like copying */
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 16px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s var(--ease-out-quart), transform 0.3s var(--ease-out-quart);
    transition-delay: 0.1s;
}

.project-modal.active .modal-title {
    opacity: 1;
    transform: translateX(0);
}


.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-gold-dim), var(--accent-gold));
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease, opacity 0.3s var(--ease-out-quart), transform 0.3s var(--ease-out-quart);
    text-wrap: nowrap;
    opacity: 0;
    transform: scale(0.85);
    transition-delay: 0.15s;
    animation: glowPulseIdle 2s infinite alternate;
}

.project-modal.active .visit-btn {
    opacity: 1;
    transform: scale(1);
}

.visit-btn:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 16px rgba(255, 219, 112, 0.3);
    animation-play-state: paused;
}

.visit-btn.disabled {
    background: var(--glass-bg-light);
    color: var(--text-muted);
    cursor: default;
    border: var(--glass-border);
    animation: none;
}


/* — Scrollable Body Layer — */
.modal-body-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
    padding-bottom: 30px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s var(--ease-out-quart), transform 0.35s var(--ease-out-quart);
    transition-delay: 0.2s;
    text-align: justify;
}

.project-modal.active .modal-description {
    opacity: 1;
    transform: translateY(0);
}


/* — Mobile Optimization — */
@media (max-width: 580px) {
    .project-modal .modal-content {
        max-height: 95vh;
        border-radius: 24px;
    }


    .modal-img-wrapper {
        height: 190px;
        margin: 55px 12px 0;
        width: calc(100% - 24px);
    }



    .modal-title-row {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 12px;
    }

    .modal-title {
        font-size: 1.15rem;
        text-align: center;
    }

    .visit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .modal-body-scrollable {
        padding: 20px;
    }
}

/* — Testimonials modal — */
.modal-container {
    display: none;
}

.testimonials-modal {
    display: none;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg-light);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

.filter-select-box[hidden] {
    display: none;
}

/* ----------  CONTACT PAGE  ---------- */
.mapbox {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: var(--glass-border);
    margin-bottom: 24px;
    box-shadow: var(--glass-shadow);
}

.mapbox figure {
    height: 280px;
}

.mapbox iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: grayscale(0.3) brightness(0.85);
}

.contact-form {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--glass-shadow);
}

.input-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 219, 112, 0.12), 0 0 20px rgba(255, 219, 112, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 130px;
    margin-bottom: 14px;
}

.form-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-gold-dim), var(--accent-gold));
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 219, 112, 0.3);
}

.form-btn:active {
    transform: translateY(0);
}

.form-btn ion-icon {
    font-size: 1.1rem;
}

/* ----------  SCROLL REVEAL  ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.4s var(--ease-out-quart),
        transform 0.4s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-28px);
    transition: opacity 0.4s var(--ease-out-quart),
        transform 0.4s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s var(--ease-out-quart),
        transform 0.4s var(--ease-out-quart);
    will-change: opacity, transform;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ----------  CUSTOM SCROLLBAR  ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 219, 112, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 219, 112, 0.35);
}


/* ==========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================== */

/* — Small mobile — */
@media (max-width: 450px) {
    main {
        flex-direction: column;
        padding: 10px 8px;
        margin: 10px auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        max-height: unset;
        overflow-y: visible;
        border-radius: var(--radius-lg);
        padding: 22px 18px;
    }

    .avatar-box {
        width: 100px;
        height: 100px;
    }

    .name {
        font-size: 1.25rem;
    }

    .navbar-list {
        flex-wrap: wrap;
        gap: 2px;
    }

    .navbar-link {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .service-list {
        grid-template-columns: 1fr;
    }

    .input-wrapper {
        grid-template-columns: 1fr;
    }

    .project-list {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.25rem;
    }
}

/* — Large mobile — */
@media (min-width: 451px) and (max-width: 580px) {
    main {
        flex-direction: column;
        padding: 12px 10px;
        margin: 10px auto;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        max-height: unset;
        overflow-y: visible;
        border-radius: var(--radius-lg);
        padding: 24px 20px;
    }

    .service-list {
        grid-template-columns: 1fr;
    }

    .project-list {
        grid-template-columns: 1fr;
    }

    .input-wrapper {
        grid-template-columns: 1fr;
    }
}

/* — Tablet — */
@media (min-width: 581px) and (max-width: 768px) {
    main {
        flex-direction: column;
        padding: 14px 14px;
        margin: 12px auto;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        max-height: unset;
        overflow-y: visible;
        border-radius: var(--radius-lg);
    }

    .sidebar-info {
        flex-direction: row;
        text-align: left;
        gap: 18px;
    }

    .avatar-box {
        margin-bottom: 0;
    }

    .info_more-btn {
        display: none;
    }

    .sidebar-info_more {
        max-height: none;
        opacity: 1;
        margin-top: 10px;
    }

    .contacts-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .contact-item {
        opacity: 1;
        transform: none;
    }
}

/* — Small desktop — */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
        padding: 22px;
    }

    main {
        gap: 18px;
    }

    /* make project grid slightly tighter on tablets */
    .project-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    /* expand modal to use full screen and adjust padding */
    .project-modal .modal-content {
        max-width: 600px;
        height: auto;
        max-height: 85vh;
        border-radius: 24px;
    }


    .modal-img-wrapper {
        height: 240px;
    }


    .modal-title-row {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 22px;
        gap: 10px;
    }

    .visit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .modal-body-scrollable {
        padding: 22px;
    }
}

/* treat smaller phones the same way */
/* removed mobile full height override */


/* — Large desktop — */
@media (min-width: 1250px) {
    main {
        max-width: 1340px;
        gap: 30px;
    }

    .sidebar {
        width: 320px;
        min-width: 320px;
    }
}

/* — Remove hover effects on touch — */
@media (hover: none) {

    .service-item:hover,
    .project-item:hover,
    .timeline-item:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.10);
        box-shadow: var(--glass-shadow);
    }

    .project-item:hover .project-img img {
        transform: none;
    }
}

/* — Professional Modal Body Lock — */
body.modal-open-lock {
    position: fixed;
    width: 100%;
    overflow-y: scroll;
    /* Prevents layout shift by forcing scrollbar visibility */
}

/* ==========================================================
   IMAGE VIEWER (LIGHTBOX)
   ========================================================== */
.image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-med), visibility var(--transition-med);
}

.image-viewer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-viewer-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    padding: 20px;
}

.image-viewer-img-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    min-height: 0;
    /* Critical for flex child to shrink below intrinsic img size */
}

#image-viewer-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    pointer-events: none;
    /* Prevents all explicit interactions like copying */
}

.image-viewer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.image-viewer-close,
.image-viewer-nav {
    background: var(--glass-bg-light);
    border: var(--glass-border);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-fast);
}

.image-viewer-close {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
}

.image-viewer-nav {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
}

.image-viewer-close:hover,
.image-viewer-nav:hover {
    background: rgba(255, 219, 112, 0.2);
    color: var(--accent-gold);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--border-glow);
}

.image-viewer-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.image-viewer-nav[style*="display: none"] {
    display: none !important;
}

.image-viewer-indicators {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.image-viewer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: var(--glass-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.image-viewer-dot.active {
    background: var(--accent-gold);
    transform: scale(1.4);
    box-shadow: 0 0 8px var(--border-glow);
}

.image-viewer-dot:hover {
    background: var(--text-primary);
}

/* Hover effect on modal image wrapper */
.modal-img-wrapper:hover .view-image-overlay {
    opacity: 1 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .image-viewer-content {
        padding: 10px;
    }

    .image-viewer-controls {
        gap: 15px;
    }

    .image-viewer-close {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }

    .image-viewer-nav {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
}