/* Project pages (/work/<slug>) and the /work index. Builds on page.css. */
.top nav a.room-link { color: var(--red); }

.w-hero { position: relative; padding: 12vh var(--gutter) 6vh; overflow: hidden; }
.w-hero::before { content: ''; position: absolute; inset: -30% -10% auto 35%; height: 140%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(200,255,0,.22), rgba(200,255,0,.06) 55%, transparent 75%); filter: blur(10px); }
.w-hero h1 { max-width: 16ch; }
.w-hero .lede { font-size: clamp(18px, 1.7vw, 24px); }

/* the devices */
.w-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; padding: 2vh var(--gutter) 12vh; perspective: 1600px; }
.dev-laptop { position: relative; width: min(1080px, 88vw); border-radius: 16px; background: #0d0d0d; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 60px 140px rgba(0,0,0,.8), 0 0 90px rgba(200,255,0,.12); transform: rotateX(4deg); overflow: hidden; }
.dev-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #141414; border-bottom: 1px solid rgba(255,255,255,.06); }
.dev-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2a2a; }
.dev-bar i:first-child { background: var(--red); }
.dev-bar span { margin-left: 14px; font-size: 12px; color: #6f6a64; background: rgba(255,255,255,.04); padding: 4px 14px; border-radius: 20px; }
.dev-screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.dev-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transform: translateY(6%);
  transition: opacity .9s ease, transform 1.2s cubic-bezier(.2,.8,.2,1); }
.dev-screen img.on { opacity: 1; transform: none; }
.dev-screen img:first-child { opacity: 1; transform: none; }
.dev-screen.cycling img:first-child:not(.on) { opacity: 0; }
.dev-phone { position: absolute; right: max(4vw, calc(50% - 600px)); bottom: 8vh; width: min(250px, 24vw); border-radius: 38px; padding: 10px; background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.18); box-shadow: 0 40px 100px rgba(0,0,0,.85), 0 0 60px rgba(200,255,0,.15); transform: rotate(4deg); }
.dev-phone .dev-screen { aspect-ratio: 9 / 19.5; border-radius: 30px; }

/* the story */
.w-story { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 6vw; align-items: start; }
.w-built { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 12px; }
.w-built li { position: relative; padding-left: 26px; color: #d4cec6; }
.w-built li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.w-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.w-tags span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 7px 12px; border-radius: 30px; border: 1px solid rgba(200,255,0,.4); color: #e8ffa8; }

/* next / previous */
.w-next { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.np { position: relative; display: grid; gap: 6px; padding: 6vh var(--gutter); text-decoration: none; overflow: hidden; }
.np + .np { border-left: 1px solid var(--line); text-align: right; }
.np span { font: 500 10.5px var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--red); }
.np b { font: 400 clamp(30px, 3.4vw, 54px)/1 var(--display); text-transform: uppercase; color: var(--ink); }
.np i { font-style: normal; color: var(--muted); font-size: 14px; }
.np img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .08; transition: opacity .5s, transform 1.2s; z-index: -1; }
.np:hover img { opacity: .22; transform: scale(1.05); }

/* the /work index */
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 18px; }
.wi { text-decoration: none; color: inherit; display: block; }
.wi figure { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: #111; }
.wi img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.wi:hover img { transform: scale(1.06) translateY(-3%); }
.wi-k { display: block; margin-top: 14px; font: 500 10px var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--red); }
.wi h3 { font: 400 26px/1 var(--display); text-transform: uppercase; color: var(--ink); margin: 8px 0 4px; }
.wi p { font-size: 13.5px; color: var(--muted); }

/* arriving from the Undrworld: you burst out of the end of the tunnel */
.tunnel-exit { display: none; }
.exit-in .tunnel-exit { display: block; position: fixed; inset: 0; z-index: 100; pointer-events: none; background: #050505; animation: exitFade 1.5s .55s forwards; }
.exit-in .tunnel-exit i { position: absolute; left: 50%; top: 50%; width: 30vmax; height: 30vmax; margin: -15vmax 0 0 -15vmax; border-radius: 50%;
  border: 2px solid var(--red); box-shadow: 0 0 40px var(--red), inset 0 0 40px rgba(200,255,0,.5); opacity: 0; animation: ring 1.3s cubic-bezier(.5,0,.75,0) forwards; }
.exit-in .tunnel-exit i:nth-child(2) { animation-delay: .08s; }
.exit-in .tunnel-exit i:nth-child(3) { animation-delay: .16s; }
.exit-in .tunnel-exit i:nth-child(4) { animation-delay: .24s; }
.exit-in .tunnel-exit i:nth-child(5) { animation-delay: .32s; }
.exit-in .tunnel-exit i:nth-child(6) { animation-delay: .40s; }
.exit-in main, .exit-in .top { animation: exitPage 1.4s .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ring { 0% { transform: scale(.05); opacity: 0; } 15% { opacity: 1; } 100% { transform: scale(5); opacity: 0; } }
@keyframes exitFade { to { opacity: 0; visibility: hidden; } }
@keyframes exitPage { from { transform: scale(1.18); filter: blur(14px); opacity: 0; } to { transform: none; filter: none; opacity: 1; } }

@media (max-width: 900px) {
  .w-story { grid-template-columns: 1fr; gap: 4vh; }
  .wgrid { grid-template-columns: 1fr 1fr; }
  .dev-phone { width: 30vw; right: 4vw; bottom: 4vh; border-radius: 26px; padding: 6px; }
  .dev-phone .dev-screen { border-radius: 22px; }
  .top nav a.room-link { display: inline; font-size: 12px; }
}
@media (max-width: 600px) {
  .wgrid { grid-template-columns: 1fr; }
  .w-next { grid-template-columns: 1fr; }
  .wpage .top nav a.pill { display: none; }
  .np + .np { border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .w-stage { padding-bottom: 14vh; }
  .dev-phone { width: 34vw; bottom: 2vh; }
}
@media (prefers-reduced-motion: reduce) { .exit-in .tunnel-exit { display: none; } .exit-in main, .exit-in .top { animation: none; } }
