@font-face {
    font-family: "MFDefrag";
    src: url("fonts/MFDefrag-SquareCircle.woff2?v=4") format("woff2");
}

:root {
    font-size: 10px;
    --cursor-size: 3rem;
}

@media (min-width: 768px) {
    :root { font-size: 13px; }
}

@media (min-width: 1200px) {
    :root { font-size: 16px; }
}


/* ======== CURSOR ======== */

@media (hover: hover) {
    * {
        cursor: none !important;
    }

    .cursor {
        position: fixed;
        width: var(--cursor-size);
        height: var(--cursor-size);
        pointer-events: none;
        z-index: 99999;
        opacity: 0;
    }

    .cursor::before,
    .cursor::after {
        content: '';
        position: absolute;
        inset: 0;
        background-size: contain;
        background-repeat: no-repeat;
        transition: opacity 0.25s ease;
    }

    .cursor::before {
        background-image: url('../img/mouse-regular-orange.svg');
        opacity: 1;
    }

    .cursor::after {
        background-image: url('../img/mouse-hovering-orange.svg');
        opacity: 1;
    }

    .cursor--hovering::before { opacity: 0; }
}


/* ======== BODY ======== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    scrollbar-width: thin;
    scrollbar-color: #FE5000 transparent;
}

html::-webkit-scrollbar {
    width: 6px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background: #FE5000;
    border-radius: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: #262626;
}

body.body--locked {
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}


/* ======== DARK MODE ======== */

body.dark-mode header a,
body.dark-mode footer a,
body.dark-mode .square-2-circle,
body.dark-mode .circle-2-square,
body.dark-mode .about p {
    color: #ffffff;
}

@media (hover: hover) {
    body.dark-mode .cursor::before,
    body.dark-mode .cursor::after {
        filter: brightness(0) invert(1);
    }
}


/* ======== HEADER ======== */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #262626;
    font-family: 'Roboto', sans-serif;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header a {
    color: #FE5000;
    text-decoration: none;
    font-size: 1.5rem;
}

.dark-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.dark-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dark-toggle__track {
    display: inline-block;
    width: 2.8rem;
    height: 1.4rem;
    background: #444;
    border-radius: 1rem;
    position: relative;
    transition: background 0.25s;
}

.dark-toggle__track::after {
    content: '';
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1rem;
    height: 1rem;
    background: #FE5000;
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}

.dark-toggle input:checked + .dark-toggle__track {
    background: #555;
}

.dark-toggle input:checked + .dark-toggle__track::after {
    transform: translateX(1.4rem);
    background: #ffffff;
}

nav {
    display: flex;
    gap: 2rem;
}


/* ======== FOOTER ======== */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: #262626;
    font-family: 'Roboto', sans-serif;
    z-index: 10;
}

footer a {
    color: #FE5000;
    text-decoration: none;
    font-size: 1.5rem;
}


/* ======== HOME ======== */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
}

.word-block {
    padding: 0 2rem;
}

.word {
    display: flex;
    width: 100%;
    line-height: 1;
}

.square-2-circle {
    font-family: "MFDefrag", sans-serif;
    font-size: calc(21.74vw - 0.8696rem);
    font-variation-settings: "STYL" 200;
    transition: font-variation-settings 0.3s cubic-bezier(0.5, 0, 0, 1);
    color: #FE5000;
    cursor: default;
    user-select: none;
}

.square-2-circle.shifted {
    font-variation-settings: "STYL" 800;
}

.square-2-circle:hover,
.square-2-circle.shifted:hover {
    font-variation-settings: "STYL" 800;
    transition: font-variation-settings 0.3s cubic-bezier(0.5, 0, 0, 1);
}

.square-2-circle.shifted:hover {
    font-variation-settings: "STYL" 200;
}

.circle-2-square {
    font-family: "MFDefrag", sans-serif;
    font-size: calc(21.74vw - 0.8696rem);
    font-variation-settings: "STYL" 800;
    transition: font-variation-settings 0.3s cubic-bezier(0.5, 0, 0, 1);
    color: #FE5000;
    cursor: default;
    user-select: none;
}

.circle-2-square.shifted {
    font-variation-settings: "STYL" 200;
}

.circle-2-square:hover,
.circle-2-square.shifted:hover {
    font-variation-settings: "STYL" 200;
    transition: font-variation-settings 0.3s cubic-bezier(0.5, 0, 0, 1);
}

.circle-2-square.shifted:hover {
    font-variation-settings: "STYL" 800;
}


/* ======== PROJECTS ======== */

.projects {
    padding: 0 2rem 6rem;
}

.projects-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #FE5000;
    border-left: 1px solid #FE5000;
}

