/* CURSOR */

*, *::before, *::after, body, a, button, input, [role="button"] {
    cursor: none !important;
}

#cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transform: translate(-50%, -50%);
    top: 0;
    left: 0;
    overflow: visible;
}

#cursor-shape {
    fill: #FFFF00;
}

@media (pointer: coarse) {
    *, *::before, *::after, body, a, button, input, [role="button"] {
        cursor: auto !important;
    }
    #cursor { display: none; }
}

/* LOADER */

#loader {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
}

#loader-canvas {
    width: 75px;
    height: 75px;
    display: block;
    transform-origin: center;
    transition: transform 0.35s ease-in;
}

#loader-canvas.shrink {
    transform: scale(0);
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/Aeonik-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/Aeonik-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: 'Aeonik', sans-serif;
    background: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

/* NAV */

.nav {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    padding-bottom: 16px;
    position: relative;
    z-index: 200;
}

/* BURGER */

#burger-btn {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

#burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #000;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.18s ease;
}

#burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#burger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU */

#mobile-menu {
    display: flex;
    position: fixed;
    inset: 0;
    background: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
    z-index: 999;
    gap: 32px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
}

#mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#mobile-menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

#mobile-menu-close::before,
#mobile-menu-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #000;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

#mobile-menu-close::before { transform: rotate(45deg); }
#mobile-menu-close::after  { transform: rotate(-45deg); }

.mobile-menu-item {
    font-size: 40px;
    font-weight: 300;
    color: #000;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
}

.nav-name {
    display: block;
    width: 147px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
    pointer-events: auto;
}

.nav-link {
    font-size: 24px;
    font-weight: 300;
    color: #000;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
}

.nav-link[data-page="contact"] {
    margin-left: auto;
}

.nav-links {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.nav-social {
    font-size: 15px;
    font-weight: 300;
    color: #000;
    text-decoration: none;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: opacity 0.2s ease;
}

.nav-social span { will-change: transform; }

.nav-divider {
    display: none;
}

/* PAGE TITLE */

.page-title {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: -0.5px;
    line-height: 1;
    flex-shrink: 0;
    padding: 24px 0;
    min-height: calc(1em + 48px);
}

@keyframes letterIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.title-letter {
    display: inline-block;
    opacity: 0;
    animation: letterIn 0.25s ease-out forwards;
}

/* CONTENT AREA */

.content-area {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* TAB ROW */

.tab-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    overflow: visible;
    flex: 1;
    min-height: 0;
    position: relative;
}

@keyframes panelReveal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* PANELS — widths & border-radius driven by JS */

.panel {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 20px;
    min-width: 20px;
    background: var(--tab-color, #BEBEBE);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: none;
    position: relative;
    opacity: 0;
}

.panel.active {
    cursor: default;
}

.panel.reveal {
    animation: panelReveal 300ms ease-out both;
    animation-delay: var(--reveal-delay, 0ms);
}

.panel-inner {
    position: relative;
    padding: clamp(16px, 3.5vw, 48px);
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transform-origin: center center;
}

.panel:has(> .expand-btn) .panel-inner {
    padding-top: 68px;
}

.panel:not(.active) .panel-inner,
.panel:not(.active) .expand-btn,
.panel:not(.active) .panel-lock {
    visibility: hidden;
}

/* PAGES */

.page {
    display: none;
}

.page.active {
    display: block;
}

/* SHOWREEL */

.showreel-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
    flex: 1;
    min-height: 0;
    min-width: 0;
}

.showreel-inner.side {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(16px, 2.5vw, 40px);
}

.panel[data-index="5"].active:not(.expanded) .showreel-inner.side {
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.panel[data-index="7"].active:not(.expanded) .showreel-inner.side {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.panel[data-index="5"].active:not(.expanded) .showreel-inner.side .showreel-meta,
.panel[data-index="7"].active:not(.expanded) .showreel-inner.side .showreel-meta {
    width: 100%;
    flex: none;
}

/* RYE LANE — fill available height, size videos from height not width */
.panel[data-index="7"].active:not(.expanded) .rye-videos {
    flex: 1;
    min-height: 0;
    align-self: stretch;
    justify-content: center;
}

.panel[data-index="7"].active:not(.expanded) .rye-videos .showreel-video-wrap.portrait {
    flex: 0 0 auto;
    height: 100%;
    width: auto;
    max-height: none;
}

.panel[data-index="5"].active:not(.expanded) .showreel-video-wrap.square {
    flex: none;
    max-height: 48vh;
    width: auto;
    align-self: center;
}

.showreel-inner.side .showreel-video-wrap {
    flex: none;
    align-self: stretch;
    width: auto;
    min-width: 0;
}

.rye-videos {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-self: stretch;
    align-items: center;
    min-height: 0;
}

.rye-videos .showreel-video-wrap.portrait {
    flex: 1;
    min-width: 0;
    max-height: 100%;
    width: auto;
}

.showreel-inner.side .showreel-meta {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-start;
}

.showreel-video-wrap {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.vimeo-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
    border-radius: 12px;
}

.vimeo-wrap #present-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.showreel-video-wrap.portrait {
    width: auto;
    aspect-ratio: 9 / 16;
    align-self: flex-start;
}

.showreel-video-wrap.square {
    width: auto;
    aspect-ratio: 1 / 1;
    align-self: flex-start;
}

/* All play/pause Rive canvases — single unified rule */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 3;
}
.play-btn.faded { opacity: 0; pointer-events: none; }
.play-btn .pause-icon { display: none; }
.play-btn.playing .play-icon  { display: none; }
.play-btn.playing .pause-icon { display: block; }

video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button {
    display: none !important;
    opacity: 0 !important;
}

#showreel-video,
#cookies-video,
#jellycat-video,
#divingboard-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

#chinatown-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#pixels-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

#rye-video,
#cycling-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* 44 PIXELS */

#bolt6-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


.video-timeline {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: height 0.2s ease;
    z-index: 2;
}

.showreel-video-wrap:hover .video-timeline {
    height: 5px;
}

.timeline-progress {
    height: 100%;
    width: 0%;
    pointer-events: none;
}

.vol-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 2;
    transition: background 0.2s ease, opacity 0.4s ease;
}

