/* ============================================================
   Bosco Busselli · studio
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --white: #ffffff;
  --beige: #e9e5dc;
  --ink: #111111;
  --muted: #8a8a8a;

  --serif: "Times New Roman", Times, serif;
  --serif-italic: "Cormorant Garamond", "Times New Roman", Times, serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-draw: cubic-bezier(0.55, 0.05, 0.2, 1);

  /* Dynamic theme colors — swapped via [data-theme="dark"] */
  --fg: var(--ink);
  --bg: var(--white);

  /* Fixed UI shell — lifted block; list ends above the icon (never behind it) */
  --ui-lift: clamp(13vh, 16vh, 17vh);
  --core-anchor: calc(50dvh - var(--ui-lift));
  --core-half: clamp(5rem, 9vh, 6.5rem);
  --rollout-gap: clamp(0.75rem, 1.6vh, 1.25rem);
  --menu-breathe: 1.5vh;
  --figures-bottom: clamp(1.75rem, 5vh, 4.5rem);
  --figures-img-size: clamp(52px, 5.5vw, 68px);
  --icon-clearance: clamp(1.35rem, 2.75vh, 2.25rem);
  --rollout-scroll-pad: clamp(3rem, 9vh, 5.5rem);
  --figures-reserve: calc(
    var(--figures-bottom) + var(--figures-img-size) + var(--icon-clearance)
  );
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow: hidden;
  transition: color 0.45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}

::selection {
  background: var(--ink);
  color: var(--white);
}

/* ============================================================
   INTRO  (data-stage="intro")
   ============================================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  opacity: 1;
  transition: opacity 0.9s var(--ease);
  pointer-events: auto;
}

.intro__emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}

.intro__emblem:hover .intro__emblem-img {
  transform: scale(1.04);
}

.intro__emblem:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 1.4rem;
}

.intro__emblem-mask {
  display: inline-block;
  clip-path: circle(0% at 50% 50%);
  -webkit-clip-path: circle(0% at 50% 50%);
  animation: emblem-draw 2.3s var(--ease-draw) 0.25s forwards;
  will-change: clip-path;
}

.intro__emblem-img {
  width: clamp(72px, 9vw, 110px);
  height: auto;
  opacity: 0;
  transform: scale(0.96);
  transition: transform 0.5s var(--ease);
  animation: emblem-fade 2.3s var(--ease-draw) 0.25s forwards;
}

@keyframes emblem-draw {
  0%   { clip-path: circle(0%  at 50% 50%); -webkit-clip-path: circle(0%  at 50% 50%); }
  100% { clip-path: circle(120% at 50% 50%); -webkit-clip-path: circle(120% at 50% 50%); }
}

@keyframes emblem-fade {
  0%   { opacity: 0; transform: scale(0.96); }
  20%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

body[data-stage="inside"] .intro {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   Lucie Olivier side background — atelier photo under the heroes
   ============================================================ */
.side-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/images/lucie/atelier.png?v=20260810a");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.75s var(--ease);
  pointer-events: none;
}

body[data-stage="inside"][data-side="artist"] .side-bg {
  opacity: 1;
}

/* About — plain beige field; atelier photo steps aside */
body[data-stage="inside"][data-side="artist"][data-artist-view="about"] {
  --bg: var(--beige);
  --fg: var(--ink);
  background: var(--beige);
  color: var(--ink);
}

body[data-stage="inside"][data-side="artist"][data-artist-view="about"] .side-bg {
  opacity: 0;
}

body[data-side="artist"][data-artist-view="about"] .brand__artist {
  filter: none;
}

body[data-side="artist"][data-artist-view="about"] .brand__illustratrice,
body[data-side="artist"][data-artist-view="about"] .menu__item,
body[data-side="artist"][data-artist-view="about"] .artist-panel__scroll p,
body[data-side="artist"][data-artist-view="about"] .contact {
  text-shadow: none;
}

