@import url('https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #060d14;
    overflow-x: hidden;
}

/* ---- Aurora Canvas (fixed, always behind everything) ---- */

#auroraCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

/* Softens the aurora as the page scrolls into the card grid */
#auroraFade {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent            0%,
        transparent           20%,
        rgba(6, 13, 20, 0.55) 40%,
        rgba(6, 13, 20, 0.82) 58%,
        rgba(6, 13, 20, 0.94) 72%,
        #060d14               88%
    );
    pointer-events: none;
    z-index: 1;
}

/* ---- All page content sits above the canvas ---- */

.PageContent {
    position: relative;
    z-index: 2;
}

/* ---- Navigation: Contact ---- */

.ContactWrapper {
    position: fixed;
    top: calc(50% - 37.5vh - 37px);
    left: 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    z-index: 200;
}

.ContactText {
    font-family: "Google Sans", sans-serif;
    font-size: 16px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(190, 228, 251, 0.75);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.ContactLine {
    height: 1.5px;
    width: 32px;
    background: rgba(190, 228, 251, 0.35);
    transition: width 0.35s ease, background 0.3s ease;
}

.ContactWrapper:hover .ContactText {
    color: rgba(190, 228, 251, 1);
    text-shadow: 0 0 24px rgba(190, 228, 251, 0.5), 0 0 60px rgba(34, 211, 238, 0.2);
}

.ContactWrapper:hover .ContactLine {
    width: 95px;
    background: rgba(190, 228, 251, 0.65);
}

/* ---- Navigation: Menu ---- */

.MenuContainer {
    position: fixed;
    top: calc(50% - 37.5vh - 37px);
    right: 28px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    z-index: 200;
}

.MenuWrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    cursor: pointer;
}