.vol-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.vol-btn.faded {
    opacity: 0;
}

.vol-btn .vol-on { display: none; }
.vol-btn .vol-off { display: block; }
.vol-btn.unmuted .vol-on { display: block; }
.vol-btn.unmuted .vol-off { display: none; }



.showreel-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    min-width: 0;
}

.showreel-title {
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showreel-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    min-width: 0;
}

.panel.active:not(.expanded) .showreel-sub {
    display: none;
}

.showreel-link {
    color: rgba(255, 255, 255, 0.9);
    text-underline-offset: 3px;
}

/* TAB TYPE LABELS */

.tab-type {
    display: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel.active:not(.expanded) .tab-type {
    display: block;
}

.panel.active:not(.expanded) .showreel-title {
    display: none;
}

/* Showreel panel — dark text on grey background */
.panel[data-index="0"] .tab-type      { color: rgba(0, 0, 0, 0.45); }
.panel[data-index="0"] .showreel-title { color: #000; }
.panel[data-index="0"] .showreel-sub   { color: rgba(0, 0, 0, 0.55); }

/* TEAM GRID */

.team-inner {
    justify-content: center;
    min-height: 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 24px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 0;
}

.team-canvas {
    width: 100%;
    max-width: 280px;
    max-height: 280px;
    aspect-ratio: 1;
    display: block;
}

.team-name {
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

/* EXPAND BUTTON */

.expand-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    background: none;
    border: none;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s ease;
    color: #ffffff;
}

.expand-btn:hover { opacity: 0.7; }

.expand-btn .collapse-icon { display: none; }
.expand-btn .expand-icon  { display: block; }

.panel.expanded .expand-btn .expand-icon   { display: none; }
.panel.expanded .expand-btn .collapse-icon { display: block; }

/* STYLE FRAMES */

.style-frames {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.panel.expanded .style-frames {
    display: grid;
    align-items: stretch;
}

.style-frames img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
}

.panel.expanded .panel-inner {
    overflow-y: auto;
    scrollbar-width: none;
}

.panel.expanded .pixels-grid {
    grid-template-columns: repeat(3, 1fr);
}

.panel.expanded .pixels-vid {
    height: clamp(100px, 30vh, 260px);
}

.panel.expanded .panel-inner::-webkit-scrollbar { display: none; }

.panel.expanded #cookies-inner .style-frames img {
    aspect-ratio: unset;
    width: 100%;
    object-fit: contain;
}

.panel.expanded .style-frames {
    grid-template-columns: repeat(3, 1fr);
}

.jellycat-right {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.panel[data-index="2"].active:not(.expanded) .jellycat-inner {
    flex-direction: column;
}
.panel[data-index="2"].active:not(.expanded) .jellycat-right {
    display: flex;
}
.panel[data-index="2"].active:not(.expanded) #jellycat-frames {
    display: none;
}

.panel.expanded .jellycat-inner {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(16px, 2.5vw, 40px);
    overflow: hidden;
}

.panel.expanded .jellycat-inner .showreel-video-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.panel.expanded .jellycat-right {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    gap: 12px;
    justify-content: center;
}

.panel.expanded .jellycat-right #jellycat-frames {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
}

