/* ── Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #08090a;
}

::-webkit-scrollbar-thumb {
    background: rgba(251, 146, 60, 0.3);
    border-radius: 10px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #050505;
    color: #e5e5e5;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    body {
    cursor: none;
    }

    a,
    button,
    [data-hover] {
    cursor: none;
    }
}

/* ── Noise Overlay ── */
.noise {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px;
}

/* ── Glass Panel ── */
.glass {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 0.55rem;
    border-radius: 9999px;
    transition: all 0.25s ease;
}

.lang-btn:hover {
    color: rgba(251, 146, 60, 0.9);
}

.lang-btn.active {
    background: rgba(251, 146, 60, 0.16);
    color: rgba(251, 191, 36, 0.96);
}

/* ── Beam Animations ── */
@keyframes beam-fall {
    0% {
    transform: translateY(-100%);
    opacity: 0;
    }

    5% {
    opacity: 0.6;
    }

    50% {
    opacity: 1;
    }

    95% {
    opacity: 0.4;
    }

    100% {
    transform: translateY(120vh);
    opacity: 0;
    }
}

.beam-1 {
    animation: beam-fall 7s linear infinite;
}

.beam-2 {
    animation: beam-fall 9s linear infinite;
    animation-delay: 2.5s;
}

.beam-3 {
    animation: beam-fall 8s linear infinite;
    animation-delay: 5s;
}

.beam-4 {
    animation: beam-fall 10s linear infinite;
    animation-delay: 1s;
}

/* ── Liquid Blobs ── */
@keyframes blob-float {

    0%,
    100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
    transform: translate(30px, -50px) scale(1.1) rotate(120deg);
    }

    66% {
    transform: translate(-20px, 40px) scale(0.95) rotate(240deg);
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-float 20s ease-in-out infinite;
    pointer-events: none;
}

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(6px);
    transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* ── Rotating Border CTA ── */
.cta-glow {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 9999px;
}

.cta-glow::after {
    content: "";
    position: absolute;
    inset: -200% -200%;
    width: 500%;
    height: 500%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 60deg, rgba(251, 146, 60, 0.7) 180deg, transparent 300deg, transparent 360deg);
    animation: spin 4s linear infinite;
    z-index: -2;
}

.cta-glow>.cta-bg {
    position: absolute;
    inset: 1.5px;
    border-radius: 9999px;
    background: #0d0d0d;
    z-index: -1;
}

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

/* ── Preloader ── */
#preloader {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}

#preloader.loaded {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.loader-track {
    width: 200px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #ea580c, #f59e0b);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* ── Project Modal ── */
#project-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    --project-modal-header-height: 53px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#project-modal.active {
    display: flex;
}

#project-modal .modal-content {
    width: 92vw;
    max-width: 1200px;
    height: 85vh;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a0a0a;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#project-modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#external-preview-link {
    position: absolute;
    top: var(--project-modal-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    letter-spacing: 0.02em;
    font-size: 0.72rem;
    font-weight: 600;
    transition: background 0.25s ease;
    z-index: 5;
}

#external-preview-link.active {
    display: flex;
    cursor: pointer;
}

#external-preview-link:hover {
    background: rgba(0, 0, 0, 0.56);
}

.external-preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    border-radius: 9999px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

/* ── Cursor ── */
#cursor-ring,
#cursor-dot,
.cursor-seg {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 150;
    border-radius: 9999px;
    transform: translate(-50%, -50%);
    display: none;
}

@media (min-width: 768px) {

    #cursor-ring,
    #cursor-dot,
    .cursor-seg {
    display: block;
    }
}

#cursor-ring {
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(251, 146, 60, 0.7);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.08), 0 0 25px rgba(251, 146, 60, 0.2);
    transition: width 0.25s, height 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.2s;
    backdrop-filter: blur(1px);
    opacity: 0;
    mix-blend-mode: screen;
}

#cursor-dot {
    width: 5px;
    height: 5px;
    background: rgba(251, 191, 36, 0.95);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    opacity: 0;
}

#cursor-ring.hovered {
    width: 56px;
    height: 56px;
    border-color: rgba(251, 146, 60, 0.9);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1), 0 0 50px rgba(251, 146, 60, 0.3);
}

/* ── Timeline ── */
.timeline-line {
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, rgba(251, 146, 60, 0.4), rgba(251, 146, 60, 0.05));
}

.timeline-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(251, 146, 60, 0.5);
    flex-shrink: 0;
}

/* ── Photo ── */
.photo-frame {
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
}

.photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 5, 5, 0.7), transparent 50%);
    pointer-events: none;
}

@keyframes character-float {

    0%,
    100% {
    transform: translateY(0) rotate(-0.7deg);
    }

    50% {
    transform: translateY(-12px) rotate(0.7deg);
    }
}

.character-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.character-3d {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 28px 46px rgba(0, 0, 0, 0.55));
    transform-origin: 50% 90%;
    animation: character-float 6.5s ease-in-out infinite;
    will-change: transform;
}

.character-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 88% 34%;
    filter: drop-shadow(0 28px 46px rgba(0, 0, 0, 0.45));
    transform: scale(1.01);
}

@media (max-width: 767px) {
    .character-video {
    object-position: 82% 34%;
    }
}

/* ── Misc ── */
.text-gradient {
    background: linear-gradient(135deg, #fb923c, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-orange {
    box-shadow: 0 0 60px rgba(251, 146, 60, 0.15), 0 0 120px rgba(251, 146, 60, 0.05);
}

.border-glow {
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(251, 146, 60, 0.6);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: 0.6s;
    pointer-events: none;
}

.skill-card:hover::before {
    left: 100%;
}

.project-card {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card .project-img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

::selection {
    background: rgba(251, 146, 60, 0.3);
    color: #fff;
}
