/* LLL — Selected works. Her niche with four frames; a frame pointed at lifts
   off the wall while the rest of the picture dims (after the "Astra" photo
   demo on recent.design). Behaviour: works.js. */

:root {
  --ground: #0b0a09;
  --ink: #f4f1ec;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Her picture fills the height (desktop: whole picture, dark sides; phone:
   cover, the sides of the wall cropped). */
.works {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.niche {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Centred even when wider than a phone (sides cropped); a little lower
     (--drop) so the header bar stays clear of the niche's opening (client,
     2026-11-16). The bottom of her stone floor crops by the same amount. */
  --drop: 4dvh;
  translate: -50% calc(-50% + var(--drop));
  height: 100dvh;
  aspect-ratio: 3922 / 6965;
}
/* The strip above her picture that the drop uncovers: her own stone wall,
   its top edge mirrored, so the bar lies on wall, not on black. */
.niche::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--drop);
  background: url("../media/works/selected-works-1440.webp?v=2") top / 100% auto no-repeat;
  transform: scaleY(-1);
}
.niche-base { display: block; width: 100%; height: 100%; }

/* The dim: over the picture and the frames at rest, under the lifted one. */
.niche-dim {
  position: absolute;
  inset: calc(-1 * var(--drop)) 0 0;   /* over the mirrored strip too */
  z-index: 2;
  background: rgba(12, 9, 7, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, background-color .35s ease;
}
/* No dim on hover any more (client, 2026-11-16: "only the frame grows");
   the veil is used only behind an open case (below). */

/* A frame: a cut-out of her pixels exactly over its place in the picture. */
.frame {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-hand, pointer);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 55%;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), filter .45s ease;
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}
.frame:focus { outline: none; }
/* Lifted: clearly larger (client: "so it shows more", as in the Astra
   demo), a little higher, a deep shadow on the wall. */
.frame.is-up { z-index: 3; }
.frame.is-up img {
  transform: translateY(-2%) scale(1.12);   /* 1.2 felt too much (client); 1.12 still reads clearly */
  filter: drop-shadow(0 3vh 3.2vh rgba(0,0,0,.55)) drop-shadow(0 .8vh 1vh rgba(0,0,0,.35));
}
.frame.is-up:focus-visible img { filter: drop-shadow(0 2.2vh 2.4vh rgba(0,0,0,.55)) drop-shadow(0 0 .4vh rgba(255,255,255,.8)); }
@media (prefers-reduced-motion: reduce) {
  .frame img, .niche-dim { transition: none; }
}


/* ─── A case, told on the wall (client: no new page, phone first) ──────────
   Built like the Girl in Blue Studios case pages; sized in cqw of the niche
   so it is the same phone layout on every screen. */
.niche { container-type: inline-size; }
.niche.is-case .frame { pointer-events: none; }
/* A case without a painting of its own (Old Garden, Phia, Rebecca) stands
   on one flat, fully opaque light grey — the colour of the client's
   reference screenshot, #f4f4f4 (2026-11-17). */
