:root {
  --shape-size: clamp(320px, min(35vw, 68vh), 640px);
  --ink: #050505;
  --soft-ink: rgba(5, 5, 5, 0.54);
  --paper: #fff;
  --fast: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Quicksand", system-ui, sans-serif;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.045);
}

.page-backdrop {
  position: fixed;
  inset: -9vmax;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-backdrop-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(30px);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 520ms ease;
}

.page-backdrop-layer.is-active {
  opacity: 0.4;
}

button {
  font: inherit;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #fff;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.loader span {
  width: 1px;
  height: 52px;
  background: #050505;
  transform-origin: center;
  animation: loader-turn 920ms var(--fast) infinite;
}

.loader-message {
  max-width: min(460px, 82vw);
  margin: 0;
  color: rgba(5, 5, 5, 0.72);
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

@keyframes loader-turn {
  0% {
    transform: scaleY(0.45);
    opacity: 0.25;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }

  100% {
    transform: scaleY(0.45);
    opacity: 0.25;
  }
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 520ms ease;
}

body.is-ready .app {
  opacity: 1;
}

body.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.shape-switcher {
  position: fixed;
  top: clamp(16px, 3vh, 32px);
  left: 50%;
  z-index: 12;
  display: grid;
  grid-template-columns: 42px 68px 42px;
  align-items: center;
  gap: 16px;
  transform: translateX(-50%);
}

.shape-icon-button,
.switch-track,
.lightbox-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.shape-icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  opacity: 0.56;
  transition: opacity 180ms ease, transform 180ms ease;
}

.shape-icon-button.is-active {
  opacity: 1;
}

.shape-icon-button:focus-visible,
.switch-track:focus-visible,
.lightbox-close:focus-visible {
  outline: 1px solid #050505;
  outline-offset: 5px;
}

.shape-icon-button:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

.switch-track {
  position: relative;
  width: 68px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(5, 5, 5, 0.22);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.035);
}

.switch-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #050505;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
  transition: transform 240ms var(--fast);
}

body[data-shape="ico"] .switch-knob {
  transform: translateX(38px);
}

.shape-symbol {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.08));
}

.gallery-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 30vw 40vw 30vw;
  align-items: center;
  overflow: visible;
}

.copy-column {
  position: relative;
  height: var(--shape-size);
  display: flex;
  align-items: center;
  overflow: visible;
  z-index: 2;
}

.copy-column-left {
  grid-column: 1;
  justify-content: flex-end;
  padding-left: clamp(24px, 4vw, 72px);
  padding-right: clamp(24px, 3.2vw, 64px);
}

.copy-column-right {
  grid-column: 3;
  justify-content: flex-start;
  padding-left: clamp(24px, 3.2vw, 64px);
  padding-right: clamp(24px, 4vw, 72px);
}

.copy-panel {
  position: absolute;
  width: min(24vw, 420px);
  height: var(--shape-size);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.2vh, 32px);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.copy-column-left .copy-panel {
  right: clamp(24px, 3.2vw, 64px);
}

.copy-column-right .copy-panel {
  left: clamp(24px, 3.2vw, 64px);
}

.copy-panel.is-active {
  opacity: 1;
}

.copy-panel h1,
.mobile-copy-panel h1 {
  margin: 0;
  font-size: clamp(2.07rem, 3.6vw, 4.4rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: 0;
}

.copy-panel p,
.mobile-copy-panel p {
  margin: 0;
  color: rgba(5, 5, 5, 0.74);
  font-size: clamp(1.05rem, 1.25vw, 1.42rem);
  font-weight: 400;
  line-height: 1.66;
}

.copy-panel small,
.mobile-copy-panel small {
  align-self: flex-end;
  color: rgba(5, 5, 5, 0.27);
  font-size: clamp(0.7rem, 0.75vw, 0.86rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-part {
  display: block;
  will-change: transform;
}

.stage-column {
  position: fixed;
  inset: 0;
  grid-column: 2;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: visible;
  z-index: 1;
  pointer-events: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mobile-copy {
  display: none;
}

.scroll-capture {
  position: fixed;
  top: 0;
  right: 10px;
  z-index: 18;
  width: 20px;
  height: 100vh;
  cursor: ns-resize;
  touch-action: none;
}

.scroll-rail {
  position: absolute;
  top: 0;
  right: 10px;
  width: 1px;
  height: 100%;
  background: rgba(5, 5, 5, 0.14);
}

.scroll-thumb {
  position: absolute;
  top: 0;
  right: 10px;
  width: 1px;
  height: max(44px, calc(100vh / 20));
  background: #050505;
  transform: translateY(0);
  transition: transform 180ms var(--fast), height 180ms ease;
}

.scroll-counter {
  position: absolute;
  top: 0;
  right: 22px;
  transform: translateY(0) rotate(-90deg);
  transform-origin: center;
  color: rgba(5, 5, 5, 0.36);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: transform 180ms var(--fast);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-frame {
  width: min(88vw, 1180px);
  max-height: 86vh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
}

.lightbox-frame img {
  width: 100%;
  max-height: calc(86vh - 130px);
  object-fit: contain;
  display: block;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.14);
}

.lightbox-frame figcaption {
  display: grid;
  gap: 10px;
  text-align: center;
}

.lightbox-frame strong {
  font-size: clamp(1.45rem, 2vw, 2.35rem);
  font-weight: 600;
}

.lightbox-frame span {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(5, 5, 5, 0.67);
  font-size: clamp(0.96rem, 1.2vw, 1.18rem);
  line-height: 1.55;
}

.lightbox-close {
  position: fixed;
  top: clamp(16px, 3vw, 34px);
  right: clamp(18px, 3vw, 38px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #050505;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

@media (max-width: 768px) {
  :root {
    --shape-size: min(95vw, 56vh);
  }

  .shape-switcher {
    top: 14px;
    gap: 12px;
    grid-template-columns: 38px 64px 38px;
  }

  .gallery-shell {
    height: auto;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding-top: 66px;
  }

  .copy-column {
    display: none;
  }

  .stage-column {
    position: relative;
    inset: auto;
    grid-column: auto;
    height: auto;
    min-height: var(--shape-size);
    align-content: center;
    padding: 10px 0 20px;
    pointer-events: auto;
  }

  .stage {
    width: var(--shape-size);
    height: var(--shape-size);
  }

  .mobile-copy {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 10;
    width: min(88vw, 520px);
    min-height: clamp(146px, 26vh, 220px);
    margin: 0 auto clamp(18px, 3vh, 28px);
    display: block;
    overflow: visible;
    transform: none;
  }

  .mobile-copy-panel {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    will-change: transform;
  }

  .mobile-copy-panel.is-active {
    opacity: 1;
  }

  .mobile-copy-panel h1 {
    font-size: clamp(1.37rem, 8vw, 2.73rem);
    line-height: 0.9;
  }

  .mobile-copy-panel p {
    font-size: clamp(0.9rem, 3.8vw, 1.05rem);
    line-height: 1.48;
  }

  .mobile-copy-panel small {
    justify-self: end;
    font-size: 0.68rem;
  }

  .scroll-capture {
    display: none;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-frame {
    width: 94vw;
    gap: 18px;
  }
}

@media (max-height: 680px) and (min-width: 769px) {
  :root {
    --shape-size: min(35vw, 62vh);
  }

  .copy-panel h1 {
    font-size: clamp(2.5rem, 4.5vw, 5rem);
  }

  .copy-panel p {
    font-size: clamp(0.92rem, 1.1vw, 1.2rem);
    line-height: 1.55;
  }
}
