* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    color: #f5e6d3;
    overflow-x: hidden;
    line-height: 1.6;
    /* Safe area for notched phones */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    /* Better font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent overscroll bounce on iOS */
    overscroll-behavior-y: none;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
}

.content {
    position: relative;
    z-index: 1;
}

/* Segmented control navigation */
.nav-bar {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(0);
    display: flex;
    padding: 4px;
    background: rgba(255, 154, 68, 0.06);
    border: 1px solid rgba(255, 154, 68, 0.3);
    border-radius: 50px;
    z-index: 100;
    backdrop-filter: blur(2px) saturate(180%);
    box-shadow: 0 8px 32px rgba(255, 154, 68, 0.1),
                inset 0 2px 10px rgba(255, 154, 68, 0.05);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.nav-bar.hidden {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
}

.nav-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 50px;
    box-shadow: inset -10px -8px 0px -11px rgba(255, 200, 150, 0.5),
                inset 0px -9px 0px -8px rgba(255, 200, 150, 0.4);
    opacity: 0.6;
    z-index: 0;
    filter: blur(1px) brightness(115%);
    pointer-events: none;
}

.nav-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: rgba(255, 154, 68, 0.15);
    border: 1px solid rgba(255, 154, 68, 0.5);
    border-radius: 50px;
    backdrop-filter: blur(4px) saturate(200%);
    box-shadow: 0 4px 20px rgba(255, 154, 68, 0.3),
                inset 0 2px 15px rgba(255, 154, 68, 0.2);
    z-index: 1;
    overflow: hidden;
}

