:root {
  color-scheme: dark;
  --dark: #0b0b0b;
  --paper: #f5ead8;
  --ink: #193a30;
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', SimSun, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--dark); }
body:has(dialog[open]) { overflow: hidden; }
button { cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid #faf5e8; outline-offset: 4px; }

.showcase { position: relative; }
.showcase.is-enhanced { height: calc(100dvh + var(--scroll-length, 100dvh)); }
.is-enhanced .showcase-frame { position: sticky; top: 0; height: 100dvh; overflow: hidden; isolation: isolate; }
.hero {
  --art-crop-x: 50%;
  --camera-origin: 45% 85%;
  position: relative;
  container-type: size;
  height: 100dvh;
  overflow: hidden;
  background: var(--dark);
}
.hero-painting, .hero-still, .hero-scene, .hero-plane { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-painting { background: var(--paper); }
.is-enhanced .hero-painting { opacity: var(--painting-opacity, 1); }
.hero-still img, .hero-plane { width: 100%; height: 100%; object-fit: cover; object-position: var(--art-crop-x) bottom; }
.is-enhanced .hero-still img { transform: scale(var(--camera-fallback, 1)); transform-origin: var(--camera-origin); }
.hero-scene { visibility: hidden; perspective: 1000px; perspective-origin: var(--camera-origin); }
.is-enhanced.has-depth .hero-scene { visibility: visible; }
.is-enhanced.has-depth .hero-still { visibility: hidden; }
.hero-plane {
  transform-origin: var(--camera-origin);
  transform: translateZ(calc(var(--plane-z) + var(--camera-z, 0px))) scale(var(--plane-scale));
}
.plane-sky { --plane-z: -600px; --plane-scale: 1.6; }
.plane-mountains { --plane-z: -150px; --plane-scale: 1.15; }
.plane-shore { --plane-z: 150px; --plane-scale: .85; }
.mountain-art {
  position: absolute;
  bottom: 0;
  left: var(--art-crop-x);
  width: max(100cqw, calc(100cqh * 1920 / 1079));
  height: max(100cqh, calc(100cqw * 1079 / 1920));
  transform: translateX(calc(0% - var(--art-crop-x)));
}
.mountain-picture { width: 100%; height: 100%; }
.hero-sprite { position: absolute; height: auto; }
.sprite-boat { transform-origin: 52% 54%; animation: boat-drift 18s ease-in-out infinite alternate paused; }
.sprite-pine, .sprite-ridge { transform-origin: 50% 94%; animation: branches-sway 5.4s ease-in-out infinite alternate paused; }
.sprite-ridge { animation-duration: 6.3s; animation-delay: -2s; }
.is-enhanced.has-depth:not(.is-painting-gone) .hero-sprite { animation-play-state: running; }
@keyframes boat-drift {
  0% { transform: translate(0, 0) rotate(-.9deg); }
  47% { transform: translate(45%, -4.5%) rotate(1.2deg); }
  100% { transform: translate(97%, 2.5%) rotate(-.7deg); }
}
@keyframes branches-sway {
  0% { transform: skewX(-2.5deg) rotate(-1.15deg); }
  100% { transform: skewX(2.5deg) rotate(1.15deg); }
}
.hero-copy { position: absolute; inset: 22% 8px auto; margin: 0; text-align: center; color: var(--ink); }
.is-enhanced .hero-copy { transform: translate3d(0, var(--title-y, 0px), 0); }
.hero-title {
  display: grid;
  justify-items: center;
  font-size: min(clamp(7.65rem, 16.2vw, 15.15rem), 31svh);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .08em;
  white-space: nowrap;
}
.hero-type { grid-area: 1 / 1; padding-inline-start: .08em; font-family: var(--serif); }
.hero-type.has-type-art { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 4.32em); aspect-ratio: 27 / 7; padding: 0; }
.has-type-art .hero-glyph { color: transparent; background: var(--title-art) no-repeat var(--glyph-position, 0%) 0 / 400% 100%; }
.hero-glyph:nth-child(2) { --glyph-position: 33.333333%; }
.hero-glyph:nth-child(3) { --glyph-position: 66.666667%; }
.hero-glyph:nth-child(4) { --glyph-position: 100%; }
.is-enhanced .hero-glyph { opacity: var(--glyph-opacity, 0); }
.hero-subtitle { display: block; margin-top: clamp(8px, 2.4svh, 37px); font: 700 clamp(1.725rem, 3.375vw, 3.15rem)/1.4 var(--serif); letter-spacing: .11em; }
.hero-subtitle img { width: min(100%, 12em); height: auto; margin-inline: auto; }
.is-enhanced .hero-subtitle { opacity: var(--subtitle-opacity, 0); }

.works { display: grid; align-items: center; min-height: 100dvh; background: var(--dark); }
.is-enhanced .works { position: absolute; inset: 0; opacity: var(--works-opacity, 0); }
.works[inert] { pointer-events: none; }
.collection, .portfolio-carousel { width: 100%; height: 100dvh; min-width: 0; }
.portfolio-carousel .circular-carousel__tile { cursor: pointer; }
.portfolio-carousel [data-dragging] .circular-carousel__tile { cursor: grabbing; }
.portfolio-carousel .portfolio-holo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.portfolio-carousel .portfolio-holo:not([data-ready]) .holo-card__face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(123deg, transparent 16%, #d9b4f446 35%, #a9edeb65 48%, #ffecad5a 56%, transparent 77%);
}

dialog {
  width: calc(100vw / 3);
  max-width: calc(100% - 28px);
  max-height: calc(100dvh - 36px);
  border: 0;
  padding: 0;
  background: var(--dark);
  color: white;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
dialog::backdrop { background: #000c; animation: fade-backdrop 340ms ease both; }
@keyframes fade-backdrop { from { opacity: 0; } to { opacity: 1; } }
.close-dialog {
  display: block;
  position: sticky;
  z-index: 1;
  top: 8px;
  width: 42px;
  height: 42px;
  margin: 8px 8px -50px auto;
  border: 0;
  border-radius: 50%;
  background: #0b0b0bd9;
  color: #fff;
}
.close-dialog::before, .close-dialog::after { content: ''; position: absolute; left: 12px; top: 20px; width: 18px; height: 1px; background: currentColor; transform: rotate(45deg); }
.close-dialog::after { transform: rotate(-45deg); }
.gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gallery img { width: 100%; height: auto; }

@media (max-width: 700px) {
  .hero-copy { top: 28%; }
  .hero { --art-crop-x: 40%; }
  .hero-title { font-size: min(21.8vw, 26svh, 9.6rem); letter-spacing: .045em; }
  .hero-subtitle { font-size: clamp(1rem, 6.4vw, 2.22rem); letter-spacing: .045em; }
  dialog { width: calc(100% - 28px); max-height: calc(100dvh - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  dialog::backdrop { animation: none; }
}
