/* ------------------------------ */
/*  GLOBAL RESETS + TYPOGRAPHY   */
/* ------------------------------ */

* {
    margin: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    line-height: 1.25;
    min-height: 100vh;
}

.page-content {
    flex: 1 0 auto;
    overflow: visible;
    min-height: 100%;
}

.project-preview-loop {
    padding: 0rem !important;
}

/* unify text styles */
h1, h2, h3, h4, h5, h6, p, a, li {
    font-size: inherit;
    font-weight: 400 !important;
    padding-left: 1rem;
}

h1 {
    padding-top: 1rem;
}

ul {
    list-style: none;
    padding-left: 0;
}

a, .project-toggle {
    text-decoration: underline;
    text-decoration-style: solid;
    color: blue;
    font-weight: 300;
}

a {
    margin-left: 1rem;
}

a:hover,
a:focus,
a:active,
.project-toggle:hover,
.project-toggle:focus,
.project-toggle:active,
.project-item.is-pinned .project-toggle {
    text-decoration-style: dotted;
    text-decoration-thickness: 2.5px;
}

/* ------------------------------ */
/*  CONSISTENT SECTION SPACING   */
/* ------------------------------ */

.footer {
    margin-top: auto;
}

/* ------------------------------ */
/*       PROJECT LIST ITEMS      */
/* ------------------------------ */

.projects-list {
    position: relative;
    overflow: hidden;
}

.project-item {
    position: relative;
}

.project-item.is-pinned .project-toggle {
    position: sticky;
    top: 0;
    z-index: 5;
}

.project-toggle {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: blue;
    text-decoration: underline;
    margin-left: 2rem;
    padding: 0;
}


/* ------------------------------ */
/*       FLOATING PREVIEW        */
/* ------------------------------ */

.project-preview-loop {
    position: relative;
    width: 100vw;
    margin-left: -1rem;
    max-width: none;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: height 0.6s ease, opacity 0.3s ease;
    z-index: 1;
    padding: 0 !important;
    cursor: pointer;
}

.project-item:hover .project-preview-loop {
    height: 20vh;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0;
}

.project-item.is-pinned .project-preview-loop {
    height: 70vh;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0;
    overflow: visible;
}

.project-item.has-video.is-pinned .project-preview-loop {
    height: 0;
    opacity: 0;
}

.project-item.is-pinned:not(.has-video) .project-preview-loop {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.project-preview-loop::-webkit-scrollbar {
    display: none;
}

.project-description {
    margin: 0 0 0 2rem;
    padding: 0;
    width: calc(100% + 2rem);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.5s ease;
}

.project-description p {
    margin-left: 2rem;
    text-indent: 1rem;
}

.project-item.is-pinned .project-description {
    max-height: 500px;
    opacity: 1;
}

.loop-track {
    display: flex;
    width: 100%;
    height: 20vh;
    animation: scrollLoop var(--loop-duration, 35s) linear infinite;
    margin: 0;
}

.project-item.is-pinned .loop-track {
    animation-play-state: paused;
    height: 70vh;
}

.project-item.has-video.is-pinned .loop-track {
    height: 0;
    opacity: 0;
}

.loop-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.loop-track img,
.loop-track video {
    height: 20vh;
    width: auto;
    object-fit: cover;
}

.project-item.is-pinned:not(.has-video) .loop-track img,
.project-item.is-pinned:not(.has-video) .loop-track video {
    height: 70vh;
}


.pinned-video-player {
    display: none;
    align-items: center;
    justify-content: flex-start;
    width: calc(100% - 2rem);
    margin: 1rem 0 0 2rem;
}

.pinned-video-player video {
    width: 40%;
    max-width: 40%;
    height: auto;
}

.project-item.has-video.is-pinned .pinned-video-player {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes scrollLoop {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--loop-shift, -50%)); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ------------------------------ */
/*          RESPONSIVE            */
/* ------------------------------ */

@media (max-width: 768px) {
    body {
        margin: 1rem;
    }
}