.panel.expanded .jellycat-right #jellycat-frames img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.panel.expanded .jellycat-right .showreel-meta {
    flex-shrink: 0;
}

/* COOKIES RIGHT COLUMN */

.cookies-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    min-width: 0;
}

.panel[data-index="1"].expanded #cookies-inner {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(16px, 2.5vw, 40px);
}

.panel[data-index="1"].expanded #cookies-inner .showreel-video-wrap {
    flex: 0 0 min(44%, 480px);
    align-self: stretch;
    min-height: 0;
}

.panel[data-index="1"].expanded .cookies-right {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    scrollbar-width: none;
    justify-content: center;
}

.panel[data-index="1"].expanded .cookies-right::-webkit-scrollbar { display: none; }

/* BOLT 6 RIGHT COLUMN */

.bolt6-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    min-width: 0;
}

.bolt6-rive-wrap {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel.expanded .bolt6-rive-wrap {
    display: flex;
}

.bolt6-rive-canvas {
    width: 300px;
    height: 300px;
    display: block;
    image-rendering: auto;
}

#jellycat-frames {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

/* BOLT 6 EXPANDED — text left, video + rive right */

.panel[data-index="4"].expanded .showreel-inner {
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(16px, 2.5vw, 40px);
}

.panel[data-index="4"].expanded .showreel-inner > .showreel-meta {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    scrollbar-width: none;
}

.panel[data-index="4"].expanded .showreel-inner > .showreel-meta::-webkit-scrollbar { display: none; }

.panel[data-index="4"].expanded .bolt6-right {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
    align-self: flex-start;
}

.panel[data-index="4"].expanded .bolt6-right > .showreel-video-wrap {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* BOLT 6 UNEXPANDED — video on top, meta below */

.panel[data-index="4"]:not(.expanded) .bolt6-right {
    order: 1;
    flex: 1;
    min-height: 0;
}

.panel[data-index="4"]:not(.expanded) .showreel-inner > .showreel-meta {
    order: 2;
    flex: 0 0 auto;
}

.panel[data-index="4"]:not(.expanded) .bolt6-right > .showreel-video-wrap {
    flex: 1;
    min-height: 0;
    width: auto;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    align-self: center;
}

/* 44 PIXELS EXPANDED — video left, meta right */

.panel[data-index="3"].expanded .pixels-inner {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(16px, 2.5vw, 40px);
}

.panel[data-index="3"].expanded .pixels-inner .showreel-video-wrap {
    flex: 0 0 min(58%, 780px);
    aspect-ratio: 16 / 9;
    align-self: center;
}

.panel[data-index="3"].expanded .pixels-inner .showreel-meta {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.panel[data-index="3"].expanded .pixels-inner .showreel-meta::before,
.panel[data-index="3"].expanded .pixels-inner .showreel-meta::after {
    content: '';
    flex: 1;
    min-height: 0;
}
.panel[data-index="3"].expanded .pixels-inner .showreel-meta::-webkit-scrollbar { display: none; }

/* Wordcast stat grid */
.pixels-stats-label {
    opacity: 0.45 !important;
    font-size: 11px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 8px;
}

.pixels-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
}

.pixels-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pixels-stat-num {
    font-size: 26px;
    font-weight: 400;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pixels-stat-label {
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pixels-stats-sep { margin-top: 14px !important; }
.pixels-cue-inline { display: none; }


.panel[data-index="3"].expanded .pixels-inner .showreel-meta::-webkit-scrollbar { display: none; }

/* 44 PIXELS UNEXPANDED */
.panel[data-index="3"]:not(.expanded) .pixels-inner > .showreel-video-wrap {
    flex: 1;
    min-height: 0;
    width: auto;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    align-self: center;
}
/* Unexpanded: single text line, grids hidden */
.pixels-stats-oneline {
    display: none;
    font-size: 11px;
    font-weight: 300;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel[data-index="3"].active:not(.expanded) .pixels-stats-oneline { display: block; }
.panel[data-index="3"].active:not(.expanded) .pixels-stat-grid { display: none; }

/* SHOWREEL — keep video wrap proportional, no cropping on wide views */
.panel[data-index="0"] .showreel-inner > .showreel-video-wrap {
    flex: 1;
    min-height: 0;
    width: auto;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    align-self: center;
}

/* MYTH STUDIO VIDEOS */

.myth-content-inner {
    overflow-y: auto;
    scrollbar-width: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.myth-meta {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 8px;
}
.myth-content-inner::-webkit-scrollbar { display: none; }



.myth-content-inner.revealed {
    opacity: 1;
    pointer-events: auto;
}

.myth-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    gap: 8px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.myth-video-wrap:nth-child(n+3) {
    display: none;
}

.myth-video-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

.myth-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* MYTH EXPANDED — responsive grid */

.panel[data-index="6"].expanded .myth-video-wrap {
    display: block;
}

.panel[data-index="6"].expanded .myth-content-inner {
    overflow: hidden;
}

.panel[data-index="6"].expanded .myth-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr;
}

@media (max-width: 1200px) {
    .panel[data-index="6"].expanded .myth-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    .panel[data-index="6"].expanded .myth-content-inner {
        overflow-y: auto;
    }
}

/* ── NEST HUB & SHORT LANDSCAPE (e.g. 1024×600) ── */
@media (max-height: 680px) and (min-width: 769px) {
    /* Reduce title padding to give the tab row more vertical space */
    .page-title {
        padding: 24px 0;
        min-height: calc(1em + 48px);
    }
    /* Show full video frame instead of cropping in constrained height */
    #jellycat-video,
    #cookies-video {
        object-fit: contain;
    }

    /* Stack all side-by-side layouts vertically — screen is too short for left/right */
    .showreel-inner.side {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .showreel-inner.side > .showreel-video-wrap,
    .showreel-inner.side > .rye-videos {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-height: 44vh;
    }
    .showreel-inner.side .showreel-meta {
        flex: 1;
        width: 100%;
        margin-top: 0;
        overflow-y: auto;
    }

    /* 44 Pixels expanded */
    .panel[data-index="3"].expanded .pixels-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }
    .panel[data-index="3"].expanded .pixels-inner .showreel-video-wrap {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-height: 44vh;
        aspect-ratio: 16 / 9;
    }
    .panel[data-index="3"].expanded .pixels-inner .showreel-meta {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        justify-content: flex-start !important;
    }

    /* 44 Pixels unexpanded — Nest Hub: keep video as main focus, stats strip already handled globally */
    .panel[data-index="3"].active:not(.expanded) .pixels-inner .showreel-meta {
        flex: 0 0 auto;
        min-height: 0;
        overflow: hidden;
    }

    /* Bolt 6 expanded */
    .panel[data-index="4"].expanded .showreel-inner {
        flex-direction: column !important;
        align-items: stretch;
    }
    .panel[data-index="4"].expanded .showreel-inner > .showreel-video-wrap {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-height: 44vh;
        aspect-ratio: 16 / 9;
    }
    .panel[data-index="4"].expanded .showreel-inner > .showreel-meta {
        flex: 1;
        overflow-y: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 768px), (orientation: portrait) {
    .panel[data-index="6"].expanded .myth-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    .panel[data-index="6"].expanded .myth-content-inner {
        overflow-y: auto;
    }
}

.myth-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.myth-play-btn.playing .myth-play-icon  { display: none; }
.myth-play-btn.playing .myth-pause-icon { display: block; }
.myth-play-btn .myth-pause-icon         { display: none; }

.myth-video-wrap:hover .myth-play-btn { opacity: 1; }

/* MYTH SPOTLIGHT */

#myth-spotlight {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 15;
}

#myth-spotlight.active {
    opacity: 1;
}

@media (pointer: coarse) {
    #myth-spotlight.active {
        pointer-events: auto;
    }
}

.myth-spotlight-inner {
    height: min(80%, 700px);
    width: auto;
    max-width: 88%;
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.86);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

#myth-spotlight.active .myth-spotlight-inner {
    transform: scale(1);
}

#myth-spotlight-vid {
    height: 100%;
    width: auto;
    display: block;
}