/* The atelier photo sits in the 120–140 luminance range, so white type needs a
   whisper of shadow to survive the bright draped ceiling. Dropped as soon as a
   light hover hero takes over the frame. */
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .brand__illustratrice,
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .menu__item,
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .works__name,
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .artist-panel__scroll p,
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .contact {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
}

/* drop-shadow runs after invert, so the halo colour is literal: dark, to hold
   the now-white signature against the bright ceiling. */
body[data-stage="inside"][data-side="artist"][data-theme="dark"] .brand__artist {
  filter: invert(1) brightness(1.6) saturate(0)
    drop-shadow(0 1px 10px rgba(0, 0, 0, 0.5));
}

/* ============================================================
   Hover hero background — FULL FRAME
   ============================================================ */
.hero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.55s var(--ease);
  pointer-events: none;
}

.hero-bg.is-visible {
  opacity: 1;
}

/* ============================================================
   INSIDE — single centered stack (no bottom band, no separator)
   ============================================================ */
.inside {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
  pointer-events: none;
}

body[data-stage="inside"] .inside {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- Fixed shell: centered core + scrollable lists + pinned icon ---------- */
.stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stack__core,
.rollouts,
.artist-rollouts,
.artist-panel,
.figures-dock {
  pointer-events: auto;
}

.stack__core {
  position: fixed;
  left: 50%;
  top: calc(var(--core-anchor) - (var(--menu-breathe) / 2));
  transform: translate(-50%, -50%);
  width: min(640px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}

/* ---------- Brand stack ---------- */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  outline: none;
}

.brand__studio-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition:
    opacity 0.65s var(--ease),
    transform 0.65s var(--ease),
    visibility 0.65s var(--ease);
}

.brand__artist-side {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(320px, 86vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%) scale(0.98);
  transition:
    opacity 0.65s var(--ease),
    transform 0.65s var(--ease),
    visibility 0.65s var(--ease);
}

.brand__artist {
  width: 100%;
  height: auto;
  max-height: clamp(4.5rem, 10vh, 6.5rem);
  object-fit: contain;
  transition: filter 0.45s var(--ease);
}

.brand__studio,
.brand__illustratrice {
  display: block;
  font-family: var(--serif-italic);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.9rem, 1.3vw, 1rem);
  letter-spacing: 0.04em;
  margin-top: 0.45rem;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

.brand__emblem {
  width: clamp(32px, 3.4vw, 42px);
  height: auto;
  margin-bottom: clamp(0.75rem, 1.8vh, 1.15rem);
  transition: filter 0.45s var(--ease);
}

