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

html, body {
  background: #fff;
  color: #111;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 3px;
  transition: background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
a:hover { background-size: 100% 1px; }
img { display: block; max-width: 100%; }

/* ---------- Top nav (centered) ---------- */
.topnav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.25rem 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  background: #fff;
  font-weight: 400;
}
.topnav .brand {
  font-family: 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  font-weight: 200;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  line-height: 1;
  display: none; /* desktop hides brand in nav (shown in hero sides) */
}
.topnav .brand.brand-left { justify-self: start; }
.topnav .brand.brand-right { justify-self: end; }
.topnav .links {
  display: flex;
  gap: 1.75rem;
  justify-self: center;
  grid-column: 2;
}
.topnav .links button {
  background: none;
  border: 0;
  padding: 0 0 3px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.topnav .links button::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.topnav .links button.active::after,
.topnav .links button:hover::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.hero .side {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
  font-family: 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  font-weight: 200;
  font-style: normal;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 1.8vw, 2rem);
  letter-spacing: -0.005em;
  line-height: 1;
}

.hero .frame {
  flex: 0 1 auto;
  max-width: min(70vw, 1000px);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  min-height: 0;
}

.hero .diptych {
  display: flex;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  cursor: pointer;
  position: relative;
}
.hero .diptych.zone-left {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath d='M48 12 L12 12 L20 4 M12 12 L20 20' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, pointer;
}
.hero .diptych.zone-right {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath d='M0 12 L36 12 L28 4 M36 12 L28 20' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 36 12, pointer;
}
.hero .diptych .panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  min-width: 0;
  overflow: hidden;
}
.hero .diptych .slide-stack {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero .diptych .slide-layer {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(0.992) translateX(0);
  transition:
    opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
  pointer-events: none;
}
.hero .diptych .slide-layer.is-active {
  opacity: 1;
  transform: scale(1) translateX(0);
  z-index: 1;
}
.hero .diptych .slide-layer.is-leaving {
  opacity: 0;
  transform: scale(0.988) translateX(0);
}
.hero .diptych.dir-next .slide-layer.is-leaving {
  transform: scale(0.988) translateX(-14px);
}
.hero .diptych.dir-next .slide-layer.is-entering {
  transform: scale(1) translateX(0);
}
.hero .diptych.dir-prev .slide-layer.is-leaving {
  transform: scale(0.988) translateX(14px);
}
.hero .diptych.dir-prev .slide-layer.is-entering {
  transform: scale(1) translateX(0);
}
.hero .diptych.dir-next .slide-layer.is-entering {
  opacity: 0;
  transform: scale(0.992) translateX(18px);
}
.hero .diptych.dir-prev .slide-layer.is-entering {
  opacity: 0;
  transform: scale(0.992) translateX(-18px);
}
@media (prefers-reduced-motion: reduce) {
  .hero .diptych .slide-layer {
    transition: opacity 0.2s ease;
    animation: none !important;
  }
  .hero .diptych .slide-layer.is-leaving,
  .hero .diptych.dir-next .slide-layer.is-leaving,
  .hero .diptych.dir-prev .slide-layer.is-leaving {
    transform: none;
  }
}

/* Hero caption (design mode only) */
.hero .hero-caption {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.005em;
  color: #111;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.hero.show-caption .hero-caption { opacity: 1; }

/* Swipe hint (mobile) — editorial viewfinder over image */
.swipe-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  pointer-events: none;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.swipe-hint::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  border: 1px solid #fff;
  mix-blend-mode: difference;
  opacity: 0.7;
  animation: viewfinderPulse 2.8s ease-in-out infinite;
}
.swipe-hint .label {
  position: relative;
  z-index: 1;
  font-family: 'Helvetica Neue', Helvetica, 'Inter', Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 200;
  letter-spacing: 0.32em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
  animation: swipeLabelPulse 2.8s ease-in-out infinite;
}
.swipe-hint .line {
  position: relative;
  z-index: 1;
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1px solid #fff;
  border-right: 1px solid #fff;
  background: none;
  mix-blend-mode: difference;
  opacity: 0.85;
}
.swipe-hint .line:first-of-type {
  transform: rotate(-135deg);
  animation: swipeChevronLeft 2.8s ease-in-out infinite;
}
.swipe-hint .line:last-of-type {
  transform: rotate(45deg);
  animation: swipeChevronRight 2.8s ease-in-out infinite;
}
.swipe-hint.dismissed {
  opacity: 0;
  visibility: hidden;
}
.swipe-hint.dismissed::before,
.swipe-hint.dismissed .line,
.swipe-hint.dismissed .label {
  animation: none;
}
@keyframes viewfinderPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.02); }
}
@keyframes swipeLabelPulse {
  0%, 100% { opacity: 0.65; letter-spacing: 0.32em; }
  50%      { opacity: 1; letter-spacing: 0.36em; }
}
@keyframes swipeChevronLeft {
  0%, 100% { transform: rotate(-135deg) translate(0, 0); opacity: 0.45; }
  50%      { transform: rotate(-135deg) translate(-5px, 0); opacity: 1; }
}
@keyframes swipeChevronRight {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.45; }
  50%      { transform: rotate(45deg) translate(5px, 0); opacity: 1; }
}
.hero .hero-caption .tag {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bbb;
}
.hero .hero-caption a {
  border-bottom: 1px solid #111;
  padding-bottom: 1px;
  transition: opacity 0.2s;
}
.hero .hero-caption a:hover { opacity: 0.55; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Footer ---------- */
.footstrip {
  flex: 0 0 auto;
  padding: 1.25rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: #111;
}
.footstrip .left  { justify-self: start; }
.footstrip .right { justify-self: end; }
.footstrip a { color: inherit; }

/* Credits hover swap */
.credits {
  display: inline-grid;
  grid-template-areas: "stack";
  cursor: default;
}
.credits .short,
.credits .full {
  grid-area: stack;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.credits .short { opacity: 1; transform: translateY(0); }
.credits .full  { opacity: 0; transform: translateY(3px); }
.credits:hover .short { opacity: 0; transform: translateY(-3px); }
.credits:hover .full  { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  html, body {
    height: 100%;
    height: 100dvh;
  }

  .topnav {
    padding: 0.85rem 1rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
    font-size: 0.8rem;
    font-weight: 200;
  }
  .topnav .brand { display: block; font-size: 0.8rem; font-weight: 200; }
  .topnav .links { gap: 1.1rem; font-size: 0.8rem; }

  .hero {
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: stretch;
    align-items: stretch;
    padding: 0.35rem 0 0;
    gap: 0;
    min-height: 0;
    text-align: center;
  }
  .hero .side { display: none; }

  .hero .frame {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    padding: 0 0.85rem;
    justify-content: center;
    gap: 0.5rem;
  }

  .hero .diptych {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    cursor: zoom-in;
    align-items: center;
    justify-content: center;
  }

  .hero .diptych .panel {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
  }

  .hero .diptych .slide-stack {
    width: 100%;
    height: 100%;
  }

  .hero .diptych .slide-layer {
    position: absolute;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 9.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    object-fit: contain;
    object-position: center;
    left: 50%;
    transform: translateX(-50%) scale(0.992);
  }

  .hero .diptych .slide-layer.is-active {
    transform: translateX(-50%) scale(1);
  }

  .hero .diptych.dir-next .slide-layer.is-leaving {
    transform: translateX(calc(-50% - 14px)) scale(0.988);
  }

  .hero .diptych.dir-prev .slide-layer.is-leaving {
    transform: translateX(calc(-50% + 14px)) scale(0.988);
  }

  .hero .diptych.dir-next .slide-layer.is-entering {
    opacity: 0;
    transform: translateX(calc(-50% + 18px)) scale(0.992);
  }

  .hero .diptych.dir-prev .slide-layer.is-entering {
    opacity: 0;
    transform: translateX(calc(-50% - 18px)) scale(0.992);
  }

  .hero .hero-caption {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 0 0.15rem 0.25rem;
    font-size: 0.72rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
  }

  .hero:not(.show-caption) .hero-caption {
    display: none;
  }

  .hero.show-caption .hero-caption {
    display: flex;
    opacity: 1;
  }

  .swipe-hint { display: flex; }

  .footstrip {
    flex: 0 0 auto;
    font-weight: 200;
    font-size: 0.78rem;
    padding: 0.85rem 1rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    text-align: center;
  }
  .footstrip .left  { justify-self: start; }
  .footstrip .right { justify-self: end; }
  .footstrip .center { justify-self: center; }

  /* Touch: show full credits text on tap-friendly strip */
  .credits .short { opacity: 1; transform: none; }
  .credits .full  { opacity: 0; transform: translateY(3px); }
  .credits:active .short,
  .credits:focus-within .short { opacity: 0; transform: translateY(-3px); }
  .credits:active .full,
  .credits:focus-within .full  { opacity: 1; transform: translateY(0); }
}
