html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
  user-select: none;
  font-family: "Google Sans", "Product Sans", "Inter", "Segoe UI", Arial, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100vw;
  height: 100vh;
  background: transparent;
  cursor: grab;
}

#scene:active {
  cursor: grabbing;
}

.text-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  padding: clamp(10px, 1.8vw, 28px);
  background: #000;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.text-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.38) 64%, rgba(0, 0, 0, 0.72)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 34%, transparent 66%, rgba(0, 0, 0, 0.28));
}

.text-masonry {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(7px, 0.9vw, 16px);
  width: 100%;
  height: calc(100vh - clamp(20px, 3.6vw, 56px));
  overflow: hidden;
}

.text-block {
  --focus: 0;
  --pulse: 1;
  --pulse-duration: 900ms;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(2px, 0.45vw, 8px);
  color: rgba(244, 244, 244, 0.86);
  opacity: min(1, calc((0.1 + (var(--focus) * 0.9)) * var(--pulse)));
  transition: opacity var(--pulse-duration) ease-in-out;
}

.text-block h1,
.text-block h2,
.text-block p {
  margin: 0;
  letter-spacing: 0;
}

.text-block h1 {
  color: #fff;
  font-size: clamp(30px, 5vw, 88px);
  font-weight: 700;
  line-height: 0.78;
}

.text-block h2 {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(17px, 2.25vw, 42px);
  font-weight: 700;
  line-height: 0.8;
}

.text-block p {
  color: rgba(232, 232, 232, 0.72);
  font-size: clamp(10px, 0.98vw, 17px);
  font-weight: 500;
  line-height: 0.9;
}

.text-block--hero h1 {
  font-size: clamp(42px, 6.2vw, 118px);
}

.text-block--hero p {
  margin-top: clamp(4px, 0.7vw, 10px);
  color: rgba(255, 255, 255, 0.64);
  font-size: clamp(13px, 1.3vw, 23px);
  line-height: 0.9;
}

.text-block--headline h2 {
  color: #fff;
  font-size: clamp(24px, 3.4vw, 66px);
  line-height: 0.78;
}

.text-block--wide p {
  color: rgba(250, 250, 250, 0.82);
  font-size: clamp(14px, 1.55vw, 28px);
  line-height: 0.86;
}

.text-block--quiet {
  color: rgba(220, 220, 220, 0.5);
}

.text-block--small p {
  color: rgba(238, 238, 238, 0.56);
  font-size: clamp(9px, 0.78vw, 14px);
  line-height: 0.92;
}

.text-block--vertical {
  align-items: center;
  justify-content: center;
}

.text-block--vertical h2 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(20px, 2.6vw, 54px);
  line-height: 0.78;
}

.span-1 {
  grid-column: span 1;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.row-1 {
  grid-row: span 1;
}

.row-2 {
  grid-row: span 2;
}

.row-3 {
  grid-row: span 3;
}

.row-4 {
  grid-row: span 4;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

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

.lightbox img {
  display: block;
  max-width: min(88vw, 1040px);
  max-height: 88vh;
  border-radius: clamp(18px, 2vw, 34px);
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

@media (max-width: 980px) {
  .text-masonry {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(14, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .text-masonry {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(16, minmax(0, 1fr));
    gap: 7px;
  }
}
