/* ==========================================================================
   Josh McKee · Research Office
   ========================================================================== */

:root {
  --ink: #140d09;
  --cream: #f3e6c4;
  --amber: #ffb347;
  --phos: #46ff86;
  --phos-dim: #23a653;
  --phos-bg: #03100a;
  --red: #9b2b1f;
  --mono: 'VT323', 'Courier New', monospace;
  --type: 'Courier Prime', 'Courier New', Courier, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
  color: var(--cream);
  font-family: var(--type);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-variant-ligatures: none;
}

[hidden] { display: none !important; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px dashed var(--amber); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- stage */

.stage {
  position: fixed; inset: 0; z-index: 1;
  touch-action: none; cursor: default;
  background: #000;
}
.stage canvas { display: block; width: 100%; height: 100%; }
body.is-pointing .stage { cursor: pointer; }
body.is-grabbable .stage { cursor: grab; }
body.is-dragging .stage { cursor: grabbing; }
/* with a mouse there's no cursor over the office: a dot in the middle shows where you're looking */
body.is-aiming .stage { cursor: none; }
.reticle {
  position: fixed; left: 50%; top: 50%; z-index: 5; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255, 246, 228, 0.85); box-shadow: 0 0 0 1.5px rgba(20, 13, 9, 0.55); pointer-events: none; opacity: 0;
  transition: opacity 0.3s, width 0.15s, height 0.15s, margin 0.15s, background-color 0.15s;
}
body.is-aiming.is-ready .reticle { opacity: 1; }
body.is-aiming.is-pointing .reticle, body.is-aiming.is-grabbable .reticle {
  width: 18px; height: 18px; margin: -9px 0 0 -9px; background: transparent;
  box-shadow: 0 0 0 2px var(--amber), 0 0 0 3.5px rgba(20, 13, 9, 0.5);
}
body.is-aiming.is-dragging .reticle { background: rgba(255, 179, 71, 0.5); }
.look-hint {
  position: fixed; left: 50%; top: calc(50% + 20px); z-index: 5; margin: 0; transform: translateX(-50%);
  font: 17px/1 var(--mono); letter-spacing: 0.06em; white-space: nowrap; color: rgba(243, 230, 196, 0.9);
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, 0.6); pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
body.is-aiming.is-ready:not(.is-locked):not(.has-prompt) .look-hint { opacity: 1; transition: opacity 0.6s 1.5s; }
.look-hint { top: calc(50% + 24px); }
/* what E (or a click) will do with whatever the dot is on */
.act-hint {
  position: fixed; left: 50%; top: calc(50% + 20px); z-index: 5; margin: 0; transform: translate(-50%, 4px);
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; white-space: nowrap;
  font: 18px/1 var(--mono); letter-spacing: 0.05em; color: var(--cream);
  background: rgba(20, 13, 9, 0.72); box-shadow: 0 0 0 1px rgba(243, 230, 196, 0.25);
  pointer-events: none; opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.act-hint kbd { display: grid; place-items: center; width: 22px; height: 22px; font: 17px/1 var(--mono); color: var(--ink); background: var(--cream); box-shadow: 0 2px 0 #8a7a5a; }
body.is-aiming .act-hint.is-on { opacity: 1; transform: translate(-50%, 0); }

/* keyboard menu: invisible until someone tabs into it */
.kbd-nav {
  position: fixed; z-index: 40; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 6px;
  background: rgba(12, 8, 6, 0.88); box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px #000;
  clip-path: inset(50%); opacity: 0;
}
.kbd-nav:focus-within { clip-path: none; opacity: 1; }
.kbd-nav button {
  padding: 5px 10px; font: 19px/1 var(--mono); text-transform: uppercase;
  background: transparent; border: 0; color: var(--cream); cursor: pointer;
}
.kbd-nav button[aria-current="true"] { background: var(--amber); color: var(--ink); }

/* hint markers: small pulsing diamonds pinned to objects (touch screens only) */
.markers { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.markers.is-on { opacity: 1; }
.marker { position: absolute; left: 0; top: 0; transition: opacity 0.2s; }
.marker::before {
  content: ''; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px;
  background: var(--amber); box-shadow: 0 0 0 2px #000;
  transform: rotate(45deg); animation: pulse 1.1s ease-in-out infinite;
}
.marker.is-minor::before { left: -4px; top: -4px; width: 8px; height: 8px; background: var(--cream); }

@keyframes pulse { 50% { transform: rotate(45deg) scale(0.6); opacity: 0.6; } }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- boot screen */

.boot {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: max(6vh, 28px) max(6vw, 20px);
  background: #000; color: #b8ffcf;
  font: clamp(18px, 2.4vw, 26px)/1.25 var(--mono);
  text-shadow: 0 0 6px rgba(70, 255, 134, 0.6);
  transform-origin: 50% 50%;
}
.boot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px);
}
.boot-text { margin: 0; white-space: pre-wrap; font: inherit; }
.boot-bar { width: min(420px, 80%); height: 14px; margin-top: 18px; box-shadow: 0 0 0 2px #b8ffcf; }
.boot-bar span { display: block; height: 100%; width: 0; background: #46ff86; transition: width 0.12s steps(4); }
.boot.is-off { animation: crt-off 0.6s cubic-bezier(0.6, 0, 0.4, 1) forwards; }
@keyframes crt-off {
  0% { transform: scale(1, 1); filter: brightness(1); }
  45% { transform: scale(1, 0.006); filter: brightness(3); background: #fff; }
  100% { transform: scale(0, 0.004); filter: brightness(4); opacity: 0; }
}

/* ---------------------------------------------------------------- fallback (no WebGL, no JS) */

.fallback { display: none; }
html:not(.js) .fallback,
body.no-office .fallback {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-content: center; gap: 4px; padding: 24px; text-align: center;
  background: #000; color: #b8ffcf; font: 22px/1.4 var(--mono);
  text-shadow: 0 0 6px rgba(70, 255, 134, 0.5);
}
.fallback p { margin: 0 auto; max-width: 30em; }
.fallback .fallback-name { font-size: 44px; margin-bottom: 8px; }
html:not(.js) .stage, html:not(.js) .content, html:not(.js) .boot, html:not(.js) .paper-wrap, html:not(.js) .kbd-nav,
body.no-office .stage, body.no-office .content, body.no-office .paper-wrap, body.no-office .kbd-nav { display: none !important; }

/* ---------------------------------------------------------------- content cards: shared */

.content { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.panel { display: none; pointer-events: auto; }
.panel.is-open { display: block; }

.panel-close {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 34px; height: 34px; padding: 0;
  font: 30px/1 var(--mono); color: inherit;
  background: transparent; border: 0; cursor: pointer; opacity: 0.75;
}
.panel-close:hover { opacity: 1; }
.panel-kicker { margin: 0 0 4px; font: 18px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }

/* card catalog and tape deck sit to the right of the scene */
.panel-library,
.panel-tapes {
  position: fixed; right: 18px; top: calc(24px + var(--safe-t)); bottom: calc(24px + var(--safe-b));
  width: min(440px, 36vw); overflow: auto; overscroll-behavior: contain;
  padding: 22px 22px 26px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 60, 30, 0.08) 27px 28px),
    #e9dcbc;
  box-shadow: 0 0 0 3px #3a2414, 0 0 0 6px #000, 10px 12px 0 2px rgba(0, 0, 0, 0.45);
  animation: slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel-library h2, .panel-tapes h2 { margin: 0 0 4px; font: 700 28px/1.1 var(--type); }
.panel-intro { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: #4a3b28; }
.shelf h3 { margin: 18px 0 10px; font: 20px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #6b4a22; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

/* index cards */
.item {
  position: relative; padding: 12px 14px 22px;
  background: #fbf6e8; color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), 2px 3px 0 rgba(60, 40, 20, 0.25);
  border-top: 2px solid #c74a3a;
  background-image: repeating-linear-gradient(0deg, transparent 0 21px, rgba(70, 110, 160, 0.18) 21px 22px);
  background-position: 0 30px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.item::after { /* the catalog-card hole */
  content: ''; position: absolute; left: 50%; bottom: 6px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: #3a2414; box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.5);
}
.item:hover, .item.is-hot { transform: translateX(-6px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), 6px 6px 0 rgba(60, 40, 20, 0.3); }
.item.is-focused { transform: translateX(-10px) rotate(-0.6deg); box-shadow: 0 0 0 2px var(--amber), 8px 8px 0 rgba(60, 40, 20, 0.35); }
.item-title { margin: 0; font: 700 18px/1.25 var(--type); }
.item-title a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.2s; }
.item-title a:hover, .item-title a:focus-visible { background-size: 100% 1px; }
.item-title a::after { content: ' \2197'; font-weight: 400; color: #8a6a3a; }
.item-by { margin: 2px 0 6px; font: 17px/1 var(--mono); color: #7a5a2a; text-transform: uppercase; letter-spacing: 0.04em; }
.item-desc { margin: 0; font-size: 14.5px; line-height: 22px; color: #2c2116; }

/* cassette J-cards */
.panel-tapes .item { border-top: 0; background: #f6efdf; padding: 14px 14px 14px 64px; }
.panel-tapes .item::after { display: none; }
.panel-tapes .item::before {
  content: ''; position: absolute; left: 12px; top: 16px; width: 40px; height: 26px;
  background:
    radial-gradient(circle at 11px 13px, #e9e1cf 0 4px, #222 4px 5px, transparent 5px),
    radial-gradient(circle at 29px 13px, #e9e1cf 0 4px, #222 4px 5px, transparent 5px),
    linear-gradient(#2a2826, #2a2826);
  box-shadow: 0 0 0 2px #111;
}
.panel-tapes .items .item:nth-child(1)::before { border-top: 5px solid #c0392b; }
.panel-tapes .items .item:nth-child(2)::before { border-top: 5px solid #2f6f8f; }
.panel-tapes .items .item:nth-child(3)::before { border-top: 5px solid #d9a43a; }
.panel-tapes .items .item:nth-child(4)::before { border-top: 5px solid #3e6b4b; }
.panel-tapes .items .item:nth-child(5)::before { border-top: 5px solid #8e44ad; }
.panel-tapes .items .item:nth-child(6)::before { border-top: 5px solid #d35400; }
.panel-tapes .item.is-focused::before { animation: spinreel 1s linear infinite; }
@keyframes spinreel { 50% { filter: brightness(1.4); } }

/* mixtapes: the one in the deck gets a little "playing" tag */
.panel-tapes .song .item-by { margin-bottom: 0; }
.panel-tapes .song.is-playing { box-shadow: 0 0 0 2px var(--amber), 6px 6px 0 rgba(60, 40, 20, 0.3); }
.panel-tapes .song.is-playing .item-title::after { content: 'PLAYING'; margin-left: 10px; padding: 1px 6px; font: 15px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink); background: var(--amber); vertical-align: 2px; }
.panel-tapes .song.is-playing::before { animation: spinreel 1s linear infinite; }

/* once the door's open: how to walk out */
.walk-hint {
  position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); z-index: 25; margin: 0; transform: translateX(-50%);
  padding: 7px 14px; font: 19px/1.1 var(--mono); letter-spacing: 0.05em; white-space: nowrap; color: var(--cream);
  background: rgba(20, 13, 9, 0.82); box-shadow: 0 0 0 2px #120a05, 0 0 0 3px rgba(243, 230, 196, 0.5);
  pointer-events: none; animation: hint-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.walk-hint[hidden] { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (max-width: 560px) { .walk-hint { white-space: normal; width: calc(100% - 48px); text-align: center; } }

/* outside the office: the way back in */
.go-in {
  position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 25; display: none;
  padding: 7px 12px; font: 20px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink);
  background: var(--cream); border: 0; box-shadow: 0 0 0 2px #120a05, 6px 6px 0 rgba(0, 0, 0, 0.4); cursor: pointer;
}
body.is-outside .go-in { display: block; animation: rise-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.go-in:hover, .go-in:focus-visible { background: var(--amber); }
.go-in kbd { margin-left: 8px; padding: 1px 5px; font: 16px/1 var(--mono); color: var(--cream); background: var(--ink); }
@media (pointer: coarse) { .go-in kbd { display: none; } }

/* the "now playing" card: YouTube's player has to stay visible while it plays */
.jukebox {
  position: fixed; left: 18px; bottom: calc(18px + var(--safe-b)); z-index: 30; width: 344px;
  padding: 10px 12px 12px; color: var(--cream);
  background: linear-gradient(180deg, #3a2414, #24150b);
  box-shadow: 0 0 0 2px #120a05, 0 0 0 4px var(--cream), 8px 10px 0 2px rgba(0, 0, 0, 0.45);
  animation: rise-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.jukebox[hidden] { display: none; }
.jukebox-label { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 18px/1.1 var(--mono); letter-spacing: 0.04em; }
.jukebox-label b { display: block; font-weight: 400; color: var(--amber); text-transform: uppercase; }
.jukebox-by { display: block; color: #d9c8a0; }
.jukebox-reels {
  flex: none; width: 40px; height: 26px;
  background:
    radial-gradient(circle at 11px 13px, #e9e1cf 0 4px, #222 4px 5px, transparent 5px),
    radial-gradient(circle at 29px 13px, #e9e1cf 0 4px, #222 4px 5px, transparent 5px),
    linear-gradient(#2a2826, #2a2826);
  box-shadow: 0 0 0 2px #111; border-top: 5px solid var(--amber);
  animation: spinreel 1s linear infinite;
}
.jukebox-screen { width: 320px; height: 200px; background: #000; box-shadow: inset 0 0 0 2px #120a05; }
.jukebox-screen iframe { display: block; width: 320px; height: 200px; border: 0; }
.jukebox.is-error .jukebox-screen::after { content: 'The tape deck needs YouTube to play this one.'; display: block; padding: 16px; font: 17px/1.3 var(--mono); color: #d9c8a0; }
.jukebox-eject {
  display: block; margin: 10px 0 0 auto; padding: 4px 12px; font: 18px/1 var(--mono); letter-spacing: 0.06em;
  color: var(--ink); background: var(--cream); border: 0; box-shadow: 0 0 0 2px #120a05; cursor: pointer;
}
.jukebox-eject:hover, .jukebox-eject:focus-visible { background: var(--amber); }
@media (max-width: 760px) {
  /* the panels come up from the bottom on narrow screens, so the card moves to the top */
  .jukebox { top: calc(12px + var(--safe-t)); bottom: auto; left: 12px; }
}
html:not(.js) .jukebox, body.no-office .jukebox { display: none !important; }

@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
@keyframes rise-in { from { transform: translateY(24px) rotate(-1.5deg); opacity: 0; } }

/* ---------------------------------------------------------------- terminal (pinned over the CRT) */

.panel-terminal {
  position: fixed; left: 10vw; top: 10vh; width: 80vw; height: 72vh;
  padding: 0; overflow: hidden; font-size: 20px;
  border-radius: 3% / 4%;
  color: var(--phos); background: var(--phos-bg);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85), 0 0 24px rgba(70, 255, 134, 0.12);
  opacity: 0; transform: scale(0.98); transition: opacity 0.25s, transform 0.25s;
}
.panel-terminal.is-on { opacity: 1; transform: none; }
.panel-terminal::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55));
}
.panel-terminal.is-full {
  left: 8px; right: 8px; top: calc(8px + var(--safe-t)); bottom: calc(8px + var(--safe-b));
  width: auto; height: auto; font-size: 19px; border-radius: 14px;
}
.panel-terminal .panel-close { top: 0; right: 6px; height: 1.4em; z-index: 3; color: var(--phos-bg); font-size: 1.3em; opacity: 1; }
.panel-terminal.is-full .term .report { grid-template-columns: 4.2em 1fr; }
.panel-terminal.is-full .term .report-title { grid-column: 1 / -1; grid-row: 2; }
.panel-terminal.is-full .term .report-dek { grid-column: 1 / -1; grid-row: 3; padding-left: 1.1em; }
.panel-terminal.is-full .term-clock { display: none; }
.term {
  height: 100%; overflow: auto; overscroll-behavior: contain;
  padding: 0 0 1em; font-family: var(--mono); line-height: 1.15;
  text-shadow: 0 0 5px rgba(70, 255, 134, 0.55);
}
.term-bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; gap: 1em;
  margin: 0; padding: 0.15em 2.2em 0.15em 0.6em;
  background: var(--phos); color: var(--phos-bg); text-shadow: none;
}
.term-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.term-cmd { margin: 0.7em 0.6em 0.4em; color: var(--phos-dim); }
.term .reports { display: grid; gap: 0; margin: 0 0.6em; }
.term .report { display: grid; grid-template-columns: 4.2em 5.4em 1fr; column-gap: 0.5em; padding: 0.35em 0.3em; border-bottom: 1px dashed rgba(70, 255, 134, 0.25); }
.term .report-meta { margin: 0; display: contents; color: var(--phos-dim); }
.term .report-ticker, .term .report-meta time { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.term-short { display: contents; }
.term-short b { grid-column: 1; grid-row: 1; font-weight: 400; color: var(--phos); }
.term-short i { grid-column: 2; grid-row: 1; font-style: normal; color: var(--phos-dim); }
.term .report-title { grid-column: 3; grid-row: 1; margin: 0; font: inherit; font-size: 1.05em; text-transform: uppercase; }
.term .report-title a { text-decoration: none; display: block; }
.term .report-title a::before { content: '  '; white-space: pre; }
.term .report-title a:hover::before, .term .report-title a:focus-visible::before { content: '> '; }
.term .report-title a:hover, .term .report-title a:focus-visible { background: rgba(70, 255, 134, 0.14); outline: none; }
.term .report-dek { grid-column: 3; grid-row: 2; margin: 0.1em 0 0; color: var(--phos-dim); font-size: 0.95em; padding-left: 1.1em; }
.term-prompt { margin: 0.4em 0.6em 0; color: var(--phos-dim); }
.term-prompt .cursor { color: var(--phos); animation: blink 1s steps(2, jump-none) infinite; }
.term .report-figure, .term .report-open { display: none; }
.term .report.is-expanded .report-figure { display: block; grid-column: 1 / -1; margin: 0.6em 0 0.3em; }
.term .report.is-expanded .report-figure img {
  display: block; width: 100%; max-width: 34em; margin: 0 auto;
  filter: grayscale(1) invert(1) sepia(1) hue-rotate(70deg) saturate(5) brightness(0.9) contrast(1.4);
  mix-blend-mode: screen; image-rendering: pixelated;
}
.term .report.is-expanded .report-open { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 0.4em 1.4em; margin: 0.3em 0 0.4em; }
.term .report-open a, .term .report-open button {
  padding: 0.05em 0.5em; font: inherit; text-decoration: none; border: 0; cursor: pointer;
  color: var(--phos-bg); background: var(--phos); text-shadow: none;
}
.term .report-open button { background: transparent; color: var(--phos); box-shadow: inset 0 0 0 1px var(--phos); }
.panel-terminal.has-expanded .report:not(.is-expanded) { display: none; }
.term-foot { margin: 0.9em 0.6em 0; color: var(--phos-dim); }
.term-foot::before { content: 'C:\\RESEARCH> '; }
.term-foot a { color: var(--phos); }

/* ---------------------------------------------------------------- report on paper */

.paper-wrap {
  position: fixed; z-index: 26; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: flex-end;
  padding: calc(24px + var(--safe-t)) 32px calc(24px + var(--safe-b));
}
.paper {
  position: relative; pointer-events: auto;
  width: min(520px, 40vw); max-height: 100%; overflow: auto;
  padding: 26px 30px 30px;
  color: #1c1610;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(180deg, #f7f1e1, #ece2c9);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 14px 18px 0 rgba(0, 0, 0, 0.4);
  transform: rotate(-1deg);
  animation: rise-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.paper .panel-close { top: 0; right: 4px; height: 30px; color: #efe6cf; font-size: 26px; }
.paper-letterhead {
  display: flex; justify-content: space-between; margin: -26px -30px 18px; padding: 6px 30px;
  font: 18px/1 var(--mono); letter-spacing: 0.08em; color: #efe6cf; background: #1b2a3a;
}
.paper-meta { margin: 0 0 8px; font: 18px/1 var(--mono); color: var(--red); letter-spacing: 0.04em; }
.paper-title { margin: 0 0 8px; font: 700 26px/1.2 var(--type); }
.paper-dek { margin: 0 0 16px; font-style: italic; font-size: 17px; color: #4a3b28; }
.paper-figure { margin: 0 0 18px; padding: 8px; background: #fff; box-shadow: 0 0 0 1px #cfc5ad; }
.paper-figure img { display: block; width: 100%; }
.paper-actions { margin: 0; }
.paper-cta {
  display: inline-block; padding: 8px 14px; font: 700 16px/1 var(--type);
  color: #f7f1e1; background: #1c1610; text-decoration: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}
.paper-cta:hover { background: var(--red); }
.paper-stamp {
  position: absolute; right: 18px; bottom: 16px; margin: 0;
  padding: 4px 10px; font: 700 15px/1 var(--type); letter-spacing: 0.08em;
  color: rgba(155, 43, 31, 0.78); border: 3px solid rgba(155, 43, 31, 0.7); border-radius: 4px;
  transform: rotate(-9deg); mix-blend-mode: multiply;
}

/* ---------------------------------------------------------------- contact + about */

.panel-contact,
.panel-about {
  position: fixed; right: 32px; top: 50%; transform: translateY(-50%);
  width: min(460px, 38vw);
  animation: rise-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel-contact .panel-close, .panel-about .panel-close { color: var(--ink); }
.card {
  position: relative; padding: 24px 26px 22px; color: var(--ink);
  background: #fbf6e8;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(70, 110, 160, 0.2) 27px 28px);
  background-position: 0 66px;
  border-top: 3px solid #c74a3a;
  box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.45);
}
.card::before, .card::after { /* rolodex slots */
  content: ''; position: absolute; bottom: -10px; width: 34px; height: 18px; background: #000; border-radius: 0 0 50% 50%;
}
.card::before { left: 22%; }
.card::after { right: 22%; }
.card h2 { margin: 0; font: 700 28px/1.1 var(--type); letter-spacing: 0.04em; }
.card-role { margin: 4px 0 14px; font: 18px/1 var(--mono); color: #6b4a22; text-transform: uppercase; }
.card-lines { list-style: none; margin: 0; padding: 0; font-size: 17px; line-height: 28px; }
.card-lines li { display: flex; gap: 12px; }
.card-lines span { min-width: 7.2em; font: 19px/28px var(--mono); color: #7a5a2a; }
.card-lines a { font-weight: 700; }

.about-card {
  position: relative;
  padding: 24px 26px; color: var(--ink);
  background: linear-gradient(180deg, #f7f1e1, #ece2c9);
  box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.45);
}
.about-body h2 { margin: 0 0 6px; font: 700 28px/1.1 var(--type); }
.about-lede { margin: 0 0 10px; font-weight: 700; font-size: 17px; }
.about-body p { font-size: 15.5px; line-height: 1.55; margin: 0 0 10px; }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 19px/1 var(--mono); text-transform: uppercase; }
.about-links a { color: var(--red); }

/* ---------------------------------------------------------------- small screens: cards become bottom sheets */

@media (max-width: 760px) {
  .panel-library,
  .panel-tapes {
    left: 8px; right: 8px; width: auto; top: auto; bottom: calc(8px + var(--safe-b)); max-height: 60vh;
    padding: 18px 16px 20px;
    animation-name: rise-in;
  }
  .panel-contact,
  .panel-about {
    left: 8px; right: 8px; width: auto; top: auto; bottom: calc(14px + var(--safe-b)); transform: none; max-height: 70vh; overflow: auto;
  }
  .about-card { padding: 18px 16px; }
  .paper-wrap { padding: calc(16px + var(--safe-t)) 8px calc(8px + var(--safe-b)); justify-content: center; align-items: flex-end; }
  .paper { width: 100%; max-height: 74vh; padding: 22px 18px 26px; transform: none; }
  .paper-letterhead { margin: -22px -18px 14px; padding: 6px 18px; }
  .paper-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