.niche.is-case .niche-dim { opacity: 1; background: #f4f4f4; }
/* A case with a painting of its own (MS Moda: hers) shows it instead, over
   the wall and the frames, the mirrored strip included. */
.case-paint {
  position: absolute;
  left: 0;
  top: calc(-1 * var(--drop));
  z-index: 3;
  width: 100%;
  height: calc(100% + var(--drop));
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.niche.is-case .case-paint.is-on { opacity: 1; visibility: visible; transition: opacity .4s ease; }

.case {
  position: absolute;
  /* 9 % of the picture; on a phone, where the picture is wider than the
     screen, at least 16 px from the screen's edge. */
  left: max(9cqw, calc((100cqw - 100vw) / 2 + 16px));
  right: max(9cqw, calc((100cqw - 100vw) / 2 + 16px));
  top: calc(64px + env(safe-area-inset-top) + 10cqw - var(--drop));   /* below the header bar; the title and text a little higher than the picture (client) */
  z-index: 4;
  color: #221a16;
  font: 400 2.9cqw/1.75 Poppins, "Helvetica Neue", Arial, sans-serif;   /* Poppins, as on leaderladieslegacy.com */
  opacity: 0;
  transform: translateY(1.5cqw);
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .8, .2, 1);
}
.case[hidden] { display: block; visibility: hidden; }
/* A closed case must never catch a click meant for the wall: its last
   slide's picture stays "visible" (is-on) under opacity 0 and sat over the
   frames, so they stopped opening (client: "then MS Moda doesn't work"). */
.case:not(.is-open), .case:not(.is-open) * { pointer-events: none; }
.case.is-open { opacity: 1; transform: none; visibility: visible; }

.case-nav { display: grid; gap: .6cqw; justify-items: start; }
.case-link { color: #fff; font-weight: 600; }
.case-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #5c0a1d;
  cursor: var(--cur-hand, pointer);
}
.case-link { transition: color .2s ease; -webkit-tap-highlight-color: transparent; }
.case-link:hover, .case-link:focus-visible { color: #8e1530; outline: none; }   /* no underline, pressed or pointed at (client) */
.case-link:focus { outline: none; }

.case-title {
  margin: 4.5cqw 0 4cqw;
  font: 700 7.4cqw/1.08 Poppins, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.045em;   /* tighter (client) */
  color: #5c0a1d;   /* the burgundy, a shade deeper so it holds on the wall */
}

.story-texts { position: relative; height: 31cqw; margin: 0 0 3.4cqw; padding: 0; list-style: none; }
.story-text {
  position: absolute;
  inset: 0;
  line-height: 1.45;   /* closer lines (client) */
  display: grid;
  grid-template-columns: 22cqw minmax(0, 1fr);   /* a narrow label, a wide text (client's layout); wide enough for "What changed" on one line */
  gap: 2.5cqw;
  visibility: hidden;
}
.story-text.is-on { visibility: visible; animation: story-in .35s cubic-bezier(.2, .8, .2, 1); }
/* Each change shows at once: the label, text and picture come in quickly
   (client: "faster, so one sees what changes"). */
@keyframes story-in { from { opacity: 0; transform: translateY(1.2cqw); } }
@keyframes story-fade { from { opacity: 0; } }
.story-text h3 { margin: 0; font: inherit; color: rgba(34, 26, 22, .62); white-space: nowrap; }   /* "The problem" never split over two lines (client) */
.story-text strong { font-weight: 500; }   /* a gentle bold: little step from the regular text (client) */
.story-text p { margin: 0; height: 100%; overflow-y: auto; padding-right: 1cqw; text-wrap: pretty; }   /* no lone word on the last line; short words are tied to the next one in case.js (client) */

/* The picture: wide, 2:1, as wide as the text — as on Girl in Blue Studios
   (client, 2026-11-17; was 3:2, before that a 4:5 Instagram post). Two
   upright photos share it half and half (.story-pair). Story bars on top,
   tap left / right. */
.story-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;   /* two Instagram posts (4:5) side by side (client, trial; was 2:1) */
  border-radius: 3cqw;
  overflow: hidden;
  background: #d9d1c8;
  /* no shadow under the picture (client) */
  user-select: none;
  -webkit-user-select: none;
}
.story-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--focus, 35%);
  visibility: hidden;
}
.story-media.is-on { visibility: visible; animation: story-fade .3s ease; }
.story-media.is-was:not(.is-on) { visibility: visible; animation: story-out .3s ease forwards; }
@keyframes story-out { to { opacity: 0; } }
.story-pair { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 100%; }
.story-pair img { width: 100%; height: 100%; min-width: 0; object-fit: cover; object-position: var(--fx, 50%) var(--focus, 35%); }
.story-bars {
  position: absolute;
  left: 3cqw;
  right: 3cqw;
  top: 2.6cqw;
  z-index: 2;
  display: flex;
  gap: 1.4cqw;
  pointer-events: none;
}
.story-bars i { position: relative; flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.45); overflow: hidden; }
.story-bars i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.story-bars i.is-done::after { transform: none; }
.story-bars i.is-on::after { animation: story-fill var(--dur, 4500ms) linear forwards; }
.story.is-paused .story-bars i.is-on::after { animation-play-state: paused; }
@keyframes story-fill { from { transform: scaleX(var(--from, 0)); } to { transform: none; } }
.story-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: var(--cur-hand, pointer);
  -webkit-tap-highlight-color: transparent;
}
.story-prev { left: 0; width: 33%; }
.story-next { right: 0; width: 67%; }
.story-tap:focus { outline: none; }

/* Back · stop · on: her new beige keys UNDER the picture, centred (client's
   mockup, 2026-11-17). Each image is her own key with its own shadow, cut
   at the gaps (assets/19-story-keys-beige.png), so laid side by side they
   are exactly her graphic: the three faces span 34cqw, the back key's cell
   is wider because its shadow falls to the left — hence the shift that
   centres the faces, not the cells. Pressed, a key sinks a little. */
.story-ctl {
  display: flex;
  justify-content: center;
  margin-top: .2cqw;
  translate: -2.3cqw 0;
}
.story-key {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-hand, pointer);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .09s ease-out, filter .09s ease-out;
}
.story-key:nth-child(1) { width: 16.3cqw; }
.story-key:nth-child(2) { width: 11.6cqw; }
.story-key:nth-child(3) { width: 11.95cqw; }
.story-key img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.story-key.is-down {
  transform: translateY(.45cqw);
  filter: brightness(.94);
  transition-duration: .05s;
}
.story-key:focus { outline: none; }
.story-key:focus-visible { filter: brightness(1.04); }

