/* ==========================================================================
   Hover Image Expandable
   - Center double rails BEHIND images
   - Smooth GSAP accordion
   - Corners + nav above images
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  overflow: hidden;
}

/* ── Rails — behind images ───────────────────────────────────────────────── */

.rails {
  --line: #ffffff;
  --line-w: 1.5px;
  --rail-gap: 5px;

  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  z-index: 0; /* BEHIND gallery */
  pointer-events: none;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: var(--rail-gap);
  will-change: transform, width;
}

.rails__line {
  display: block;
  width: var(--line-w);
  height: 100%;
  background: var(--line);
  opacity: 0.95;
  flex: 0 0 auto;
}

/* ── Gallery — above rails ───────────────────────────────────────────────── */

.gallery {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: min(1400px, 100%);
  height: min(72vh, 620px);
}

.panel {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  cursor: pointer;
  background: #0c0c0c;
  will-change: width;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.panel:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
  z-index: 3;
}

.panel__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
}

.panel__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  transform: scale(1.08);
  filter: grayscale(1) brightness(0.82);
  user-select: none;
  pointer-events: none;
  will-change: transform, filter;
}

.panel.is-active .panel__img {
  filter: grayscale(0) brightness(1);
}

/* ── Chrome — corners + nav above images ─────────────────────────────────── */

.chrome {
  --line: #ffffff;
  --corner: 22px;

  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  will-change: transform, width;
}

.chrome__box {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.chrome__corner {
  position: absolute;
  width: var(--corner);
  height: var(--corner);
  border: 0 solid var(--line);
  opacity: 0.95;
}

.chrome__corner--tl {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
}

.chrome__corner--tr {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
}

.chrome__corner--bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.chrome__corner--br {
  bottom: 0;
  right: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.chrome__meta {
  position: absolute;
  left: 50%;
  transform: translateX(12px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: auto;
  color: #fff;
}

.chrome__name {
  display: flex;
  flex-direction: column;
  gap: 7px;
  user-select: none;
  margin-bottom: 4px;
}

.chrome__name span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0.92;
}

.chrome__nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chrome__nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.chrome__nav a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .gallery {
    gap: 4px;
    height: min(58vh, 460px);
  }

  .rails {
    --rail-gap: 4px;
  }

  .chrome {
    --corner: 14px;
  }

  .chrome__nav a {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .chrome__meta {
    gap: 6px;
  }
}
