/* ludovicocordara.com: a library with five rooms, and the shelves of a life.
   The footage is the one loud thing. Everything else is quiet: one serif, one gilt
   accent, no boxes, left-aligned, generous space. */

:root {
  --bg:     #0d0b09;   /* walnut black */
  --ink:    #ece4d4;   /* parchment */
  --dim:    #b9af9c;
  --stone:  #8f8778;
  --faint:  #625a4d;
  --gilt:   #cfae72;
  --rule:   rgba(236, 228, 212, 0.14);
  --serif:  'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --sans:   'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease:   cubic-bezier(.22, 1, .36, 1);
  --pad:    clamp(22px, 6vw, 96px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 18px/1.55 var(--serif); letter-spacing: -0.004em;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip; min-height: 100dvh;
}
/* a still, faint warmth behind everything; fixed, so it never repaints on scroll */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 700px at 80% 30%, rgba(60, 48, 32, 0.16), transparent 70%),
    radial-gradient(700px 600px at 10% 90%, rgba(28, 34, 52, 0.10), transparent 70%);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(207, 174, 114, .32); color: inherit; }
/* on paper, a pencil-warm highlight that keeps the ink readable */
.b3d ::selection { background: rgba(176, 132, 62, .28); color: #1d140b; }
:focus-visible { outline: 1px solid rgba(236, 228, 212, .7); outline-offset: 4px; border-radius: 2px; }

/* the page never scrolls: the camera moves, shelves scroll inside themselves */
html, body { overflow: hidden; overscroll-behavior: none; }


[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* corners */
.mark { position: fixed; top: 22px; left: 24px; z-index: 30; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(236, 228, 212, 0.3); font: 500 14px/1 var(--serif); letter-spacing: .04em; transition: border-color .4s ease; }
.mark:hover { border-color: rgba(236, 228, 212, 0.8); }
.corner { position: fixed; top: 30px; right: 26px; z-index: 30; display: flex; gap: 24px; align-items: baseline; font: 400 13px/1 var(--sans); }
.corner a, .corner button { color: rgba(240, 233, 220, .9); transition: color .3s ease;
  text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 1px 3px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .85); }

.corner a:hover, .corner button:hover, .corner button[aria-pressed="true"] { color: #fff; }
.corner .mail { font: italic 400 16px/1 var(--serif); }

/* the doors: the first thing you see. the click plays a filmed entrance: the doors swing open and the
   camera walks into the round hall, ending on the hall's still, where it hands over */
.doors { position: fixed; inset: 0; z-index: 60; overflow: hidden; transition: opacity .45s ease; }
.doors[hidden] { display: none; }
.frame, .entrance { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.entrance { opacity: 0; }
.doors.rolling .entrance { opacity: 1; }
.doors.done { opacity: 0; pointer-events: none; }
.enter { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; justify-items: center; gap: 12px; padding: 30px 46px; cursor: pointer;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .8); transition: opacity .6s ease; }
.enter-name { white-space: nowrap; font: 400 clamp(20px, 2.2vw, 30px)/1 var(--serif); letter-spacing: .06em; color: var(--ink); animation: up 1.8s var(--ease) .4s both; }
/* focused on load so Enter opens the doors; the cue already says what to do, so no ring */
.enter:focus-visible { outline: none; }
/* the titles, kept to a whisper under the name */
.enter-roles { white-space: nowrap; font: 400 10px/1 var(--sans); letter-spacing: .14em; color: rgba(236, 228, 212, .42); margin-top: -4px; animation: up 1.8s var(--ease) .65s both; }
.enter-cue { font: italic 400 15px/1 var(--serif); color: rgba(236, 228, 212, .6); animation: up 1.8s var(--ease) .9s both, glow 3s ease-in-out 2.6s infinite; }
@keyframes glow { 50% { color: rgba(236, 228, 212, .95); } }
.doors.opening .enter { opacity: 0; pointer-events: none; }
.skip { position: absolute; right: var(--pad); bottom: clamp(36px, 7vh, 72px); padding: 10px 0; font: italic 400 15px/1 var(--serif);
  color: rgba(236, 228, 212, .5); text-shadow: 0 1px 10px rgba(0, 0, 0, .8); transition: color .3s ease, opacity .4s ease; }
.skip:hover, .skip:focus-visible { color: var(--ink); }
.doors.done .skip { opacity: 0; }
html:not(.entered) .lib .door, html:not(.entered) .lib .targets { visibility: hidden; }
/* film finish: a fine moving grain over the doors and the hall, so both read as one camera */
.grain { position: absolute; inset: -64px; pointer-events: none; background: url('../assets/glide/grain.webp') 0 0 / 256px 256px;
  opacity: .1; mix-blend-mode: overlay; animation: grain .8s steps(1) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 17% { transform: translate(-31px, 18px); } 33% { transform: translate(22px, -27px); }
  50% { transform: translate(-14px, -38px); } 67% { transform: translate(35px, 12px); } 83% { transform: translate(-25px, 30px); } }

/* the library: one still per room, covering the screen; names ride on it in its own coordinates */
.lib { position: fixed; inset: 0; overflow: hidden; background: var(--bg); touch-action: none; }
.scene { position: absolute; inset: 0; }
.scene[hidden] { display: none; }
.stage { position: absolute; transform-origin: 0 0; }
.still { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.walk { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.lib.filming .walk { opacity: 1; }
.shade { position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    /* the ceilings are bright; a soft dark band at the top keeps the corner words and the way back readable */
    linear-gradient(rgba(10, 7, 4, .6), rgba(10, 7, 4, .26) 70px, transparent 130px),
    radial-gradient(150% 110% at 50% 45%, transparent 55%, rgba(13, 11, 9, 0.55)),
    linear-gradient(to top, rgba(13, 11, 9, 0.62), transparent 30%); }
/* a dissolve through dark, for leaving a room */
.lib::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .42s ease; z-index: 5; }
.lib.blink::after { opacity: 1; }
.lib:not(.home) .intro { opacity: 0; visibility: hidden; }
.lib.filming .intro, .lib.moving .door, .lib.filming .door { opacity: 0; pointer-events: none; }

/* the doorways: the names are carved into the hub picture; the button is the arch and its cartouche */
.door { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: calc(var(--w) * 100%); height: calc(var(--h) * 100%);
  padding: 0; transition: opacity .4s ease; }
/* the doorway itself glows a little under the pointer, so it reads as a way through */
.door::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 78%; border-radius: 48% 48% 0 0 / 22% 22% 0 0;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 210, 150, .16), transparent 70%); opacity: 0; transition: opacity .5s ease; }
.door:hover::after, .door:focus-visible::after { opacity: 1; }
.door:focus-visible { outline: none; }