/* The header bar (src/head.css), laid over her picture as on the main page:
   as wide as the picture on screen (the screen, on a phone), its type sized
   to the picture's width as there (68 px on a 2160 px plate). */
.works .head {
  left: 50%;
  top: 0;
  translate: -50% 0;
  width: min(100vw, 100dvh * 3922 / 6965);
  font-size: clamp(12.5px, calc(min(100vw, 100dvh * 3922 / 6965) * 68 / 2160), 15px);
}

/* The neighbouring clients by name, between the text and the picture: plain
   text, no button (client) — only its colour changes when pointed at. */
.case-pn {
  display: flex;
  justify-content: space-between;
  gap: 3cqw;
  margin: 3cqw 0 3.4cqw;   /* the picture stays where it was while the text above moves up */
}
.pn-btn {
  display: grid;
  justify-items: start;
  gap: .1em;
  padding: 0;
  border: 0;
  background: none;
  color: #221a16;
  font: 500 2.9cqw/1.3 Poppins, "Helvetica Neue", Arial, sans-serif;
  text-align: left;
  cursor: var(--cur-hand, pointer);
  transition: color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.pn-btn small { font-size: .78em; font-weight: 400; color: rgba(34, 26, 22, .62); transition: color .2s ease; }
.pn-next { justify-items: end; text-align: right; }
.pn-btn:hover, .pn-btn:focus-visible, .pn-btn:hover small, .pn-btn:focus-visible small { color: #7b0f28; outline: none; }
.pn-btn:focus { outline: none; }

/* Inside a project "let's talk" turns bold and burgundy (client): the
   moment to reach out. The shortcut panel here is her beige wall (assets/14-shortcut-works-
   beige.webp), a shade darker so the white type reads, not the sky. */
.niche.is-case ~ .head .head-cta { font-weight: 500; color: #fff; background: #7b0f28; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 14px rgba(0,0,0,.3); }   /* burgundy here (client) */
.niche.is-case ~ .head .head-cta:hover, .niche.is-case ~ .head .head-cta:focus-visible { background: #8e1530; }
.head-panel[data-plate="works"] {
  background-image: linear-gradient(rgba(30, 22, 14, .3), rgba(30, 22, 14, .3)), url("../media/works/shortcut-beige.webp?v=1");
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 22px 50px rgba(0,0,0,.45), 0 6px 14px rgba(0,0,0,.28);
}

/* Inside a project the shortcut (still the main story) wears the colour of
   that project's painting — for MS Moda its pale misty sky — so dark type. */
.head-panel[data-plate="case-ms-moda"] {
  background-image: url("../media/works/shortcut-msmoda.webp?v=1");
  color: #2a211c;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 22px 50px rgba(0,0,0,.32), 0 6px 14px rgba(0,0,0,.18);
}
/* The cases on the plain light grey: the header bar is the same grey, a
   touch deeper, with dark type (client: "the bar must look like the rest of
   the background", not a dark band). "let's talk" stays burgundy. */
.niche.is-plain ~ .head {
  background: linear-gradient(#eaeaea, #efefef);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,.16);
  color: #2a211c;
  text-shadow: none;
}
.niche.is-plain ~ .head .head-burger i { box-shadow: none; }
.niche.is-plain ~ .head .head-menu, .niche.is-plain ~ .head .head-link { opacity: .62; }
.niche.is-plain ~ .head .head-link[aria-current="page"],
.niche.is-plain ~ .head .head-menu:hover, .niche.is-plain ~ .head .head-link:hover,
.niche.is-plain ~ .head .head-menu[aria-expanded="true"] { opacity: 1; }
.niche.is-plain ~ .head .head-cta { text-shadow: none; }
/* The cases on the plain light grey: the panel wears the same grey. */
.head-panel[data-plate="case-plain"] {
  background: #f4f4f4;
  color: #2a211c;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 22px 50px rgba(0,0,0,.22), 0 6px 14px rgba(0,0,0,.12);
}
.head-panel[data-plate="case-ms-moda"] .head-panel-title,
.head-panel[data-plate="case-plain"] .head-panel-title { color: #5c0a1d; }
.head-panel[data-plate="case-ms-moda"] button:hover,
.head-panel[data-plate="case-ms-moda"] button:focus-visible,
.head-panel[data-plate="case-plain"] button:hover,
.head-panel[data-plate="case-plain"] button:focus-visible { background: rgba(60, 45, 30, .08); }
@media (prefers-reduced-motion: reduce) { .story-text.is-on, .story-media.is-on { animation: none; } }

/* Comes in whole once her picture and the frames are ready (no half-drawn
   wall while it loads). */
.niche { opacity: 0; transition: opacity .25s ease; }
.niche.is-ready { opacity: 1; }
/* The bar comes in with it, so it never stands alone on black. */
.works .head { transition: opacity .25s ease; }
.niche:not(.is-ready) ~ .head { opacity: 0; }
