/* ══════════════════════════════════════════════
   CUSTOM PROPERTIES
   ══════════════════════════════════════════════ */
:root {
    --base: #050505;
    --surface: #0A0A0A;
    --card: #0D0D0D;
    --border: #1A1A1A;
    --border-light: #222222;
    --muted: #555555;
    --body: #999999;
    --heading: #EDEDED;
    --accent: #3B82F6;
    --accent-hover: #5B9BF7;
    --accent-dim: #1d4ed8;
}

/* ══════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) var(--base);
}

body {
    overflow-x: hidden;
    cursor: none;
}

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
}

::selection {
    background: var(--accent);
    color: var(--base);
}

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

::-webkit-scrollbar-track {
    background: var(--base);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ══════════════════════════════════════════════
   PAGE LOADER
   ══════════════════════════════════════════════ */
.loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--base);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-letter {
    font-family: 'Instrument Serif', serif;
    font-size: 4rem;
    color: var(--heading);
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: loaderReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.loader-letter:nth-child(1) {
    animation-delay: 0.1s;
}

.loader-letter:nth-child(2) {
    animation-delay: 0.25s;
    color: var(--accent);
}

.loader-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: loaderReveal 0.5s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.loader-line::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: translateX(-100%);
    animation: loaderBar 1s 0.6s ease-in-out forwards;
}

@keyframes loaderReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loaderBar {
    to {
        transform: translateX(0);
    }
}

/* ══════════════════════════════════════════════
   CUSTOM CURSOR
   ══════════════════════════════════════════════ */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background 0.3s ease;
}

.custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

.custom-cursor.hovering {
    width: 56px;
    height: 56px;
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.04);
}

@media (max-width: 768px) {

    .custom-cursor,
    .custom-cursor-dot {
        display: none;
    }
}

/* ══════════════════════════════════════════════
   AMBIENT ORBS
   ══════════════════════════════════════════════ */
.ambient-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.03;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -200px;
    animation: orbFloat1 25s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #8B5CF6;
    bottom: -150px;
    left: -150px;
    animation: orbFloat2 30s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    animation: orbFloat3 20s ease-in-out infinite;
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0)
    }

    33% {
        transform: translate(-80px, 60px)
    }

    66% {
        transform: translate(40px, -40px)
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0)
    }

    33% {
        transform: translate(60px, -80px)
    }

    66% {
        transform: translate(-40px, 40px)
    }
}

@keyframes orbFloat3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.02
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.04
    }
}

/* ══════════════════════════════════════════════
   GRAIN + DOT GRID
   ══════════════════════════════════════════════ */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.022;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

.dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 65%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 65%);
}

/* ══════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════ */
.nav-blur {
    background: rgba(5, 5, 5, 0.55);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

#navbar.visible {
    transform: translateY(0);
}

.nav-cta {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

.nav-cta:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

/* ══════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════ */
.hero-name {
    font-size: clamp(3.5rem, 10vw, 9rem);
}

/* Gradient text on name */
.gradient-text {
    background: linear-gradient(135deg, #EDEDED 0%, #EDEDED 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Photo frame — static glow */
.photo-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-glow-static {
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.04) 50%, transparent 70%);
    filter: blur(20px);
    transition: opacity 0.6s ease;
}

.photo-frame:hover .photo-glow-static {
    opacity: 1.3;
}

.hero-photo {
    position: relative;
    width: clamp(200px, 26vw, 320px);
    height: clamp(200px, 26vw, 320px);
    border-radius: 50%;
    overflow: hidden;
    background: var(--base);
    border: 2px solid rgba(59, 130, 246, 0.15);
    transition: border-color 0.5s ease;
}

.hero-photo:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.hero-photo img {
    filter: saturate(0.55) contrast(1.12) brightness(0.88);
    transition: filter 0.8s ease;
}

.hero-photo:hover img {
    filter: saturate(0.9) contrast(1.05) brightness(1);
}

.photo-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.2;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

.photo-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 50%;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* Available badge */
.available-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    white-space: nowrap;
}

