/* Wide windows, the Work gallery, the ALX archive, and the journey scroll.
 * Tokens come from brana.css. */

.win.wide { width: min(980px, calc(100vw - 32px)); height: min(760px, calc(100vh - 80px)) }
.win.tall { height: calc(100vh - 70px) }
.win.max { left: 0 !important; top: 34px !important; width: 100vw; height: calc(100vh - 34px); box-shadow: none }
.win.max .tbar { cursor: default }

/* ---------- Work ---------- */
.status { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; width: max-content }
.status.live { color: var(--rubric) }
.status.ship { color: var(--green) }
.status.lab { color: var(--blue) }
@keyframes fadein { from { opacity: 0; transform: translateY(4px) } }
.works { height: 100%; overflow: auto; padding: 22px 26px 30px }
.works-view.enter > * { animation: fadein .35s ease both }
.works-head h2 { font-family: var(--geez); color: var(--rubric); font-size: 40px; margin: 0; line-height: 1 }
.works-head h2 span { font-family: var(--serif); color: var(--fg); font-size: 28px; margin-left: 8px }
.works-head p { margin: 6px 0 4px; color: var(--ink-soft) }
.works-group { margin: 22px 0 10px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--rubric); display: flex; align-items: center; gap: 10px }
.works-group::after { content: ""; flex: 1; height: 1px; background: var(--line) }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px }
.card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 8px 8px 12px;
  background: var(--panel); border: 1px solid var(--line);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s;
  animation: cardin .5s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i) * 35ms);
}
@keyframes cardin { from { opacity: 0; translate: 0 14px } }
.card:hover, .card:focus-visible { box-shadow: 6px 6px 0 var(--rubric); border-color: var(--fg) }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px }
.card-meta .yr { font-size: 11px; color: var(--ink-soft) }
.card-name { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.1 }
.card-sum { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5 }

/* A plate: a screenshot printed in faded ink until you look closer, or a telsem plate */
.plate { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--fg); background: var(--disc) }
.plate img {
  width: 100%; height: 100%; object-fit: cover; object-position: top; display: block;
  filter: grayscale(1) sepia(.55) contrast(1.15) brightness(1.02); mix-blend-mode: multiply;
  transition: filter .6s ease, transform .8s ease;
}
.plate.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(28, 21, 16, .22) .8px, transparent 1.2px) 0 0 / 4px 4px;
  transition: opacity .6s ease;
}
.card:hover .plate img, .detail-plate .plate img { filter: none; mix-blend-mode: normal; transform: scale(1.03) }
.card:hover .plate.shot::after, .detail-plate .plate.shot::after { opacity: 0 }
.tplate { width: 100%; height: 100%; display: block }
.tplate .turn { transform-origin: 160px 100px; transform-box: view-box; transition: transform 1.4s cubic-bezier(.2, .8, .3, 1) }
.card:hover .tplate .turn { transform: rotate(45deg) }
.tglyph { font-family: var(--geez); font-size: 44px; fill: var(--rubric) }

.back { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); margin-bottom: 14px }
.back:hover { border-color: var(--rubric); color: var(--rubric) }
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start }
.detail-plate .plate { box-shadow: 8px 8px 0 var(--rubric) }
.detail h2 { font-family: var(--serif); font-size: 36px; margin: 8px 0 2px; line-height: 1.05 }
.detail .lede { font-family: var(--serif); font-style: italic; font-size: 18px; margin: 0 0 8px }
.visit { display: inline-block; margin-top: 4px; padding: 6px 12px; border: 2px solid var(--fg); background: var(--fg); color: var(--bg); text-decoration: none; transition: transform .15s, box-shadow .15s }
.visit:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--rubric) }
.detail-body p { max-width: 68ch }
.pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 12px }
.pn button { font-size: 12px; color: var(--ink-soft); text-align: left }
.pn button:last-child { text-align: right }
.pn button:hover { color: var(--rubric) }