.MenuText {
    font-family: "Google Sans", sans-serif;
    font-size: 16px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(190, 228, 251, 0.75);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.MenuLine {
    height: 1.5px;
    width: 32px;
    background: rgba(190, 228, 251, 0.30);
    transition: width 0.35s ease, background 0.3s ease;
}

.MenuWrapper:hover .MenuText {
    color: rgba(190, 228, 251, 1);
    text-shadow: 0 0 24px rgba(190, 228, 251, 0.5), 0 0 60px rgba(34, 211, 238, 0.2);
}

.MenuWrapper:hover .MenuLine {
    width: 65px;
    background: rgba(190, 228, 251, 0.65);
}

/* Dropdown expands leftward inline with the toggle */
.MenuDropdown {
    display: flex;
    flex-direction: row;
    align-items: center;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width 0.35s ease, opacity 0.3s ease;
    padding-right: 24px;
}

.MenuDropdown.open { max-width: 400px; opacity: 1; }

.MenuNavItem {
    font-family: "Google Sans", sans-serif;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(190, 228, 251, 0.60);
    text-decoration: none;
    padding: 0 16px;
    border-left: 1px solid rgba(190, 228, 251, 0.12);
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.MenuNavItem:first-child { border-left: none; }

.MenuNavItem:hover {
    color: rgba(190, 228, 251, 1);
    text-shadow: 0 0 20px rgba(190, 228, 251, 0.4);
}

/* ---- Page Header ---- */

.PageHeader {
    /*
     * Center the Portfolio title at the same vertical level as the nav buttons.
     * Nav center ≈ calc(12.5vh - 37px + 8px) = calc(12.5vh - 29px)
     * Title center = padding-top + title-height/2
     * Solving: padding-top = calc(12.5vh - 29px) - title-height/2
     * title-height ≈ clamp(3rem, 6.5vw, 5.5rem) * line-height(1.05)
     * half ≈ clamp(1.6rem, 3.4vw, 2.9rem)
     */
    padding-top: calc(50vh - 37.5vh - 29px - clamp(1.6rem, 3.4vw, 2.9rem));
    padding-bottom: clamp(48px, 7vw, 80px);
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.PageTitle {
    font-family: "Berkshire Swash", serif;
    font-size: clamp(3rem, 6.5vw, 5.5rem);
    color: #bee4fb;
    margin: 0 0 20px 0;
    line-height: 1.05;
    text-shadow:
        0 0 50px  rgba(190, 228, 251, 0.45),
        0 0 120px rgba(34,  211, 238, 0.18);
    opacity: 0;
    transform: translateY(14px);
    animation: headerFadeUp 0.9s ease 0.15s forwards;
}

.PageSubtitle {
    font-family: "Google Sans", sans-serif;
    font-size: clamp(0.82rem, 1.1vw, 0.98rem);
    color: rgba(190, 228, 251, 0.42);
    letter-spacing: 0.02em;
    max-width: 500px;
    line-height: 1.85;
    opacity: 0;
    transform: translateY(10px);
    animation: headerFadeUp 0.9s ease 0.35s forwards;
}

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

.ResumeLink {
    display: inline-flex;
    align-items: center;
    margin-top: 32px;
    padding: 13px 36px;
    font-family: "Google Sans", sans-serif;
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(34, 211, 238, 0.90);
    text-decoration: none;
    border: 1px solid rgba(34, 211, 238, 0.40);
    background: rgba(34, 211, 238, 0.06);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 0 18px rgba(34, 211, 238, 0.12),
        0 0 40px rgba(34, 211, 238, 0.06);
    transition:
        color        0.3s ease,
        border-color 0.3s ease,
        background   0.3s ease,
        text-shadow  0.3s ease,
        box-shadow   0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: headerFadeUp 0.9s ease 0.55s forwards;
}

.ResumeLink:hover {
    color: rgba(34, 211, 238, 1);
    border-color: rgba(34, 211, 238, 0.70);
    background: rgba(34, 211, 238, 0.10);
    text-shadow: 0 0 22px rgba(34, 211, 238, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 28px rgba(34, 211, 238, 0.22),
        0 0 60px rgba(34, 211, 238, 0.10);
}

/* ---- Card Grid ---- */

.CardSection {
    padding: clamp(40px, 6vw, 72px) clamp(24px, 7vw, 96px) clamp(80px, 10vw, 130px);
    max-width: 1420px;
    margin: 0 auto;
}

.CardGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: clamp(14px, 2vw, 24px);
}

/* ---- Project Card — Liquid Glass ---- */

.ProjectCard {
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    overflow: hidden;
    background: rgba(190, 228, 251, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(190, 228, 251, 0.13);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 1px 0 0 rgba(255, 255, 255, 0.04),
        inset -1px 0 0 rgba(255, 255, 255, 0.04),
        0 4px 28px rgba(0, 0, 0, 0.38);
    opacity: 0;
    transform: translateY(36px);
    /* transition for scroll-reveal */
    transition:
        opacity    0.65s ease,
        transform  0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.35s ease,
        box-shadow   0.35s ease;
}

/* Scroll-reveal: JS adds this class when card enters viewport */
.ProjectCard.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Dome sheen — top-half glass highlight */
.ProjectCard::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.11) 0%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 4;
}

/* Hover state */
.ProjectCard:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 1px 0 0 rgba(255, 255, 255, 0.07),
        inset -1px 0 0 rgba(255, 255, 255, 0.07),
        0 16px 48px rgba(0, 0, 0, 0.55),
        0 0  28px rgba(34, 211, 238, 0.10),
        0 0  60px rgba(34, 211, 238, 0.05);
}

/* Keep hover lift only after reveal */
.ProjectCard.revealed:hover {
    transform: translateY(-6px);
}

/* ---- Card Image ---- */

.CardImageWrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

/* Hide broken image icons on placeholder cards (no src set) */
.CardImageWrap img:not([src]),
.CardImageWrap img[src=""] {
    display: none;
}

.CardImageWrap img {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    object-fit: cover;
    display: block;
    filter: brightness(0.82) contrast(1.06);
    transition: filter 0.45s ease, transform 0.45s ease;
}

.ProjectCard:hover .CardImageWrap img {
    filter: brightness(1.0) contrast(1.06);
    transform: scale(1.02);
}

/*
 * Gradient placeholder backgrounds — used when no image is present.
 * Add more as needed (--10, --11, etc.) in the same format.
 * To use: add the class to .CardImageWrap alongside CardImageBg--N
 */
.CardImageBg--1 { background: linear-gradient(135deg, #0a1628 0%, #0d3b4f 55%, #06b6d4 130%); }
.CardImageBg--2 { background: linear-gradient(135deg, #1a0a2e 0%, #2d1b6b 55%, #818cf8 130%); }
.CardImageBg--3 { background: linear-gradient(135deg, #051520 0%, #0c3a5c 55%, #0ea5e9 130%); }
.CardImageBg--4 { background: linear-gradient(135deg, #0a1a0e 0%, #0d3b25 55%, #34d399 130%); }
.CardImageBg--5 { background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 55%, #3b82f6 130%); }
.CardImageBg--6 { background: linear-gradient(135deg, #180a2e 0%, #3b0f6b 55%, #a78bfa 130%); }
.CardImageBg--7 { background: linear-gradient(135deg, #051520 0%, #072a3e 55%, #22d3ee 130%); }
.CardImageBg--8 { background: linear-gradient(135deg, #1a0808 0%, #4a1010 55%, #ef4444 130%); }
.CardImageBg--9 { background: linear-gradient(135deg, #0f1a08 0%, #253b10 55%, #84cc16 130%); }

/* ---- Card Body ---- */

.CardBody {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    background: rgba(3, 8, 16, 0.72);
    position: relative;
    z-index: 2;
}

.CardTitle {
    font-family: "Berkshire Swash", serif;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: rgba(190, 228, 251, 0.90);
    margin: 0;
    font-weight: normal;
    line-height: 1.35;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    padding-right: 24px; /* room for arrow */
}

.ProjectCard:hover .CardTitle {
    color: rgba(190, 228, 251, 1);
    text-shadow: 0 0 18px rgba(190, 228, 251, 0.22);
}

.CardTag {
    font-family: "Google Sans", sans-serif;
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(34, 211, 238, 0.50);
    transition: color 0.3s ease;
}

.ProjectCard:hover .CardTag {
    color: rgba(34, 211, 238, 0.85);
}

/* Subtle arrow that slides in on hover */
.CardArrow {
    position: absolute;
    bottom: 19px;
    right: 20px;
    font-size: 13px;
    color: rgba(34, 211, 238, 0);
    transform: translateX(-8px);
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 3;
    font-family: "Google Sans", sans-serif;
}

.ProjectCard:hover .CardArrow {
    color: rgba(34, 211, 238, 0.72);
    transform: translateX(0);
}

/* ---- Footer ---- */

.PageFooter {
    padding: 26px clamp(24px, 7vw, 96px);
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(190, 228, 251, 0.05);
    position: relative;
    z-index: 2;
}

.Copyright {
    font-family: "Google Sans", sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(190, 228, 251, 0.25);
}

/* ================================================================
   MOBILE — Portrait & Landscape shared: static gradient, fix nav
   ================================================================ */
@media (max-width: 900px) {

    /* Hide canvas, show static aurora gradient */
    #auroraCanvas,
    #auroraFade { display: none; }

    html {
        background:
            radial-gradient(ellipse 160% 70% at 50% 22%, rgba(34, 211, 238, 0.22) 0%, transparent 65%),
            radial-gradient(ellipse 110% 55% at 15% 12%, rgba(52, 211, 153, 0.16) 0%, transparent 60%),
            radial-gradient(ellipse 90%  50% at 85% 32%, rgba(129, 140, 248, 0.14) 0%, transparent 58%),
            radial-gradient(ellipse 130% 40% at 50% 50%, rgba(13,  148, 136, 0.10) 0%, transparent 70%),
            linear-gradient(to bottom, #020709 0%, #050d16 50%, #060d14 100%);
    }

    /* Fix nav to top of screen with a simple pixel offset */
    .ContactWrapper,
    .MenuContainer {
        top: 20px;
    }

    /* Shrink nav text so it fits on narrow screens */
    .ContactText,
    .MenuText {
        font-size: 11px;
        letter-spacing: 3px;
    }

    .ContactLine,
    .MenuLine { width: 22px; }

    /* Cap menu dropdown so it doesn't overlap Contact */
    .MenuDropdown.open { max-width: 175px; }
    .MenuNavItem {
        font-size: 9px;
        letter-spacing: 2px;
        padding: 0 9px;
    }

    /* Header: replace the complex calc with a simple top padding on mobile */
    .PageHeader {
        padding-top: 80px;
        padding-bottom: clamp(32px, 5vw, 56px);
        padding-left: clamp(16px, 5vw, 48px);
        padding-right: clamp(16px, 5vw, 48px);
    }

    /* Title: tighter floor for small phones */
    .PageTitle {
        font-size: clamp(2.2rem, 8vw, 4rem);
    }

    /* Subtitle: slightly larger min so it reads on small screens */
    .PageSubtitle {
        font-size: clamp(0.78rem, 2.5vw, 0.95rem);
    }

    /* Card section: tighter side padding on mobile */
    .CardSection {
        padding-left: clamp(12px, 4vw, 48px);
        padding-right: clamp(12px, 4vw, 48px);
    }
}

/* ================================================================
   MOBILE — Landscape only: compress header so cards peek on screen
   ================================================================ */
@media (max-width: 900px) and (orientation: landscape) {

    .ContactWrapper,
    .MenuContainer { top: 14px; }

    /* Compact header — must leave enough room for cards to peek */
    .PageHeader {
        padding-top: 56px;
        padding-bottom: 16px;
    }

    .PageTitle {
        font-size: clamp(1.6rem, 5vw, 2.6rem);
        margin-bottom: 10px;
    }

    .PageSubtitle {
        font-size: clamp(0.7rem, 1.8vw, 0.85rem);
        line-height: 1.6;
    }

    .ResumeLink {
        margin-top: 14px;
        padding: 9px 24px;
        font-size: 10px;
        letter-spacing: 4px;
    }

    /* Tighter card section top padding */
    .CardSection {
        padding-top: clamp(20px, 3vw, 36px);
    }
}
