* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #000; }
@font-face { font-family: 'Quest Pixel'; src: url('/media/cf4de751ada78ceac033dbe16a687742939995b77bc2a052ae17a4957958594d.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: swap; }
:root { --ui-gold: #ffb83e; --ui-yellow: #ffff00; --ui-stone: #514b3d; --ui-light: #81765a; --ui-dark: #24231d; --ui-font: 'Quest Pixel', monospace; }
body { color: var(--ui-gold); font-family: var(--ui-font); }
button { font: inherit; }
#stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; background: #000; }
#scene { position: relative; width: min(100vw, 177.7778vh); aspect-ratio: 16 / 9; overflow: hidden; }
.backdrop, .film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.film { visibility: hidden; }
.film.ready { visibility: visible; }
#door-video { z-index: 2; }
#choices { position: absolute; inset: 0; z-index: 3; }
.quest-prompt { position: absolute; left: 74%; top: 43%; max-width: 25%; }
h1 { margin: 0; color: var(--ui-gold); font-size: clamp(20px, 2.3vw, 40px); line-height: 1; font-weight: 400; letter-spacing: 0; text-shadow: 2px 2px 0 #17140c; }
.door { position: absolute; background: transparent; border: 2px solid transparent; border-radius: 50% 50% 4% 4% / 35% 35% 3% 3%; cursor: pointer; transition: background .22s, border-color .22s, box-shadow .22s; -webkit-tap-highlight-color: transparent; }
.left { left: 36.7%; top: 52.4%; width: 7.8%; height: 17.2%; }
.right { left: 52%; top: 48.3%; width: 11.5%; height: 21.4%; }
.door:hover, .door:focus-visible { outline: none; border-color: var(--ui-yellow); background: #ffff0014; box-shadow: 0 0 0 1px #332b12, inset 0 0 0 1px #9e7c24; }
#stage:not([data-state="idle"]) #choices { visibility: hidden; pointer-events: none; }
#blackout { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; --fade: 0; }
.curtain { position: absolute; inset: 0; will-change: transform; }
.curtain-left { background: linear-gradient(to right, #000 0%, #000 65%, transparent 100%); transform: translateX(calc(-100% * (1 - var(--fade)))); }
.curtain-right { background: linear-gradient(to left, #000 0%, #000 65%, transparent 100%); transform: translateX(calc(100% * (1 - var(--fade)))); }
/* Shared game controls: use this class for all future buttons. */
.game-button { color: var(--ui-gold); font-family: var(--ui-font); font-size: 26px; line-height: 1; padding: 10px 16px 12px; border: 3px solid; border-color: #9b8c67 #27271f #24241d #81765c; border-radius: 0; background: linear-gradient(110deg, #ffffff05, #0000000a), var(--ui-stone); box-shadow: 0 0 0 2px #161811, inset 0 0 0 1px #625b46, 2px 3px 0 #0009; text-shadow: 2px 2px 0 #17140c; cursor: pointer; }
.game-button:hover { color: var(--ui-yellow); background-color: #625b47; }
.game-button:active { border-color: #24241d #81765c #9b8c67 #27271f; box-shadow: 0 0 0 2px #161811, inset 2px 2px 0 #0005; }
.game-button:focus-visible { outline: 2px solid var(--ui-yellow); outline-offset: 4px; }
#scene-navigation { position: absolute; left: max(22px, env(safe-area-inset-left)); top: max(22px, env(safe-area-inset-top)); z-index: 7; display: flex; flex-wrap: wrap; max-width: calc(100% - 44px); align-items: stretch; gap: 12px; }
#home { display: flex; align-items: center; gap: 10px; }
#back[hidden] { display: none; }
#home svg { width: 24px; height: 24px; image-rendering: pixelated; filter: drop-shadow(1px 2px 0 #17140c); }
#resume { position: absolute; z-index: 6; }
#resume[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (prefers-reduced-motion: reduce) { .door { transition: none; } }
@media (max-width: 600px) { .quest-prompt { left: 72%; max-width: 27%; } h1 { font-size: 20px; } #scene-navigation { top: 14px; left: 14px; } .game-button { font-size: 22px; padding: 8px 12px; } }

#room-video { z-index: 1; }
#room-choices { position: absolute; inset: 0; z-index: 3; visibility: hidden; pointer-events: none; }
#stage[data-state="room"] #room-choices { visibility: visible; pointer-events: auto; }
.frame-selector { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.frame-selector svg { display: block; width: 100%; height: 100%; overflow: visible; }
.frame-selector polygon { fill: transparent; stroke: #ffb83e85; stroke-width: 1; stroke-linejoin: miter; }
.frame-selector:hover polygon, .frame-selector:focus-visible polygon { fill: #ffff0019; stroke: var(--ui-yellow); stroke-width: 2; }
.frame-selector:focus-visible { outline: none; }

.frame-selector[data-gallery] { display: none; }
#stage[data-gallery="probly"] .frame-selector[data-gallery="probly"],
#stage[data-gallery="kraken"] .frame-selector[data-gallery="kraken"] { display: block; }

#about[hidden], #stage:not([data-state="idle"]) #about { display: none; }
#stage[data-state="idle"] #about:not([hidden]) { display: block; }

/* Scrollable portfolio pages keep the supplied parchment visible behind the work. */
#pillar-page { position: absolute; inset: 0; z-index: 4; overflow: hidden; background: #d9bd89 url('/media/3132d5ee30057d83268a4ff80cf2826de04284ac17e511f1310dd970dc7568ef.png') center / 100% 100% no-repeat; color: #342719; scrollbar-color: #795730 #d8bd8b; }
#pillar-page[hidden] { display: none; }
#pillar-page[data-gallery="kraken"] { background-image: url('/media/513c7b00218266f3764eac24c9cccfe7ee8ecab4a8079907b1a805c4ce014c10.webp'); background-color: #c8bd9e; }
#pillar-page[data-gallery="kraken"] .book-scroll { inset: 11% 6.5% 0; }
#pillar-page[data-gallery="kraken"] .book-content { padding-top: 36px; }
.book-scroll { position: absolute; inset: 3.6% 5.8% 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-color: #795730 #d8bd8b; }
.book-scroll:focus-visible { outline: 2px solid #795730; outline-offset: -2px; }
.book-content { width: 92%; max-width: 1080px; margin: 0 auto; padding: 80px 0 64px; }
.book-intro { max-width: 830px; margin-bottom: 48px; }
.book-eyebrow { margin: 0 0 12px; font-size: 20px; color: #795025; }
#pillar-title { color: #362318; font-size: clamp(62px, 7vw, 100px); line-height: .95; text-shadow: 1px 2px 0 #f6e2bb; }
.book-deck { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; margin: 18px 0; }
.book-summary { max-width: 790px; font-size: 25px; line-height: 1.35; margin: 24px 0 0; }
.featured-film { display: grid; grid-template-columns: 1fr minmax(240px, 360px); gap: clamp(28px, 5vw, 80px); align-items: center; padding: 36px 0 48px; border-top: 2px solid #76532a70; border-bottom: 2px solid #76532a70; }
.book-content h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 400; line-height: 1; margin: 0 0 20px; }
.film-story p:not(.book-eyebrow) { font-size: 25px; line-height: 1.3; }
.film-story .film-prompt { font-size: 30px; }
.book-note { color: #73512e; font-size: 20px; }
.portfolio-player { position: relative; width: 100%; aspect-ratio: 550 / 802; background: #14110f; border: 4px solid; border-color: #a2814c #4a321d #3a281a #8c693d; box-shadow: 0 0 0 1px #342719, 5px 7px 0 #5e402322; }
.featured-player { aspect-ratio: 688 / 1310; }
.film-thumbnail { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #100e0b; cursor: pointer; }
.film-thumbnail img { width: 100%; height: 100%; object-fit: contain; display: block; }
.play-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 152px; min-height: 72px; display: grid; place-items: center; font-size: 26px; white-space: nowrap; pointer-events: none; }
.film-thumbnail:hover .play-label { color: var(--ui-yellow); background-color: #625b47; }
.film-thumbnail:focus-visible { outline: 3px solid #81540e; outline-offset: 6px; }
.portfolio-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.portfolio-video[hidden], .film-thumbnail[hidden] { display: none; }
.more-films { padding-top: 45px; }
.collection-heading { margin-bottom: 30px; }
.film-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 70px); }
.film-grid article { min-width: 0; }
.film-grid h3 { font-size: 32px; font-weight: 400; margin: 22px 0 8px; }
.film-grid p { font-size: 24px; line-height: 1.2; margin: 0; }
.book-footer { margin-top: 44px; padding-top: 22px; border-top: 1px solid #76532a70; font-size: 21px; color: #73512e; }
@media (max-width: 700px) {
 .book-content { width: 88%; padding-top: 80px; }
 .book-summary { font-size: 22px; }
 .featured-film { grid-template-columns: 1fr; gap: 22px; }
 .featured-player { max-width: 360px; margin: auto; }
 .film-grid { grid-template-columns: 1fr; gap: 38px; }
 .film-story p:not(.book-eyebrow) { font-size: 23px; }
}

.featured-film + .featured-film { border-top: 0; }

/* Liminal: let the three films sit together beneath the introduction. */
.liminal-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: clamp(18px, 3vw, 36px); }
.liminal-gallery .featured-film { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 0; border: 0; min-width: 0; }
.liminal-gallery .film-story { min-height: 76px; display: flex; align-items: end; }
.liminal-gallery h2 { font-size: clamp(28px, 3vw, 38px); margin: 0; }
.liminal-gallery .portfolio-player { aspect-ratio: 550 / 802; width: 100%; max-width: none; margin: 0; }
.liminal-gallery .play-label { min-width: 130px; }
@media (max-width: 700px) {
 .liminal-gallery { grid-template-columns: 1fr; gap: 38px; }
 .liminal-gallery .featured-film { max-width: 380px; width: 100%; margin: 0 auto; }
 .liminal-gallery .film-story { min-height: 0; }
}

.liminal-gallery .featured-player { aspect-ratio: 688 / 1310; }

.pillar-gallery[hidden] { display: none; }
.market-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.market-gallery h2 { font-size: 30px; }
.market-gallery .film-story { min-height: 90px; }
@media (min-width: 701px) and (max-width: 1000px) { .market-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; } }
@media (max-width: 700px) { .market-gallery { grid-template-columns: 1fr; } .market-gallery .film-story { min-height: 0; } }

.artwork-thumbnail { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.artwork-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.artwork-thumbnail:hover .play-label { color: var(--ui-yellow); background-color: #625b47; }
.artwork-thumbnail:focus-visible { outline: 3px solid #81540e; outline-offset: 6px; }
#artwork-viewer { width: min(1100px, 90vw); max-height: 90vh; padding: 20px; border: 4px solid #95805a; color: var(--ui-gold); background: var(--ui-stone); }
#artwork-viewer::backdrop { background: #000c; }
#artwork-viewer header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
#artwork-viewer h2 { font-size: 34px; margin: 0; font-weight: 400; }
.artwork-images { display: flex; align-items: start; gap: 16px; }
.artwork-images[hidden] { display: none; }
.artwork-images img { min-width: 0; flex: 1; width: 100%; max-height: 70vh; object-fit: contain; }
@media(max-width:700px) { .artwork-images { flex-direction: column; } #artwork-viewer { padding: 12px; } }

/* Keep mixed media collections in rows of similarly shaped media. */
.balanced-gallery { display: flex; flex-direction: column; gap: 44px; }
.balanced-artwork-grid, .balanced-video-grid { display: grid; gap: 28px 32px; width: 100%; }
.balanced-artwork-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.balanced-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 840px; margin: 0 auto; }
.balanced-gallery .film-story { min-height: 76px; }
.balanced-video-grid .film-thumbnail { background: #fff; }
@media (max-width: 700px) {
 .balanced-artwork-grid, .balanced-video-grid { grid-template-columns: 1fr; gap: 32px; }
 .balanced-gallery .film-story { min-height: 0; }
}

#boot-loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #10100d; }
#boot-loader[hidden] { display: none; }
.boot-panel { width: min(420px, calc(100vw - 40px)); padding: 28px; text-align: center; background: var(--ui-stone); border: 4px solid; border-color: #9b8c67 #27271f #24241d #81765c; box-shadow: 0 0 0 2px #161811; }
.boot-panel p { margin: 0 0 18px; font-size: 26px; text-shadow: 2px 2px #17140c; }
#boot-progress { appearance: none; display: block; width: 100%; height: 24px; border: 2px solid #27271f; background: #25241d; color: #c49b37; }
#boot-progress::-webkit-progress-bar { background: #25241d; }
#boot-progress::-webkit-progress-value { background: linear-gradient(#e8bd50, #98731f); }
#boot-progress::-moz-progress-bar { background: linear-gradient(#e8bd50, #98731f); }
#boot-percent { margin: 12px 0 0; }
#boot-continue { margin-top: 20px; }

.competition-links .competition-post { padding: 0 0 24px; border-bottom: 1px solid #76532a70; }
.competition-links .film-story { min-height: 110px; }
.post-link { display: inline-block; align-self: flex-start; text-decoration: none; }
@media (max-width:700px) { .competition-links .film-story { min-height: 0; } }

/* Aligned rows of posts with comparable proportions. */
.post-gallery { display: flex; flex-direction: column; gap: 42px; }
.post-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.post-gallery .film-story { height: 110px; min-height: 110px; align-items: end; }
.post-gallery .portfolio-player { aspect-ratio: var(--post-ratio); background: white; }
.post-gallery .artwork-thumbnail { cursor: pointer; background: white; }
.post-gallery .artwork-thumbnail img { object-fit: contain; }
#artwork-source { text-decoration: none; margin-left: auto; white-space: nowrap; }
#artwork-source[hidden] { display: none; }
@media(max-width:700px) {
 .post-row { grid-template-columns: 1fr; gap: 32px; }
 .post-gallery .film-story { height: auto; min-height: 0; }
 .post-gallery .portfolio-player { aspect-ratio: auto; }
 .post-gallery .artwork-thumbnail img { height: auto; }
 #artwork-viewer header { flex-wrap: wrap; gap: 12px; }
}

/* Asset preparation precedes the measured opening-video loading bar. */
.asset-spinner { width:48px; height:48px; margin:24px auto 8px; border:4px solid #81765a55; border-top-color:var(--ui-gold); border-right-color:var(--ui-gold); border-radius:50%; animation:asset-spin .85s linear infinite; }
@keyframes asset-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .asset-spinner { animation:none; } }
#contact-alex { position:absolute; z-index:2; top:100%; left:50%; transform:translateX(-50%); display:flex; align-items:center; text-decoration:none; pointer-events:none; opacity:0; visibility:hidden; white-space:nowrap; }
#contact-alex[hidden] { display:none; }
#about-intro.running #contact-alex, #about-intro[data-finished="true"] #contact-alex { opacity:1; visibility:visible; pointer-events:auto; }

.product-films { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; width: 100%; margin-inline: auto; }
@media(max-width:700px) { .product-films { grid-template-columns: 1fr; } }

/* One visit, one introduction. The room video loops independently. */
#about-intro { position:absolute; inset:0; z-index:4; pointer-events:none; overflow:hidden; }
#about-intro[hidden] { display:none; }
.about-shade { position:absolute; inset:0; background:linear-gradient(90deg, #0005, #0008 50%, #0005); transition:opacity 2s; }
.about-scroll { position:absolute; top:16%; bottom:5%; left:12%; right:12%; overflow:hidden; mask-image:linear-gradient(transparent, #000 5%, #000 94%, transparent); }
.about-copy { padding:24px 0; opacity:0; }
.about-scroll p { margin:0 0 .65em; text-align:center; font-family:var(--ui-font); font-size:clamp(18px, 2vw, 28px); line-height:1.15; color:#f3e3bc; text-shadow:2px 2px 0 #22160d, -1px -1px 0 #22160d, 0 2px 8px #000; }
#about-intro.running .about-copy { opacity:1; animation:about-scroll-down 38s linear both; }
#about-intro[data-finished="true"] .about-shade { opacity:0; }
@keyframes about-scroll-down { 0%,20% { transform:translateY(0); } 100% { transform:translateY(-100%); } }
@media(max-width:700px) { .about-scroll { left:6%; right:6%; top:22%; bottom:5%; } .about-scroll p { font-size:20px; } }
@media(prefers-reduced-motion:reduce) { .about-scroll { overflow-y:auto; pointer-events:auto; } #about-intro.running .about-copy { animation:none; } }

/* Mobile portrait is a cinematic entry gate, never a squeezed gallery. */
#orientation-gate { position:fixed; inset:0; z-index:110; background:#000; display:grid; place-items:center; opacity:1; transition:opacity .6s; }
#orientation-gate[hidden] { display:none; }
#orientation-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#orientation-gate::after { content:""; position:absolute; inset:0; background:#000; opacity:.25; pointer-events:none; transition:opacity .6s; }
.orientation-controls { position:relative; z-index:1; text-align:center; padding:24px; }
#rotate-hint { font-size:22px; color:#f3e3bc; text-shadow:2px 2px #000; }
#orientation-sound { position:absolute; top:max(20px,env(safe-area-inset-top)); left:max(20px,env(safe-area-inset-left)); z-index:1; }
#orientation-gate.to-black::after { opacity:1; z-index:2; }
#orientation-gate.leaving { opacity:0; pointer-events:none; }
.mobile-portrait dialog { visibility:hidden; }
@media(prefers-reduced-motion:reduce) { #orientation-gate, #orientation-gate::after { transition:none; } }

#home-transition { position:fixed; inset:0; z-index:90; overflow:hidden; pointer-events:auto; --fade:0; }
#home-transition[hidden] { display:none; }