.available-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* Hero accent line */
.hero-accent-line {
    width: 60px;
    height: 2px;
    background: var(--accent);
    margin-top: 16px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-accent-line.revealed {
    transform: scaleX(1);
}

@media (max-width: 1023px) {
    .hero-accent-line {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Typed text */
.typed-cursor {
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

/* Hero glow */
#hero-glow {
    background: radial-gradient(800px circle at 50% 50%, rgba(59, 130, 246, 0.06), transparent 60%);
}

/* Scroll indicator */
.scroll-line {
    width: 1px;
    height: 50px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
    0% {
        top: -100%
    }

    100% {
        top: 200%
    }
}

/* Char line animation */
.char-line {
    transform: translateY(115%);
    animation: charReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0.1s);
}

@keyframes charReveal {
    to {
        transform: translateY(0);
    }
}

/* CTA buttons */
.cta-primary {
    background: var(--accent);
    color: var(--base);
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.cta-primary:hover::before {
    transform: translateX(100%);
}

.cta-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.35), 0 0 80px rgba(59, 130, 246, 0.1);
}

/* ══════════════════════════════════════════════
   MARQUEE STATS STRIP
   ══════════════════════════════════════════════ */
.marquee-strip {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.5);
    position: relative;
    z-index: 10;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 30s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

.marquee-item {
    padding: 0 24px;
    font-size: 0.85rem;
    color: var(--heading);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 500;
}

.marquee-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    flex-shrink: 0;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ══════════════════════════════════════════════
   IMPACT BADGES (glowing metric highlights)
   ══════════════════════════════════════════════ */
.impact-badge {
    color: var(--accent);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════
   ABOUT — Word reveal
   ══════════════════════════════════════════════ */
.about-word {
    display: inline-block;
    opacity: 0.07;
    transform: translateY(4px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-right: 0.15em;
}

.about-word.revealed {
    opacity: 1;
    transform: translateY(0);
}

.about-word.highlight {
    color: var(--accent);
    font-style: italic;
}

.about-word.em {
    font-style: italic;
}

/* ══════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════ */
#timeline-progress {
    transition: height 0.15s linear;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.timeline-dot {
    z-index: 2;
}

/* ══════════════════════════════════════════════
   SPOTLIGHT CARD
   ══════════════════════════════════════════════ */
.spotlight-card {
    position: relative;
    border-radius: 1rem;
    background: rgba(13, 13, 13, 0.5);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(59, 130, 246, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.spotlight-card:hover::before {
    opacity: 1;
}

.spotlight-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.spotlight-card-inner {
    position: relative;
    z-index: 2;
}

/* ══════════════════════════════════════════════
   SKILL + TECH PILLS
   ══════════════════════════════════════════════ */
.skill-pill {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.78rem;
    color: var(--body);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.01);
}

.skill-pill:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--heading);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.08);
}

.tech-pill {
    display: inline-block;
    padding: 5px 16px;
    font-size: 0.78rem;
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 100px;
    background: rgba(59, 130, 246, 0.04);
}

/* ══════════════════════════════════════════════
   PROJECTS
   ══════════════════════════════════════════════ */
.projects-scroll-wrapper {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.projects-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.project-card {
    scroll-snap-align: start;
    background: rgba(13, 13, 13, 0.5);
    border: 1px solid var(--border);
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.project-card:hover {
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4), 0 0 60px rgba(59, 130, 246, 0.06);
}

.project-card-inner {
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
}

.project-number {
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: 'Instrument Serif', serif;
    font-size: 9rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.015);
    pointer-events: none;
    user-select: none;
}

/* ══════════════════════════════════════════════
   3D TILT CARDS
   ══════════════════════════════════════════════ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

/* ══════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════ */
.contact-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 20%;
    right: -200px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(200px);
    opacity: 0.04;
    pointer-events: none;
}

.contact-glow-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: 10%;
    left: -100px;
    border-radius: 50%;
    background: #8B5CF6;
    filter: blur(180px);
    opacity: 0.025;
    pointer-events: none;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--muted);
    transition: all 0.5s ease;
}

.contact-link:hover .contact-icon {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.06);
    color: var(--accent);
}

.contact-link:hover .contact-icon svg {
    color: var(--accent);
    fill: var(--accent);
}

.contact-arrow {
    color: var(--accent);
    font-size: 1.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover .contact-arrow {
    opacity: 1;
    transform: translateX(0);
}

.contact-link {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover {
    padding-left: 8px;
}

/* Language badges */
.lang-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(13, 13, 13, 0.3);
    transition: all 0.3s ease;
}

.lang-badge:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.04);
}

/* ══════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════
   MAGNETIC BUTTON
   ══════════════════════════════════════════════ */
.magnetic-btn {
    position: relative;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ══════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-up {
        opacity: 1;
        transform: none;
    }

    .about-word {
        opacity: 1;
        transform: none;
    }

    .char-line {
        transform: none;
    }

    .hero-accent-line {
        transform: scaleX(1);
    }

    .ambient-orb {
        animation: none;
    }

    body {
        cursor: auto;
    }

    .custom-cursor,
    .custom-cursor-dot {
        display: none;
    }

    .loader {
        display: none;
    }

    .marquee-track {
        animation: none;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-photo {
        width: 170px;
        height: 170px;
    }

    .projects-scroll-wrapper {
        scroll-snap-type: none;
    }

    .projects-track {
        flex-direction: column;
        align-items: stretch;
    }

    .project-card {
        width: 100% !important;
    }

    .contact-arrow {
        opacity: 1;
        transform: translateX(0);
    }

    .project-number {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    .hero-photo {
        width: 140px;
        height: 140px;
    }

    .hero-name {
        font-size: clamp(2.5rem, 14vw, 4.5rem);
    }
}