/* PANEL LOCK */

.panel-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.lock-open {
    display: none;
}

.panel-lock.unlocked .lock-form {
    display: none;
}

.panel-lock.unlocked .lock-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-open-btn {
    width: 48px;
    height: 48px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-form {
    width: 230px;
}

.lock-pill {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 100px;
    padding: 10px 10px 10px 20px;
    gap: 8px;
}

.lock-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Aeonik', sans-serif;
    font-size: 16px;
    color: #000;
    min-width: 0;
}

.lock-input::placeholder {
    color: #aaa;
}

.lock-btn {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}


/* CONTACT */

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-link {
    font-size: 32px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
}

/* ─── TABLET LANDSCAPE — side layouts switch to grid (text bottom) ≤1100px ─── */

@media (max-width: 1100px) {
    .showreel-inner.side {
        display: grid !important;
        grid-template-rows: 1fr auto;
        gap: 10px;
        align-items: unset;
        flex-direction: unset;
    }
    .rye-videos {
        grid-row: 1;
    }
    .showreel-inner.side > .showreel-video-wrap {
        grid-row: 1;
        min-height: 0;
        width: 100% !important;
    }
    .showreel-inner.side .showreel-meta {
        grid-row: 2;
        margin-top: 0;
        width: 100%;
    }
}

