/* style.css */

:root {
    --bg-color: #111111;
    --text-main: #e0e0e0;
    --accent: rebeccapurple;
    --border: #333333;
    --card-bg: #000000;
    --font-main: 'Courier New', Courier, monospace;
    --logo-size: 55px;
}

* {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.4;
    cursor: none;
    width: 100%;
}

main {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: left;
    align-items: center;
    text-align: left;
    width: 100%;
}

.hero-content {
    position: absolute;
    z-index: 10;
    padding-bottom: 5rem;
}

.hero-content .subtitle {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    margin-top: 0;
}

.arrow {
    /* source: codepen.io/iam_aspencer/pen/ROraQd */
    position: absolute;
    z-index: 2;
    bottom: 130px;
    left: calc(50% - 1px);
    width: 3px;
    height: 25px;
    background: white;

    animation: bounce 1s cubic-bezier(.19, .38, 0, 1) infinite;

    &::before { /* bottom part of arrow */
        content: '';
        position: absolute;
        width: 15px;
        height: 15px;
        bottom: 0;
        left: -6px;
        border-bottom: solid white 3px;
        border-right: solid white 3px;

        transform: rotate(45deg);
    }

    &::after {
        content: '';
        position: absolute;
        width: 40px;
        height: 40px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        /* background-color: rebeccapurple; debug
        opacity: .5; */
    }

    &:hover {
        background-color: white !important;
    }
}

/* arrow animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(-4px);
    }

    50% {
        transform: translateY(4px);
    }
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--text-main);
    display: block !important;
    padding-bottom: 5px;
    width: fit-content;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--accent);
    margin-top: 2rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
}

h4 {
    font-weight: 100;
    text-decoration: underline dashed;
    margin-bottom: 0;
    text-transform: uppercase;
}
p {
    max-width: 60ch;
}

a {
    color: var(--text-main);
    text-decoration: none;
    text-decoration-thickness: 1px;
}

a:hover {
    background-color: var(--accent);
    text-decoration: none;
    cursor: none !important;
}

/* --- Nav --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--text-main);
    z-index: 1000;
    padding: 10px;
}

nav {
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

nav a.active:not(.nav-logo) {
    background-color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;

    & a {
        padding-left: 2px;
        padding-right: 2px;
    }
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo:hover {
    background-color: transparent !important;
}

.nav-logo svg {
    height: var(--logo-size);
    fill: var(--accent);
    background-color: none !important;
    &:hover {
        transform: translateY(-2.5px);
        background-color: transparent !important;
    }
}

.nav-logo:active svg {
    transform: scale(0.95);
    fill: var(--accent);
    transition: 0.1s;
    background-color: transparent !important;
}

/* --- Scroll Progress Bar (Added) --- */
.progress-container {
    position: fixed;

    top: calc(var(--logo-size) + 17px);
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    z-index: 1001;
}

.progress-bar {
    height: 4px;
    background: var(--accent);
    width: 0%;
}

/* --- Location --- */
.location-wrapper {
    margin-top: 1rem;
    width: fit-content;
}

.location-wrapper:hover {
    color: var(--accent);
}

.location-wrapper i {
    color: var(--text-main);
}

.ku-text {
    font-size: x-large;
    text-decoration: underline;
    background: linear-gradient(90deg,
            #E8000D 0%,
            #0051BA 25%,
            #E8000D 50%,
            #0051BA 75%,
            #E8000D 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: snakeMove 7s linear infinite;
}

a.ku-link:hover {
    background-color: white !important;
}

@keyframes snakeMove {
    to {
        background-position: 200% center;
    }
}

/* --- Buttons --- */
.hero-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--text-main);
    background: black;
    color: var(--text-main);
    font-family: var(--font-main);
    text-decoration: none;
    cursor: none;
    transition: 0s;
}

.btn:hover {
    background: var(--text-main);
    color: black;
}

.btn-icon {
    font-size: 1.7rem;
    margin-left: auto;
}

/* --- Projects --- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* mobile about page fixes */
@media (max-width: 768px) {

    .about-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .about-text {
        width: 100%;
        overflow: visible;
    }

    .about-images {
        flex: none;
        width: 100%;
        flex-direction: row;
        gap: 1rem;
    }

    .about-images img,
    .about-images video {
        width: 50%;
        height: auto;
        object-fit: cover;
    }
}

/* force left align with block */
@media (max-width: 768px) {
    main {
        max-width: 768px;
        margin: 0;
        display: block;
    }
}

