/* Reset & base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    background-color: #0b0b0b;
    color: #fff;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Full-page Canvas */
#heroGraph {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* behind all content */
    pointer-events: none;
    /* clicks pass through */
}

/* Hero section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5vw;
    text-align: center;
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90vw;
    height: 90vh;
    margin-left: 5vw;
    margin-right: 5vw;
    margin-top: 5vh;
    margin-bottom: 5vh;
}

@supports (height: 100dvh) {
  .hero-content {
    width: 90dvw;
    height: 90dvh;
    margin-left: 5dvw;
    margin-right: 5dvw;
    margin-top: 5dvh;
    margin-bottom: 5dvh;
  }
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
}

.tagline {
    font-size: 1.3rem;
    font-weight: 300;
    color: #ccc;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-image {
    position: relative;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.hero-image.show {
    opacity: 1;
    transform: translateY(0);
}

.hero-image img {
    display: block;
    max-width: 80vw;
    max-height: 100%;

    /* Stillness */
    transition: opacity 0.6s ease;
    pointer-events: none;
}

/* Scroll-down arrow */
.scroll-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0rem;
}

.scroll-down {
    font-size: 2rem;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s;
}

.scroll-down:hover {
    transform: translateY(5px);
}

section#about {
    padding: 6vh 10vw;
    width: 100%;
    text-align: center;
}

section#about h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

section#about p {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Desktop layout */
@media (min-aspect-ratio: 1/1) {
    .hero-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-evenly;
        text-align: left;
        gap: 5vw
    }

    h1 {
        text-align: left;
    }

    .tagline {
        font-size: 1.5rem;
        text-align: left;
    }

    .hero-image img {
        max-height: 90vh;
        max-width: 100%;
    }
}

html {
    scroll-behavior: smooth;
}


section#projects {
    padding: 8vw 10vw;
    margin: 0 auto;
    text-align: center;
}

section#projects h2 {
    margin-bottom: 1rem;
}

section#projects p {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Section intro */
.section-intro {
    font-size: 1.2rem;
    font-weight: 300;
    color: #aaa;
    margin-bottom: 3rem;
}

/* Grid layout */
.projects-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: stretch;
    align-content: center;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 300px;
    border-radius: 1rem;
    padding: 2rem;
    text-align: left;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.project-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.project-card p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.7;
}

/* Responsive grid */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Modal base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 999;
}

/* When active */
.modal.active {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

#project-modal.active {
    z-index: 9999;
}

/* Modal content wider and more flexible */
.modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 5%;
    /* more horizontal padding for comfort */
    max-width: 1000px;
    /* wider max-width */
    width: 90vw;
    /* responsive width */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Animate content in */
.modal.active .modal-content {
    transform: scale(1);
    height: 90%;
    overflow-y: auto;
    opacity: 1;
}

/* Justify and widen the modal description text */
#modal-description {
    margin-top: 1rem;
    font-size: 1.15rem;
    color: #ddd;
    /* Remove any width or max-width restrictions */
    width: 100%;
}

/* Optional: ensure the paragraph fills modal content width */
.modal-content p {
    margin: 0;
    padding: 0;
    line-height: 1.8;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.8;
}

/* Typewriter cursor effect */
.typewriter-cursor::after {
    content: '|';
    margin-left: 4px;
    animation: blink 0.8s infinite;
    color: #fff;
    opacity: 0.7;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
    }
}

/* ===== Redesigned Timeline Section ===== */
#timeline {
    padding: 8vw 5vw;
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
    text-align: left;
}

#timeline h2 {
    margin-bottom: 1rem;
}

#timeline .section-intro {
    font-size: 1.2rem;
    font-weight: 300;
    color: #aaa;
    margin-bottom: 3rem;
    /* text-align: center; */
}


.timeline-place {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: #bbb;
    /* softer light gray for subtlety */
    margin-top: -0.3rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-style: normal;
    text-shadow: none;
}

/* Container & vertical line */
.timeline-container {
    position: relative;
    margin: 3rem 0;
    padding-left: 2.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

/* Timeline entry */
.timeline-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3.5rem;
    max-width: 1100px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
}

/* Marker circle */
.timeline-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #888;
    position: absolute;
    left: -10px;
    top: 0.4rem;
    flex-shrink: 0;
}

/* Content */
.timeline-content {
    margin-left: 2rem;
}