.nav-slider.animating {
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50px;
    box-shadow: inset -10px -8px 0px -11px rgba(255, 200, 150, 0.9),
                inset 0px -9px 0px -8px rgba(255, 200, 150, 0.7);
    opacity: 0.8;
    filter: blur(1px) drop-shadow(5px 2px 4px rgba(0, 0, 0, 0.2)) brightness(120%);
    pointer-events: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: #b8844d;
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-link.active {
    color: #ffb366;
}

.nav-link:hover:not(.active) {
    color: #d4956a;
}

.hero {
    height: 100vh;
    height: 100svh; /* Small viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    --mouse-x: 50%;
    --mouse-y: 50%;
    background:
        radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg, #ff9a44 0%, #fc6c44 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 154, 68, 0.5);
}

.hero .tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    --mouse-x: 50%;
    --mouse-y: 50%;
    background:
        radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg, #ff9a44 0%, #fc6c44 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 179, 102, 0.3);
}

.hero .subtitle {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #d4956a;
    max-width: 700px;
    margin: 0 auto;
}

.hero-text-container {
    position: relative;
    padding: 2rem 3rem;
    --blur-opacity: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-text-container::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -60px;
    right: -60px;
    bottom: -80px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    -webkit-mask: radial-gradient(ellipse at center, black 0%, transparent 70%);
    mask: radial-gradient(ellipse at center, black 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
    opacity: var(--blur-opacity, 1);
}

#quote {
    min-height: 100vh;
    min-height: 100svh; /* Small viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.quote-container {
    position: relative;
    padding: 2rem 3rem;
    --blur-opacity: 1;
}

.quote-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -40px;
    right: -40px;
    bottom: -60px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    -webkit-mask: radial-gradient(ellipse at center, black 0%, transparent 70%);
    mask: radial-gradient(ellipse at center, black 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
    opacity: var(--blur-opacity, 1);
    transition: opacity 0.1s ease;
}

.quote-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-style: italic;
    font-weight: 400;
    max-width: 900px;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    --mouse-x: 50%;
    --mouse-y: 50%;
    background:
        radial-gradient(ellipse 250px 100px at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg, #ff9a44 0%, #fc6c44 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 154, 68, 0.5);
    transition: opacity 0.1s ease;
}

.quote-author {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    --mouse-x: 50%;
    --mouse-y: 50%;
    background:
        radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg, #ff9a44 0%, #fc6c44 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 25px rgba(255, 179, 102, 0.5);
    transition: opacity 0.1s ease;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    font-size: 2rem;
    color: #ff9a44;
    text-shadow: 0 0 20px rgba(255, 154, 68, 0.8);
    opacity: 1;
    transition: opacity 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.section {
    min-height: 100vh;
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Shared liquid glass card style */
.glass-card {
    position: relative;
    background: rgba(255, 154, 68, 0.08);
    backdrop-filter: blur(2px) saturate(180%);
    border: 1px solid rgba(255, 154, 68, 0.4);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(255, 154, 68, 0.15),
      inset 0 4px 20px rgba(255, 154, 68, 0.1);
    transition: all 0.3s ease, backdrop-filter 0.8s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.section.visible .glass-card {
    backdrop-filter: blur(2px) saturate(180%);
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2rem;
    backdrop-filter: blur(1px);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 200, 150, 0.8),
                inset 0px -9px 0px -8px rgba(255, 200, 150, 0.6);
    opacity: 0.6;
    z-index: 0;
    filter: blur(1px) drop-shadow(10px 4px 6px rgba(0, 0, 0, 0.3)) brightness(115%);
    pointer-events: none;
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.glass-card:hover {
    border-color: rgba(255, 154, 68, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 154, 68, 0.25),
                inset 0 4px 20px rgba(255, 154, 68, 0.15);
}

#bio {
    padding-top: 400px;
}

.section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 2rem;
    text-align: center;
    --mouse-x: 50%;
    --mouse-y: 50%;
    background:
        radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg, #ff9a44 0%, #fc6c44 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 154, 68, 0.3);
}

.bio-content {
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
    gap: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d4956a;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.bio-content strong {
    color: #ffb366;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-top: 2rem;
}

.education-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.education-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

.education-logo svg {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.education-logo svg path,
.education-logo svg g {
    fill: #d4956a;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.education-card:hover .education-logo svg path,
.education-card:hover .education-logo svg g {
    opacity: 1;
    fill: #ff9a44;
}

.education-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ffb366;
}

.education-card .degree {
    font-size: 1.1rem;
    color: #ff9a44;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.education-card .details {
    font-size: 0.95rem;
    color: #d4956a;
    line-height: 1.6;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.research-card {
    padding: 2rem;
    text-align: center;
}

.research-card h3 {
    color: #ff9a44;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-shadow: 0 0 20px rgba(255, 154, 68, 0.3);
}

.research-card p {
    color: #d4956a;
}

.publication-item {
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.publication-item .title {
    font-weight: 600;
    color: #ffb366;
    margin-bottom: 0.5rem;
}

.publication-item .authors {
    color: #d4956a;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.publication-item .venue {
    color: #ff9a44;
    font-style: italic;
    font-size: 0.9rem;
}

.experience-item {
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.experience-item h3 {
    color: #ffb366;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.experience-item .role {
    color: #ff9a44;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.experience-item .date {
    color: #b8844d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.experience-item ul {
    color: #d4956a;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-category h3 {
    color: #ff9a44;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(255, 154, 68, 0.2);
    border: 1px solid rgba(255, 154, 68, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #ffb366;
}

.skill-tag:hover {
    background: rgba(255, 154, 68, 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 154, 68, 0.5);
}

#contact {
    text-align: center;
    min-height: 60vh;
    padding: 60px 20px 40px 20px;
}

#contact h2 {
    text-align: center;
}

.contact-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 154, 68, 0.08);
    border: 1px solid rgba(255, 154, 68, 0.4);
    border-radius: 50px;
    color: #ffb366;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    backdrop-filter: blur(2px) saturate(180%);
    box-shadow: 0 8px 32px rgba(255, 154, 68, 0.15),
                inset 0 4px 20px rgba(255, 154, 68, 0.1);
    transition: all 0.3s ease, backdrop-filter 0.8s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.contact-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 50px;
    backdrop-filter: blur(1px);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 200, 150, 0.8),
                inset 0px -9px 0px -8px rgba(255, 200, 150, 0.6);
    opacity: 0.6;
    z-index: 0;
    filter: blur(1px) drop-shadow(10px 4px 6px rgba(0, 0, 0, 0.3)) brightness(115%);
    pointer-events: none;
}

.contact-link > * {
    position: relative;
    z-index: 1;
}

.section.visible .contact-link {
    backdrop-filter: blur(2px) saturate(180%);
}

.contact-link svg {
    width: 24px;
    height: 24px;
    fill: #d4956a;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.contact-link:hover {
    border-color: rgba(255, 154, 68, 0.6);
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 154, 68, 0.25),
                inset 0 4px 20px rgba(255, 154, 68, 0.15);
}

.contact-link:hover svg {
    opacity: 1;
    fill: #ff9a44;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #b8844d;
    font-size: 0.9rem;
}

/* Easter Egg: Planet Controls */
.planet-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 4px;
    background: rgba(255, 154, 68, 0.06);
    border: 1px solid rgba(255, 154, 68, 0.3);
    border-radius: 50px;
    z-index: 100;
    backdrop-filter: blur(2px) saturate(180%);
    box-shadow: 0 8px 32px rgba(255, 154, 68, 0.1),
                inset 0 2px 10px rgba(255, 154, 68, 0.05);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.planet-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 50px;
    box-shadow: inset -10px -8px 0px -11px rgba(255, 200, 150, 0.5),
                inset 0px -9px 0px -8px rgba(255, 200, 150, 0.4);
    opacity: 0.6;
    z-index: 0;
    filter: blur(1px) brightness(115%);
    pointer-events: none;
}

