/* --------------------------------------------------------------------------
   @property — lets the browser interpolate --grad-angle as a real number
   so the gradient angle on the name text can be animated smoothly.
   Must be declared before first use.
-------------------------------------------------------------------------- */
@property --grad-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 120deg;
}

:root {
    --bg-base: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(20, 20, 20, 0.3);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --------------------------------------------------------------------------
   Ambient Background
-------------------------------------------------------------------------- */
.orb-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

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

.orb-1 {
    top: -10%; left: -10%; width: 35vw; height: 35vw;
    background: #5B21B6;
    animation: orb-fade-in 2s ease-out forwards,
               orb-drift-1 25s 2s infinite alternate ease-in-out;
}
.orb-2 {
    bottom: -10%; right: -10%; width: 40vw; height: 40vw;
    background: #3B82F6;
    animation: orb-fade-in 2s 0.3s ease-out forwards,
               orb-drift-2 30s 2s infinite alternate ease-in-out;
}
.orb-3 {
    top: 30%; left: 30%; width: 30vw; height: 30vw;
    background: #8B5CF6;
    animation: orb-fade-in 2s 0.6s ease-out forwards,
               orb-drift-3 28s 2s infinite alternate ease-in-out;
}

@keyframes orb-fade-in {
    0%   { opacity: 0; }
    100% { opacity: 0.45; }
}

@keyframes orb-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(15vw, 10vh) scale(1.05); }
    66%  { transform: translate(25vw, -5vh) scale(0.95); }
    100% { transform: translate(10vw, -15vh) scale(1); }
}
@keyframes orb-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-15vw, -10vh) scale(1.05); }
    66%  { transform: translate(-5vw, -20vh) scale(0.95); }
    100% { transform: translate(-20vw, 5vh) scale(1); }
}
@keyframes orb-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-10vw, 15vh) scale(0.95); }
    66%  { transform: translate(15vw, 20vh) scale(1.05); }
    100% { transform: translate(20vw, 5vh) scale(1); }
}

/* --------------------------------------------------------------------------
   Glass Utility
-------------------------------------------------------------------------- */
.liquid-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* --------------------------------------------------------------------------
   Scroll Progress Nav
-------------------------------------------------------------------------- */
.scroll-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.scroll-nav__track {
    position: relative;
    width: 1px;
    height: 240px;
    background: rgba(255, 255, 255, 0.12);
}

.scroll-nav__fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    transition: height 0.1s linear;
    height: 0%;
}

.scroll-nav__item {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    cursor: pointer;
}

.scroll-nav__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s, transform 0.3s;
    flex-shrink: 0;
}

.scroll-nav__item.active .scroll-nav__dot,
.scroll-nav__item:hover .scroll-nav__dot {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.4);
}

.scroll-nav__label {
    position: absolute;
    right: 14px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    text-transform: uppercase;
}

.scroll-nav__item:hover .scroll-nav__label,
.scroll-nav__item.active .scroll-nav__label {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 900px) {
    .scroll-nav { display: none; }
}

/* --------------------------------------------------------------------------
   Scroll Reveal
-------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(25px) translateZ(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* --------------------------------------------------------------------------
   Layout
-------------------------------------------------------------------------- */
.spatial-canvas {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10rem 5% 5rem 5%;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Hero
-------------------------------------------------------------------------- */
.hero-section {
    margin-bottom: 12rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-greeting { display: flex; align-items: center; gap: 2rem; }

.avatar-grounded {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-grounded:hover { transform: scale(1.05); }

#profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#profile-img.loaded { opacity: 1; }

.massive-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
}

.nyvil-glass-text {
    background: linear-gradient(var(--grad-angle), #e8e0ff 0%, #7c6ff7 45%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 800;
    animation: grad-sweep 20s 2s infinite alternate ease-in-out;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    line-height: 1.6;
    letter-spacing: -0.3px;
}

@keyframes grad-sweep {
    0%   { --grad-angle: 100deg; }
    100% { --grad-angle: 220deg; }
}

/* --------------------------------------------------------------------------
   Skills Cloud
-------------------------------------------------------------------------- */
.skills-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 12rem;
    padding-left: 2rem;
    align-items: center;
}

.glass-pill {
    padding: 1rem 2rem;
    border-radius: 100px;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: default;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.glass-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation-play-state: paused !important;
}

.offset-1 { margin-top: 15px; }
.offset-2 { margin-top: -10px; }
.offset-3 { margin-top: 20px; }

.bob-1 { animation: gentle-bob 4s   infinite alternate         ease-in-out; }
.bob-2 { animation: gentle-bob 5s   infinite alternate-reverse ease-in-out; }
.bob-3 { animation: gentle-bob 6s   infinite alternate         ease-in-out; }

@keyframes gentle-bob {
    0%   { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

/* --------------------------------------------------------------------------
   Projects
-------------------------------------------------------------------------- */
.section-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    padding-left: 2rem;
    border-left: 1px solid var(--text-secondary);
}

.project-stream { display: flex; flex-direction: column; gap: 8rem; }

.glass-project {
    border-radius: 40px;
    padding: 3rem;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 85%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                background 0.3s,
                border-color 0.3s,
                box-shadow 0.3s;
}

.stagger-left  { margin-right: auto; }
.stagger-right { margin-left: auto; text-align: right; flex-direction: row-reverse; }

.glass-project:hover {
    transform: scale(1.02) translateZ(0);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.project-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: -0.8px;
    line-height: 1.1;
}

.project-desc  {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.arrow-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-highlight);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.glass-project:hover .arrow-circle {
    transform: scale(1.1) rotate(-45deg);
    background: #fff;
    color: #000;
}

/* --------------------------------------------------------------------------
   Contact Dock
-------------------------------------------------------------------------- */
.action-dock {
    margin-top: 12rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.dock-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
}

.dock-btn:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   Mobile
-------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero-greeting   { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .avatar-grounded { width: 100px; height: 100px; }
    .glass-project   { width: 100%; flex-direction: column !important; align-items: flex-start; text-align: left; gap: 2rem; padding: 2rem; }
    .arrow-circle    { align-self: flex-end; }
    .skills-cloud    { padding-left: 0; }
    .project-stream  { gap: 4rem; } /* Keep gaps a bit tighter on mobile */
}