/* ─── PORTRAIT / TABLET (≤768px or portrait orientation) ─── */

@media (max-width: 768px), (orientation: portrait) {

    body { padding: 16px; }

    /* Nav */
    .nav-name { display: block; transform: translateX(-20px); }
    .nav-link, .nav-links { display: none; }
    #burger-btn { display: flex; }
    .page-title { font-size: 28px; flex: 0 0 auto; padding: 12px 0; min-height: calc(1em + 24px); }

    /* Panels stack vertically */
    .tab-row { flex: 1; flex-direction: column; height: auto; max-height: none; align-items: stretch; }
    .panel   { min-width: unset; min-height: 20px; width: 100% !important; flex-basis: 20px; }

    /* All video tabs — video at natural ratio, meta pinned to bottom */
    .showreel-inner {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        justify-content: flex-start;
        align-items: stretch;
    }
    .showreel-inner:not(.side) > .showreel-video-wrap {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: unset;
        border-radius: 10px;
    }
    #divingboard-wrap {
        flex: 1 !important;
        aspect-ratio: unset !important;
        min-height: 0 !important;
    }
    .showreel-inner > .showreel-meta { margin-top: 12px; flex: 1; overflow: hidden; }
    .showreel-inner > .showreel-meta .tab-type { flex-shrink: 0; position: relative; }
    .showreel-title { font-size: 15px; }
    .showreel-sub   { font-size: 12px; }
    .panel.expanded .showreel-inner > .showreel-meta { overflow: visible; flex-shrink: 0; }

    /* 44 Pixels — 2-column grid on mobile, smaller videos */
    .pixels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pixels-vid {
        height: clamp(60px, 18vh, 150px);
    }
    .pixels-inner .showreel-meta { flex-shrink: 1; overflow: hidden; margin-top: 8px; }

    /* 44 Pixels expanded — stack column in portrait */
    .panel[data-index="3"].expanded .pixels-inner {
        flex-direction: column !important;
        align-items: stretch;
    }
    .panel[data-index="3"].expanded .pixels-inner .showreel-video-wrap {
        flex: 0 0 auto !important;
        width: 100% !important;
        aspect-ratio: 16 / 9;
        min-height: unset;
        align-self: auto;
    }
    .panel[data-index="3"].expanded .pixels-inner .showreel-meta {
        flex: 0 0 auto;
        min-width: 0;
        overflow: visible;
        justify-content: flex-start;
    }

    /* Side layouts → stack to column, video natural ratio, text fills remaining space */
    .showreel-inner.side            { flex-direction: column; gap: 10px; align-items: stretch; }
    .showreel-inner.side .showreel-video-wrap { width: 100% !important; flex: 0 0 auto; aspect-ratio: 16/9; min-height: unset; align-self: auto; }
    .showreel-inner.side .showreel-meta       { flex: 1; width: 100%; margin-top: 10px; overflow: hidden; }
    .showreel-inner.side .showreel-meta .showreel-sub { font-size: 12px; }
    .panel.expanded .showreel-inner.side .showreel-meta { overflow: visible; }

    /* Show description text in portrait for panels with empty space below video */
    .panel[data-index="0"].active:not(.expanded) .showreel-sub,
    .panel[data-index="1"].active:not(.expanded) .showreel-sub,
    .panel[data-index="4"].active:not(.expanded) .showreel-sub,
    .panel[data-index="9"].active:not(.expanded) .showreel-sub { display: block; }

    /* Cookies + Bolt 6 unexpanded — wrapper fills remaining space, clips overflow */
    .panel[data-index="1"].active:not(.expanded) .cookies-right {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* Cookies expanded — stack video above content in portrait */
    .panel[data-index="1"].expanded #cookies-inner {
        flex-direction: column !important;
    }
    .panel[data-index="1"].expanded #cookies-inner .showreel-video-wrap {
        flex: 0 0 auto !important;
        width: 100% !important;
        aspect-ratio: 16 / 9;
        min-height: unset;
    }
    .panel[data-index="1"].expanded .cookies-right {
        flex: 0 0 auto !important;
        overflow-y: visible;
    }
    .showreel-video-wrap.square,
    .showreel-video-wrap.portrait   { width: 100% !important; aspect-ratio: unset; align-self: auto; }

    /* Bolt 6 expanded — stack to column in portrait */
    .panel[data-index="4"].expanded .showreel-inner {
        flex-direction: column !important;
        align-items: stretch;
    }
    .panel[data-index="4"].expanded .showreel-inner > .showreel-meta {
        overflow-y: visible;
        max-height: none;
        align-self: auto;
    }

    /* Rye Lane portrait — videos stay side by side */
    .rye-videos {
        flex-direction: row !important;
        gap: 8px;
        min-height: 0;
        height: 100%;
    }
    .rye-videos .showreel-video-wrap.portrait {
        flex: 1;
        min-width: 0;
        aspect-ratio: unset;
        width: auto !important;
        height: 100%;
    }

    /* JellyCat — column on portrait, images in 4-col row, text below */
    .jellycat-inner { flex-direction: column !important; gap: 10px; justify-content: flex-start; align-items: stretch; }
    .jellycat-inner .showreel-video-wrap { flex: 1 !important; width: 100% !important; min-height: 0; }
    .jellycat-right { flex: none !important; flex-direction: column; gap: 8px; flex-shrink: 0; justify-content: flex-start; }
    #jellycat-frames { order: -1; grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .jellycat-right .showreel-meta { order: 1; }
    .panel.expanded .jellycat-inner { overflow-y: auto; }

    /* Myth Studio unexpanded portrait — fill height, clear expand button */
    .panel[data-index="6"]:not(.expanded) .myth-content-inner {
        overflow: hidden; /* prevent scroll fighting the flex height chain */
        display: flex;
        flex-direction: column;
        height: 100%;
        padding-top: 68px;
    }
    .panel[data-index="6"]:not(.expanded) .myth-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr;
        margin-top: 0;
        flex: 1;
        min-height: 0;
        height: 0; /* forces flex to control size, not grid content */
    }
    .panel[data-index="6"]:not(.expanded) .myth-video {
        object-fit: cover; /* fill each cell — no letterbox gaps */
    }

    /* Expanded myth — fill blank cell with last video spanning full width */
    .panel.expanded .myth-content-inner .myth-video-wrap:last-child { grid-column: span 2; }

    /* Style frames */
    .style-frames,
    .panel.expanded .style-frames { grid-template-columns: repeat(2, 1fr); }

    /* Team grid */
    .team-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }

    /* Bolt6 */
    .bolt6-rive-canvas { width: 180px; height: 180px; }

    /* Vimeo */
    .vimeo-wrap { flex: 0 0 auto; }

    /* 44 Pixels — show description text in portrait if space allows */
    .panel[data-index="3"].active:not(.expanded) .showreel-sub { display: block; }
    .panel[data-index="3"].active:not(.expanded) .showreel-title { display: block; }
    .panel[data-index="3"].active:not(.expanded) .pixels-inner .showreel-meta {
        overflow: hidden;
        flex-shrink: 1;
        min-height: 0;
    }

    /* 44 Pixels — prioritise stats over description on mobile */
    .panel[data-index="3"].active:not(.expanded) .pixels-desc { order: 5; }

    /* Show compact Cue summary in unexpanded mobile only */
    .panel[data-index="3"].active:not(.expanded) .pixels-cue-inline { display: block; }

    /* ── Showreel unexpanded portrait — video fills full 16:9 at panel width ── */
    .panel[data-index="0"].active:not(.expanded) .showreel-inner > .showreel-video-wrap {
        flex: 0 0 auto;
        width: 100%;
        align-self: auto;
    }
    .panel[data-index="0"].active:not(.expanded) .showreel-inner > .showreel-meta {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* ── 44 Pixels hero video unexpanded portrait — full-width 16:9 ── */
    .panel[data-index="3"].active:not(.expanded) .pixels-inner > .showreel-video-wrap {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 9;
        align-self: auto;
    }

    /* ── Bolt 6 unexpanded portrait — video full-width 16:9, rive hidden ── */
    .panel[data-index="4"].active:not(.expanded) .bolt6-right {
        flex: 0 0 auto;
        width: 100%;
    }
    .panel[data-index="4"].active:not(.expanded) .bolt6-right > .showreel-video-wrap {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 9;
        align-self: auto;
    }
    .panel[data-index="4"].active:not(.expanded) .bolt6-rive-wrap {
        display: none;
    }
    .panel[data-index="4"].active:not(.expanded) .showreel-inner > .showreel-meta {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* ── Rye Lane unexpanded portrait — two portrait videos side by side ── */
    .panel[data-index="7"].active:not(.expanded) .rye-videos {
        flex: 1;
        min-height: 0;
        align-items: center;
        justify-content: center;
    }
    .panel[data-index="7"].active:not(.expanded) .rye-videos .showreel-video-wrap.portrait {
        flex: 0 0 auto;
        width: calc(50% - 4px) !important;
        height: auto;
        aspect-ratio: 9 / 16;
        align-self: center;
        min-width: 0;
    }
    .panel[data-index="7"].active:not(.expanded) .showreel-inner.side > .showreel-meta {
        flex: 0 0 auto;
        overflow: hidden;
        min-height: 0;
    }
}

/* ─── PHONE (≤430px) ─── */

@media (max-width: 430px) {
    body   { padding: 12px; }
    .panel { min-height: 10px; flex-basis: 10px; }
    .myth-grid  { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
    .team-grid  { grid-template-columns: repeat(2, 1fr); }
    .style-frames,
    .panel.expanded .style-frames { grid-template-columns: 1fr 1fr; }
    .bolt6-rive-canvas { width: 140px; height: 140px; }
    #jellycat-frames   { grid-template-columns: repeat(2, 1fr); }
}
