/* ============================================
   Portfolio — Fonts + Tailwind Overrides
   Polices : Montserrat Alternates + Manrope
   ============================================ */

/* ---- Fonts ---- */
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-Light.ttf') format('truetype');
    font-weight: 300;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-Regular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-Medium.ttf') format('truetype');
    font-weight: 500;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-SemiBold.ttf') format('truetype');
    font-weight: 600;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-Bold.ttf') format('truetype');
    font-weight: 700;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-ExtraBold.ttf') format('truetype');
    font-weight: 800;
}
@font-face {
    font-family: 'Montserrat Alternates';
    src: url('/static/font/Montserrat/MontserratAlternates-Italic.ttf') format('truetype');
    font-style: italic;
    font-weight: 400;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-Light.ttf') format('truetype');
    font-weight: 300;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-Regular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-Medium.ttf') format('truetype');
    font-weight: 500;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-SemiBold.ttf') format('truetype');
    font-weight: 600;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-Bold.ttf') format('truetype');
    font-weight: 700;
}
@font-face {
    font-family: 'Manrope';
    src: url('/static/font/Manrope/static/Manrope-ExtraBold.ttf') format('truetype');
    font-weight: 800;
}

/* ---- Base ---- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Fade-in animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Loader ---- */
#loader {
    position: fixed;
    inset: 0;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Glass navbar ---- */
.nav-glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ---- Mobile menu ---- */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Form focus/error ---- */
.form-input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input.error {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08);
}

/* ---- Button loader ---- */
.btn-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

/* ---- CV button ---- */
.cv-card {
    position: relative;
    overflow: hidden;
}

.cv-orbit {
    position: absolute;
    top: -70px;
    right: -30px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    border: 1px dashed rgba(99, 102, 241, 0.35);
    opacity: 0.7;
    animation: cv-orbit 9s linear infinite;
    pointer-events: none;
}

.cv-orbit__dot {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.6);
    transform: translateX(-50%);
}

.cv-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.cv-note {
    margin: 0 0 18px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.cv-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 26px;
    border-radius: 999px;
    background: linear-gradient(120deg, #0f172a 0%, #4f46e5 45%, #ec4899 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 18px 36px rgba(79, 70, 229, 0.25), 0 6px 16px rgba(15, 23, 42, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    isolation: isolate;
}

.cv-button__shine {
    position: absolute;
    top: -40%;
    left: -30%;
    width: 70%;
    height: 180%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
    transform: translateX(-140%) rotate(12deg);
    transition: transform 0.7s ease;
    z-index: 0;
}

.cv-button__icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.95rem;
    z-index: 1;
}

.cv-button__text {
    z-index: 1;
}

.cv-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 24px 48px rgba(79, 70, 229, 0.3), 0 10px 22px rgba(236, 72, 153, 0.2);
}

.cv-button:hover .cv-button__shine {
    transform: translateX(220%) rotate(12deg);
}

.cv-button:active {
    transform: translateY(0) scale(0.99);
}

.cv-button:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.35);
    outline-offset: 4px;
}

@keyframes cv-orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- Hero gradient text ---- */
.hero-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Skill tag hover ---- */
.skill-tag-hover {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.skill-tag-hover:hover {
    background-color: #6366f1;
    color: #fff;
    transform: scale(1.05);
}

/* ---- Card hover ---- */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1), 0 0 0 1px rgba(99, 102, 241, 0.04);
}

/* ---- Decorative blobs ---- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

/* ---- Floating image containers ---- */
.floating-img {
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.floating-img > div {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.floating-img:hover > div {
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.06);
    transform: scale(1.03) rotate(0deg);
}

/* ---- Draggable elements ---- */
.draggable {
    cursor: grab;
    touch-action: none;
    transform: translate(var(--drag-x, 0px), var(--drag-y, 0px));
    will-change: transform;
}

.draggable,
.draggable * {
    user-select: none;
    -webkit-user-select: none;
}

.draggable img,
.draggable svg {
    -webkit-user-drag: none;
}

.draggable.dragging {
    cursor: grabbing;
}

/* ---- Logo slots ---- */
.logo-slot {
    width: 112px;
    height: 112px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: rgba(99, 102, 241, 0.6);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    position: absolute;
    z-index: 12;
    transition: transform 0.18s ease, filter 0.18s ease;
    transform: translate(var(--drag-x, 0px), var(--drag-y, 0px))
        rotate(var(--logo-rotate, 0deg))
        scale(var(--logo-scale, 1));
}

.logo-slot img,
.logo-slot svg {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(99, 102, 241, 0.25));
    transition: filter 0.2s ease;
}

.logo-slot:hover {
    filter: drop-shadow(0 14px 26px rgba(99, 102, 241, 0.25));
}

.logo-slot.dragging {
    filter: drop-shadow(0 18px 32px rgba(99, 102, 241, 0.35));
}

.logo-slot.dragging img,
.logo-slot.dragging svg {
    filter: drop-shadow(0 18px 26px rgba(99, 102, 241, 0.4));
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 300;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-panel {
    position: relative;
    width: min(980px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
}

/* ---- Print ---- */
@media print {
    nav, .mobile-menu, #loader, footer, .blob { display: none !important; }
    body { background: #fff !important; }
    .fade-in { opacity: 1 !important; transform: none !important; }
}