/* The ALX archive */
.alx-intro { display: flex; gap: 18px; align-items: center; margin-bottom: 8px }
.alx-intro p { margin: 0; font-family: var(--serif); font-size: 17px; font-style: italic }
.seal, .stamp { color: var(--rubric); flex: none; width: 104px; height: 104px }
.seal svg, .stamp svg { width: 100%; height: 100%; font-family: var(--mono) }
.seal svg { animation: spin 40s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
.track { border-top: 1px solid var(--line); padding: 14px 0 6px; animation: cardin .5s ease both; animation-delay: calc(var(--i) * 60ms) }
.track h3 { display: flex; align-items: baseline; gap: 10px; font-family: var(--serif); font-size: 22px; margin: 0 0 2px }
.track .tn { font-family: var(--geez); color: var(--rubric); font-size: 18px; min-width: 22px }
.track .count { font-family: var(--mono); font-size: 11px; color: var(--ink-soft) }
.track p { margin: 0 0 8px; font-size: 12px; color: var(--ink-soft) }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px }
.chip { font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); color: var(--fg); text-decoration: none; transition: background .15s, color .15s, transform .15s }
.chip:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px) }

/* ---------- The journey scroll ---------- */
.body.flush:has(.jr) { overflow: auto; overflow-x: hidden }
.jr {
  position: relative; min-height: 100%; padding: 0 26px 60px; overflow-x: clip;
  background: linear-gradient(90deg, var(--vellum) 0 10px, transparent 10px calc(100% - 10px), var(--vellum) 0);
}
.jr-pin { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; pointer-events: none; height: 0 }
.jr-now { margin-top: 12px; height: max-content; background: var(--panel); border: 2px solid var(--fg); box-shadow: 4px 4px 0 var(--rubric); padding: 4px 10px; font-family: var(--geez); font-size: 15px; color: var(--rubric) }
.jr-head { min-height: 62%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 60px 0 20px }
.jr-title { font-size: clamp(80px, 14vw, 150px); line-height: .9; color: var(--rubric); text-shadow: 4px 4px 0 var(--fg) }
.jr-head p { font-family: var(--serif); font-style: italic; font-size: 20px; margin: 10px 0 0 }
.cue { display: block; font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-top: 18px; animation: cue 1.8s ease-in-out infinite; transition: opacity .3s }
@keyframes cue { 50% { transform: translateY(6px); opacity: .5 } }
.jr-head.scrolled .cue { opacity: 0; animation: none }

.track-wrap { position: relative; padding: 10px 0 }
.thread { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; translate: -50% 0; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 12px) }
.thread-ink { position: absolute; top: 0; bottom: 0; left: -.5px; width: 3px; background: var(--rubric); transform-origin: top; transform: scaleY(0) }
.reader { position: absolute; left: 50%; top: 0; width: 34px; height: 22px; z-index: 2; transform: translate(-50%, 0); will-change: transform }
.reader svg { width: 100%; height: 100%; display: block; margin-top: -11px }
.r-iris { transition: cx .4s ease }

.jp { position: relative; width: 50%; padding: 26px 0; --dir: -1 }
.jp.right { margin-left: 50%; --dir: 1 }
.jp-inner {
  margin: 0 34px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line);
  opacity: calc(.08 + var(--p) * .92);
  transform: translateX(calc((1 - var(--p)) * var(--dir) * 48px)) rotate(calc((1 - var(--p)) * var(--dir) * 1.5deg));
  filter: blur(calc((1 - var(--p)) * 4px));
  will-change: transform, opacity, filter;
  transition: border-color .3s, box-shadow .3s;
}
.jp.lit .jp-inner { border-color: var(--fg); box-shadow: 5px 5px 0 var(--shadow) }
.node { position: absolute; top: 44px; width: 13px; height: 13px; background: var(--panel); border: 2px solid var(--fg); rotate: 45deg; transition: background .3s, scale .3s; z-index: 1 }
.jp.left .node { right: -7.5px }
.jp.right .node { left: -7.5px }
.jp.lit .node { background: var(--rubric); scale: 1.25 }
.jp .yr { font-family: var(--geez); color: var(--rubric); font-size: 13px }
.jp .yr .gz { color: var(--ink-soft) }
.jp .hd {
  font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.1; margin: 2px 0 6px;
  clip-path: inset(-10% calc((1 - min(1, var(--p) * 1.25)) * 100%) -10% 0);
}
.jp p { margin: 0 0 8px }

