/* =========================================================================
   BASIC (default): plain, fast, the work does the talking.
   ========================================================================= */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--font);
  --gutter: clamp(16px, 3vw, 32px);
  --radius: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font);
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

/* The header stays put at the top in both modes. */
.top {
  position: sticky; top: 0; z-index: 45; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: space-between; align-items: center;
  padding: 20px var(--gutter);
  font: 15px/1.5 var(--font); text-transform: none; letter-spacing: 0;
}
.names { font-weight: 600; text-decoration: none; font-family: var(--display); }
.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a, .nav .link { text-decoration: none; color: var(--muted); background: none; border: 0; padding: 0; }
.nav a:hover, .nav .link:hover { color: var(--ink); }
/* the page you're on: ink colour and an underline, same spot in both modes */
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav .link[aria-busy="true"] { cursor: progress; }

/* Fun mode switch: top right */
.mode {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line); border-radius: 99px; padding: 5px 6px 5px 12px;
  font-size: 13px;
}
.mode:hover { border-color: var(--ink); }
@media (max-width: 480px) {
  .top { padding-top: 14px; padding-bottom: 12px; row-gap: 6px; }
  .nav { gap: 14px; font-size: 14px; flex-wrap: nowrap; }
  .mode { padding: 4px 5px 4px 10px; gap: 6px; font-size: 12px; }
}
.mode-track { width: 30px; height: 18px; border-radius: 99px; background: var(--line); position: relative; }
.mode-knob {
  position: absolute; top: 3px; left: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ink); transition: transform .3s;
}
.mode[aria-pressed="true"] .mode-knob { transform: translateX(12px); }

.intro { margin: 0; padding: 0 var(--gutter) 20px; color: var(--muted); max-width: 60ch; }

/* Work grid */
.grid {
  display: grid; gap: var(--gutter);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 var(--gutter) var(--gutter);
}
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 40px 0; }

