@property --title-reveal {
  syntax: '<percentage>';
  initial-value: -10%;
  inherits: false;
}

.card-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 10px 20px;
  color: var(--color-card-title);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-mask-image: linear-gradient(to right, black var(--title-reveal), transparent calc(var(--title-reveal) + 12%));
  mask-image: linear-gradient(to right, black var(--title-reveal), transparent calc(var(--title-reveal) + 12%));
  animation: title-reveal 1.4s cubic-bezier(0.25, 0, 0.35, 1) 0.9s forwards;
}

@keyframes title-reveal {
  from { --title-reveal: -10%; }
  to   { --title-reveal: 108%; }
}

.container {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.container > a {
  flex: 1;
  align-self: stretch;
  min-width: 0;
  padding-bottom: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.photo {
  max-width: 100%;
  max-height: 100%;
  display: block;
  cursor: zoom-in;
  pointer-events: auto;
}

.photo--recto {
  view-transition-name: photo;
  animation: ken-burns 10s ease-out 0.9s both;
}

@media (orientation: portrait) and (max-width: 599px) {
  .photo {
    max-height: 65vh;
  }
}

@media (orientation: portrait) and (min-width: 600px) {
  .photo {
    max-width: 85vw;
    max-height: 75vh;
  }
}

/* Smartphone landscape — nav moves to a vertical pill on the right (see
   navigation.css), so the card no longer needs the upward shift that made
   room for a bottom nav. It centers vertically instead, with room reserved
   on the right for the nav pill. */
@media (orientation: landscape) and (max-height: 500px) {
  .container > a {
    padding-bottom: 0;
    padding-right: calc(50px + 24px + 26px + 24px);
  }

  /* No good spot for the title bar at this size — rotated along the left
     edge still crowded the card, so it's hidden here rather than repositioned. */
  .card-title {
    display: none;
  }
}

@keyframes ken-burns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

#jump-control {
  display: flex;
  align-items: center;
  overflow: hidden;
  view-transition-name: jump-control;
}

nav.share-mode #jump-control { display: none; }

#jump-input {
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--color-text);
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
  outline: none;
  transition: width 0.22s ease;
  cursor: default;
  padding: 0;
}

#jump-input::placeholder {
  color: var(--color-text);
  opacity: 1;
}

#jump-control.open #jump-input {
  width: 60px;
  cursor: text;
}

#jump-control.open #jump-input::placeholder {
  opacity: 0.3;
}

#jump-input::-webkit-outer-spin-button,
#jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#jump-go {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  max-width: 0;
  overflow: hidden;
  padding: 0;
  transition: max-width 0.22s ease;
}

#jump-control.open #jump-go {
  max-width: 36px;
  padding-right: 8px;
}

#jump-go:hover { opacity: 0.6; }
