@font-face {
  font-family: 'Drabina Elephants';
  src: url('../fonts/portraits/Drabina-Solid.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.page-elephants { --scene-ink: #e8dfcd; background: #050c26; color: var(--scene-ink); isolation: isolate; }
.page-elephants .site-header,
.page-elephants .site-footer { background: transparent; color: var(--scene-ink); }
body.page-elephants .site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: 0;
}
.page-elephants .site-header .nav a,
.page-elephants .series-nav-back { color: var(--scene-ink); }
.page-elephants .site-footer { position: relative; z-index: 3; color: #8d5b49; }
.elephants-background { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: #050c26; }
.elephants-sky { position: absolute; inset: 0; background: #050c26; }
.elephants-stars,
.elephants-pencil { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.elephants-stars {
  background: linear-gradient(#02081a22, #02081a44), url('../images/works/elephants-starry-sky.webp') center / cover;
}
.elephants-sun {
  --sun-open: 0;
  position: absolute;
  left: 50%;
  width: clamp(140px, 20vw, 270px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  will-change: top, opacity;
}
.elephants-sun-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 42%, #fff 0 60%, #ffffe9 83%, #fff6ba);
  box-shadow: 0 0 18px #fff9dcbb, 0 0 42px #ffffcc88;
  opacity: calc(1 - var(--sun-open) * .35);
  filter: blur(calc(.4px + var(--sun-open) * 4px));
  transform: scale(calc(1 + var(--sun-open) * .30));
}
.elephants-sun-halo {
  position: absolute;
  inset: -100%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffeec9 0%, #ffffeb88 20%, #ffffe333 42%, #fff0 68%);
  opacity: calc(.25 + var(--sun-open) * .75);
  transform: scale(calc(.65 + var(--sun-open) * .55));
}
.elephants-sun-rays {
  position: absolute;
  inset: -80%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 8deg, #fffef780 0deg 1deg, #fff0 2.5deg 13deg, #ffffed44 14deg 15deg, #fff0 17deg 28deg);
  mask-image: radial-gradient(circle, #0000 18%, #000b 24%, #0007 36%, #0000 65%);
  -webkit-mask-image: radial-gradient(circle, #0000 18%, #000b 24%, #0007 36%, #0000 65%);
  opacity: calc(.10 + var(--sun-open) * .45);
  filter: blur(.9px);
  transform: scale(calc(.8 + var(--sun-open) * .25));
}
.elephants-pencil { opacity: 0; }
.elephants-wave-defs { position: absolute; pointer-events: none; }
.elephants-desert {
  position: fixed;
  top: var(--dune-top, 72vh);
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 180px;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  clip-path: url(#elephants-dune-edge);
  background: radial-gradient(ellipse at 65% 65%, #f17126, #f7e1b8 50%, #f7f0e0);
}
.elephants-desert canvas { display: block; width: 100%; height: 100%; }
.elephants-desert a { display: none !important; }
.elephants-room {
  --elephant-art-height: clamp(280px, 60svh, 680px);
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 80px auto 0;
  padding: 18px 0 36px;
}
.elephants-heading { position: relative; z-index: 3; margin: 100px 24px 0; text-align: center; mix-blend-mode: multiply; }
.elephants-heading h1 {
  font-family: 'Drabina Elephants', Georgia, serif;
  font-size: calc((100vw - 48px) * .062);
  font-weight: 400;
  line-height: 1.08;
  position: relative;
  color: #eb792f;
  opacity: .33;
  white-space: nowrap;
  text-shadow: -1px 0 2px #ffb14a33;
}
.elephants-heading h1::after {
  content: attr(data-echo);
  position: absolute;
  inset: 0;
  color: #f29146;
  opacity: .46;
  transform: translateX(9px) skewX(-1.4deg);
  filter: blur(3px);
  mask-image: linear-gradient(to right, #0000 35%, #0003 65%, #000 100%);
  -webkit-mask-image: linear-gradient(to right, #0000 35%, #0003 65%, #000 100%);
  pointer-events: none;
}
.elephants-gallery {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 8px 20vw 16px;
  cursor: grab;
}
.elephants-gallery::-webkit-scrollbar { display: none; }
.elephants-gallery:focus-visible { outline: 2px solid var(--scene-ink); outline-offset: -4px; }
.elephants-gallery.is-navigating { scroll-snap-type: none; }
.elephants-gallery.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.elephants-artwork { --artwork-scale: .8; --mirage: 1; flex: 0 0 60vw; min-width: 0; margin: 0; scroll-snap-align: center; }
.elephants-artwork:first-child { --mirage: 0; --artwork-scale: .87; }
.elephants-artwork:nth-child(3) { --artwork-scale: 1; }
.elephants-image { position: relative; display: flex; align-items: flex-end; justify-content: center; height: var(--elephant-art-height); }
.elephants-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(78vw, 100%);
  max-height: calc(100% * var(--artwork-scale));
  object-fit: contain;
  -webkit-user-drag: none;
  opacity: calc(1 - var(--mirage) * .78);
  filter: blur(calc(var(--mirage) * 11px));
  transform: translateY(calc(var(--mirage) * -5px)) skewX(calc(var(--mirage) * -1.5deg));
}
.elephants-image::before,
.elephants-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(78vw, calc(var(--artwork-ratio) * var(--elephant-art-height) * var(--artwork-scale)));
  max-width: 100%;
  height: calc(100% * var(--artwork-scale));
  background: var(--mirage-image) center bottom / contain no-repeat;
  pointer-events: none;
  opacity: calc(var(--mirage) * .15);
  mix-blend-mode: normal;
  filter: blur(calc(2px + var(--mirage) * 6px)) hue-rotate(50deg);
  transform: translateX(calc(-50% + var(--mirage) * 15px)) skewX(calc(var(--mirage) * 2deg));
}
.elephants-image::after { filter: blur(calc(2px + var(--mirage) * 4px)) hue-rotate(-45deg); transform: translateX(calc(-50% - var(--mirage) * 13px)); }
/* Offset copies of the white lace read as a white tear, not a colour mirage. */
.elephants-artwork:nth-child(3) .elephants-image::before,
.elephants-artwork:nth-child(3) .elephants-image::after { display: none; }
.elephants-controls button {
  position: absolute;
  top: calc(18px + 8px + var(--elephant-art-height) / 2);
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 64px;
  border: 1px solid #ffffff22;
  border-radius: 24px;
  background: #ffffff0d;
  color: var(--scene-ink);
  font: 32px Georgia, serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s;
}
.elephants-prev { left: 12px; }
.elephants-next { right: 12px; }
.elephants-controls button:hover { background: #ffffff33; }
.elephants-controls button:disabled { opacity: .2; cursor: default; }
.elephants-position { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  .elephants-room { --elephant-art-height: clamp(260px, 54svh, 580px); margin-top: 90px; padding-top: 12px; }
  .elephants-gallery { padding-inline: 7vw; }
  .elephants-artwork { flex-basis: 86vw; }
  .elephants-heading { margin-top: 72px; }
  .elephants-controls button { top: calc(12px + 8px + var(--elephant-art-height) / 2); width: 40px; height: 56px; }
  .elephants-prev { left: 2px; }
  .elephants-next { right: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .elephants-controls button { transition: none; }
  .elephants-heading h1 { animation: none; }
  .elephants-image img { transform: none; }
}
