@import url("https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css");

/* Base */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Funnel Sans", sans-serif;
    background-color: rgb(255, 255, 255);
    background-size: cover;
    background-image:
        linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.8)),
        radial-gradient(18% 28% at 24% 50%, #CEFAFFFF 7%, #073AFF00 100%),
        radial-gradient(18% 28% at 18% 71%, #FFFFFF59 6%, #073AFF00 100%),
        radial-gradient(70% 53% at 36% 76%, #73F2FFFF 0%, #073AFF00 100%),
        radial-gradient(42% 53% at 15% 94%, #FFFFFFFF 7%, #073AFF00 100%),
        radial-gradient(42% 53% at 34% 72%, #FFFFFFFF 7%, #073AFF00 100%),
        radial-gradient(18% 28% at 35% 87%, #FFFFFFFF 7%, #073AFF00 100%),
        radial-gradient(31% 43% at 7% 98%, #FFFFFFFF 24%, #073AFF00 100%),
        radial-gradient(21% 37% at 72% 23%, #D3FF6D9C 24%, #073AFF00 100%),
        radial-gradient(35% 56% at 91% 74%, #4FA1FFF5 9%, #073AFF00 100%),
        radial-gradient(74% 86% at 67% 38%, #6DFFAEF5 24%, #073AFF00 100%),
        linear-gradient(125deg, #4EFFFCFF 1%, #4C00FCFF 100%);
    z-index: 0;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 120px 120px;
    background-attachment: fixed;
    mix-blend-mode: soft-light;
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
    margin: 0;
}

        /* Layout */
        .main {
            width: 100%;
            padding: 100px 24px 24px;
            box-sizing: border-box;
        }

        .sheet {
            max-width: 720px;
            margin: 0 auto 48px;
            padding: 24px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 16px;
            backdrop-filter: blur(9.1px);
            -webkit-backdrop-filter: blur(9.1px);
            border: 1px solid rgba(255, 255, 255, 0.89);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .home {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            margin: 24px 0 48px;
        }

        .container {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 48px;
        }

        .intro-text {
            display: flex;
            flex-direction: column;
            justify-content: left;
            text-align: left;
            max-width: 390px;
            gap: 24px;
        }

        .intro-text h1,
        .intro-text h2,
        .intro-text p {
            margin: 0;
        }

        /* Typography */
        .home .brand-text {
            font-family: "Google Sans Code", sans-serif;
            font-size: xx-large;
            font-weight: 600;
            color: #09121c;
            margin: 0 0 8px 0;
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: "Stack Sans Headline", "Funnel Sans", sans-serif;
        }

        p, li, a, button, input, textarea {
            font-family: "Funnel Sans", sans-serif;
        }

        .h2-section {
            margin: 24px 0 32px 16px;
        }

        .h3-section {
            margin: 16px 0 32px 24px;
        }

        /* Media */
        .main img {
            border-radius: 8px;
            border: 1px solid #ddd;
            max-width: 500px;
            min-width: 200px;
            height: auto;
        }

        #profilepic {
            width: 100%;
            max-width: 402px;
            height: auto;
            object-fit: cover;
            margin: auto;
            border-radius: 12px;
        }

        .image-list {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 24px;
            justify-content: left;
            align-items: center;
            margin-bottom: 24px;
        }

        .image-list img {
            height: 280px !important;
            width: auto !important;
            max-width: none !important;
            min-width: auto !important;
            object-fit: contain !important;
        }

        .project-image {
            width: 100%;
            height: auto;
            border-radius: 6px;
            border: 1px solid #ddd;
            object-fit: cover;
        }

        /* Header / Nav */
        header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            min-width: 100%;
            z-index: 100;
        }

        #topbar {
            position: sticky;
            top: 0;
            padding: 16px;
            background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(9.1px);
            -webkit-backdrop-filter: blur(9.1px);
            border-bottom: 1px solid #ddd;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            overflow: hidden;
            z-index: 100;
        }

        #topbar ul {
            list-style: none;
            display: flex;
            align-items: center;
            gap: 24px;
            padding: 0;
            margin: 16px;
        }

        #topbar .brand-text {
            font-family: "Google Sans Code", sans-serif;
            font-size: large;
            font-weight: 600;
            color: #09121c;
            margin: 0 16px 0 0;
        }

        #topbar ul li a {
            text-decoration: none;
            font-size: large;
            font-weight: 500;
            color: #252d36;
        }

        #topbar ul li a:hover {
            background-color: yellow;
            text-decoration: underline dashed;
            text-decoration-color: rgb(210, 210, 210);
        }

        /* Buttons */
        .button-column {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            width: 100%;
            gap: 16px;
            margin-top: 16px;
        }

        .button {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 24px;
            background: #3871af;
            color: #fff;
            text-decoration: none;
            font-size: x-large;
            border-radius: 6px;
            border: 0;
            white-space: nowrap;
            transition: background 0.3s;
        }

        .button:hover {
            background: #285680;
            cursor: pointer;
        }

        .button-row {
            display: flex;
            flex-direction: row;
            gap: 12px;
            width: 100%;
            flex-wrap: nowrap;
        }

        .button-row .button {
            flex: 1;
            min-width: 0;
        }

        .icon {
            width: 18px;
            height: auto;
            display: block;
        }

        /* Projects */
        #projects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 24px;
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 16px;
            box-sizing: border-box;
            transition: all 0.3s ease;
        }

        .project {
            width: 100%;
            min-height: 200px;
            box-sizing: border-box;
            background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(9.1px);
            -webkit-backdrop-filter: blur(9.1px);
            border: 1px solid rgba(255, 255, 255, 0.89);
            border-radius: 8px;
            padding: 16px;
            transition: all 0.3s cubic-bezier(.2,.8,.2,1);
            will-change: transform, opacity;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
        }

        .project h3 {
            font-size: 18px;
            color: #39526e;
        }

        .project-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-top: 12px;
        }

        .project-tag {
            background-color: #f0f0f0;
            color: #555;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
        }

        .project:hover {
            background-color: #fbfbfb;
            transform: scale(1.03);
        }

        /* Collapsible */
        .collapsible-list {
            padding: 0;
            margin: 0;
        }

        .collapsible {
            color: #000000;
            cursor: pointer;
            width: 100%;
            border: none;
            text-align: left;
            outline: none;
            list-style: none;
            margin-left: 0;
            margin-bottom: 0;
            padding: 0;
            transition: all 0.2s ease-out;
        }

        .collapsible:hover {
            color: #3a707a;
            text-decoration: underline;
            text-decoration-style: dotted;
            text-decoration-color: #3a707a;
        }

        .content {
            margin: 16px 0 12px;
            padding: 0 18px;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.2s ease-in, padding 0.2s ease-in, border-width 0.2s ease-in;
            will-change: max-height, padding, border-width;
        }

        .content p {
            margin-top: 0;
        }

        .content img { 
            object-fit: contain;
        }

        .content img .landscape {
            height: 150px;
            width: auto;
        }

        .content img .portrait {
            width: 150px;
            height: auto;
        }

        .collapsible::before {
            content: "\25B6 ";
            font-size: 13px;
            color: rgb(0, 0, 0);
            margin-right: 8px;
            display: inline-block;
            transition: transform 0.2s ease-in-out;
        }

        .collapsible.active::before {
            transform: rotate(90deg);
        }

        /* Colour demo */
        .colour-buttons {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
            margin: 20px 0;
        }

        .colour-btn {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }

        .colour-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        }

        .colour-btn.active {
            border-color: #09121c;
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(0,0,0,0.4);
        }

        .colour-display {
            display: inline-block;
            margin: 30px 0 0;
        }

        #colour-image {
            height: 550px !important;
            width: auto !important;
            max-width: 100%;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            transition: opacity 0.3s ease;
            display: block;
            object-fit: contain !important;
            margin: 0;
            padding: 0;
        }

        /* Footer */
        .bottombar {
            padding: 16px;
            background-color: aliceblue;
        }

        /* Burger menu */
        .burger-menu {
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 35px;
            height: 35px;
            cursor: pointer;
            position: relative;
        }

        .burger-menu span {
            width: 25px;
            height: 3px;
            background-color: #09121c;
            transition: all 0.3s ease;
            position: absolute;
        }

        .burger-menu span:nth-child(1) {
            top: 8px;
        }

        .burger-menu span:nth-child(2) {
            top: 16px;
        }

        .burger-menu span:nth-child(3) {
            top: 24px;
        }

        .burger-menu.active span:nth-child(1) {
            top: 16px;
            transform: rotate(45deg);
        }

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

        .burger-menu.active span:nth-child(3) {
            top: 16px;
            transform: rotate(-45deg);
        }

        /* Responsive */
        @media (max-width: 768px) {
            .main {
                padding: 100px 16px 16px;
            }

            .intro-text {
                max-width: 100%;
                width: 100%;
            }

            .container {
                padding: 0 16px;
            }

            #profilepic {
                max-width: 100%;
            }

            .button {
                padding: 10px 16px;
            }

            .burger-menu {
                display: flex;
                position: fixed;
                right: 32px;
                top: 24px;
                z-index: 101;
            }

            #topbar {
                position: relative;
                overflow: hidden;
                max-height: 80px;
                transition: max-height 0.3s ease;
            }

            #topbar.active {
                max-height: 300px;
            }

            #topbar ul {
                flex-direction: column;
                align-items: flex-start;
                margin: 16px;
                gap: 0;
            }

            #topbar ul li:first-child {
                padding-bottom: 0;
                margin-bottom: 0;
                border-bottom: none;
                width: 100%;
            }

            #topbar ul.active li:first-child {
                padding-bottom: 16px;
                margin-bottom: 16px;
                border-bottom: 1px solid rgba(221, 221, 221, 0.5);
            }

            #topbar ul li:not(:first-child) {
                display: none;
                width: 100%;
                border-bottom: 1px solid rgba(221, 221, 221, 0.3);
            }

            #topbar ul.active li:not(:first-child) {
                display: block;
                padding: 16px 0;
            }

            #topbar ul.active li:last-child {
                border-bottom: none;
            }

            .content img {
                height: auto;
            }
        }

        @keyframes slow-scroll {
            from { transform: translateY(0); }
            to { transform: translateY(-15%); }
        }

/* Simple page-load transition (works in all browsers) */
.main {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    animation: page-in 420ms cubic-bezier(.2,.8,.2,1) 80ms forwards;
    will-change: transform, opacity;
}

@keyframes page-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .main {
        animation: none;
        opacity: 1;
        transform: none;
    }
}