.compaq { margin: 10px 0 0 }
.compaq canvas { width: 100%; height: auto; aspect-ratio: 320 / 236; image-rendering: pixelated; display: block; border: 1px solid var(--line); background: var(--disc) }
.compaq figcaption, .alx-stamp cite { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; display: block; font-style: normal }

.guess { background: var(--ink); color: #e9d9b4; padding: 10px 12px; margin-top: 8px; font-size: 12px }
.g-log { margin: 0; max-height: 130px; overflow: auto; white-space: pre-wrap; font: inherit }
.g-form { display: flex; gap: 8px; align-items: center; margin-top: 6px }
.g-prompt { color: #e0533f }
.g-form input { width: 60px; background: transparent; border: 0; border-bottom: 1px solid #e9d9b4; color: inherit; font: inherit; outline: 0 }
.g-form button { border: 1px solid #e9d9b4; padding: 1px 8px; font-size: 11px }
.g-form button:hover { background: #e9d9b4; color: var(--ink) }

.alx-stamp { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; margin-top: 8px }
.alx-stamp .stamp { width: 96px; height: 96px; opacity: 0; transform: scale(2.2) rotate(-30deg) }
.k-alx.done .stamp { animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1) forwards }
@keyframes stamp { to { opacity: 1; transform: scale(1) rotate(-10deg) } }
.alx-stamp blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 16px }
.open-alx { grid-column: 1 / -1; justify-self: start; font-size: 12px; border: 1px solid var(--fg); padding: 4px 10px }
.open-alx:hover { background: var(--fg); color: var(--bg) }

.vs { font-family: var(--serif); font-size: 26px; margin: 4px 0 }
.vs s { text-decoration: none; position: relative; color: var(--ink-soft) }
.vs s::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 54%; height: 3px; background: var(--rubric);
  transform-origin: left; transform: scaleX(clamp(0, calc(var(--p) * 2 - 1), 1));
}
.vs b { color: var(--rubric) }
.ai-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px }
.ai-list li { font-size: 11px; border: 1px solid var(--line); padding: 1px 8px }
.ai-list .no { border-color: var(--rubric); color: var(--rubric) }

.live-seal { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--rubric); color: var(--rubric); padding: 4px 12px; font-weight: 600; letter-spacing: .15em }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--rubric); animation: pulse 1.6s ease-out infinite }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(163, 38, 27, .6) } 100% { box-shadow: 0 0 0 12px rgba(163, 38, 27, 0) } }
.typed { font-size: 20px; color: var(--rubric); font-weight: 600; min-height: 1.5em }
.caret { animation: blink 1s steps(2) infinite; margin-left: 2px }
.jr-foot { text-align: center; padding: 30px 0 10px; font-family: var(--serif); font-style: italic; font-size: 18px }
.knot { display: block; font-size: 28px; color: var(--rubric); animation: spin 12s linear infinite }

/* Phones: the thread moves to the left edge, panels stack */
@media (max-width: 760px) {
  .win.wide, .win.tall { width: 100%; height: auto }
  .works { padding: 16px }
  .detail { grid-template-columns: 1fr }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px }
  .card-name { font-size: 17px }
  .card-sum { display: none }
  .alx-intro { flex-direction: column; align-items: flex-start }
  .jr { padding: 0 14px 40px }
  .thread, .reader { left: 18px }
  .jp, .jp.right { width: 100%; margin-left: 0; --dir: 1 }
  .jp-inner { margin: 0 0 0 40px }
  .jp.left .node, .jp.right .node { left: 11px; right: auto }
  .alx-stamp { grid-template-columns: 72px 1fr }
  .alx-stamp .stamp { width: 72px; height: 72px }
}
@media (prefers-reduced-motion: reduce) {
  .jp-inner { opacity: 1; transform: none; filter: none }
  .jp .hd { clip-path: none }
  .alx-stamp .stamp { opacity: 1; transform: rotate(-10deg) }
}
