/* CSS Variables */
@property --gradient-border {
    syntax: "<percentage>";
    inherits: true;
    initial-value: 100%;
}

@property --var1 {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}

@property --var2 {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}

:root {
    --main-color-light: rgb(245, 236, 230);
    --secondary-color-light: rgba(128, 128, 128, 0.08);
    --main-color-grey: rgba(128, 128, 128, 0.6);
    --main-color-accent: rgba(194, 0, 0, 0.3);
    --font-color-heading: rgb(24, 24, 24);
    --font-color-text: rgba(0, 0, 0, 0.8);
    --mobile-breakpoint: 1000px;
}

/* Global Styles */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--main-color-light);
    margin: 0;
    padding: 0;
}

.background {
    position: fixed;
    width: 100dvw;
    height: 100dvh;
    top: 0;
    left: 0;
    transition: --gradient-border 1s ease-in-out;
    background: linear-gradient(
        135deg,
        rgb(255, 255, 255) var(--gradient-border),
        rgb(0, 0, 0) var(--gradient-border)
    );
    z-index: 10;
    mix-blend-mode: difference;
    pointer-events: none;
}

.main-grid {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: min(8dvw, 120px) 1fr;
    grid-template-areas:
        "title"
        "main-content";
    width: 100%;
    max-width: 1500px;
    height: 100dvh;
    padding: min(8px, 1%) min(8px, 1%) min(8px, 1%);
    font-family:
        "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

.background-dark {
    --gradient-border: 0%;
}

.disabled {
    pointer-events: none;
}

p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--font-color-text);
}

h1 {
    color: var(--font-color-heading);
    font-size: 2rem;
}

h2 {
    color: var(--font-color-heading);
    font-size: 1.5rem;
    margin-top: 0;
}

hr {
    border: 0;
    height: 1px;
    background: rgb(121, 121, 121);
    margin: 10px 0;
}

a {
    color: rgb(0, 79, 170);
    mix-blend-mode: normal;
}

.big-text {
    font-size: calc(1rem + 2dvw);
    font-weight: 600;
}

/* Title Styles */
.header {
    grid-area: title;
    position: relative;
    width: 100%;
    display: flex;
}

.header .title-text-svg {
    flex: 1 1 100%;
}

.hamburger-button {
    display: none;
    width: 0%;
    cursor: pointer;
    transform-origin: center;
    transition: width 0.3s ease;
}

.hamburger-button.expanded {
    width: 9%;
}

@media screen and (max-width: 1000px) {
    .hamburger-button{
   		display: block;
    }
}

.title-text {
    fill: var(--font-color-heading);
    font-size: 20px;
    font-weight: 800;
    font-family: "Times New Roman", Times, serif, sans-serif;
    line-height: 0px;
    opacity: 1;
    transition: opacity 0.5s ease;
    user-select: none;
}

.title-text.faded {
    opacity: 0.07;
}

@media screen and (max-width: 1000px) {
    .title-text.faded {
        opacity: 1;
    }
}

.main-content {
    box-sizing: border-box;
    position: relative;
    grid-area: main-content;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 0;
}

.main-container {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    padding: 0px min(3%, 12px);
    overflow: hidden;
}

/* Top Menu Styles */
.nav-menu-container {
    box-sizing: border-box;
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nav-menu {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: min(1200px, 100%);
    height: 100%;
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-size: 2rem;
    font-weight: 600;
    padding: 0 1rem;
    pointer-events: auto;
}

.nav-menu-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 0%;
    transition: all 0.5s ease;
    z-index: 4;
    pointer-events: none;
}
.theme-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-menu.sec-menu{
    display: none;
}

.theme-toggle:hover {
    transform: scale(1.2);
    --gradient-border: 5%;
}

.theme-toggle:active {
    transform: scale(1.1);
}