/* remove nav links on mobile */
@media (max-width: 540px) {
    .nav-links {
        display: none;
    }

    nav {
        justify-content: center;
    }
}

/* mobile projects: 2 columns */
@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop: 3 project columns */
@media (min-width: 1024px) {
    .project-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.project-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    padding: 10px;
    background: black;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent);
}

.img-zoom-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    background: #111;
}

.img-zoom-wrapper img,
.img-zoom-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0s;

    /* custom image positions and zoom */
    transform-origin: var(--img-pos, center top);
    object-position: var(--obj-pos, center center);

    transform: scale(var(--img-zoom, 1));
}

.video-on-hover:hover img,
.video-on-hover:hover video,
.expand-video:hover img,
.expand-video:hover video {
    transform: scale(1) !important;
    object-position: center center !important;
}

.project-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.project-tags span {
    border: 1px solid var(--border);
    padding: 2px 8px;
    font-size: 0.8rem;
    color: var(--text-main);
}

.project-links {
    margin-top: 1rem;
    display: flex;
    align-items: center;
}

/* --- Education / Coursework Styling --- */

/* University Header Info */
.education-header {
    display: inline-block;
    margin-top: 0;
    padding-top: 0;
}

.education-header h3 {
    display: inline-block;
    padding: 0;
}

.edu-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 2.5rem;
}

.edu-stats {
    display: flex;
    flex-direction: column;
    text-align: left;
    font-size: 0.9rem;
    opacity: 0.6;
    line-height: 1.2;
}

.edu-header-row h3 {
    margin-top: 1rem;
}

.course-degree {
    font-size: 1.1rem;
    margin-top: 0;
    color: var(--text-main);
}

@media (max-width: 600px) {
    .edu-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .course-degree {
        margin-bottom: 0;
    }

    .edu-stats {
        text-align: left;
    }
}

/* Card Internals */
.course-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border);
    /* Receipt line */
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.course-code {
    color: var(--accent);
}

.course-grade {
    opacity: 0.5;
}

.course-title {
    font-size: 1.2rem;
    font-weight: bold;
    opacity: .9;
}

.course-desc {
    font-size: 0.9rem;
    flex-grow: 1;
}

/* --- Expanding Video Logic --- */
.expand-video:hover {
    overflow: visible;
    position: static;
    z-index: 50;
}

.expand-video:hover .coursemap-video {
    position: absolute;
    top: -1px;
    left: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    object-fit: contain;
    background: black;
    z-index: 60;
    border: 1px solid var(--accent);
}

/* --- Footer --- */
footer {
    padding-top: 1rem;
    padding-bottom: 1rem;
    text-align: center;
    border-top: 1px dashed var(--border);
}

footer p {
    max-width: none;
    margin: 0;
}

.social-links {
    display: flex;
    justify-content: left;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 1.5rem;
}

/* --- Raw Cursor --- */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    background-color: var(--accent);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-circle {
    display: none;
}

body.link-hovered .cursor-dot {
    width: 30px;
    height: 30px;
    cursor: none;
}

@media (max-width: 768px) {
    .cursor-dot {
        display: none;
    }

    body {
        cursor: auto;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        text-align: center;
    }
}

/* lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
}

.about-images img.lightbox-trigger {
    cursor: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.about-images img.lightbox-trigger:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- About Section --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text {
    flex: 1;
}

.about-images {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-images img {
    width: 100%;
    border-radius: 8px;
}

.about-images video {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

/* --Contact-- */
#contact {
    min-height: 75vh;
    padding-bottom: 4rem;
}

/* -- Snow -- */
.toggle-snow {
    padding-left: 2px;
    position: absolute;
    bottom: 120px;
    z-index: 20;
    opacity: .5;

    &:hover {
        opacity: 1;
        background-color: var(--accent);
        padding-left: 2px;
        padding-right: 2px;
    }
}


