/* ==========================================================================
   Home — «La sala»: a room of paintings that turns with the scroll
   ========================================================================== */
@font-face { font-family: "Creato Display"; src: url("/assets/fonts/CreatoDisplay-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("/assets/fonts/CreatoDisplay-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("/assets/fonts/CreatoDisplay-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Taviraj"; src: url("/assets/fonts/Taviraj-200-italic.woff2") format("woff2"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "Taviraj"; src: url("/assets/fonts/Taviraj-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  --bg: #0d0d0c; --ink: #ece7de; --ink-2: rgba(236, 231, 222, .62); --line: rgba(236, 231, 222, .16);
  --sans: "Creato Display", "Helvetica Neue", Arial, sans-serif; --serif: "Taviraj", Georgia, serif;
  --g: clamp(16px, 3.4vw, 48px);
  --cw: clamp(180px, 19vw, 300px);   /* painting base width */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.it { font-family: var(--serif); font-style: italic; font-weight: 200; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.skip { position: absolute; left: var(--g); top: -100px; z-index: 200; background: var(--ink); color: var(--bg); padding: 8px 14px; }
.skip:focus { top: 12px; }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.pill--solid { background: var(--ink); color: var(--bg); }

/* ---------- scene ---------- */
.track { height: 900vh; }
.scene { position: fixed; inset: 0; overflow: hidden; }
.ambient { position: absolute; inset: -20%; }
.ambient img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.2); transition: opacity 1.2s ease; will-change: opacity; }
.ambient img.on { opacity: .5; }
.ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 0%, rgba(13,13,12,.55) 60%, var(--bg) 100%); }

/* ---------- header ---------- */
.top { position: fixed; z-index: 30; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; padding: 20px var(--g); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.sig { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 8px; background: rgba(13,13,12,.85); font-weight: 500; letter-spacing: .08em; box-shadow: 0 0 0 1px var(--line); }
.navp { display: flex; gap: 6px; }
.navp a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(13,13,12,.8); box-shadow: 0 0 0 1px var(--line); transition: background .3s, color .3s; }
.navp a:hover, .navp a:focus-visible { background: var(--ink); color: var(--bg); }
.navp sup { font-size: 9px; margin-left: 3px; opacity: .7; }
.menu-btn { display: none; height: 30px; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.hint { position: absolute; left: 50%; top: 20px; height: 30px; line-height: 30px; transform: translateX(-50%); z-index: 31; margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(236,231,222,.9); white-space: nowrap; text-shadow: 0 1px 12px rgba(0,0,0,.6); pointer-events: none; }
.hint .it { font-size: 14px; text-transform: none; letter-spacing: 0; }
@media (max-width: 960px) { .hint .long { display: none; } }

/* mobile menu */
.mmenu { position: fixed; inset: 0; z-index: 25; background: var(--bg); display: grid; place-items: center; text-align: center; clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .6s cubic-bezier(.7,0,.2,1), visibility 0s .6s; }
.menu-open .mmenu { clip-path: inset(0); visibility: visible; transition: clip-path .6s cubic-bezier(.7,0,.2,1), visibility 0s; }
.mmenu ul { list-style: none; margin: 0; padding: 0; }
.mmenu a { display: block; padding: 8px 0; font-size: 44px; line-height: 1; text-transform: uppercase; letter-spacing: -.01em; }
.mmenu a span { display: block; font-family: var(--serif); font-style: italic; font-weight: 200; font-size: 17px; text-transform: none; color: var(--ink-2); margin-top: 4px; }
.mmenu p { position: absolute; left: 0; right: 0; bottom: 32px; font-size: 14px; color: var(--ink-2); }

/* ---------- opening ---------- */
.pre { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.pre__hello { position: absolute; left: 0; right: 0; top: 44%; transform: translateY(-50%); z-index: 2; margin: 0; text-align: center; letter-spacing: -.02em; line-height: .9; font-size: clamp(64px, 11vw, 176px); font-weight: 300; mix-blend-mode: difference; color: #fff; }
.pre__hello .ln { display: block; overflow: hidden; padding-bottom: .06em; }
.pre__hello .ln > span { display: block; }
.pre__sub { position: absolute; left: 0; right: 0; bottom: 12%; margin: 0; text-align: center; font-size: clamp(19px, 1.9vw, 26px); line-height: 1.4; color: rgba(236,231,222,.85); }
.pre__sub .it { color: var(--ink); font-weight: 300; }

/* ---------- 3D room ---------- */
.stage { position: absolute; left: 50%; top: 44%; width: 0; height: 0; perspective: 1500px; }
.world, .spin, .cloud, .fore { position: absolute; transform-style: preserve-3d; }
.card { position: absolute; width: calc(var(--cw) * var(--s)); left: calc(var(--cw) * var(--s) / -2); top: calc(var(--cw) * var(--s) / var(--ratio) / -2); transform-style: preserve-3d; will-change: transform; --t: 8px; }
.face { display: block; }
.face img { width: 100%; aspect-ratio: var(--ratio); object-fit: cover; box-shadow: 0 28px 44px rgba(0,0,0,.5); }
.shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.face, .shade { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* canvas thickness: four side faces behind the painting */
.edge { position: absolute; display: block; background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)), var(--src); background-size: cover; }
.edge--l { top: 0; bottom: 0; left: 0; width: var(--t); transform-origin: left center; transform: rotateY(90deg); background-position: left center; }
.edge--r { top: 0; bottom: 0; right: 0; width: var(--t); transform-origin: right center; transform: rotateY(-90deg); background-position: right center; }
.edge--t { left: 0; right: 0; top: 0; height: var(--t); transform-origin: center top; transform: rotateX(-90deg); background-position: center top; }
.edge--b { left: 0; right: 0; bottom: 0; height: var(--t); transform-origin: center bottom; transform: rotateX(90deg); background-position: center bottom; }
.card.is-back .edge, .opening .edge { display: none; }
.bit { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.bit > div { position: absolute; width: var(--bw); left: calc(var(--bw) / -2); top: calc(var(--bw) * -.75); will-change: transform; }
.bit img { width: 100%; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 18px 30px rgba(0,0,0,.4); }

/* ---------- caption ---------- */
.caption { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 80px var(--g) 30px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  background: linear-gradient(rgba(13,13,12,0), rgba(13,13,12,.7) 45%); }
.cap-mask { overflow: hidden; }
.cap-kick { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.cap-title { margin: 6px 0 0; font-weight: 300; font-size: clamp(36px, 5vw, 76px); line-height: 1.04; letter-spacing: -.02em; padding-bottom: .12em; }
.cap-about { margin: 14px 0 0; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.35; max-width: 30em; }
.cap-after { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.dots { display: flex; gap: 6px; margin-top: 18px; }
.dots i { width: 18px; height: 2px; background: var(--line); transition: background .4s; }
.dots i.on { background: var(--ink); }

/* ---------- phone ---------- */
@media (max-width: 700px) {
  :root { --cw: 58vw; }
  .card { --t: 6px; }
  .hint { top: 74px; }
  .navp { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .pre__hello { top: 36%; }
  .pre__sub { bottom: auto; top: 64%; padding: 0 var(--g); }
  .caption { grid-template-columns: 1fr; gap: 16px; padding-bottom: 76px; background: linear-gradient(rgba(13,13,12,0), rgba(13,13,12,.88) 32%, rgba(13,13,12,.94)); }
  .cap-title { font-size: 34px; }
  .cap-about { font-size: 17px; }
  .stage { top: 35%; }
}

/* ---------- without JavaScript: a plain list of the works ---------- */
.fallback { padding: 120px var(--g) 80px; }
.fallback h1 { font-weight: 300; font-size: 40px; margin: 0 0 24px; }
.fallback ol { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.fallback li a { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); }
.fallback li strong { display: block; font-weight: 400; font-size: 24px; }
.fallback li span { color: var(--ink-2); }

/* with JavaScript the room is shown and the list is kept for screen readers; without it, only the list */
.js .fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
html:not(.js) .scene, html:not(.js) .track, html:not(.js) .pre { display: none; }
.mmenu p a { display: inline; padding: 0; font-size: 14px; text-transform: none; letter-spacing: 0; }