@media (max-width: 768px) {
    .projects-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.projects-list li {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid #FE5000;
    border-bottom: 1px solid #FE5000;
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
    container-type: inline-size;
}

.projects-list a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

.project-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.projects-list li:hover .project-preview {
    opacity: 1;
}

.projects-list a {
    font-family: 'Roboto', sans-serif;
    font-size: 7cqw;
    color: #FE5000;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.projects-list span {
    font-family: 'Roboto', sans-serif;
    font-size: 7cqw;
    color: #FE5000;
}

.project-type {
    opacity: 0.5;
}

.project-year {
    margin-top: auto;
}

body.dark-mode .projects-list a,
body.dark-mode .projects-list span {
    color: #ffffff;
}

body.dark-mode .projects-list,
body.dark-mode .projects-list li {
    border-color: #ffffff;
}


/* ======== LIGHTBOX ======== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #262626;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.lightbox--open {
    opacity: 1;
    pointer-events: all;
}

.lightbox__media-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lightbox__close {
    background: none;
    border: none;
    color: #FE5000;
    font-size: 2.5rem;
    line-height: 1;
    padding: 0 0 1rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.lightbox__close:hover { opacity: 1; }

body.dark-mode .lightbox__close { color: #ffffff; }

.lightbox__arrow {
    background: none;
    border: none;
    color: #FE5000;
    font-size: 3rem;
    padding: 1rem 2rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.lightbox__arrow:hover { opacity: 1; }

body.dark-mode .lightbox__arrow { color: #ffffff; }

.lightbox__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.lightbox__media {
    height: calc(90vh - 6rem);
    aspect-ratio: 9 / 16;
    background: #333;
}

@media (max-width: 640px) {
    .lightbox {
        flex-wrap: wrap;
        align-content: center;
    }

    .lightbox__inner {
        order: 1;
        flex: 0 0 100%;
    }

    .lightbox__arrow {
        order: 2;
        flex: 1;
    }

    .lightbox__media {
        height: calc(70vh - 6rem);
    }
}

.lightbox__title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    color: #FE5000;
    margin: 0;
}

.lightbox__year {
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    color: #FE5000;
    margin: 0;
    opacity: 0.5;
}

body.dark-mode .lightbox {
    background: #ffffff;
}

body.dark-mode .lightbox__media {
    background: #ddd;
}

body.dark-mode .lightbox__title,
body.dark-mode .lightbox__year {
    color: #ffffff;
}

.lightbox__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ======== PROJECT ======== */

.project {
    padding: 8rem 2rem 6rem;
}

.project__layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.project__text {
    position: sticky;
    top: 8rem;
}


.project__title,
.project__type,
.project__year,
.project__description {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: #FE5000;
    margin: 0;
    padding: 1rem 0;
    line-height: 1.4;
}

.project__title,
.project__type {
    border-top: 1px solid #FE5000;
}

.project__year + .project__description {
    border-top: 1px solid #FE5000;
}

.project__year {
    padding-top: 0;
}

.project__description--meta {
    opacity: 0.5;
}

.project__video {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #333;
}

.project__video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    /* 16:9 video covering a 3:2 container: width = 100% × (16/9) ÷ (3/2) = 100% × 32/27 */
    height: 100%;
    width: calc(100% * 32 / 27);
    transform: translate(-50%, -50%);
    border: none;
}

.project__video--vertical {
    aspect-ratio: 1 / 1;
}

.project__video--vertical iframe {
    width: 100%;
    height: 100%;
}

.project__video::after {
    content: '';
    position: absolute;
    inset: 0;
}

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

.project__image {
    width: 100%;
    background: #333;
}

.project__image img {
    width: 100%;
    height: auto;
    display: block;
}

body.dark-mode .project__title,
body.dark-mode .project__type,
body.dark-mode .project__year,
body.dark-mode .project__description {
    color: #ffffff;
}

body.dark-mode .project__title,
body.dark-mode .project__type,
body.dark-mode .project__year + .project__description {
    border-color: #ffffff;
}

body.dark-mode .project__image {
    background: transparent;
}

@media (max-width: 768px) {
    .project__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project__text {
        position: static;
    }

    .project__title,
    .project__type,
    .project__year,
    .project__description {
        font-size: 1.4rem;
    }
}


/* ======== ABOUT ======== */

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
}

.about-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8rem 2rem 6rem;
}

.about-sphere {
    position: relative;
    overflow: hidden;
}

#sphere-scene {
    position: absolute;
    inset: 0;
}

.about-cta {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    color: #FE5000;
    margin: 0;
    padding: 2rem 0 0 0;
}

body.dark-mode .about-cta {
    color: #ffffff;
}

@media (max-width: 768px) {
    .about-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .about-text {
        padding: 8rem 2rem 3rem;
    }

    .about-sphere {
        height: 60vh;
    }

    .about-cta-arrow {
        display: none;
    }

    .about-cta::after {
        content: ' \2193';
    }
}

.about {
    padding: 0 2rem;
    max-width: 620px;
}

.about-text .about {
    padding: 0;
}

.about p {
    font-family: 'Roboto', sans-serif;
    font-size: 3rem;
    line-height: 1.2;
    color: #FE5000;
    margin: 0;
}

.about-text .about p {
    font-size: 1.5rem;
}

.gif-card {
    width: 80px;
    height: 142px;
    background: #333;
    overflow: hidden;
    cursor: pointer;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: box-shadow 0.2s ease;
}

.gif-card:hover {
    box-shadow: 0 0 18px rgba(254, 80, 0, 0.85);
}

.gif-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