.brand__title {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

body[data-side="artist"] .brand__studio-side {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  pointer-events: none;
  position: absolute;
  width: 100%;
}

body[data-side="artist"] .brand__artist-side {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

body[data-side="artist"] .figures--center {
  opacity: 1;
}

body[data-side="artist"] .brand {
  min-height: clamp(5rem, 11vh, 7rem);
  width: min(340px, 88vw);
}

body[data-side="artist"] .menu.menu--studio {
  display: none;
}

body[data-side="artist"] .menu.menu--artist {
  display: flex;
}

body[data-side="artist"] .rollouts {
  opacity: 0;
  pointer-events: none;
}

body[data-side="artist"] .artist-rollouts[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Lucie Olivier — artist works list (same rollout as studio WORKS) ---------- */
.artist-rollouts {
  position: fixed;
  left: 50%;
  top: calc(
    var(--core-anchor) + var(--core-half) + var(--rollout-gap) + (var(--menu-breathe) / 2)
  );
  bottom: var(--figures-reserve);
  transform: translateX(-50%);
  width: min(640px, 90vw);
  overflow: hidden;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease);
}

.rollout--artist-works {
  width: min(440px, 80%);
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding-bottom: var(--rollout-scroll-pad);
  scroll-padding-bottom: var(--rollout-scroll-pad);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transform-origin: top center;
  animation: rollout-roll 1.9s var(--ease) both;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
}

.rollout--artist-works::-webkit-scrollbar {
  display: none;
}

/* ---------- Lucie Olivier — artist panels (scroll + fade) ---------- */
.artist-panel {
  position: fixed;
  left: 50%;
  top: calc(
    var(--core-anchor) + var(--core-half) + var(--rollout-gap) + (var(--menu-breathe) / 2)
  );
  bottom: var(--figures-reserve);
  transform: translateX(-50%);
  width: min(640px, 90vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.55s var(--ease), visibility 0.55s var(--ease);
}

body[data-side="artist"] .artist-panel[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

.artist-panel__scroll {
  width: min(480px, 84%);
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding-bottom: var(--rollout-scroll-pad);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
}

.artist-about__scroll::-webkit-scrollbar {
  display: none;
}

.artist-panel__scroll p {
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: clamp(0.92rem, 1.35vw, 1.02rem);
  line-height: 1.75;
  text-align: center;
  max-width: 38ch;
  margin: 0 auto;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

#artistAbout .artist-panel__scroll {
  width: min(560px, 92%);
}

#artistAbout .artist-panel__scroll p {
  max-width: 50ch;
}

/* Bosco Busselli silhouette — just right of centre, on beige */
.artist-about__figure {
  position: fixed;
  left: calc(50% + clamp(0.75rem, 3vw, 2.5rem));
  right: auto;
  top: 0;
  bottom: 0;
  width: min(34vw, 380px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-bottom: var(--figures-reserve);
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s var(--ease), visibility 0.55s var(--ease);
}

body[data-side="artist"] #artistAbout[aria-hidden="false"] .artist-about__figure {
  opacity: 1;
  visibility: visible;
}

.artist-about__img {
  height: min(calc(100dvh - var(--figures-reserve) - 2rem), 820px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left bottom;
}

body[data-side="artist"] #artistAbout[aria-hidden="false"] {
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
}

body[data-side="artist"] #artistAbout[aria-hidden="false"] .artist-panel__scroll {
  width: min(42ch, 48vw);
  margin-left: auto;
  margin-right: auto;
  transform: translateX(clamp(-3vw, -4%, -1.25rem));
}

body[data-side="artist"] #artistAbout[aria-hidden="false"] .artist-panel__scroll p {
  max-width: none;
  text-align: center;
}

.artist-panel__scroll p + p {
  margin-top: clamp(0.9rem, 2vh, 1.25rem);
}

.artist-panel__empty {
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: 1rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Primary menu (Times) ---------- */
.menu {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(2.25rem, 5.5vw, 4.25rem);
  margin-top: clamp(1.5rem, 3.5vh, 2.35rem);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease);
}

.menu__item {
  font-family: var(--serif);
  font-size: clamp(0.68rem, 0.95vw, 0.76rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.25rem 0 0.35rem;
  position: relative;
  color: var(--fg);
  transition: opacity 0.3s var(--ease), color 0.45s var(--ease);
  touch-action: manipulation;
}

.menu__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.55s var(--ease), background-color 0.45s var(--ease);
}

.menu__item.is-active::after { transform: scaleX(1); }
.menu__item:hover { opacity: 0.7; }
.menu__item.is-active:hover { opacity: 1; }

.menu.menu--artist {
  display: none;
}

/* ---------- Rollouts (pinned between menu and icon; scroll + fade above icon) ---------- */
.rollouts {
  position: fixed;
  left: 50%;
  top: calc(
    var(--core-anchor) + var(--core-half) + var(--rollout-gap) + (var(--menu-breathe) / 2)
  );
  bottom: var(--figures-reserve);
  transform: translateX(-50%);
  width: min(640px, 90vw);
  overflow: hidden;
  z-index: 2;
  transition: opacity 0.55s var(--ease);
}

.rollout {
  width: min(440px, 80%);
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding-bottom: var(--rollout-scroll-pad);
  scroll-padding-bottom: var(--rollout-scroll-pad);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transform-origin: top center;
  animation: rollout-roll 1.9s var(--ease) both;
  /* Fade only at the very bottom — extra pad lets titles scroll into clarity */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 78%,
    rgba(0, 0, 0, 0.45) 92%,
    transparent 100%
  );
}