.timeline-date {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 0.3rem;
    font-weight: 300;
}

.timeline-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: #fff;
}

.timeline-content p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
}

/* Scroll reveal */
.timeline-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .timeline-container {
        padding-left: 3.5rem;
    }

    .timeline-marker {
        left: -13px;
        top: 0.5rem;
    }

    .timeline-content h3 {
        font-size: 1.6rem;
    }

    .timeline-content p {
        font-size: 1.1rem;
    }
}


/* Music & Math Section */
#music-math {
    position: relative;
    padding: 8vw 5vw;
    max-width: 1200px;
    width: 90%;
    margin: 0 auto 10vw auto;
    text-align: center;
}

#music-math h2 {
    margin-bottom: 1rem;
}

#music-math .section-intro {
    font-size: 1.2rem;
    font-weight: 300;
    color: #aaa;
    margin-bottom: 4rem;
    text-align: center;
}

.music-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

#musicCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.music-text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.music-paragraph {
    text-align: left;
}

.music-paragraph h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.music-paragraph p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
}


/* Responsive */
@media (min-width: 768px) {
    .music-text {
        gap: 4rem;
    }

    .music-paragraph h3 {
        font-size: 2rem;
    }

    .music-paragraph p {
        font-size: 1.1rem;
    }
}


#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 1.8rem;
    text-decoration: none;
    color: #fff;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
    /* hidden by default */
}

#backToTop:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}


#backToTop {
    bottom: 2rem;
    left: 2rem;
    /* move from right to left */
    right: auto;
}



/* Contact Me Floating Button Wrapper */
#contactWrapper {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

/* Floating button */
#contactButton {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#contactButton:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Contact Form */
#contactForm {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Show form */
#contactWrapper.active #contactForm {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Close button */
#contactClose {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

#contactClose:hover {
    color: #fff;
}

/* Form styling */
#contactForm h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

#contactForm input,
#contactForm textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
    transition: background 0.3s ease;
}

#contactForm input:focus,
#contactForm textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

#contactForm button {
    width: 100%;
    padding: 0.7rem 0;
    border: none;
    border-radius: 1rem;
    background: #fff;
    color: #0b0b0b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#contactForm button:hover {
    background: #f0f0f0;
}

#atom {
    margin: 6vh auto;
    max-width: 900px;
    padding: 0 2rem;
}

.atom-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.atom-card {
    position: relative;
    /* padding: 2rem 2.5rem 3rem 2.5rem;
  width: 800px; */
    overflow: hidden;
    /* hide overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.atom-date {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}


.atom-label {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
}

.atom-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #eee;
    margin: 0;
    /* overflow-y: auto; */
    padding-right: 0.5rem;
    /* space for scrollbar */
}

.atom-arrow {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    width: 48px;
    /* fixed square size */
    height: 48px;
    line-height: 48px;
    /* vertically center text */
    text-align: center;
    /* horizontally center text */
    border-radius: 50%;
    display: inline-flex;
    /* inline and flex to center content */
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
    /* prevent wrapping */
    flex-shrink: 0;
    /* don't shrink */
}

.atom-arrow:hover {
    color: #fff;
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.15);
}

#atom h3 {
    text-align: center;
    /* Center the subtitle */
    font-size: 1.3rem;
    /* Smaller font size */
    font-weight: 300;
    /* Light font weight for subtlety */
    margin-bottom: 3rem;
    color: #888;
    /* More subtle, lighter gray color */
    font-family: 'Inter', sans-serif;
    /* Match body font, or your preferred */
}

.atom-source {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.25rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.atom-source a {
    color: #8F9CA9;
    /* subtle, calm blue */
    text-decoration: underline;
    transition: color 0.3s ease;
}

.atom-source a:hover,

.atom-source a:focus {
    color: #9dd7ff;
    text-decoration: underline;
    outline: none;
}

/* Mobile */
@media (max-width: 600px) {
    .atom-container {
        gap: 0.8rem;
    }

    .atom-text {
        font-size: 1.05rem;
    }
}

#atom h2 {
    text-align: center;
    margin-bottom: 0.3rem;
}

/* Modal (simple) */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.modal-inner {
    background: #0b0b0b;
    padding: 1rem;
    border-radius: 10px;
    width: min(520px, 92%);
}

.modal-inner input {
    width: 100%;
    padding: 0.6rem;
    margin: 0.6rem 0;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}