@media screen and (max-width: 1000px) {
    .nav-menu-container {
        box-sizing: border-box;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        width: fit-content;
        height: 100%;
        background-color: var(--main-color-light);
        transition: all 0.5s ease;
        z-index: 4;
        pointer-events: none;
    }

    .nav-menu {
        box-sizing: border-box;
        position: relative;
        display: flex;
        flex-direction: column;
        width: auto;
        height: auto;
        align-items: start;
        justify-content: flex-start;
        gap: 4px;
        padding: 1rem;
        transition: all 0.5s ease;
        background-color: var(--main-color-light);
        z-index: 5;
    }

    .nav-menu-hidden {
        transform: translateX(-100%);
    }
    .nav-menu-overlay-active {
        opacity: 100%;
        pointer-events: all;
    }
    .theme-toggle{
        display: none;
    }
    .nav-menu.sec-menu {
        display: flex;
    }
}


.nav-menu-item {
    position: relative;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-menu-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--main-color-light);
    transform-origin: center;
    transform: scaleY(0) scaleX(1.1);
    transition: transform 0.3s;
    mix-blend-mode: difference;
}

.nav-menu-item:hover::after {
    transform: scaleY(1) scaleX(1.1);
}
.nav-menu-item.active::after {
    transform: scaleY(1) scaleX(1.1);
}

.nav-menu-item.active:hover::after {
    transform: scaleY(1) scaleX(1.2);
}

.animation-fade-in {
    animation: elementFadeIn 0.5s normal forwards;
}

.animation-fade-out {
    animation: elementFadeOut 0.5s normal forwards;
}

@keyframes elementFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 100%;
        transform: translateY(0px);
    }
}

@keyframes elementFadeOut {
    0% {
        opacity: 100%;
    }

    100% {
        opacity: 0;
    }
}

/* Ticker Styles */
.ticker {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.ticker-track {
    display: flex;
    width: max-content;
    color: rgb(255, 0, 0);
    animation:
        ticker 10s linear infinite,
        red-alert 1s infinite alternate ease-in-out;
}

.tick {
    display: inline-block;
    font-size: 100px;
    font-weight: bold;
    font-family: "Times New Roman", Times, serif;
    user-select: none;
    white-space: nowrap;
    text-align: center;
}

@keyframes ticker {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes red-alert {
    0% {
        color: rgb(255, 0, 0);
    }

    100% {
        color: rgb(131, 0, 0);
    }
}

.flex-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 20px;
}

.flex-container.space-between {
    justify-content: space-between;
}

.button {
    box-sizing: border-box;
    position: relative;
    margin: 10px;
    padding: 10px 20px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--secondary-color-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Tech Item Styles */
#skills-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: auto;
}

.flex-container-tech-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    height: auto;
    margin: 20px 0;
    gap: min(20px, 2vw);
}

.tech-item {
    box-sizing: border-box;
    position: relative;
    padding: 10px;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--secondary-color-light);
    transition: all 0.3s ease;
}

.tech-item-shine {
    inset: 0;
    position: absolute;
    border-radius: 10px;
    background: linear-gradient(
        120deg,
        transparent var(--var1),
        white var(--var1),
        white var(--var2),
        transparent var(--var2)
    );
    pointer-events: none;
    z-index: 10;
}

.shine-animation {
    animation: colourShift 0.5s linear;
}

@keyframes colourShift {
    0% {
        --var1: 0%;
        --var2: 0%;
    }

    20% {
        --var1: 0%;
        --var2: 20%;
    }

    50% {
        --var1: 40%;
        --var2: 60%;
    }

    80% {
        --var1: 80%;
        --var2: 100%;
    }

    100% {
        --var1: 100%;
        --var2: 100%;
    }
}

.tech-item svg {
    margin: 10px 0;
    width: 100%;
    height: 100%;
    display: block;
}

.tech-item img {
    margin: 10px 0;
    width: 100%;
    height: 70%;
    display: block;
    transition: all 1s ease;
}

.tech-item:hover {
    box-shadow: 0px 0px 10px var(--main-color-grey);
}