.rollout::-webkit-scrollbar {
  display: none;
}

.rollout[hidden] { display: none; }

/* Unfurl inside the fixed zone — no layout push */
@keyframes rollout-roll {
  0% {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
    filter: blur(2px);
  }
  35% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    max-height: 100%;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Cascading items inside the rollout — staggered drop */
.rollout li,
.rollout .about {
  opacity: 0;
  animation: item-drop 1.05s var(--ease) both;
}

@keyframes item-drop {
  0%   { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}

.rollout li:nth-child(1)    { animation-delay: 0.50s; }
.rollout li:nth-child(2)    { animation-delay: 0.70s; }
.rollout li:nth-child(3)    { animation-delay: 0.90s; }
.rollout li:nth-child(4)    { animation-delay: 1.10s; }
.rollout li:nth-child(5)    { animation-delay: 1.30s; }
.rollout li:nth-child(6)    { animation-delay: 1.50s; }

.rollout .about             { animation-delay: 0.60s; }
.rollout .about + .about     { animation-delay: 0.80s; }

/* ---------- Works list ---------- */
.works {
  list-style: none;
  padding-bottom: 0.25rem;
}
.works li + li { margin-top: 0.15rem; }

.works__item {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(1.25rem, 1fr);
  column-gap: clamp(0.4rem, 1.5vw, 0.65rem);
  align-items: end;
  width: 100%;
  padding: 0.22rem 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.25s var(--ease);
}

.works__name {
  font-family: var(--serif-italic);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-width: 0;
  color: var(--fg);
  transition: color 0.45s var(--ease), opacity 0.25s var(--ease);
}

.works__dots {
  width: 100%;
  min-width: 1.25rem;
  height: 1px;
  margin-bottom: 0.28em;
  background-image: radial-gradient(circle, currentColor 0.55px, transparent 0.55px);
  background-size: 4px 1px;
  background-repeat: repeat-x;
  background-position: left bottom;
  opacity: 0.7;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

.works__item:hover .works__name { opacity: 0.6; }

.works__item:not([data-gallery]) {
  cursor: default;
}

/* ---------- Press list ---------- */
.rollout--press { width: min(540px, 86%); }

.press {
  list-style: none;
  text-align: center;
  padding-bottom: 0.25rem;
}

.press li + li { margin-top: clamp(0.85rem, 2vh, 1.4rem); }

.press__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: opacity 0.25s var(--ease);
}

.press__item:hover { opacity: 0.55; }

.press__title {
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.25;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

.press__source {
  font-family: var(--serif);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.45s var(--ease);
}

body[data-theme="dark"] .press__source { color: rgba(255, 255, 255, 0.7); }

/* ---------- About / Contact ---------- */
.about {
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.7;
  text-align: center;
  max-width: 32ch;
  margin: 0 auto;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

.about + .about {
  margin-top: clamp(0.85rem, 2vh, 1.25rem);
}

.contact {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--fg);
  transition: color 0.45s var(--ease);
}

.contact a:hover { opacity: 0.6; }

/* ---------- Figures dock — side icons + garda (center), always pinned ---------- */
.figures-dock {
  position: fixed;
  left: 50%;
  bottom: calc(var(--figures-bottom) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 3vw, 2.5rem);
  width: min(100%, 94vw);
  opacity: 0;
  transition: opacity 0.55s var(--ease);
}

body[data-stage="inside"] .figures-dock {
  opacity: 1;
  transition-delay: 0.95s;
}

.figures {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  transition: opacity 0.35s var(--ease);
}

.figures-dock .figures:hover,
.figures-dock .figures:focus-visible {
  opacity: 0.6;
}

.figures__img {
  display: block;
  width: auto;
  height: var(--figures-img-size);
  transition: filter 0.45s var(--ease);
}

.figures__img--side {
  height: var(--figures-img-size);
  max-width: clamp(56px, 6.5vw, 72px);
}

.figures--right .figures__img--side {
  max-width: clamp(80px, 10vw, 104px);
}

/* ============================================================
   DARK THEME — applied while hovering a dark-background project
   ============================================================ */
body[data-theme="dark"] {
  --fg: #ffffff;
  color: #ffffff;
}

body[data-theme="dark"] .brand__title,
body[data-theme="dark"] .brand__studio,
body[data-theme="dark"] .brand__illustratrice {
  color: #ffffff;
}

body[data-theme="dark"] .menu__item::after {
  background: #ffffff;
}

body[data-theme="dark"] .brand__emblem,
body[data-theme="dark"] .brand__artist,
body[data-theme="dark"] .figures__img {
  /* black PNG → white via invert */
  filter: invert(1) brightness(1.6) saturate(0);
}

body[data-theme="dark"] ::selection {
  background: #ffffff;
  color: #111111;
}

/* ============================================================
   Carousel / lightbox
   ============================================================ */
.carousel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}

.carousel.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s var(--ease), visibility 0s;
}

.carousel__stage {
  width: min(80vw, 1100px);
  height: min(78vh, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.99);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.carousel__img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.carousel__title {
  position: fixed;
  top: clamp(1.5rem, 4vh, 2.4rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif-italic);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.carousel__counter {
  position: fixed;
  bottom: clamp(1.5rem, 4vh, 2.4rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.carousel__close {
  position: fixed;
  top: clamp(1rem, 3vh, 1.8rem);
  right: clamp(1.2rem, 3vw, 2.2rem);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
  transition: opacity 0.3s var(--ease);
}

.carousel__close:hover { opacity: 0.5; }

.carousel__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--ink);
  padding: 1rem;
  transition: opacity 0.3s var(--ease);
  opacity: 0.65;
}

.carousel__nav:hover { opacity: 1; }
.carousel__nav--prev { left: clamp(0.5rem, 2vw, 2rem); }
.carousel__nav--next { right: clamp(0.5rem, 2vw, 2rem); }

/* ============================================================
   Inside elements draw-in (after intro completes)
   ============================================================ */
body[data-stage="inside"] .brand,
body[data-stage="inside"] .menu {
  animation: inside-fade 0.85s var(--ease) both;
}

body[data-stage="inside"] .brand { animation-delay: 0.25s; }
body[data-stage="inside"] .menu  { animation-delay: 0.55s; }

@keyframes inside-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .stack__core {
    width: min(100%, 92vw);
  }

  .rollouts,
  .artist-rollouts,
  .artist-panel {
    width: min(100%, 94vw);
  }

  .rollout,
  .rollout--artist-works {
    width: min(360px, 90vw);
  }

  .rollout--press {
    width: min(420px, 92vw);
  }

  .works__item {
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 0.32rem;
  }

  .works__name {
    white-space: normal;
    line-height: 1.25;
  }

  .works__dots {
    margin-bottom: 0;
    min-width: 0;
  }

  .artist-about__figure {
    display: none;
  }

  body[data-side="artist"] #artistAbout[aria-hidden="false"] .artist-panel__scroll {
    width: min(560px, 92%);
    transform: none;
  }

  body[data-side="artist"] #artistAbout[aria-hidden="false"] .artist-panel__scroll p {
    text-align: center;
  }
}

