* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
}

.artist-portrait img { border-radius: 2px; }
.custom-cursor-dot { position: fixed; top: 0; left: 0; z-index: 2147483647; width: 12px; height: 12px; margin: -6px 0 0 -6px; pointer-events: none; opacity: 0; mix-blend-mode: difference; }
.custom-cursor-dot::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transform: scale(1); transition: transform 220ms cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  html.custom-cursor, html.custom-cursor * { cursor: none !important; }
  html.custom-cursor .custom-cursor-dot { opacity: 1; }
  .custom-cursor-dot.is-interactive::before { transform: scale(2.5); }
}
@media (prefers-reduced-motion: reduce) { .custom-cursor-dot::before { transition: none; } }
.sculpture-canvas { opacity: 0; transition: opacity 900ms ease; }
.sculpture-canvas.is-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sculpture-canvas { transition: none; } }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 1.5% 0 0.4%;
}
.menu-toggle { display: none; }

.site-header a {
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.065em;
  text-decoration: none;
}

.site-title {
  font-size: clamp(2.5rem, 4vw, 4.75rem);
  line-height: 1;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-size: clamp(1.2rem, 1.55vw, 1.85rem);
  line-height: 1.1;
  white-space: nowrap;
}

nav a { position: relative; }
nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.16em; height: .13em; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 220ms ease; }
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
  }

  .site-title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    white-space: normal;
  }

  nav {
    align-self: flex-end;
    font-size: 1.25rem;
  }
}

.gallery {
  min-height: calc(100vh - 5rem);
  display: grid;
  place-items: center;
}

.gallery[hidden] {
  display: none;
}

