/* ==========================================================
   Lens — floating tile board
   Replaces the old sb-pillar layouts. Tiles float on a single
   canvas; hovering surfaces the relevant tag/headline/body in
   the centre reveal panel.
   ========================================================== */

.lens-board {
  position: relative;
  border-top: 1px solid var(--rule);
  padding: 96px 64px 120px;
  overflow: hidden;
  max-width: 1500px;
  margin: 0 auto;
}

.lens-intro {
  max-width: 720px;
  margin-bottom: 32px;
}
.lens-intro .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 24px;
}
.lens-intro h2 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 400;
  font-size: clamp(48px, 7vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--paper);
}
.lens-intro h2 em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.lens-intro .lens-lead {
  margin-top: 24px;
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--paper-dim);
  max-width: 50ch;
}

/* ---------- Stage ---------- */
.lens-stage {
  position: relative;
  width: 100%;
  height: 720px;
  margin-top: 24px;
}

/* ---------- Centre reveal panel ---------- */
.lens-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 6;          /* above tiles so it's always readable */
  padding: 0 32px;
}
.lens-reveal-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--paper-dim);
  margin-bottom: 24px;
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
.lens-reveal-tag em { color: var(--accent); font-style: normal; }
.lens-reveal-head {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 8vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--accent);
  max-width: 16ch;
  text-shadow: 0 4px 24px rgba(0,0,0,0.55);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
}
.lens-reveal-body {
  margin-top: 24px;
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--paper);
  max-width: 44ch;
  text-shadow: 0 2px 16px rgba(0,0,0,0.55);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
}

/* fade in on swap */
.lens-reveal.swap .lens-reveal-tag,
.lens-reveal.swap .lens-reveal-head,
.lens-reveal.swap .lens-reveal-body {
  opacity: 0;
  transform: translateY(8px);
}


/* Hide mobile-only text by default — surfaced via media query */
.lens-mobile-text { display: none; }

/* ---------- Tiles ---------- */
.lens-tile {
  position: absolute;
  display: block;
  cursor: pointer;
  z-index: 3;
  transition:
    transform 0.6s cubic-bezier(0.2,0.8,0.2,1),
    opacity 0.4s ease,
    filter 0.4s ease,
    box-shadow 0.4s ease;
  filter: saturate(0.92);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(242,235,216,0.16);
}
.lens-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lens-tile .lens-cap {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--paper);
  background: rgba(0, 0, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 5px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s;
}

/* Tile placement — Hubble centred above the headline, others at perimeter */
.lens-tile.lt-01 { top: 0%; left: 50%; width: 12%; margin-left: -6%; aspect-ratio: 4/3; transform: rotate(-2deg); }
.lens-tile.lt-02 { top: 4%;  right: 1%;  width: 22%; aspect-ratio: 16/10; transform: rotate(3deg); }
.lens-tile.lt-03 { top: 2%;  left: 1%;   width: 19%; aspect-ratio: 3/4;   transform: rotate(-3deg); }
.lens-tile.lt-04 { bottom: 4%; left: 1%; width: 16%; aspect-ratio: 3/4;   transform: rotate(2deg); }
.lens-tile.lt-05 { bottom: 2%; right: 1%; width: 24%; aspect-ratio: 16/10; transform: rotate(-2deg); }

/* Hover state — dim aggressively so the centre text dominates */
.lens-stage.is-hovering .lens-tile {
  opacity: 0.22;
  filter: saturate(0.4) blur(2px);
}
.lens-stage.is-hovering .lens-tile.is-active {
  opacity: 1;
  filter: saturate(1.05) blur(0);
  box-shadow: 0 50px 110px rgba(0,0,0,0.7);
  z-index: 4;
}
.lens-tile.is-active .lens-cap { opacity: 1; transform: translateY(0); }

/* Lift active tiles slightly */
.lens-tile.lt-01.is-active { transform: rotate(0) scale(1.04) translateY(-6px); }
.lens-tile.lt-02.is-active { transform: rotate(0) scale(1.04) translateY(-6px); }
.lens-tile.lt-03.is-active { transform: rotate(0) scale(1.06) translateY(-6px); }
.lens-tile.lt-04.is-active { transform: rotate(0) scale(1.05) translateY(-6px); }
.lens-tile.lt-05.is-active { transform: rotate(0) scale(1.04) translateY(-6px); }

/* In-view entry */
.lens-stage .lens-tile {
  opacity: 0;
  animation: lensTileIn 1.1s cubic-bezier(0.2,0.8,0.2,1) forwards;
}
.lens-tile.lt-01 { animation-delay: 0.05s; }
.lens-tile.lt-02 { animation-delay: 0.18s; }
.lens-tile.lt-03 { animation-delay: 0.32s; }
.lens-tile.lt-04 { animation-delay: 0.46s; }
.lens-tile.lt-05 { animation-delay: 0.6s; }

@keyframes lensTileIn {
  from { opacity: 0; transform: scale(0.9) rotate(0deg) translateY(20px); }
  to   { opacity: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .lens-board {
    padding: 72px 24px 96px;
    overflow: visible;
  }
  .lens-intro { margin-bottom: 24px; }

  /* Stage becomes a vertical stack of cards. Reveal panel hidden — cards carry their own copy. */
  .lens-stage {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 16px;
  }
  .lens-reveal { display: none; }

  /* Hide secondary Altair tile — Messi alone represents sport & gaming */
  .lens-tile.lt-05 { display: none; }

  .lens-tile {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    aspect-ratio: auto !important;
    animation: none !important;
    opacity: 1 !important;
    filter: saturate(0.95) !important;
    border-radius: 8px;
    box-shadow: 0 24px 56px rgba(0,0,0,0.4);
    overflow: hidden;
    background: rgba(0,0,0,0.18);
  }
  .lens-tile img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-bottom: 1px solid rgba(242,235,216,0.12);
  }
  .lens-tile.lt-03 img { aspect-ratio: 3/4; }
  .lens-tile.lt-04 img { aspect-ratio: 3/4; }
  .lens-tile .lens-cap { display: none; }

  /* Mobile text panel — visible, styled as card body */
  .lens-mobile-text {
    display: block;
    padding: 24px 22px 28px;
  }
  .lens-mtag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--paper-dim);
    margin-bottom: 16px;
  }
  .lens-mtag em {
    color: var(--accent);
    font-style: normal;
  }
  .lens-mhead {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 400;
    font-size: clamp(28px, 7.5vw, 44px);
    line-height: 1.0;
    letter-spacing: -0.025em;
    color: var(--paper);
    margin-bottom: 14px;
  }
  .lens-mhead em {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
  }
  .lens-mbody {
    font-family: 'Inter Tight', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--paper);
    opacity: 0.9;
  }

  /* Disable hover dim on mobile entirely */
  .lens-stage.is-hovering .lens-tile,
  .lens-stage.is-hovering .lens-tile.is-active {
    opacity: 1 !important;
    filter: saturate(0.95) !important;
    transform: none !important;
  }
}
