/* ═══ the project pop-up ═══════════════════════════════════════════
   Shared by the room (all pages that load base.css) and /work/, which
   doesn't load base.css: so this file carries everything the pop-up needs,
   including the division palettes, covers, action buttons and write-up styles. */
@import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;700&family=JetBrains+Mono:wght@400;700&family=Silkscreen:wght@400;700&family=Oswald:wght@400;600&family=Caveat:wght@500;700&display=swap');
:root { --font-ui: 'Arimo', Arial, sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, monospace; }
/* resets, at zero specificity so any real rule below wins */
:where(.pj-modal) *, :where(.pj-modal) *::before, :where(.pj-modal) *::after { box-sizing: border-box; margin: 0; padding: 0; }
:where(.pj-modal) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:where(.pj-modal) a { color: inherit; }

/* covers (cards and pop-ups): players take over the square */
.cover {
  aspect-ratio: 1; border-radius: calc(var(--w-radius, 14px) - 6px); overflow: hidden; margin-bottom: 10px;
  display: grid; place-items: center; font-size: 56px;
  background: var(--w-cover, linear-gradient(135deg, hsl(var(--hue) 60% 75%), hsl(calc(var(--hue) + 60) 60% 55%)));
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a playable cover: a ▶ on hover (always, faintly, on touch screens); clicking it plays */
.cover.can-play { position: relative; cursor: pointer; }
.cover.can-play::after {
  content: '\25B6\FE0E'; position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  display: grid; place-items: center; padding-left: 4px; box-sizing: border-box; border-radius: 50%;
  background: rgba(10, 10, 20, .55); color: #fff; font-size: 22px; line-height: 1;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  opacity: 0; transform: scale(.9); transition: opacity .18s, transform .18s; pointer-events: none;
}
.cover.can-play:hover::after, .cover.can-play:focus-visible::after { opacity: 1; transform: none; }
.cover.can-play > span { transition: opacity .18s; }
@media (hover: hover) { .cover.can-play:hover > span { opacity: 0; } } /* the placeholder glyph steps aside for the ▶ */
.cover.can-play.playing { cursor: auto; }
.cover.can-play.playing::after { display: none; }
@media (hover: none) { .cover.can-play::after { opacity: .75; transform: none; } }
.cover iframe { width: 100%; height: 100%; border: 0; display: block; }
.cover.playing { background: #000; }
.cover.playing.wave { background: var(--w-cover, #111); } /* uploaded tracks: waveform on the world's own cover color */
.cover .wave-play { width: 100%; height: 100%; display: block; }
.cover .cover-audio { width: 90%; }
.cover:has(.cover-audio) { background: var(--w-cover, #111); }

/* action buttons + small tags */
.ph { font: 10px var(--font-mono); padding: 1px 5px; border-radius: 3px; background: rgba(255, 200, 0, .25); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions a, .actions button { font: 12px var(--font-mono); padding: 6px 10px; border-radius: 999px; border: 1px solid currentColor; text-decoration: none; }
.actions a:hover, .actions button:hover { background: var(--w-accent); color: var(--w-on-accent, #fff); border-color: var(--w-accent); } /* --w-bg can be a gradient, so text on the accent has its own colour */

/* write-ups (markdown) */
.md { font: 15px/1.6 var(--w-body); }
.md p { margin: 0 0 .7em; }
.md h3, .md h4, .md h5 { font: var(--w-card-title); margin: .9em 0 .35em; }
.md ul, .md ol { margin: 0 0 .7em 1.2em; }
.md blockquote { margin: 0 0 .7em; padding-left: 10px; border-left: 3px solid currentColor; opacity: .8; }
.md code { font: 13px var(--font-mono); background: rgba(127,127,127,.15); padding: 1px 4px; border-radius: 3px; }
.md pre { font: 13px/1.5 var(--font-mono); background: rgba(127,127,127,.12); padding: 8px 10px; border-radius: 6px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; } /* long commands wrap instead of scrolling sideways */
.md pre code { background: none; padding: 0; }
.md a { color: var(--w-accent); }
.md hr { border: 0; border-top: 1px solid currentColor; opacity: .3; margin: 1em 0; }

/* airishee: dusk sky + ink */
.w-airishee {
  --w-bg: linear-gradient(180deg, #8fa3d9 0%, #c9b8e0 45%, #f4c7b0 100%);
  --w-fg: #0b0b10; --w-accent: #0b0b10; --w-on-accent: #f4f1fa; --w-body: 'Arimo', sans-serif;
  --w-title: 700 64px 'Arimo', sans-serif; --w-card-title: 700 18px 'Arimo', sans-serif;
  --w-card: rgba(255,255,255,.35); --w-card-border: 1px solid rgba(255,255,255,.6);
  --w-card-shadow: 0 20px 50px rgba(60,50,120,.3); --w-radius: 16px;
  --w-cover: linear-gradient(160deg, #dfe6ff, #f7d6c8);
  background-attachment: fixed;
}
.w-airishee .wp-title img { filter: invert(1) drop-shadow(0 6px 20px rgba(255,255,255,.4)); }
.w-airishee .cover span { color: #0b0b10; opacity: .5; }

/* NWGC: a Pacific North-West basement LAN. Walnut paneling, amber CRT
   phosphor, evergreen felt, buffalo plaid. */
.w-nwgc {
  --w-bg: #17110c; --w-fg: #f3e2c4; --w-accent: #ffb000; --w-on-accent: #17110c; --w-body: 'JetBrains Mono', monospace;
  --w-title: 700 clamp(44px, 9vw, 96px) 'Silkscreen', monospace; --w-card-title: 700 16px 'Silkscreen', monospace;
  --w-card: #221811; --w-card-border: 2px solid #ffb000; --w-card-shadow: 6px 6px 0 #2f5d44; --w-radius: 0px;
  --w-cover: repeating-linear-gradient(0deg, rgba(255,176,0,.10) 0 2px, transparent 2px 4px), linear-gradient(160deg, #2a1d14, #120c08);
  --w-stamp-bg: #2f5d44; --w-stamp-fg: #f3e2c4;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 72px);
}
.w-nwgc .wp-title { color: #ffb000; text-shadow: 0 0 18px rgba(255,176,0,.55), 0 0 2px #ffcf66; animation: jitter 3.5s steps(1) infinite; }
@keyframes jitter { 0%, 92% { transform: none; } 93% { transform: translate(4px, -2px) skewX(8deg); } 96% { transform: translate(-3px, 1px); } }
.w-nwgc .cover span { color: #ffb000; text-shadow: 0 0 12px rgba(255,176,0,.6); }
.w-nwgc::after { content: ''; position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 3px); }

/* Garage: asphalt, safety orange, spec sheets */
.w-garage {
  --w-bg: #232427; --w-fg: #e8e6e1; --w-accent: #ff6a13; --w-on-accent: #111; --w-body: 'JetBrains Mono', monospace;
  --w-title: 600 clamp(56px, 11vw, 120px) 'Oswald', sans-serif; --w-card-title: 600 20px 'Oswald', sans-serif;
  --w-card: #2d2f33; --w-card-border: 1px solid #45484d; --w-card-shadow: 0 0 0 2px #ff6a13; --w-radius: 4px;
  --w-cover: linear-gradient(#7fa6c922 1px, transparent 1px) 0 0/16px 16px, linear-gradient(90deg, #7fa6c922 1px, transparent 1px) 0 0/16px 16px, #1b2a3a;
  --w-stamp-bg: #ff6a13; --w-stamp-fg: #111;
}
.w-garage .wp-title { text-transform: uppercase; letter-spacing: .02em; }
.w-garage .wp-head { border-bottom: 6px solid; border-image: repeating-linear-gradient(45deg, #ff6a13 0 14px, #111 14px 28px) 6; padding-bottom: 24px; margin-bottom: 28px; }
.w-garage .cover span { color: #7fa6c9; }

/* me: paper, pen, highlighter */
.w-me {
  --w-bg: #f6efe0; --w-fg: #1f2a5c; --w-accent: #e0457b; --w-on-accent: #fff; --w-body: 'Times New Roman', Times, serif;
  --w-title: 700 clamp(64px, 12vw, 128px) 'Caveat', cursive; --w-card-title: 700 26px 'Caveat', cursive;
  --w-card: #fffdf6; --w-card-border: 1px solid #e6dcc4; --w-card-shadow: 0 12px 24px rgba(80,60,20,.15); --w-radius: 2px;
  --w-cover: linear-gradient(#cfd9f5 1px, transparent 1px) 0 0/100% 22px, #fffdf6;
  --w-stamp-bg: #ffd84d; --w-stamp-fg: #1f2a5c;
  background-image: radial-gradient(#e2d6bb 1px, transparent 1px); background-size: 22px 22px;
}
.w-me .wp-title { background: linear-gradient(transparent 55%, #ff7eb6aa 55% 85%, transparent 85%); display: inline-block; padding: 0 8px; }
.w-me .card:nth-child(odd) { rotate: -1.2deg; } .w-me .card:nth-child(even) { rotate: 1deg; }
.w-me .card::before { content: ''; position: absolute; top: -9px; left: 50%; width: 70px; height: 20px; translate: -50% 0; rotate: -3deg; background: rgba(255, 216, 77, .6); }
.w-me .cover span { color: #1f2a5c; }

/* ═══ project detail (pop-up over the room, a division or the catalog) ═══ */
.pj-modal {
  position: fixed; inset: 0; z-index: 104; padding: 56px 16px 24px;
  display: flex; justify-content: center; align-items: flex-start;
  background: rgba(6, 6, 16, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s;
}
.pj-modal.in { opacity: 1; }
.pj {
  position: relative; width: 100%; max-width: 860px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--w-bg); background-attachment: scroll; color: var(--w-fg); font-family: var(--w-body);
  border-radius: var(--w-radius, 14px); border: var(--w-card-border); box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transform-origin: var(--ox) var(--oy); transform: translateY(14px) scale(.97); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.pj-modal.in .pj { transform: none; }
/* long write-ups scroll inside the pop-up; the × stays put and the page behind doesn't move */
.pj-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px; }
html.pj-lock, html.pj-lock body { overflow: hidden; }
.pj.w-nwgc::after { position: absolute; border-radius: inherit; z-index: -1; } /* the scanlines texture the card, behind its content: never over a video, cover or text */
.pj-x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 999px; font: 22px/1 var(--font-mono); background: rgba(10, 10, 20, .55); color: #fff; }
.pj-x:hover, .pj-x:focus-visible { background: rgba(10, 10, 20, .85); }
.pj-top { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: start; }
/* videos (YouTube): full width at 16:9 across the top, the title and details below */
.pj-video .pj-top { grid-template-columns: 1fr; gap: 18px; }
.pj-video .cover { aspect-ratio: 16 / 9; max-width: none; width: 100%; font-size: 64px; }
.pj .cover { margin: 0; font-size: 80px; }
.pj-info { padding-top: 4px; min-width: 0; }
.pj-cat { font: 12px var(--font-mono); opacity: .6; letter-spacing: .05em; margin-bottom: 8px; padding-right: 36px; }
.pj h2 { font: var(--w-card-title); font-size: clamp(28px, 5vw, 44px); line-height: 1.05; margin-bottom: 8px; overflow-wrap: anywhere; }
.pj-meta { font: 12px var(--font-mono); opacity: .7; margin-bottom: 8px; }
.pj .byline { font: italic 14px var(--w-body); opacity: .75; margin-bottom: 8px; }
.pj-blurb { font-size: 16px; opacity: .9; margin-bottom: 4px; }
.pj-body { margin-top: 22px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); font-size: 16px; line-height: 1.6; }
.pj-body h3, .pj-body h4, .pj-body h5 { margin: 18px 0 6px; }
.pj-body ol, .pj-body ul { padding-left: 22px; margin: 6px 0 12px; }
.pj-body p { margin: 0 0 12px; }
@media (max-width: 640px) {
  .pj-modal { padding: 12px 10px; }
  .pj-scroll { padding: 16px; }
  .pj-top { grid-template-columns: 1fr; gap: 16px; }
  .pj .cover { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .pj, .pj-modal { transition: none; } }