/* Project Box Styles */
#project-section {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.project-box {
    display: grid;
    grid-template-rows: 1fr auto;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "description picture"
        "tags picture";
    width: 100%;
    height: fit-content;
    margin: 10px;
    border-radius: 4px;
    background-color: var(--secondary-color-light);
    transition: all 0.3s ease;
}

.project-box:hover {
    box-shadow: 0 0 10px var(--main-color-grey);
}

.project-box .description {
    grid-area: description;
    height: auto;
    margin: min(30px, 2vw);
}

.project-box .picture {
    grid-area: picture;
    overflow: hidden;
    width: auto;
    height: auto;
    border-radius: 0px 4px 4px 0px;
}

@media screen and (max-width: 600px) {
    .project-box {
        grid-template-columns: 1fr;
        grid-template-areas:
            "picture"
            "description"
            "tags";
    }

    .project-box .picture {
        border-radius: 4px 4px 0px 0px;
    }
}

.picture > img {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: all 1s ease;
}

.project-box .tags {
    position: relative;
    grid-area: tags;
    display: flex;
    flex-direction: row;
    flex-flow: wrap;
    justify-content: left;
    align-items: center;
    width: auto;
    height: fit-content;
    gap: 10px;
    margin: min(30px, 2vw);
}

.tags img {
    width: clamp(30px, 3vw, 40px);
    height: clamp(30px, 3vw, 40px);
    display: block;
    position: relative;
    object-fit: contain;
    background: radial-gradient(rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 60%);
    transition: all 0.3s ease;
}

.tags > img:hover {
    transform: rotateZ(10deg);
}

/* 3D Scene Styles */
.scene3D {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 300px;
}

.tilt {
	transform: rotateY(25deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slideSide {
    animation: slideAndFadeOut 1s normal forwards;
}

.slideSideReverse {
    animation: slideAndFadeOut 1s reverse forwards;
}

.slideUp {
    animation: slideUpAndFadeOut 1s normal forwards;
}

.slideUpReverse {
    animation: slideUpAndFadeOut 1s reverse forwards;
}

.slideDown {
    animation: slideDownAndFadeOut 1s normal forwards;
}

.slideDownReverse {
    animation: slideDownAndFadeOut 1s reverse forwards;
}

@keyframes slideDownAndFadeOut {
    0% {
        transform: translateY(0px);
        opacity: 1;
    }

    100% {
        transform: translateY(500px);
        opacity: 0;
    }
}

@keyframes slideUpAndFadeOut {
    0% {
        transform: translateY(0px);
        opacity: 1;
    }

    100% {
        transform: translateY(-500px);
        opacity: 0;
    }
}

@keyframes slideAndFadeOut {
    0% {
        transform: translateX(0px);
        opacity: 1;
    }

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

@starting-style {
    .main-menu-item {
        transform: translateX(-300px);
        opacity: 0%;
    }
}

.main-menu-item {
    position: relative;
    color: var(--font-color-heading);
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-weight: 1000;
    font-family: "Times New Roman", Times, serif;
    letter-spacing: 0px;
    line-height: clamp(3rem, 10vw, 6.5rem);
    transition: all 0.05s ease;
    backface-visibility: hidden;
    user-select: none;
    cursor: pointer;
}

.main-menu-item:hover {
    color: var(--main-color-accent);
    transform: scale(1.1);
    animation: shake 0.2s linear 1 forwards;
}

@keyframes shake {
    0% {
        rotate: 0deg;
    }

    33% {
        rotate: 1deg;
    }

    66% {
        rotate: -1deg;
    }

    100% {
        rotate: 0deg;
    }
}

.main-menu-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--main-color-accent);
    transform-origin: center;
    transform: scaleY(0);
    transition: transform 0.3s;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    z-index: -1;
}

.main-menu-item:hover::before {
    transform: scaleY(0);
}

/* Overrides */
.display-none {
    opacity: 0%;
    display: none !important;
    pointer-events: none;
    user-select: none;
}
img {
    filter: invert(1);
}

.invert {
    filter: invert(0);
}