.text-page[hidden] { display: none; }
.text-page { padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 7vw, 9rem) 7rem; }
.text-page-inner { max-width: 1280px; margin: 0 auto; }
.artist-layout { display: grid; grid-template-columns: minmax(200px, min(34vw, 640px)) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: start; }
.artist-portrait { width: 100%; }
.artist-portrait img { display: block; width: 100%; height: auto; }
.page-copy { max-width: 780px; }
.page-copy h1 { margin: 0 0 2rem; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .98; letter-spacing: -.065em; }
.page-copy p { margin: 0 0 1.4em; font-size: clamp(1rem, 1.18vw, 1.2rem); line-height: 1.65; text-align: justify; }
.about-page .page-copy { max-width: 840px; margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  .artist-page .artist-portrait, .about-page .about-sculpture { transform: translate3d(0, var(--parallax-visual, 0px), 0); }
  .text-page .page-copy { transform: translate3d(0, var(--parallax-copy, 0px), 0); }
}
@media (min-width: 901px) {
  .artist-page { padding-left: .4%; padding-right: clamp(1.5rem, 3vw, 4rem); }
  .artist-page .text-page-inner { max-width: none; }
  .artist-layout { grid-template-columns: var(--site-title-width, 34vw) minmax(0, 1fr); column-gap: clamp(1rem, 1.2vw, 1.5rem); }
  .artist-page .page-copy { max-width: none; }
  .artist-page .page-copy p { line-height: 1.5; margin-bottom: 1.15em; }
}
.about-page { padding-top: clamp(1.5rem, 4vh, 3rem); }
.about-sculpture { width: 100%; height: clamp(260px, 32vw, 380px); display: grid; place-items: center; touch-action: pan-y; cursor: grab; outline-offset: 4px; }
.about-sculpture:active { cursor: grabbing; }
.about-sculpture:focus-visible { outline: 2px solid #000; }
.about-sculpture canvas { display: block; width: 100%; height: 100%; }
.about-sculpture-message { font-size: .9rem; }
.about-sculpture-hint { margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); text-align: center; font-size: .85rem; font-style: italic; color: #777; }
@media (prefers-reduced-motion: no-preference) {
  .about-page .page-copy p.reveal-pending { opacity: 0; transform: translateY(24px); transition: opacity 850ms ease, transform 850ms cubic-bezier(.22, 1, .36, 1); }
  .about-page .page-copy p.reveal-pending.revealed { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  .text-page { padding: 2.5rem 1.25rem 4rem; }
  .artist-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .artist-portrait { width: min(100%, 500px); margin-inline: auto; }
  .page-copy h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
  .page-copy p { font-size: 1rem; line-height: 1.6; }
  .about-sculpture { height: clamp(230px, 65vw, 320px); }
}

.hand-view {
  width: min(100%, 850px);
  height: min(78vh, 850px);
  min-height: 320px;
  display: grid;
  place-items: center;
}

.hand-view canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hand-message {
  font-size: 0.9rem;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .gallery {
    min-height: calc(100vh - 8rem);
  }

  .hand-view {
    height: min(65vh, 650px);
  }
}

.gallery {
  position: relative;
  overflow: hidden;
}

@media (min-width: 701px) {
  .gallery { overflow: visible; }
  .hand-view { height: min(calc(78vh + 160px), 1010px); min-height: 480px; }
}

.hand-view {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
  outline-offset: -4px;
  user-select: none;
}

.carousel-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.carousel-card {
  position: absolute;
  top: 72%;
  left: 50%;
  width: clamp(70px, 8vw, 145px);
  height: clamp(130px, 25vh, 260px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}

.carousel.is-dragging .carousel-card { transition: none; }
.carousel-card img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.carousel-card:focus-visible, .carousel-arrow:focus-visible, .image-dialog-close:focus-visible { outline: 2px solid black; outline-offset: 4px; }

.carousel-arrow {
  position: absolute;
  top: 72%;
  z-index: 100;
  width: clamp(48px, 8vw, 145px);
  height: clamp(80px, 17vh, 180px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 250ms ease, opacity 250ms ease;
}
.carousel-arrow:hover { transform: translateY(-50%) scale(1.08); }
.carousel-arrow--previous { right: calc(50% + clamp(50px, 6vw, 110px)); }
.carousel-arrow--next { left: calc(50% + clamp(50px, 6vw, 110px)); }
.carousel-arrow svg { width: 100%; height: 100%; overflow: visible; }
.carousel-arrow path { fill: rgba(255,255,255,.55); stroke: rgba(0,0,0,.62); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.image-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 5vh 5vw;
  border: 0;
  background: #fff;
  overflow: hidden;
  touch-action: pan-y;
}
.image-dialog[open] { display: grid; place-items: center; }
.image-dialog::backdrop { background: transparent; }
.image-dialog-image { display: block; max-width: 90vw; max-height: 88vh; object-fit: contain; touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.image-dialog-close { position: fixed; z-index: 102; top: 1rem; right: 1.5rem; border: 0; background: transparent; color: #000; font: 300 3rem/1 Arial, sans-serif; cursor: pointer; }
.image-dialog-arrow { position: fixed; top: 50%; width: clamp(46px, 7vw, 120px); height: clamp(70px, 15vh, 155px); }
.image-dialog-arrow--previous { left: clamp(8px, 3vw, 50px); }
.image-dialog-arrow--next { right: clamp(8px, 3vw, 50px); }
.image-dialog-exiting { position: fixed; pointer-events: none; object-fit: contain; z-index: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .carousel-card { top: 73%; width: 20vw; height: 23vh; min-height: 100px; }
  .carousel-arrow { top: 73%; }
  .carousel-arrow--previous { right: calc(50% + 12vw); }
  .carousel-arrow--next { left: calc(50% + 12vw); }
  .image-dialog-arrow { top: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel-card, .carousel-arrow, nav a::after { transition: none; }
}

/* Keep the entire composition available on small screens, including short landscape viewports. */
@media (max-width: 700px) {
  .site-header {
    gap: .65rem;
    padding: max(.5rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .5rem max(.75rem, env(safe-area-inset-left));
  }
  nav { gap: .7em; }
  nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .gallery { min-height: max(420px, calc(100svh - 8.5rem)); }
  .hand-view { width: 100%; height: min(72svh, 650px); min-height: 320px; }
  .carousel-card { top: 70%; width: clamp(60px, 19vw, 110px); height: clamp(115px, 26svh, 215px); }
  .carousel-arrow { top: 70%; width: 52px; height: 82px; }
  .carousel-arrow--previous { right: calc(50% + 11vw); }
  .carousel-arrow--next { left: calc(50% + 11vw); }
  .image-dialog { padding: max(52px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .image-dialog-image { max-width: calc(100vw - 32px); max-height: calc(100svh - 100px); }
  .image-dialog-close { top: max(8px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); min-width: 48px; min-height: 48px; }
  .image-dialog-arrow { top: 50%; width: 48px; height: 76px; }
  .image-dialog-arrow--previous { left: max(8px, env(safe-area-inset-left)); right: auto; }
  .image-dialog-arrow--next { right: max(8px, env(safe-area-inset-right)); left: auto; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .gallery { min-height: max(260px, calc(100svh - 3.5rem)); }
  .hand-view { height: max(260px, calc(100svh - 3.5rem)); min-height: 0; }
  .carousel-card { top: 70%; height: 28svh; min-height: 0; }
  .carousel-arrow { top: 70%; height: 20svh; }
  .image-dialog-image { max-height: calc(100svh - 24px); max-width: calc(100vw - 140px); }
  .image-dialog-arrow { top: 50%; }
}
@media (max-width: 700px) and (max-height: 500px) and (orientation: landscape) {
  .gallery { min-height: max(260px, calc(100svh - 8rem)); }
  .hand-view { height: max(260px, calc(100svh - 8rem)); }
}

@media (max-width: 700px) {
  .site-header.menu-ready { position: relative; z-index: 200; flex-direction: row; align-items: center; gap: .5rem; }
  .menu-ready .site-title { font-size: clamp(1.65rem, 7vw, 3.5rem); flex: 1; min-width: 0; white-space: nowrap; }
  .menu-ready .menu-toggle { flex: 0 0 48px; height: 48px; display: grid; place-content: center; gap: 7px; padding: 0; border: 0; background: transparent; color: #000; cursor: pointer; }
  .menu-toggle span { display: block; width: 28px; height: 3px; background: currentColor; transition: transform 400ms cubic-bezier(.22, 1, .36, 1); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }
  .menu-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
  .menu-ready nav { position: absolute; top: 100%; left: 0; right: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; padding: .8rem max(1.25rem, env(safe-area-inset-right)) 1.3rem max(1.25rem, env(safe-area-inset-left)); background: #fff; box-shadow: 0 18px 25px rgba(0,0,0,.07); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-12px); transition: opacity 300ms ease, transform 400ms cubic-bezier(.22, 1, .36, 1), visibility 0s linear 400ms; }
  .menu-ready nav a { font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1; transform: translateY(-8px); opacity: 0; transition: opacity 250ms ease, transform 400ms cubic-bezier(.22, 1, .36, 1); }
  .menu-ready.menu-open nav { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
  .menu-ready.menu-open nav a { opacity: 1; transform: translateY(0); }
  .menu-ready.menu-open nav a:nth-child(2) { transition-delay: 45ms; }
  .menu-ready.menu-open nav a:nth-child(3) { transition-delay: 90ms; }
  .menu-ready + main .gallery { min-height: max(420px, calc(100svh - 4rem)); }
}
@media (prefers-reduced-motion: reduce) {
  .menu-toggle span, .menu-ready nav, .menu-ready nav a { transition: none; }
}