/* bookcases: the name written in the empty shelf at eye level */
.case, .frame-b { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: calc(var(--w) * 100%); height: calc(var(--h) * 100%); padding: 0;
  transition: opacity .45s ease; }
.case span { position: absolute; left: 4%; right: 4%; top: calc(var(--ly) * 100%); translate: 0 -50%; text-align: center;
  font: italic 400 calc(var(--u) * 1.18)/1.1 var(--serif); letter-spacing: .01em; color: #f1dfb8;
  text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 1px 3px rgba(0, 0, 0, .9), 0 0 calc(var(--u) * 1.2) rgba(255, 200, 130, .35); transition: color .3s ease, text-shadow .3s ease; }
.case::after { content: ""; position: absolute; left: 30%; right: 30%; top: calc(var(--ly) * 100% + var(--u) * 1); height: 1px; background: rgba(241, 223, 184, .45);
  transform: scaleX(.4); transition: transform .5s var(--ease), opacity .4s ease; }
.case:hover span, .case:focus-visible span { color: #fff6e2; text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 calc(var(--u) * 2) rgba(255, 206, 140, .8); }
.case:hover::after, .case:focus-visible::after { transform: scaleX(1); }
.case:focus-visible, .frame-b:focus-visible { outline: none; }
/* portraits: the name small on the wall under each frame */
.frame-b span { position: absolute; left: -20%; right: -20%; top: 100%; margin-top: calc(var(--u) * .35); text-align: center;
  font: italic 400 calc(var(--u) * .78)/1.15 var(--serif); color: rgba(241, 223, 184, .82); text-shadow: 0 0 2px #000, 0 1px 4px #000; transition: color .3s ease; }
.frame-b::before { content: ""; position: absolute; inset: 10%; box-shadow: 0 0 calc(var(--u) * 2.2) rgba(255, 210, 150, 0); transition: box-shadow .5s ease; }
.frame-b:hover::before, .frame-b:focus-visible::before { box-shadow: 0 0 calc(var(--u) * 2.2) rgba(255, 210, 150, .35); }
.frame-b:hover span, .frame-b:focus-visible span { color: #fff6e2; }
.lib.zoomed .case, .lib.zoomed .frame-b, .lib.zoomed .targets { opacity: 0; pointer-events: none; }

/* the way back: always in the same place, top centre */
.back { position: absolute; top: 26px; left: 50%; translate: -50% 0; z-index: 8; padding: 6px 4px; font: italic 400 19px/1 var(--serif); color: var(--ink);
  text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 1px 14px rgba(0, 0, 0, .95); border-bottom: 1px solid rgba(236, 228, 212, .45); transition: color .3s ease, border-color .3s ease; }
.back:hover, .back:focus-visible { color: #fff; border-color: rgba(236, 228, 212, .9); }
.lib.filming .back { opacity: 0; pointer-events: none; }

/* a row of names at the bottom, for screens where the still is wider than the view */
.targets { display: none; }

/* in on a shelf: a sharper close-up of it fades over the still, and its volumes stand on it */
.near { position: absolute; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.near.on { opacity: 1; }
.shelf { position: absolute; display: flex; align-items: flex-end; justify-content: center; gap: 0.8%; padding: 0;
  opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.shelf.on { opacity: 1; pointer-events: auto; }
.shelf-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.shelf-layer .shelf { pointer-events: auto; }
.book { position: relative; flex: none; width: var(--bw); height: var(--bh); padding: 0; container-type: size;
  background: var(--tex) 50% 50% / cover; border-radius: 3% 3% 1% 1% / 1% 1% 0.5% 0.5%;
  box-shadow: 1.5cqw 0 2.5cqw rgba(0, 0, 0, .55), -0.8cqw 0 1.6cqw rgba(0, 0, 0, .4); transform-origin: 50% 100%;
  transition: transform .45s var(--ease), filter .3s ease; }
/* the spine's roundness: darker at both edges, a soft highlight on the curve */
.book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 236, 200, .1) 34%, rgba(255, 236, 200, .04) 60%, rgba(0, 0, 0, .5)); }
.book-label { position: absolute; left: 8%; right: 8%; top: 14%; display: flex; align-items: center; justify-content: center;
  padding: 9% 6%; background: rgba(16, 9, 4, .86);
  border-top: 0.9cqw solid rgba(222, 186, 116, .7); border-bottom: 0.9cqw solid rgba(222, 186, 116, .7);
  box-shadow: 0 -2.6cqw 0 -1.8cqw rgba(222, 186, 116, .4), 0 2.6cqw 0 -1.8cqw rgba(222, 186, 116, .4), inset 0 0.8cqw 4cqw rgba(0, 0, 0, .6); }
/* the leather's grain runs through the label and the gilt alike, so the title looks stamped in */
.book-label::after { content: ""; position: absolute; inset: 0; background: url(/assets/book/grain.webp) 0 0 / 40cqw 40cqw; mix-blend-mode: multiply; opacity: .55; pointer-events: none; }
.book-t { position: relative; display: block; text-align: center; text-wrap: balance; hyphens: none; overflow-wrap: normal; white-space: normal;
  font: 600 min(15cqw, calc(94cqw / var(--lw))) / 1.15 var(--serif); letter-spacing: .05em; text-transform: uppercase;
  color: #e4c27c; text-shadow: 0 -0.05em 0 rgba(0, 0, 0, .85), 0 0.04em 0 rgba(255, 226, 160, .16), 0 0 0.4em rgba(240, 200, 120, .14); }
.book[data-leather="vellum"] .book-label { background: linear-gradient(180deg, rgba(92, 28, 22, .9), rgba(70, 20, 16, .88)); }
/* a few gilt bands lower down the spine, like the old volumes around them */
.book::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 14%; height: 6%; pointer-events: none;
  border-top: 0.8cqw solid rgba(214, 178, 110, .45); border-bottom: 0.8cqw solid rgba(214, 178, 110, .45); }
.shelf { perspective: 220cqh; }
/* pointing at a volume tips its top out toward you, like a finger hooking it off the shelf */
button.book:hover, button.book:focus-visible { transform: rotateX(-7deg) translateY(-1.2%); outline: none;
  box-shadow: 1.5cqw 0 2.5cqw rgba(0, 0, 0, .55), -0.8cqw 0 1.6cqw rgba(0, 0, 0, .4), 0 -6cqw 9cqw -4cqw rgba(0, 0, 0, .7); }
.book.taken { visibility: hidden; }
/* light catching the tipped volume, drawn as an overlay so the title stays sharp */
button.book .book-label::before { content: ""; position: absolute; inset: -60% -30%; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(closest-side, rgba(255, 230, 180, .16), transparent); }
button.book:hover .book-label::before, button.book:focus-visible .book-label::before { opacity: 1; }
/* the plain volumes that fill a shelf out: no title, a little darker, not clickable */
.book.filler { cursor: default; filter: brightness(.72) saturate(.85); transform: rotate(var(--tilt, 0deg)); }
.book.filler::before { bottom: auto; top: 18%; height: 4%; }
/* your volumes catch a little more light than the old ones around them */
button.book { transition: transform .5s cubic-bezier(.3, 1.3, .5, 1), box-shadow .5s ease; box-shadow: 1.5cqw 0 2.5cqw rgba(0, 0, 0, .55), -0.8cqw 0 1.6cqw rgba(0, 0, 0, .4); }

/* the reader: the room dims and the book comes forward */
.reader { position: fixed; inset: 0; z-index: 50; perspective: 2200px; }
.reader[hidden] { display: none; }
.reader-shade { position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 50%, rgba(10, 8, 6, .62), rgba(6, 5, 4, .9)); opacity: 0; transition: opacity .7s ease; }
.reader.in .reader-shade { opacity: 1; }
.reader-close { position: absolute; top: 28px; right: 30px; z-index: 2; font: italic 400 17px/1 var(--serif); color: rgba(236, 228, 212, .85);
  text-shadow: 0 0 2px #000; opacity: 0; transition: opacity .5s ease .4s, color .3s ease; }
.reader.in .reader-close { opacity: 1; }
/* the corner links sit where Close does; they step aside while a book is open */
.corner { transition: opacity .5s ease; }
body:has(.reader.in) .corner { opacity: 0; pointer-events: none; }
.reader-close:hover, .reader-close:focus-visible { color: #fff; }
.b3d { position: fixed; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transform-origin: 50% 50%; }
.b-face, .b-page, .b-cover { position: absolute; top: 0; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.b-back { left: 0; width: 100%; transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
  background: var(--tint) url(/assets/book/cover.webp) 50% 50% / cover; background-blend-mode: multiply; }
.b-spine { left: calc(50% - var(--d) / 2); width: var(--d); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: var(--tex) 50% 50% / cover; }
.b-spine .book { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: none; transition: none; }
.b-edge { left: calc(50% - var(--d) / 2); width: var(--d); transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
  background: repeating-linear-gradient(90deg, #efe4c8 0 2px, #d8cba8 2px 3px); box-shadow: inset 0 0 12px rgba(80, 60, 30, .45); }
.b-right { left: 0; width: 100%; transform: translateZ(calc(var(--d) / 2 - 1px)); background: url(/assets/book/page.webp) 50% 50% / cover;
  box-shadow: inset 14px 0 22px -12px rgba(60, 40, 20, .55); color: #2a2017; overflow: hidden; }
.b-cover { left: 0; width: 100%; transform-style: preserve-3d; transform-origin: 0 50%; transform: translateZ(calc(var(--d) / 2)); -webkit-backface-visibility: visible; backface-visibility: visible; }
.b-cover-front, .b-cover-inside { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; transform-style: flat; }
.b-cover-front { background: var(--tint) url(/assets/book/cover.webp) 50% 50% / cover; background-blend-mode: multiply; display: grid; place-items: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .45); }
.b-cover-front span { max-width: 70%; text-align: center; font: 500 clamp(20px, calc(var(--w) * 0.07), 40px)/1.15 var(--serif); letter-spacing: .06em; color: #e9cf96;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 0 1px rgba(255, 230, 170, .5); }
.b-cover-inside { transform: rotateY(180deg); background: url(/assets/book/page.webp) 50% 50% / cover; box-shadow: inset -14px 0 22px -12px rgba(60, 40, 20, .55);
  display: grid; place-items: center; }
.b-pic { width: 76%; display: grid; place-items: center; gap: 1.4em; }
.b-pic .nums { display: grid; gap: 1.6em; justify-items: center; text-align: center; }
.b-pic .nums b { display: block; font: 400 clamp(40px, calc(var(--w) * 0.13), 72px)/1 var(--serif); color: #22180f; font-variant-numeric: lining-nums; }
.b-pic .nums span { display: block; margin-top: 8px; max-width: 24ch; font: italic 400 clamp(14px, calc(var(--w) * 0.03), 17px)/1.4 var(--serif); color: #6b5640; }
.b-pic img { max-width: 100%; max-height: calc(var(--w) * 1.05); object-fit: contain; box-shadow: 0 6px 18px rgba(40, 25, 10, .35); }
.b-plate { font: italic 400 clamp(26px, calc(var(--w) * 0.09), 52px)/1.1 var(--serif); color: #3b2a1a; text-align: center; }
.b-words { position: absolute; inset: 9% 11% 9% 13%; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; justify-content: center; }
.b-words::-webkit-scrollbar { display: none; }
.b-kind { font: italic 400 clamp(14px, calc(var(--w) * 0.03), 18px)/1.2 var(--serif); color: #7a6448; }
.b-title { margin-top: .5em; font: 500 clamp(26px, calc(var(--w) * 0.075), 44px)/1.08 var(--serif); letter-spacing: -0.01em; color: #22180f; }
.b-meta { margin-top: .5em; font: italic 400 clamp(15px, calc(var(--w) * 0.033), 19px)/1.3 var(--serif); color: #6b5640; }
.b-more { margin-top: .9em; font: italic 400 clamp(15px, calc(var(--w) * 0.032), 19px)/1.5 var(--serif); color: #5d4a36; }
.b-line { margin-top: 1.1em; font: 400 clamp(16px, calc(var(--w) * 0.036), 21px)/1.55 var(--serif); color: #2f241a; }
.b-go { align-self: flex-start; margin-top: 1.2em; font: italic 400 clamp(15px, calc(var(--w) * 0.033), 19px)/1 var(--serif); color: #6e4b1c; border-bottom: 1px solid rgba(110, 75, 28, .5); padding-bottom: 3px; }
.b-words .role-b { margin-top: 1em; }
.b-words .role-b li { font: 400 clamp(16px, calc(var(--w) * 0.035), 20px)/1.5 var(--serif); color: #2f241a; }
.b-words .role-b li + li { margin-top: .6em; }
.b-words .role-b a, .b-words .role-link { color: #6e4b1c; border-bottom: 1px solid rgba(110, 75, 28, .5); }
.b-words .role-link { align-self: flex-start; margin-top: 1.2em; font: italic 400 17px/1 var(--serif); padding-bottom: 3px; }
.b-words .nums { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-top: 1.3em; }
.b-words .nums b { display: block; font: 400 clamp(26px, calc(var(--w) * 0.07), 40px)/1 var(--serif); color: #22180f; font-variant-numeric: lining-nums; }
.b-words .nums span { display: block; margin-top: 6px; max-width: 20ch; font: 400 12px/1.4 var(--sans); color: #6b5640; }
.b-pic-top { display: block; max-width: 60%; max-height: 26%; margin: 7% auto 0; object-fit: contain; box-shadow: 0 6px 18px rgba(40, 25, 10, .35); }
.b-pic-top + .b-words { top: 36%; }

/* a portrait: the dots assemble in the frame itself; the words sit beside it */
.view { position: absolute; inset: 0; z-index: 6; }
.view[hidden] { display: none; }
.hero-t h2 { font: italic 400 clamp(34px, 3.6vw, 54px)/1.05 var(--serif); letter-spacing: -0.015em; text-shadow: 0 2px 24px rgba(0, 0, 0, .7); }
@keyframes come { from { opacity: 0; transform: translateY(16px); } }
.hero-view { background: linear-gradient(to right, rgba(10, 8, 6, .1) 36%, rgba(10, 8, 6, .9) 56%), radial-gradient(90% 90% at 34% 50%, transparent, rgba(10, 8, 6, .6)); justify-content: center; }
.hero-c { position: fixed; display: block; background: #0f0c09; }
.hero-t { position: fixed; left: calc(var(--fx) + clamp(36px, 5vw, 80px)); right: var(--pad); top: 50%; translate: 0 -50%; max-width: 520px; }
.hero-more { font-style: italic; color: #b9ab93 !important; font-size: clamp(16px, 1.2vw, 18px) !important; }
.hero-t p { margin-top: 18px; font: 400 clamp(18px, 1.4vw, 21px)/1.55 var(--serif); color: #ddd3c1; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.view.in .hero-t { animation: come .8s var(--ease) .25s both; }

.sheet-img[hidden] { display: none; }

/* opening words: the one orchestrated moment */
.intro { position: absolute; left: var(--pad); bottom: clamp(64px, 13vh, 130px); max-width: 900px; pointer-events: none; text-shadow: 0 2px 30px rgba(0, 0, 0, .5); }
.intro h1 { font: 400 clamp(34px, 3.4vw, 52px)/1 var(--serif); letter-spacing: -0.01em; }
.intro-role { margin-top: 16px; max-width: 62ch; font: 400 clamp(15px, 1.15vw, 18px)/1.5 var(--serif); color: #e2d8c6; }
.intro-role li + li { margin-top: 2px; }
/* one quiet line of proof, in the small sans used for facts elsewhere */
.intro-proof { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 18px; font: 400 13px/1.4 var(--sans); letter-spacing: .02em; color: rgba(236, 228, 212, .72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
.intro-role li { text-shadow: 0 0 2px rgba(0, 0, 0, .9), 0 1px 12px rgba(0, 0, 0, .85); }
.intro h1, .intro-role, .intro-proof { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform 1.2s var(--ease); }
.lib.home .intro h1, .lib.home .intro-role, .lib.home .intro-proof { opacity: 1; transform: none; transition-duration: 1.4s, 1.6s; }
.lib.home .intro-proof { transition-delay: .35s; }
.lib.home .intro-role { transition-delay: .15s; }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }
/* the side sheet */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet[hidden] { display: none; }
.sheet-shade { position: absolute; inset: 0; background: rgba(8, 7, 5, .55); opacity: 0; transition: opacity .45s ease; }
.sheet-card { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); overflow-y: auto; padding: 84px 48px 48px; background: #14110d;
  box-shadow: -30px 0 60px rgba(0, 0, 0, .5); transform: translateX(104%); transition: transform .5s var(--ease); }
.sheet.in .sheet-shade { opacity: 1; }
.sheet.in .sheet-card { transform: none; }
.sheet-img { display: flex; justify-content: center; background: #0f0d0a; padding: 22px; box-shadow: inset 0 0 0 1px rgba(207, 174, 114, .22); }
.sheet-img img { max-width: 100%; max-height: 52vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.sheet-text { margin-top: 30px; }
.sheet-kind { font: italic 400 16px/1 var(--serif); color: var(--stone); }
.sheet-title { margin-top: 12px; font: 400 36px/1.1 var(--serif); letter-spacing: -0.01em; }
.sheet-meta { margin-top: 8px; font: 400 13px/1.4 var(--sans); color: var(--faint); }
.sheet-line { margin-top: 18px; font: 400 19px/1.55 var(--serif); color: var(--dim); white-space: pre-line; }
.sheet-go { display: inline-block; margin-top: 22px; font: italic 400 18px/1 var(--serif); color: var(--gilt); border-bottom: 1px solid rgba(207, 174, 114, .5); padding-bottom: 3px; }
.sheet-close { position: absolute; top: 30px; right: 34px; font: italic 400 16px/1 var(--serif); color: var(--stone); }
.sheet-close:hover { color: var(--ink); }



.jdo { position: fixed; right: 18px; bottom: 14px; z-index: 6; padding: 6px; font: 600 12px/1 var(--sans); letter-spacing: .3em; color: transparent; user-select: none; cursor: default; transition: color .5s ease; }
.jdo:hover, .jdo:focus { color: #fff; outline: none; }
.nerazzurri .case span, .nerazzurri .book-t { color: #7fa6ff; }

@media (prefers-reduced-motion: reduce) {
  .doors { transition: none; }
  .intro h1, .intro-role, .intro-proof, .grain { animation: none; }
  .sheet-card, .sheet-shade, .lib::after { transition: none; }
  .view.in .hero-t { animation: none; }
}
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  /* on a tall screen the still is wider than the view: drag it sideways, or pick from the row below */
  .targets { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 7; display: flex; gap: 6px 18px; overflow-x: auto;
    padding: 10px 18px; scrollbar-width: none; justify-content: safe center; }
  .targets[hidden] { display: none; }
  .targets::-webkit-scrollbar { display: none; }
  .targets button { flex: none; font: italic 400 16px/1 var(--serif); color: rgba(236, 228, 212, .88); white-space: nowrap; padding: 6px 0;
    text-shadow: 0 0 2px #000, 0 1px 8px rgba(0, 0, 0, .95); }
  .lib.home .intro { bottom: 76px; }
  .lib.filming .targets { opacity: 0; pointer-events: none; }
  .hero-view { background: rgba(10, 8, 6, .5); }
  .hero-t { left: var(--pad); right: var(--pad); top: calc(var(--fy) + 26px); translate: none; }
  .hero-t h2 { font-size: 30px; }
}
@media (max-width: 760px) {
  .corner { top: 28px; right: 18px; gap: 16px; }
  .corner .mail { display: none; }
  .corner a, .corner button { color: rgba(236, 228, 212, .9); text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 1px 3px rgba(0, 0, 0, .9), 0 0 16px rgba(0, 0, 0, .8); }
  .mark { left: 16px; top: 20px; text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .8); border-color: rgba(236, 228, 212, .5); }
  .shade { background:
    linear-gradient(to bottom, rgba(13, 11, 9, 0.6), rgba(13, 11, 9, 0.25) 9%, transparent 16%),
    radial-gradient(150% 110% at 50% 45%, transparent 52%, rgba(13, 11, 9, 0.62)),
    linear-gradient(to top, rgba(13, 11, 9, 0.92), rgba(13, 11, 9, 0.6) 30%, transparent 58%); }
  .back { top: 28px; left: 64px; translate: none; font-size: 15px; }
  .intro h1 { font-size: 32px; }
  .intro-role { font-size: 14.5px; line-height: 1.45; }
  .enter { top: 30%; }
  .enter-roles { white-space: normal; width: 74vw; text-align: center; line-height: 1.7; font-size: 9px; }
  .sheet-card { padding: 72px 24px 36px; }
}
@media (max-width: 359px) {
  .corner { gap: 11px; }
  .back { left: 58px; font-size: 14px; }
}

/* living light: a slow, uneven breath of warm lamplight over each room */
.flicker { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(70% 60% at 50% 55%, rgba(255, 196, 120, .5), transparent 75%); opacity: .0; animation: flicker 7.3s steps(60) infinite; }
@keyframes flicker { 0% { opacity: .10; } 13% { opacity: .16; } 17% { opacity: .08; } 31% { opacity: .14; } 44% { opacity: .11; } 46% { opacity: .19; }
  58% { opacity: .12; } 71% { opacity: .15; } 79% { opacity: .07; } 88% { opacity: .13; } 100% { opacity: .10; } }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.lib.zoomed .dust { opacity: .5; }

/* hidden things */
.egg { position: absolute; padding: 0; border-radius: 40%; }
.egg:focus-visible { outline: 1px dashed rgba(236, 228, 212, .5); }
.lib.zoomed .egg { pointer-events: none; }
.lamp-off { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.1s ease;
  background: radial-gradient(circle at var(--lx) var(--ly), rgba(255, 210, 140, .12) 0, rgba(8, 5, 2, .35) 6%, rgba(6, 4, 2, .86) 26%, rgba(4, 3, 2, .94) 60%); }
[data-scene="work"].lamp .lamp-off { opacity: 1; }
.egg[data-egg="globe"].spin { animation: globe 1.4s cubic-bezier(.2, .7, .3, 1); border-radius: 50%; }
@keyframes globe { 0% { box-shadow: inset 0 0 0 0 rgba(255, 220, 160, 0); } 30% { box-shadow: inset 0 0 40px 4px rgba(255, 220, 160, .35); } 100% { box-shadow: inset 0 0 0 0 rgba(255, 220, 160, 0); } }
.egg-books { position: absolute; left: -9999px; top: 0; width: 60px; height: 200px; }
.egg-books .book { width: 30px; height: 200px; }
/* type "sparta": the hall darkens and the words come up in the stone over the doors */
.molon { position: absolute; left: 0; right: 0; top: 23.5%; text-align: center; pointer-events: none; opacity: 0;
  font: 600 calc(var(--u) * 2.2)/1 var(--serif); letter-spacing: .3em; color: #ffd98f;
  text-shadow: 0 0 calc(var(--u) * .4) rgba(255, 200, 110, .9), 0 0 calc(var(--u) * 2) rgba(255, 170, 70, .6); transition: opacity 1.4s ease; }
.lib.sparta .molon { opacity: 1; }
.lib.sparta [data-scene="hub"] .still { filter: brightness(.45) sepia(.25); transition: filter 1.4s ease; }
[data-scene="hub"] .still { transition: filter 1.4s ease; }
@media (prefers-reduced-motion: reduce) { .flicker { animation: none; opacity: .12; } .dust { display: none; } }