.planet-controls.hidden {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 154, 68, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 12px;
    position: relative;
    z-index: 1;
}

.controls-header button {
    background: none;
    border: none;
    color: rgba(255, 154, 68, 0.8);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.controls-header button:hover {
    opacity: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    position: relative;
    z-index: 1;
}

.control-group label {
    font-size: 0.65rem;
    color: rgba(255, 154, 68, 0.6);
    letter-spacing: 0.3px;
    text-align: center;
}

.control-group input[type="range"] {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 154, 68, 0.1);
    border: 1px solid rgba(255, 154, 68, 0.2);
    border-radius: 50px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 14px;
    background: rgba(255, 154, 68, 0.15);
    border: 1px solid rgba(255, 154, 68, 0.5);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 154, 68, 0.3),
                inset 0 2px 15px rgba(255, 154, 68, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 14px;
    background: rgba(255, 154, 68, 0.15);
    border: 1px solid rgba(255, 154, 68, 0.5);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 154, 68, 0.3),
                inset 0 2px 15px rgba(255, 154, 68, 0.2);
}

@media (max-width: 768px) {
    .section {
        padding: 60px 15px;
        min-height: auto;
    }

    /* Hide navigation on mobile */
    .nav-bar {
        display: none;
    }

    /* Hero adjustments */
    .hero-text-container {
        padding: 1.5rem 1rem;
    }

    .hero-text-container::before {
        left: -20px;
        right: -20px;
        top: -20px;
        bottom: -40px;
    }

    /* Quote adjustments */
    .quote-container {
        padding: 1.5rem 1rem;
    }

    .quote-container::before {
        left: -15px;
        right: -15px;
    }

    /* Bio section */
    #bio {
        padding-top: 150px;
    }

    /* Glass cards */
    .glass-card {
        border-radius: 1.25rem;
    }

    .glass-card::after {
        border-radius: 1.25rem;
    }

    .bio-content,
    .experience-item,
    .publication-item,
    .research-card,
    .education-card {
        padding: 1.25rem;
    }

    /* Grids */
    .education-grid,
    .research-grid,
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Education logos */
    .education-logo {
        width: 80px;
        height: 80px;
    }

    .education-card h3 {
        font-size: 1.25rem;
    }

    .education-card .degree {
        font-size: 1rem;
    }

    /* Experience */
    .experience-item h3 {
        font-size: 1.2rem;
    }

    .experience-item ul {
        padding-left: 1.25rem;
    }

    /* Contact - ensure minimum tap target size */
    .contact-links {
        gap: 1rem;
    }

    .contact-link {
        padding: 0.75rem 1.25rem;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .contact-link svg {
        width: 28px;
        height: 28px;
    }

    .contact-link::after {
        border-radius: 50px;
    }

    /* Scroll indicator */
    .scroll-indicator {
        font-size: 1.5rem;
        bottom: 20px;
    }

    /* Footer */
    footer {
        font-size: 0.8rem;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .glass-card:hover {
        transform: none;
    }

    .contact-link:hover {
        transform: none;
    }

    .skill-tag:hover {
        transform: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 0.95rem;
    }

    .section h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .quote-text {
        font-size: 1.2rem;
    }

    .quote-author {
        font-size: 0.95rem;
    }

    .bio-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .nav-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    #bio {
        padding-top: 100px;
    }
}
