/* Project Select and the project viewer. Desktop sizes are in screen px (960 x 540); .tall is the phone screen (540 wide). */

/* ---------- Project Select ---------- */
.select { background: linear-gradient(180deg, #1a2150, #0b0f24); }
.sel-head { position: absolute; left: 24px; right: 24px; top: 10px; display: flex; align-items: center; gap: 24px; }
.sel-head h1 { margin: 0; font: 700 24px/1 var(--font); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.cat-hint { font-size: 16px; color: var(--dim); }
.back { font: 700 24px/1 var(--font); color: #fff; padding: 8px 12px; background: #0008; border: 3px solid #fff4; }
.device { position: absolute; left: 12px; top: 44px; width: 672px; height: 480px; }
.frame-art { position: absolute; inset: 0; width: 672px; height: 480px; z-index: 2; pointer-events: none; }
.hole { position: absolute; overflow: hidden; background: #000; cursor: pointer; z-index: 1; }
.feed, .feed video, .feed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.osd { position: absolute; left: 12px; top: 10px; font-size: 24px; color: #7dff8c; text-shadow: 2px 2px 0 #000; z-index: 3; }
.info { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px; background: linear-gradient(transparent, #000d); display: grid; gap: 4px; z-index: 3; }
.info b { font: 700 16px/1.2 var(--font); color: #fff; }
.info span { font-size: 16px; color: #c9d3ff; }

/* Category switch effects */
.fx { position: absolute; inset: 0; z-index: 5; pointer-events: none; display: none; }
.fx.static { display: block; background: repeating-linear-gradient(0deg, #fff3 0 2px, #0006 2px 4px), repeating-linear-gradient(90deg, #ffffff22 0 3px, #00000044 3px 7px) #555; animation: static 0.12s steps(3) infinite; }
@keyframes static { 33% { background-position: 0 3px, 5px 0; filter: brightness(1.4); } 66% { background-position: 0 -2px, -4px 0; filter: brightness(0.7); } }
.fx.disk { display: grid; place-content: center; justify-items: center; gap: 8px; background: #0b0f24; color: #fff; font-size: 16px; }
.fx.disk img { width: 48px; }
.fx.disk i { display: block; width: 160px; height: 12px; border: 2px solid #fff; background: var(--green) no-repeat 0 0 / 0 100%; animation: load 0.6s steps(8) forwards; }
@keyframes load { to { background-size: 100% 100%; } }
/* Device parts that follow the selection (desktop) */
.tuner { position: absolute; z-index: 3; height: 40px; transform: translate(-50%, -50%); transition: left 0.35s steps(7); pointer-events: none; }
.needle { position: absolute; z-index: 3; height: 84px; transform-origin: 50% 100%; translate: -50% -100%; transition: transform 0.45s steps(9); pointer-events: none; }
.lcd { position: absolute; z-index: 3; display: flex; align-items: center; padding: 0 14px; background: #0d2a14; color: #7dff8c; font-size: 16px; text-shadow: 0 0 6px #7dff8c88; box-shadow: inset 0 0 0 3px #071408; white-space: nowrap; overflow: hidden; }
.cart { position: absolute; z-index: 0; width: 120px; transform: translate(-50%, -100%); transition: transform 0.3s steps(6); pointer-events: none; }
.cart.out { transform: translate(-50%, -190%); }
.cart img { display: block; width: 100%; }
.cart .label { position: absolute; left: 10.7%; top: 21%; width: 80.5%; height: 57%; object-fit: cover; }
.fx.boot { display: grid; place-content: center; justify-items: center; gap: 8px; background: #e8ecff; color: #1c2a6b; font: 700 24px/1 var(--font); }
.fx.boot small { font-size: 16px; color: #556; }
.fx.needle { display: block; background: #0004; }

/* Thumbnail list (vertical on desktop) */
.thumbs { position: absolute; right: 12px; top: 44px; width: 252px; height: 456px; overflow: hidden; }
.track { transition: transform 0.15s steps(3); }
.thumb { position: relative; display: grid; grid-template-columns: 128px 1fr; grid-template-rows: auto 1fr; column-gap: 10px; width: 100%; height: 80px; margin-bottom: 8px; padding: 1px; text-align: left; background: #0b0f24; border: 3px solid #2a3570; }
.thumb > img:first-child { grid-row: 1 / 3; width: 128px; height: 72px; object-fit: cover; }
.thumb .badge { position: absolute; left: 6px; top: 6px; width: 24px; }
.thumb .tag { font-size: 16px; color: #7dff8c; align-self: end; }
.thumb b { font: 700 16px/1.15 var(--font); color: #fff; align-self: start; overflow-wrap: break-word; overflow: hidden; max-height: 56px; }
.thumb.on { border-color: var(--gold); background: #1c2a6b; }
.thumb.on b { color: var(--gold); }

/* Phones: the skin is the device; preview on top, tabs in the header, thumbnails along the bottom */
.tall .select { display: flex; flex-direction: column; }
.tall .select .sel-head { position: relative; left: 0; right: 0; top: 0; padding: 12px 16px; gap: 12px; flex: none; }
.tall .select .sel-head h1 { display: none; }
.tall .tabs { position: absolute; right: 16px; top: 12px; display: flex; gap: 8px; z-index: 2; }
.tall .tab { font: 700 24px/1 var(--font); padding: 8px 10px; background: #0008; border: 3px solid #fff4; color: var(--dim); }
.tall .tab.on { color: #000; background: var(--gold); border-color: #000; }
.tall .device { position: relative; left: 0; top: 0; width: 100%; height: auto; flex: 1; min-height: 0; }
.tall .hole { position: absolute; inset: 0; }
.tall .info b, .tall .info span { font-size: 24px; }
.tall .osd { font-size: 32px; }
.tall .thumbs { position: relative; right: 0; top: 0; width: 100%; height: 330px; flex: none; padding: 14px 0; }
.tall .track { display: flex; gap: 12px; padding: 0 16px; }
.tall .thumb { flex: none; display: block; width: 400px; height: 300px; margin: 0; padding: 4px; }
.tall .thumb > img:first-child { width: 384px; height: 216px; }
.tall .thumb .tag { display: none; }
.tall .thumb b { display: block; margin-top: 10px; font-size: 24px; line-height: 1.2; max-height: 58px; }

/* ---------- Project viewer ---------- */
.viewer { background: linear-gradient(180deg, #1a2150, #0b0f24); }
.v-head { position: absolute; left: 24px; right: 24px; top: 10px; display: flex; align-items: baseline; gap: 16px; }
.v-head h1 { margin: 0; font: 700 24px/1.1 var(--font); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.v-head span { font-size: 16px; color: var(--dim); }
.v-list { position: absolute; left: 16px; top: 52px; width: 280px; bottom: 44px; margin: 0; padding: 0; list-style: none; overflow: auto; scrollbar-width: none; }
.v-list button { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; text-align: left; border: 3px solid transparent; font-size: 16px; }
.v-list img { width: 32px; height: auto; }
.v-list small { font-size: 16px; color: var(--dim); }
.v-list button.on { border-color: var(--gold); background: #1c2a6b; color: var(--gold); }
.v-stage { position: absolute; left: 308px; top: 48px; right: 12px; bottom: 40px; cursor: pointer; }
.v-show { position: absolute; inset: 0; overflow: hidden; background: #000; }
.v-show video, .v-show iframe, .v-img, .v-poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; image-rendering: auto; }
.v-poster { object-fit: cover; filter: brightness(0.6); image-rendering: pixelated; }
.v-play { position: absolute; inset: 0; display: grid; place-items: center; font: 700 24px/1 var(--font); color: var(--gold); text-shadow: 3px 3px 0 #000; }
.v-info { position: absolute; inset: 0; overflow: auto; padding: 16px 20px; background: var(--navy); cursor: auto; font-size: 16px; line-height: 1.4; scrollbar-width: thin; }
.v-info h2 { margin: 0 0 12px; font: 700 24px/1.2 var(--font); color: var(--gold); }
.v-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 12px; }
.v-info dt { color: var(--sky); }
.v-info dd { margin: 0; }
.v-info p { margin: 0; }
.v-info .soon { margin-top: 12px; color: var(--gold); }
.tall .viewer { display: flex; flex-direction: column; }
.tall .v-head { position: relative; left: 0; right: 0; top: 0; padding: 12px 16px; flex-wrap: wrap; gap: 8px 16px; }
.tall .v-head h1 { flex-basis: 100%; font-size: 32px; }
.tall .v-head span { font-size: 24px; }
.tall .v-stage { position: relative; inset: auto; margin: 0 12px; aspect-ratio: 16 / 10; flex: none; }
.tall .v-list { position: relative; left: 0; top: 0; width: auto; bottom: auto; flex: 1; min-height: 0; padding: 8px 12px 16px; }
.tall .v-list button { grid-template-columns: 48px 1fr auto; font-size: 24px; padding: 10px; }
.tall .v-list img { width: 48px; }
.tall .v-list small, .tall .v-info { font-size: 24px; }
.tall .v-info h2 { font-size: 32px; }

/* Desktop Select: hints sit under the thumbnail column so they never cover the device. */
.select .hint { left: 696px; right: 12px; bottom: 10px; flex-direction: column; align-items: flex-start; gap: 4px; }
.select .thumbs { height: 392px; }

/* Animated tile background (ComfyUI pattern) behind the in-screen UI. */
/* These views sit on the light-trails canvas (js/trails.js). */
.select, .viewer, .stub { background: transparent; }
@keyframes tile-scroll { to { background-position: 128px 128px; } }
@media (prefers-reduced-motion: reduce) { .select, .viewer, .stub { animation: none; } }

/* BACK on every project screen. Desktop: a small button at the start of the header. */
.back:hover { color: var(--gold); border-color: var(--gold); }
.sel-head .back, .v-head .back, .stub-back { font-size: 16px; padding: 6px 10px; border-width: 2px; flex: none; }
.stub-back { position: absolute; left: 24px; top: 14px; }
.tall .stub-back { font-size: 24px; padding: 10px 14px; border-width: 3px; }
.v-head { align-items: center; }
.tall .sel-head .back, .tall .v-head .back { font-size: 24px; padding: 10px 14px; border-width: 3px; }

/* Phones: lists scroll with a finger. */
/* Phone Select: 16:9 preview across the width, a details panel taking the remaining height, carousel at the bottom. */
.tall .select .device { flex: none; height: auto; aspect-ratio: 16 / 9; }
.tall .select .info { display: none; }
.tall .detail { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 8px; display: grid; align-content: start; gap: 10px; touch-action: pan-y; scrollbar-width: none; }
.tall .detail b { font: 700 32px/1.15 var(--font); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.tall .detail span { font-size: 24px; color: var(--sky); }
.tall .detail p { margin: 0; font-size: 24px; line-height: 1.4; color: var(--ink); }
.tall .detail small { font-size: 20px; color: var(--dim); }
.tall .thumbs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; overscroll-behavior: contain; }
.tall .thumbs::-webkit-scrollbar { display: none; }
.tall .track { transform: none !important; width: max-content; }
.v-list, .v-info { touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tall .v-list { scrollbar-width: thin; }

/* Phones: views sit on a dark tint so the light trails stay in the background and never cross text. */
.tall .select, .tall .viewer, .tall .stub { background: #0b0f24e6; }
/* Phone Select: header, 16:9 preview, details, carousel. The carousel height (--th) and its picture height (--ih)
   are set by select.js from the screen height, so details always keep room and nothing is cut off. */
.tall .detail { padding-bottom: 28px; scrollbar-width: thin; -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.tall .thumbs { height: var(--th, 330px); }
.tall .thumb { width: calc(var(--ih, 216px) * 16 / 9 + 16px); height: calc(var(--th, 330px) - 28px); }
.tall .thumb > img:first-child { width: calc(var(--ih, 216px) * 16 / 9); height: var(--ih, 216px); }
.tall .thumb b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: none; margin-top: 4px; font-size: 16px; }
.tall .thumb { padding: 2px; }
.tall .detail b { font-size: 28px; }
/* Phone project page: the list fades out at the bottom so it reads as scrollable rather than cut off. */
.tall .v-list { padding-bottom: 40px; -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), transparent); mask-image: linear-gradient(#000 calc(100% - 40px), transparent); }

/* ---------- Resume (file select) and About ---------- */
.resume, .about { background: transparent; }
.rs-head { position: absolute; left: 24px; right: 24px; top: 10px; display: flex; align-items: center; gap: 16px; }
.rs-head h1 { margin: 0; font: 700 24px/1 var(--font); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.rs-head .back { font-size: 16px; padding: 6px 10px; border-width: 2px; }
.rs-files { position: absolute; left: 24px; right: 24px; top: 54px; bottom: 44px; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; overflow: auto; scrollbar-width: none; align-content: start; }
.rs-file { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "no yr" "co co" "role role"; gap: 2px 8px; width: 100%; padding: 2px 6px; text-align: left; color: #fff; }
.rs-file .no { grid-area: no; font-size: 12px; color: var(--sky); }
.rs-file b { grid-area: co; font: 700 18px/1.15 var(--font); }
.rs-file .yr { grid-area: yr; font-size: 12px; color: var(--gold); }
.rs-file .role { grid-area: role; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-file.on b { color: var(--gold); }
.rs-stats .no { color: var(--green); }
.rs-detail, .rs-status, .ab-body { position: absolute; left: 24px; right: 24px; top: 54px; bottom: 44px; overflow: auto; padding: 6px 12px; scrollbar-width: thin; }
.rs-card { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 2px dashed #ffffff22; }
.rs-card .yr { font-size: 14px; color: var(--sky); } .rs-card b { font: 700 24px/1.1 var(--font); color: var(--gold); } .rs-card .role { font-size: 16px; color: #fff; }
.rs-detail h2 { margin: 12px 0 6px; font: 700 14px/1 var(--font); color: var(--dim); letter-spacing: 2px; }
.rs-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rs-log li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.4; }
.rs-log li::before { content: "▶"; position: absolute; left: 0; color: var(--gold); font-size: 12px; top: 2px; }
.rs-status { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.rs-who { display: grid; justify-items: center; gap: 8px; text-align: center; }
.rs-who img, .ab-pic { width: 160px; height: 160px; image-rendering: pixelated; border: 4px solid #000; box-shadow: 0 0 0 3px var(--gold); }
.rs-who b { font: 700 16px/1.2 var(--font); color: var(--gold); }
.rs-who dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; margin: 0; font-size: 12px; text-align: left; }
.rs-who dt { color: var(--sky); } .rs-who dd { margin: 0; }
.rs-skills { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rs-skills li { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: start; }
.rs-skills b { font: 700 14px/1.6 var(--font); color: var(--green); }
.rs-skills span { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-skills i { font-style: normal; font-size: 12px; padding: 3px 6px; background: #0b0f24; border: 2px solid #2a3570; }
.ab-body { display: flex; gap: 20px; align-items: start; }
.ab-pic { flex: none; margin-top: 6px; }
.ab-text { display: grid; gap: 8px; }
.ab-text b { font: 700 24px/1.1 var(--font); color: var(--gold); } .ab-title { font-size: 14px; color: var(--sky); }
.ab-text p { margin: 0; font-size: 16px; line-height: 1.5; }
.ab-links { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--dim); }
.ab-links a { color: var(--gold); }
/* phones: one column, bigger type, tinted so the trails stay behind */
.tall .resume, .tall .about { background: #0b0f24e6; }
.tall .rs-head { left: 16px; right: 16px; top: 12px; }
.tall .rs-head h1 { font-size: 32px; } .tall .rs-head .back { font-size: 24px; padding: 10px 14px; border-width: 3px; }
.tall .rs-files { left: 16px; right: 16px; top: 80px; bottom: 16px; grid-template-columns: 1fr; gap: 8px; }
.tall .rs-file .no, .tall .rs-file .yr, .tall .rs-file .role { font-size: 20px; } .tall .rs-file b { font-size: 26px; }
.tall .rs-detail, .tall .rs-status, .tall .ab-body { left: 16px; right: 16px; top: 80px; bottom: 16px; }
.tall .rs-card b { font-size: 30px; } .tall .rs-card .yr, .tall .rs-card .role, .tall .rs-log li, .tall .ab-text p { font-size: 22px; } .tall .rs-detail h2 { font-size: 20px; }
.tall .rs-status, .tall .ab-body { display: flex; flex-direction: column; align-items: center; }
.tall .rs-who dl, .tall .rs-skills i, .tall .ab-links, .tall .ab-title { font-size: 20px; } .tall .rs-who b { font-size: 24px; }
.tall .rs-skills li { grid-template-columns: 1fr; gap: 6px; } .tall .rs-skills b { font-size: 22px; }
.tall .ab-text b { font-size: 30px; } .tall .ab-text { text-align: left; }
.tall .resume .hint, .tall .about .hint { display: none; }