/* Container that covers the screen */
.snowing {
    position: absolute;
    top: -300px;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.snowing.hidden {
    display: none;
}

/* --- Base Snow Styles --- */
.snowing .small,
.snowing .medium {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    top: -100px;
    /* Start above screen */
    animation: snow-fall 12s linear infinite, snow-shake 4s ease-in-out infinite;
}

.snowing .small {
    width: 6px;
    height: 6px;
}

.snowing .medium {
    width: 8px;
    height: 8px;
}

/* --- Keyframe Animations --- */
@keyframes snow-fall {
    0% {
        top: -10%;
    }

    100% {
        top: 100%;
    }
}

@keyframes snow-shake {
    0% {
        transform: translateX(0px);
    }

    50% {
        transform: translateX(60px);
    }

    100% {
        transform: translateX(0px);
    }
}

/* --- Random Positioning & Delays for Small Snow --- */
.snowing .small {
    &:nth-child(1) {
        left: 210px;
        animation-delay: 9s, .3s;
    }

    &:nth-child(2) {
        left: 400px;
        animation-delay: 6s, .3s;
    }

    &:nth-child(3) {
        left: 720px;
        animation-delay: 8s, .3s;
    }

    &:nth-child(4) {
        left: 140px;
        animation-delay: 10s, .3s;
    }

    &:nth-child(5) {
        left: 500px;
        animation-delay: 7s, .2s;
    }

    &:nth-child(6) {
        left: 150px;
        animation-delay: 5.2s, .3s;
    }

    &:nth-child(7) {
        left: 200px;
        animation-delay: 3.4s, .3s;
    }

    &:nth-child(8) {
        left: 70px;
        animation-delay: 6.6s, .3s;
    }

    &:nth-child(9) {
        left: 380px;
        animation-delay: 5.6s, .3s;
    }

    &:nth-child(10) {
        left: 130px;
        animation-delay: 11s, .2s;
    }

    &:nth-child(11) {
        left: 20px;
        animation-delay: 10.5s, .3s;
    }

    &:nth-child(12) {
        left: 620px;
        animation-delay: 8s, .3s;
    }

    &:nth-child(13) {
        left: 400px;
        animation-delay: 3.7s, 3s;
    }

    &:nth-child(14) {
        left: 500px;
        animation-delay: 6s, .3s;
    }

    &:nth-child(15) {
        left: 660px;
        animation-delay: 9s, .3s;
    }

    &:nth-child(16) {
        left: 610px;
        animation-delay: 7.3s, .3s;
    }

    &:nth-child(17) {
        left: 20px;
        animation-delay: 6.8s, 2s;
    }

    &:nth-child(18) {
        left: 670px;
        animation-delay: 6.5s, .6s;
    }

    &:nth-child(19) {
        left: 210px;
        animation-delay: 4s, .3s;
    }

    &:nth-child(20) {
        left: 20px;
        animation-delay: -1.1s, -.1s;
    }
}

/* --- Random Positioning & Delays for Medium Snow --- */
.snowing .medium {
    &:nth-child(1) {
        left: 300px;
        animation-delay: 3.4s, 1s;
    }

    &:nth-child(2) {
        left: 530px;
        animation-delay: .2s, .1s;
    }

    &:nth-child(3) {
        left: 340px;
        animation-delay: 6s, 2s;
    }

    &:nth-child(4) {
        left: 250px;
        animation-delay: 3.4s, 3s;
    }

    &:nth-child(5) {
        left: 400px;
        animation-delay: 8.4s, .3s;
    }

    &:nth-child(6) {
        left: 720px;
        animation-delay: 7.7s, 1s;
    }

    &:nth-child(7) {
        left: 350px;
        animation-delay: 6s, 0.5s;
    }

    &:nth-child(8) {
        left: 560px;
        animation-delay: 1s, 0.5s;
    }

    &:nth-child(9) {
        left: 10px;
        animation-delay: 8.2s, 0.5s;
    }

    &:nth-child(10) {
        left: 40px;
        animation-delay: 3s, 1s;
    }

    &:nth-child(11) {
        left: 220px;
        animation-delay: .6s, 3s;
    }

    &:nth-child(12) {
        left: 630px;
        animation-delay: 9.4s, 2s;
    }

    &:nth-child(13) {
        left: 420px;
        animation-delay: 8s, 3s;
    }

    &:nth-child(14) {
        left: 580px;
        animation-delay: 2s, .3s;
    }

    &:nth-child(15) {
        left: 420px;
        animation-delay: 7s, 1s;
    }

    &:nth-child(16) {
        left: 360px;
        animation-delay: 8s, .3s;
    }

    &:nth-child(17) {
        left: 90px;
        animation-delay: 4.5s, 1s;
    }

    &:nth-child(18) {
        left: 130px;
        animation-delay: 8.2s, 1s;
    }

    &:nth-child(19) {
        left: 150px;
        animation-delay: 6.5s, .1s;
    }

    &:nth-child(20) {
        left: 640px;
        animation-delay: 10s, 1.5s;
    }
}