@view-transition {
    navigation: auto;
}

:root {
    --bg: #111113;
    --text-white: #ffffff;
    --text-cream: #ece6d9;
    --text-grey: #727272;
    --text-role: #888888;
    --border-card: rgba(255, 255, 255, 0.1);
    --hover-bg: #ece6d9;
    --hover-text-dark: #1c1c1f;
    --info-panel-width: 700px;
}

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

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

body {
    font-family: 'Sentient', serif;
    font-weight: 400;
    color: var(--text-white);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Two-column wrapper ── */

.case-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    gap: 24px;
}

/* ── Left column: fixed info panel ── */

.info-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--info-panel-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 0 24px 24px;
    overflow: hidden;
}

.info-top {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.back-link {
    margin-bottom: 4px;
    font-family: 'Sentient', serif;
    font-weight: 300;
    font-size: 14px;
    line-height: normal;
    color: var(--text-grey);
    text-decoration: none;
    transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-link:hover {
    color: var(--text-cream);
}

.info-title {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 16px;
}

.info-company {
    font-family: 'Sentient', serif;
    font-weight: 400;
    font-size: 56px;
    line-height: 1.145;
    letter-spacing: -1.4px;
    color: var(--text-cream);
}

.info-role {
    font-family: 'Sentient', serif;
    font-weight: 300;
    font-size: 16px;
    line-height: normal;
    color: var(--text-role);
}

.info-description {
    font-family: 'Sentient', serif;
    font-weight: 300;
    font-size: 18px;
    line-height: normal;
    color: var(--text-white);
    opacity: 0.8;
    width: 100%;
}

/* ── Bottom: project list ── */

.info-bottom {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cases-label {
    font-family: 'Sentient', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.145;
    letter-spacing: -0.4px;
    color: var(--text-grey);
    padding: 4px 0;
    border-bottom: 1px solid var(--border-card);
}

.project-list {
    overflow: hidden;
}

/* ── Project items ── */

.project-item {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-card);
    padding: 24px 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    gap: 0;
    transition: gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-item.active {
    gap: 16px;
}

.project-header {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    padding-right: 24px;
}

.project-hover-arrow {
    display: none;
}

.project-name-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.project-name {
    font-family: 'Sentient', serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.145;
    letter-spacing: -0.6px;
    color: var(--text-cream);
    opacity: 0.5;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-item:not(.active):hover .project-name {
    opacity: 1;
}

/* Right-side arrow — visible only when active */
.project-arrow {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.145;
    color: var(--text-cream);
    opacity: 0;
    margin-left: auto;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

/* Smooth expand/collapse via CSS grid — no height jumps */
.project-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.project-content-inner {
    overflow: hidden;
    min-height: 0;
    display: flex;
    gap: 40px;
    padding-right: 24px;
}

.project-content p {
    font-family: 'Sentient', serif;
    font-weight: 300;
    font-size: 16px;
    line-height: normal;
    color: var(--text-white);
    opacity: 0.8;
    flex: 1;
    transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* No hover color change on content text — just the name lights up */

/* ── Active project state ── */

.project-item.active .project-name {
    opacity: 1;
}

.project-item.active .project-arrow {
    opacity: 1;
}

.project-item.active .project-content {
    grid-template-rows: 1fr;
    opacity: 1;
}

/* Spacing between header and content is handled by gap on .project-item */

/* ── Right column: scrollable image gallery ── */

.image-gallery {
    margin-left: calc(var(--info-panel-width) + 8px);
    padding: 24px 24px 24px 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Scrollbar styling */
.image-gallery::-webkit-scrollbar {
    width: 0;
}

/* ── Image group per project ── */

.image-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Image cards ── */

.image-card {
    width: 100%;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #2a2a2e;
}

.image-card img,
.image-card video {
    width: 100%;
    height: auto;
    display: block;
}

.image-card {
    position: relative;
}

.image-card .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-card .play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px;
}

.image-card .play-btn:hover {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1.08);
}

.image-card.playing .play-btn {
    opacity: 0;
    pointer-events: none;
}

/* Placeholder card when no image is provided */
.image-card.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a2e;
    min-height: 300px;
}

.image-card.placeholder::after {
    content: attr(data-label);
    font-family: 'Sentient', serif;
    font-weight: 300;
    font-size: 16px;
    color: var(--text-grey);
}

/* ── Mobile: stack columns ── */

@media (max-width: 900px) {
    html, body {
        overflow: auto;
    }

    .case-wrapper {
        flex-direction: column;
        height: auto;
        gap: 0;
    }

    .info-panel {
        position: relative;
        width: 100%;
        height: auto;
        padding: 24px;
    }

    .image-gallery {
        margin-left: 0;
        height: auto;
        overflow: visible;
        padding: 24px;
    }

    .image-card.placeholder {
        min-height: 200px;
    }
}

/* View Transitions */

@keyframes vt-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes vt-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vt-slide-up-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

::view-transition-old(root) {
    animation: 280ms ease-out both vt-fade-out;
}

::view-transition-new(root) {
    animation: 280ms ease-in both vt-slide-up-in;
}

/* Entrance animations for case page elements */

@keyframes entrance-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.back-link,
.info-title,
.info-description,
.info-bottom,
.image-gallery {
    animation: entrance-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.back-link        { animation-delay: 0.05s; }
.info-title       { animation-delay: 0.1s; }
.info-description { animation-delay: 0.15s; }
.info-bottom      { animation-delay: 0.2s; }
.image-gallery    { animation-delay: 0.12s; }
