/* Font Face Declarations */
@font-face {
    font-family: 'FunnelSans';
    src: url('Fonts/FunnelSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FunnelSans';
    src: url('Fonts/FunnelSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'FunnelSans';
    src: url('Fonts/FunnelSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0A010D;
    color: #F7EAFB;
    font-family: 'FunnelSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    display: flex;
}

::selection {
    background-color: #67488D;
    color: #ffffff;
}

/* Base styles */
:root {
    --sidebar-width: 215.26px;
    --sidebar-left: 146px;
    --content-gap: 75px;
    --max-content-width: 750px;
    --homepage-image-width: 1100px;
    --moneypal-image-width: 1200px;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: var(--sidebar-left);
    top: 0;
    padding: 64px 0 2rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.name {
    font-size: 1.2rem;
    font-weight: 500;
}

.name a {
    color: #F7EAFB;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.name a:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    flex-direction: column;
    margin-top: 48px;
}

.nav-links a {
    color: #978F99;
    text-decoration: none;
    font-family: 'FunnelSans-Regular', system-ui;
    transition: color 0.3s ease;
}

.nav-links a:first-child,
.nav-links a:nth-child(2),
.nav-links a:nth-child(3) {
    margin-bottom: 8px;
}

.nav-links a:hover {
    color: #F7EAFB;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.sidebar-footer p {
    font-size: 0.9rem;
}

.doodle {
    width: var(--sidebar-width);
    height: 225.41px;
    object-fit: contain;
}

/* Main Content Area */
.main-content {
    margin-left: calc(var(--sidebar-left) + var(--sidebar-width) + var(--content-gap));
    padding-top: 64px;
    padding-right: 2rem;
    padding-bottom: 2rem;
    width: calc(100% - (var(--sidebar-left) + var(--sidebar-width) + var(--content-gap)));
    max-width: none;
}

.main-content h1 {
    color: #F7EAFB;
    font-family: 'FunnelSans-Bold', system-ui;
    font-size: 18px;
    margin-bottom: 48px;
}

/* Intro Section & Hero Styles */
.intro-section {
    max-width: 1000px;
    margin-bottom: 6rem;
}



.hero-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
}

.hero-line {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    line-height: 1.2;
}

.serif-text {
    font-family: 'Times New Roman', Times, serif;
    font-size: 84px;
    color: #F7EAFB;
    font-weight: normal;
}

.serif-italic {
    font-family: 'Times New Roman', Times, serif;
    font-size: 84px;
    font-style: italic;
    color: #978F99;
    font-weight: normal;
}

.hero-pill-img {
    height: 80px;
    width: 140px;
    border-radius: 50px;
    object-fit: cover;
    border: 2px solid #F7EAFB;
}

.rotate-right {
    transform: rotate(5deg);
}

.rotate-left {
    transform: rotate(-5deg);
}

.hero-subtext {
    font-size: 24px;
    color: #978F99;
    margin-top: 2rem;
    font-family: 'FunnelSans-Regular', system-ui;
    line-height: 3;
}

.learn-more-btn {
    display: inline-block;
    background-color: #67488D;
    color: #F7EAFB;
    text-decoration: none;
    padding: 6px 24px;
    border-radius: 50px;
    font-family: 'FunnelSans-Regular', system-ui;
    font-size: 16px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
}

.learn-more-btn:hover {
    background: radial-gradient(circle 60px at var(--x, 50%) var(--y, 50%), #9d84c9, #67488D);
}

/* Project Cards */
.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card {
    display: flex;
    gap: 6rem;
    margin-bottom: 6rem;
    width: 100%;
}

.project-details {
    flex: 0 1 500px;
}

.project-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #F7EAFB;
}

.project-description {
    color: #978F99;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.role-section {
    color: #978F99;
    margin-bottom: 1.5rem;
}

.role-section p:first-child {
    margin-bottom: 0.25rem;
}

.learn-more {
    color: #F7EAFB;
    text-decoration: none;
}

.project-image {
    flex: 1;
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 1100/562.69;
}

.project-image-full {
    width: var(--homepage-image-width);
    height: auto;
    aspect-ratio: 1100/562.69;
    border-radius: 8px;
    margin: 0 0 48px;
    background: #D9D9D9;
    object-fit: cover;
}

.project-video-full {
    width: var(--homepage-image-width);
    height: auto;
    aspect-ratio: 1100/562.69;
    border-radius: 8px;
    margin: 0 0 48px;
    border: 0;
    display: block;
}

.moneypal-image {
    width: var(--moneypal-image-width);
    height: auto;
    aspect-ratio: 1200/562.69;
    border-radius: 8px;
    margin: 0 0 48px;
    background: #D9D9D9;
    object-fit: cover;
}

.role-section {
    color: #978F99;
    margin-bottom: 1rem;
}

.learn-more {
    color: #F7EAFB;
    text-decoration: none;
    display: inline-block;
    transition: font-weight 0.3s ease;
}

.learn-more:hover {
    font-weight: bold;
}

/* Project Detail Page */
.project-content {
    max-width: 828.49px;
}

.project-content h1 {
    font-family: 'FunnelSans-Bold', system-ui;
    font-size: 32px;
    margin-bottom: 16px;
}

.project-content h2 {
    font-family: 'FunnelSans-Medium', system-ui;
    font-size: 24px;
    margin-top: 32px;
    margin-bottom: 16px;
}

.project-details-section {
    margin-top: 48px;
}

.project-details-section ul {
    list-style-type: none;
    padding: 0;
}

.project-details-section li {
    margin-bottom: 12px;
    font-family: 'FunnelSans-Regular', system-ui;
}

/* MoneyPal Project Page */
.project-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #F7EAFB;
    font-size: 18px;
    width: 1100px;
}

.project-header .date,
.project-header .event {
    margin: 0;
}

.project-header a {
    color: #F7EAFB;
    text-decoration: none;
}

.project-header a:hover {
    text-decoration: underline;
}

.header-line {
    height: 1px;
    background: #F7EAFB;
    margin-bottom: 48px;
    width: 1100px;
}

.project-intro,
.content-section {
    display: flex;
    gap: 166px;
    margin-bottom: 48px;
    width: 1000px;
}

.project-title-area {
    width: 270px;
}

.project-title-area h1 {
    color: #F7EAFB;
    font-family: 'FunnelSans-Bold', system-ui;
    font-size: 24px;
    margin: 0 0 48px 0;
}

.skills {
    color: #978F99;
}

.project-overview,
.section-content {
    flex: 1;
    min-height: 276px;
    color: #F7EAFB;
}

.section-title {
    width: 270px;
    color: #F7EAFB;
}

.main-content h2 {
    font-family: 'FunnelSans-Medium', system-ui;
    font-size: 18px;
    margin: 0 0 16px 0;
    text-transform: uppercase;
}

.main-content p {
    font-family: 'FunnelSans-Regular', system-ui;
    line-height: 1.6;
    font-size: 18px;
    margin: 0;
}

.team-section {
    margin-bottom: 24px;
}

.team-section h2,
.special-thanks h2 {
    margin-bottom: 16px;
}

.team-section p {
    width: 400px;
    color: #978F99;
}

.special-thanks p {
    width: 400px;
    color: #978F99;
}

/* About Page */
.about-section {
    width: 1000px;
    margin-bottom: 64px;
}

.about-section p {
    color: #F7EAFB;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.section {
    margin-bottom: 64px;
    width: 1000px;
}

.section-content {
    display: flex;
    gap: 166px;
}

.section-title {
    width: 270px;
}

.section-title h2 {
    color: #F7EAFB;
    font-family: 'FunnelSans-Medium', system-ui;
    font-size: 18px;
    text-transform: uppercase;
    margin: 0;
}

.section-list {
    flex: 1;
}

.section-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-list li {
    color: #978F99;
    font-size: 18px;
    margin-bottom: 8px;
}

.section-list li:last-child {
    margin-bottom: 0;
}

.section-list li a {
    color: #978F99;
    text-decoration: none;
    transition: color 0.3s ease;
}

.section-list li a:hover {
    color: #F7EAFB;
}

/* Footer */
.footer {
    margin-top: 4rem;
    text-align: left;
}

/* About and Me pages specific styles */
.about-content,
.me-content {
    max-width: 800px;
}

.bio-text,
.about-description,
.about-mission {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.intro-section h1 {
    font-size: 40px;
}

.intro-section p {
    font-size: 40px;
}

/* Responsive styles */
@media (max-width: 1440px) {
    :root {
        --homepage-image-width: 100%;
        --moneypal-image-width: 100%;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-left: 32px;
        --content-gap: 32px;
    }

    .sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: calc(var(--sidebar-left) + 180px + var(--content-gap));
        padding-right: 32px;
    }

    .project-intro,
    .content-section,
    .section-content {
        flex-direction: column;
        gap: 24px;
    }

    .project-title-area,
    .section-title {
        width: 100%;
    }

    .project-overview,
    .section-content {
        width: 100%;
    }

    .project-card {
        flex-direction: column;
    }

    .project-image {
        width: 100%;
        margin-bottom: 24px;
    }

    .project-details {
        width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --homepage-image-width: 100%;
        --moneypal-image-width: 100%;
    }
}

@media (max-width: 900px) {
    body {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .nav-section {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .nav-links {
        display: flex;
        gap: 24px;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0 32px;
        width: 100%;
    }

    .project-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .project-intro,
    .content-section,
    .section-content {
        flex-direction: column;
        gap: 24px;
        width: 100%;
    }

    .about-section,
    .section {
        width: 100%;
    }

    .project-title-area,
    .section-title {
        width: 100%;
    }

    .project-overview,
    .section-list {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .project-card {
        flex-direction: column;
        gap: 2rem;
    }

    .project-image {
        width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 580px) {
    :root {
        --homepage-image-width: 100%;
        --moneypal-image-width: 100%;
    }

    .nav-links a[href="moneypal.html"] {
        display: none;
    }

    :root {
        --content-gap: 16px;
    }

    body {
        padding: 16px;
    }

    .sidebar {
        padding: 16px 0;
        left: 0
    }

    .nav-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
    }

    .main-content {
        padding: 0;
    }

    .intro-section p {
        font-size: 30px;
    }

    .learn-more-btn {
        font-size: 14px;
    }

    .project-header,
    .header-line,
    .project-image-full,
    .project-video-full,
    .project-intro,
    .intro-section,
    .content-section,
    .about-section,
    .section {
        width: 100%;
    }

    .project-details {
        flex: 1;
    }

    .project-card {
        margin-bottom: 1rem;
    }

    .name a {
        font-size: 30px;
    }

    .project-image-full,
    .project-video-full,
    .project-image,
    .project-detail-image,
    .about-me-image {
        margin-bottom: 24px;
        border-radius: 4px;
        max-height: 220px;
        object-fit: cover;
    }

    .section-list {
        height: fit-content;
        flex: none;
    }

    .section-list li {
        margin-bottom: 8px;
    }

    h1,
    h2 {
        font-size: 16px;
    }

    /* Hero Responsive Styles */
    .serif-text,
    .serif-italic {
        font-size: 32px;
    }

    .hero-pill-img {
        height: 48px;
        width: 80px;
    }

    .hero-line {
        gap: 0.75rem;
    }

    p,
    li {
        font-size: 16px;
    }
}

/* Hover Popup Styles */
.hover-popup-trigger {
    position: relative;
    cursor: pointer;
}

.popup-image {
    display: none;
    position: absolute;
    bottom: 100%;
    /* Position above the link */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    /* Adjust size */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    border: 2px solid #F7EAFB;
    background-color: #0A010D;
    /* background to prevent see-through */
    margin-bottom: 10px;
}

.hover-popup-trigger:hover .popup-image {
    display: block;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 900px) {
    .popup-image {
        display: none !important;
    }
}

/* Playground Mosaic */
.playground-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding-bottom: 64px;
    width: 96%;
    /* Prevent hover popup from causing scrollbar */
}

.playground-item {
    position: relative;
    z-index: 1;
    /* Ensure no overflow hidden so image can pop out */
}

.playground-item:hover {
    z-index: 100;
    /* Bring to front on hover */
}

.playground-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    /* Bouncy transition */
    display: block;
    cursor: pointer;
}

.playground-item:hover img {
    transform: scale(1.3);
    /* Pop up effect */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #9d84c9;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .playground-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Lightbox Styles */
#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 1, 13, 0.95);
    /* Deep dark background */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    /* Removed manual opacity transition for View Transitions API */
}

/* Mobile Navigation Styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
    /* Above mobile menu */
    padding: 0;
    margin: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #F7EAFB;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 9px;
}

.hamburger span:nth-child(3) {
    top: 18px;
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

/* Mobile Menu Media Query */
@media (max-width: 900px) {
    .hamburger {
        display: block;
    }

    .nav-section {
        position: relative;
        /* Ensure nav items align properly with hamburger */
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        /* Override potential column layout from other queries */
        width: 90%;
    }

    .nav-links {
        display: none;
        /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        flex-direction: column;
        background-color: #0A010D;
        padding: 20px 0;
        border-bottom: 1px solid #333;
        z-index: 1000;
        gap: 20px;
        align-items: center;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
        margin: 0;
    }

    .nav-links a {
        font-size: 18px;
        padding: 10px;
        width: 100%;
        text-align: center;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    /* view-transition-name handled in JS */
    /* Removed manual transform transition */
}

/* Ensure smooth cross-fade for the backdrop */
::view-transition-group(root) {
    animation-duration: 0.4s;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;
    color: #F7EAFB;
    cursor: pointer;
    z-index: 2001;
    line-height: 1;
    transition: color 0.3s ease;
}

#lightbox-close:hover {
    color: #9d84c9;
}