@media (max-width: 640px) {
  :root {
    --ui-lift: clamp(9.5vh, 11.5vh, 13vh);
    --core-half: clamp(3.85rem, 7.5vh, 5rem);
    --rollout-gap: clamp(0.55rem, 1.2vh, 0.85rem);
    --menu-breathe: 1.1vh;
    --figures-bottom: clamp(1rem, 3.5vh, 1.75rem);
    --figures-img-size: clamp(44px, 11vw, 52px);
    --icon-clearance: clamp(1rem, 2.2vh, 1.5rem);
    --rollout-scroll-pad: clamp(2.5rem, 7vh, 3.5rem);
  }

  .intro__emblem-img {
    width: clamp(60px, 17vw, 84px);
  }

  .brand__emblem {
    width: clamp(28px, 7.5vw, 36px);
    margin-bottom: clamp(0.55rem, 1.5vh, 0.85rem);
  }

  .brand__title {
    font-size: clamp(1.28rem, 6.2vw, 1.72rem);
    letter-spacing: 0.08em;
  }

  .brand__studio,
  .brand__illustratrice {
    font-size: clamp(0.8rem, 3.1vw, 0.9rem);
    margin-top: 0.35rem;
  }

  body[data-side="artist"] .brand {
    min-height: clamp(4rem, 9vh, 5.5rem);
    width: min(272px, 90vw);
  }

  body[data-side="artist"] .brand__artist-side {
    width: min(272px, 90vw);
  }

  body[data-side="artist"] .brand__artist {
    max-height: clamp(3.25rem, 7.5vh, 4.25rem);
  }

  .menu {
    gap: clamp(0.95rem, 4.2vw, 1.45rem);
    margin-top: clamp(1.1rem, 2.8vh, 1.55rem);
  }

  .menu__item {
    font-size: clamp(0.58rem, 2.65vw, 0.68rem);
    letter-spacing: 0.14em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .works__name {
    font-size: clamp(0.84rem, 3.6vw, 0.94rem);
  }

  .works__item {
    min-height: 44px;
    padding: 0.38rem 0;
  }

  .about {
    font-size: clamp(0.86rem, 3.4vw, 0.94rem);
    max-width: 30ch;
    line-height: 1.65;
  }

  .about + .about {
    margin-top: clamp(0.7rem, 1.6vh, 1rem);
  }

  .artist-panel__scroll p {
    font-size: clamp(0.86rem, 3.4vw, 0.96rem);
    max-width: 32ch;
  }

  .press__title {
    font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  }

  .press__source {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }

  .figures-dock {
    gap: clamp(0.65rem, 3vw, 1.1rem);
  }

  .figures__img--side {
    max-width: clamp(42px, 11vw, 50px);
  }

  .figures--right .figures__img--side {
    max-width: clamp(50px, 13vw, 62px);
  }

  .carousel__title {
    top: calc(clamp(1rem, 3vh, 1.5rem) + env(safe-area-inset-top, 0px));
    max-width: 86vw;
    text-align: center;
    font-size: clamp(0.88rem, 3.8vw, 1rem);
    line-height: 1.3;
  }

  .carousel__counter {
    bottom: calc(clamp(1rem, 3vh, 1.5rem) + env(safe-area-inset-bottom, 0px));
  }

  .carousel__close {
    top: calc(clamp(0.75rem, 2.5vh, 1.25rem) + env(safe-area-inset-top, 0px));
    right: calc(clamp(0.85rem, 2.5vw, 1.25rem) + env(safe-area-inset-right, 0px));
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .carousel__nav {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .carousel__nav--prev {
    left: calc(clamp(0.25rem, 1.5vw, 0.75rem) + env(safe-area-inset-left, 0px));
  }

  .carousel__nav--next {
    right: calc(clamp(0.25rem, 1.5vw, 0.75rem) + env(safe-area-inset-right, 0px));
  }

  .carousel__stage {
    width: 94vw;
    height: min(68vh, 68dvh);
  }

  .carousel__nav { padding: 0.5rem; }
}

@media (max-width: 380px) {
  .menu {
    gap: clamp(0.7rem, 3.5vw, 1rem);
  }

  .menu__item {
    font-size: 0.56rem;
    letter-spacing: 0.11em;
  }

  .brand__title {
    font-size: clamp(1.15rem, 5.8vw, 1.45rem);
  }
}

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

  .intro__emblem-mask { clip-path: none; -webkit-clip-path: none; }
  .intro__emblem-img  { opacity: 1; transform: none; }
}