.card { display: block; text-decoration: none; color: inherit; outline-offset: 4px; }
.card[hidden] { display: none; }
.thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--c, #ddd); border-radius: var(--radius); position: relative; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .thumb img, .card:hover .thumb video { transform: scale(1.02); }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--c, #ddd); color: var(--ph-ink, #fff);
  font: 600 clamp(20px, 3vw, 34px)/1.1 var(--display); text-align: center; padding: 16px;
}
.cap { display: flex; gap: 8px; align-items: baseline; padding-top: 10px; }
.cap .brand { font-weight: 600; }
.cap .logo { height: 20px; width: auto; max-width: 140px; object-fit: contain; align-self: center; }
.slot-empty .thumb { background: #f4f4f4; }
.v-logo { height: 32px; width: auto; max-width: 200px; object-fit: contain; margin-bottom: 8px; }
.cap .what { color: var(--muted); }
.cap .by { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding: 32px var(--gutter); color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--line); margin-top: var(--gutter);
}
.foot a { text-decoration: none; }
.foot-links { display: flex; gap: 16px; }
.foot .link, .crit-line .link, .v-end .link { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
.foot .link:hover { color: var(--ink); }
.crit-line { margin: 0; padding: 8px var(--gutter) 0; color: var(--muted); }
.crit-line .link, .v-end .link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.v-end { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 8px 0 24px; }
.awards { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.awards li { font-size: 12px; font-weight: 600; border: 1px solid var(--ink); border-radius: 99px; padding: 2px 10px; }
.cap .award { font-size: 11px; font-weight: 600; border: 1px solid currentColor; border-radius: 99px; padding: 0 7px; white-space: nowrap; }
dialog.crit { border: 0; padding: 0; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); background: var(--bg); color: var(--ink); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog.crit::backdrop { background: rgba(0, 0, 0, .4); }
.crit-form { display: grid; gap: 12px; padding: 20px; }
.crit-head { display: flex; justify-content: space-between; align-items: center; }
.crit-head h2 { margin: 0; font: 600 20px/1.2 var(--display); }
.crit-head .link { background: none; border: 0; color: var(--muted); cursor: pointer; }
.crit-form p { margin: 0; }
.crit-form .muted { color: var(--muted); }
.crit-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.crit-form small { color: var(--muted); font-weight: 400; }
.crit-form input, .crit-form select, .crit-form textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
.crit-form input:focus, .crit-form select:focus, .crit-form textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.crit-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .crit-form .two { grid-template-columns: 1fr; } }
.crit-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.crit-form .send { background: var(--ink); color: var(--bg); border: 0; border-radius: 99px; padding: 11px 18px; font-weight: 600; cursor: pointer; }
.crit-form .send:disabled { opacity: .5; }
.crit-msg { min-height: 1.4em; font-size: 13px; }
.crit-form .small { font-size: 13px; }
.crit-form[hidden] { display: none; }
.crit-form .small .link { background: none; border: 0; cursor: pointer; font-family: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; padding: 0; }
.crit-switch { display: flex; gap: 6px; align-items: center; padding: 16px 20px 0; }
.crit-switch [role="tab"] { font: 600 14px/1 var(--display); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 99px; padding: 9px 14px; cursor: pointer; }
.crit-switch [aria-selected="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.crit-switch .link { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.verdict { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.verdict legend { font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 6px; }
.verdict label { display: block; }
.verdict input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.verdict span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 9px 14px; cursor: pointer; font-size: 14px; font-weight: 500; }
.verdict input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.verdict input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
body.fun .crit-switch [aria-selected="true"], body.fun .verdict input:checked + span { background: var(--accent); color: #111; border-color: var(--accent); }
body.fun .crit-form .send, body.fun .awards li { background: var(--accent); color: #111; border-color: var(--accent); }
.foot-line { flex: 1; text-align: center; min-width: 200px; }
@media (max-width: 640px) { .foot-line { order: 3; text-align: left; flex-basis: 100%; } }
.foot a:hover { color: var(--ink); }

/* Project viewer: opens straight from the grid */
.viewer { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.viewer[hidden] { display: none; }
.viewer-bar {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter); border-bottom: 1px solid var(--line);
}
.viewer-title { margin: 0; font: 600 15px/1.3 var(--display); }
.viewer-title span { color: var(--muted); font-weight: 400; }
.viewer-nav { display: flex; gap: 6px; }
.viewer-nav button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 13px; }
.viewer-nav button:hover { border-color: var(--ink); }
.viewer-body { padding: var(--gutter); display: grid; gap: var(--gutter); max-width: 1400px; margin: 0 auto; }
.meta { display: grid; gap: 6px; max-width: 62ch; }
.meta p { margin: 0; white-space: pre-line; }
.meta .sub { color: var(--muted); font-size: 13px; }
.meta a { font-size: 13px; }
.story { display: none; }
.label { margin: 0 0 6px; font: 600 12px/1.3 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gutter); max-width: 1000px; }
.why p { margin: 0; max-width: 62ch; white-space: pre-line; }
.sketches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.sketches > * { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--line); }
.media figure { margin: 0; }
.media figure > img, .media figure > video, .media figure > .ph { width: 100%; border-radius: var(--radius); }
.media figcaption { padding-top: 8px; font-size: 13px; color: var(--muted); }
.media figcaption b { color: var(--ink); font-weight: 600; }
.us { }
.us-about { padding: 24px var(--gutter) 0; max-width: 900px; }
.us-who { font-size: 20px; line-height: 1.4; margin: 0 0 16px; max-width: 40ch; }
.now-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 12px 0 0; }
.now-next dt { font: 600 12px/1.3 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.now-next dd { margin: 4px 0 0; white-space: pre-line; }
.media { display: grid; gap: var(--gutter); }
.media > * { width: 100%; border-radius: var(--radius); }
.media .ph { aspect-ratio: 16 / 10; }

/* About */
.people {
  display: grid; gap: calc(var(--gutter) * 2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 24px var(--gutter) var(--gutter);
}
@media (max-width: 720px) { .people { grid-template-columns: 1fr; } }
.person h2 { margin: 16px 0 2px; font: 600 20px/1.2 var(--display); }
.person .role { margin: 0 0 12px; color: var(--muted); }
.person p { max-width: 52ch; white-space: pre-line; }
.person .photo { max-width: 420px; aspect-ratio: 4 / 5; background: var(--line); overflow: hidden; border-radius: var(--radius); }
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.person .fun-bio { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 13px;
}
.toast[hidden] { display: none; }

.fun-only { display: none; }

/* =========================================================================
   FUN MODE: same content, a different site. Colours come from the editor
   (--fun-bg / --fun-accent are set on <body> by app.js).
   ========================================================================= */
body.fun {
  --bg: var(--fun-bg, #1d1814);
  --ink: #f3ead8;
  --muted: #b5a891;
  --line: #3d342c;
  --accent: var(--fun-accent, #ff6a2b);
  --paper: #f3ead8;
  --mustard: #f2b33d;
  --display: "Bricolage Grotesque", var(--font);
  --mono: "Space Mono", ui-monospace, monospace;
  --radius: 14px;
  font-family: var(--mono);
  font-size: 14px;
}
/* film grain */
body.fun::before {
  content: ""; position: fixed; inset: -50%; z-index: 40; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -2%); } }

body.fun .fun-only { display: block; }
body.fun .nav a, body.fun .nav .link { color: var(--ink); }
body.fun .nav a:hover, body.fun .nav .link:hover { color: var(--accent); }
body.fun .nav a[aria-current="page"] { color: var(--accent); text-decoration-color: var(--accent); }
body.fun .mode { border-color: var(--accent); background: var(--accent); color: #111; }
body.fun .mode-track { background: #111; }
body.fun .mode-knob { background: var(--accent); }

body.fun .intro {
  color: var(--ink); max-width: 16ch;
  font: 800 clamp(44px, 9vw, 132px)/.9 var(--display); letter-spacing: -.045em;
  padding-top: 32px; padding-bottom: 40px;
}
body.fun .intro em { font-style: normal; color: var(--accent); }

.cap .extra { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--accent, #111); }
body.fun .cap .award { color: var(--accent); }


body.fun .thumb { background: var(--c); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
body.fun .card:hover .thumb { outline: 3px solid var(--accent); }
body.fun .cap { flex-wrap: wrap; padding: 10px 2px 0; }
body.fun .cap .brand { font: 800 22px/1.05 var(--display); letter-spacing: -.01em; }
/* logos are made for light backgrounds, so they get a little white plate in fun mode */
body.fun .cap .logo, body.fun .v-logo { background: #fff; padding: 4px 8px; border-radius: 6px; box-sizing: content-box; }
body.fun .cap .what { width: 100%; order: 3; font-size: 12px; text-transform: uppercase; }
body.fun .cap .by { background: var(--accent); color: #111; border-radius: 99px; padding: 1px 9px; font-weight: 700; font-size: 11px; text-transform: uppercase; }
@media (max-width: 760px) { body.fun .grid { gap: 40px; } }

body.fun .us { padding: 80px var(--gutter) 40px; }
.us h2 { margin: 0 0 24px; font: 800 clamp(36px, 6vw, 80px)/.95 var(--display); letter-spacing: -.03em; }
.us-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); }
@media (max-width: 640px) { .us-row { grid-template-columns: 1fr; } }
.us-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.us-card:nth-child(1) { transform: rotate(-1deg); }
.us-card:nth-child(2) { transform: rotate(1deg); }
.us-card h3 { margin: 0; font: 800 28px/1.1 var(--display); }
.us-card p { margin: 6px 0 14px; color: var(--muted); white-space: pre-line; }
.us-card a { margin-right: 16px; color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 700; }

body.fun .viewer-bar { border-color: var(--line); }
body.fun .viewer-title { font: 800 24px/1.1 var(--display); }
body.fun .viewer-nav button { border-color: var(--ink); font: 700 12px/1 var(--mono); text-transform: uppercase; padding: 8px 14px; }
body.fun .viewer-nav button:hover { background: var(--accent); border-color: var(--accent); color: #111; }
body.fun .story { display: block; border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin-top: 8px; }
body.fun .story b { display: block; text-transform: uppercase; font-size: 11px; color: var(--accent); margin-bottom: 4px; }
body.fun .meta p { font-size: 14px; }

body.fun .person h2 { font: 800 clamp(36px, 5vw, 60px)/.95 var(--display); letter-spacing: -.03em; }
body.fun .person .photo { box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
body.fun .person:nth-child(1) .photo { transform: rotate(-2deg); }
body.fun .person:nth-child(2) .photo { transform: rotate(2deg); }
body.fun .person .fun-bio { display: block; border-left: 3px solid var(--accent); padding-left: 14px; }
body.fun .person a { color: var(--accent); }
body.fun .toast { background: var(--accent); color: #111; }


::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the secret way into the editor: no visual hint, just easy to tap */
[data-secret] { -webkit-user-select: none; user-select: none; touch-action: manipulation; padding: 8px 4px; margin: -8px -4px; }

/* =========================================================================
   FUN MODE, WORK PAGE: a shelf of tapes. Each project is its own cassette.
   ========================================================================= */
body.fun[data-page="work"] .grid { display: none; }
body.fun { background: radial-gradient(1200px 600px at 70% -10%, #3a2a1f 0%, transparent 60%), var(--bg); }
body.fun .intro { max-width: 14ch; padding-bottom: 12px; }
.hand { font-family: "Permanent Marker", var(--display); font-weight: 400; }
.tape { padding: 0 var(--gutter); }
body.fun .tape { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 24px clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { body.fun .tape { grid-template-columns: 1fr; } }
.shelf-top { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.note { margin: 0; font-size: clamp(20px, 2.4vw, 28px); color: var(--mustard); transform: rotate(-1.5deg); }
.sound { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 6px 12px; font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.sound[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }

/* the shelf: tape cases stacked spine-out on a wooden plank */
.shelves { display: grid; gap: 40px; }
.shelf h3 { margin: 0 0 12px; font: 800 22px/1 var(--display); }
.shelf h3 small { font: 700 11px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-left: 8px; }
.stack { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 3px; }
.spine {
  width: calc(100% - 14px); display: grid; grid-template-columns: 52px minmax(0, auto) minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  height: 52px; padding: 0 16px 0 0; border: 0; border-radius: 3px; text-align: left; color: #1d1a17;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, .06) 70%, rgba(0, 0, 0, .18)), var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 0 #0004, 0 6px 14px #0006;
  transform: translateX(var(--nudge, 0)) rotate(var(--tilt, 0deg));
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), box-shadow .25s;
  font: 13px/1.2 var(--mono); cursor: pointer;
}
.spine:hover, .spine:focus-visible { transform: translateX(calc(var(--nudge, 0px) + 16px)) rotate(0deg); box-shadow: 0 2px 0 #0004, 0 14px 26px #0008; outline: none; }
.spine:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 14px 26px #0008; }
.sp-no { align-self: stretch; display: grid; place-items: center; background: var(--c, var(--accent)); color: var(--ink, #111); border-radius: 3px 0 0 3px; font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.sp-brand { font-size: 22px; line-height: 1; color: #1d1d6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-title { color: #5a5249; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-cert { font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--mustard); color: #1d1a17; border-radius: 99px; padding: 2px 7px; }
.sp-len { color: #8a8073; font-variant-numeric: tabular-nums; }
.plank { height: 16px; margin-top: 6px; border-radius: 2px; background: linear-gradient(180deg, #8a5a36, #6b4329 60%, #4a2d1b); box-shadow: 0 10px 20px #0008; }
.blank { color: var(--muted); }
@media (max-width: 560px) {
  .spine { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; height: 56px; }
  .sp-title, .sp-cert { display: none; }
}

/* liner notes, on paper */
.liner { background: var(--paper); color: #1d1a17; border-radius: 4px; padding: 22px; transform: rotate(.8deg); box-shadow: 0 20px 50px #0008; }
.liner h3 { margin: 0 0 10px; font-size: 26px; color: #1d1d6b; }
.liner p { margin: 0 0 10px; font: 14px/1.55 var(--mono); }
.liner .credits { display: grid; gap: 2px; font-weight: 700; }
@media (max-width: 860px) { .liner { transform: none; } }

/* the cassette (also used on the shelf animation and in the deck) */
.cassette { display: block; width: 100%; height: auto; }
.cassette .screw circle { fill: #8f8a83; } .cassette .screw path { stroke: #3a3632; stroke-width: 2.5; }
.cassette .label { fill: var(--paper, #f3ead8); }
.cassette .side { font: 800 52px/1 var(--display); }
.cassette .kind { font: 700 30px/1 var(--mono); letter-spacing: .1em; }
.cassette .hand { fill: #1d1d6b; font-family: "Permanent Marker", var(--display); }
.cassette .brand { font-size: 66px; }
.cassette .title { font-size: 34px; }
.cassette .rule { stroke: #cfc5b2; stroke-width: 2; }
.cassette .pack { fill: #3f2c20; }
.hub { animation: reel 1.6s linear infinite paused; }
@keyframes reel { to { transform: rotate(-360deg); } }

/* the case in the loading animation: clear lid over the J-card, tray with the tape */
.stage { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; }
.case { width: min(520px, 84vw); aspect-ratio: 110 / 70; position: relative; perspective: 1800px; transform-style: preserve-3d; }
.case-tray { position: absolute; inset: 0; padding: 5% 4%; background: linear-gradient(180deg, #2a2724, #151311); border-radius: 6px; box-shadow: inset 0 0 0 2px #ffffff14, 0 30px 60px #000a; }
.case-lid { position: absolute; inset: 0; transform-origin: left center; transition: transform .45s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.case.open .case-lid { transform: rotateY(-155deg); }
.jcard-front { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; background: var(--c, var(--accent)); backface-visibility: hidden; box-shadow: inset 0 0 0 2px #ffffff30; }
.jcard-front img { width: 100%; height: 100%; object-fit: cover; }
/* the inside of the J-card, seen when the lid is open */
.jcard-inside {
  position: absolute; inset: 0; border-radius: 6px; transform: rotateY(180deg); backface-visibility: hidden;
  background: repeating-linear-gradient(180deg, transparent 0 27px, #d9cfbb 27px 28px), var(--paper); color: #1d1a17;
  padding: 7% 8%; display: grid; align-content: start; gap: 4px; font: 12px/1.4 var(--mono);
  box-shadow: inset 0 0 0 2px #ffffff30, inset -10px 0 18px -10px #0005;
}
.jcard-inside b { font-size: 28px; color: #1d1d6b; }
.jcard-inside i { display: block; height: 1.1em; }
/* the clear plastic: a rim round the tray and a sheen on the lid */
.case::before { content: ""; position: absolute; inset: -6px; border-radius: 10px; border: 2px solid #ffffff2e; background: #ffffff08; pointer-events: none; }
.jcard-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, #ffffff40 0%, #ffffff00 35%, #ffffff10 60%, #ffffff00 80%); }
.jf-band { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; background: var(--paper); color: #1d1a17; font: 13px/1.2 var(--mono); }
.jf-band b { font-size: 24px; color: #1d1d6b; }

/* the deck at the top of a project page in fun mode */
body.fun .viewer { background: radial-gradient(900px 400px at 20% -10%, #3a2a1f 0%, transparent 60%), var(--bg); }
.mini-deck { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mini-deck .bay {
  flex: none; width: clamp(120px, 16vw, 190px); padding: 8px 10px; border-radius: 10px;
  background: linear-gradient(180deg, #d9d6cf, #a8a49c 60%, #8c887f); box-shadow: inset 0 1px 0 #fff9, 0 8px 20px #0008;
}
.mini-deck .bay svg { display: block; border-radius: 4px; box-shadow: 0 0 0 4px #0d0d0d; background: #0d0d0d; }
body.fun .viewer .hub { animation-play-state: running; }
.viewer.loading .mini-deck .bay svg, .viewer.loading .viewer-body { opacity: 0; }
.viewer .viewer-body { transition: opacity .35s; }
.mini-deck .np { display: grid; min-width: 0; }
.mini-deck .np small { font: 700 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.mini-deck .np b { font: 800 clamp(20px, 2.6vw, 30px)/1.05 var(--display); }
.mini-deck .np > span { color: var(--muted); font: 14px/1.3 var(--mono); }
@media (max-width: 560px) {
  body.fun .viewer-bar { flex-wrap: wrap; }
  .mini-deck .bay { width: 110px; padding: 6px; }
}
body.fun .crit-line { padding-top: 40px; }
