/* amittechguy.in, world view: panels as cards over the world, markers, Next and Back.
   exhibits.js marks the .beat the visitor is at with `on`; its .panel (in the hero: .hero-text) is the card.
   What a card looks like (colours, type, the sign, the stepper's buttons) is in world.css, section "3D view". */
.gl main, .gl .stepper { display: none; }           /* until exhibits.js is up (html.ex-on); never under the screenshot camera */
.gl.ex-on main { display: block; }
.gl.ex-on .stepper { display: flex; }
.gl .contact footer, .gl .first { display: none; }  /* the page's foot and the plain portrait belong to the simple view */

.gl .beat {
  --gap: clamp(12px, 2.4vw, 28px);
  position: fixed; z-index: 10; left: var(--gap); bottom: var(--gap);
  width: min(540px, 46vw); max-height: calc(100svh - var(--bar) - var(--gap) - 12px); /* under the top bar; a taller card scrolls inside itself */
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 0; padding: 0; overflow: visible;
  visibility: hidden; pointer-events: none;         /* a hidden card takes no focus; the empty part of the box lets clicks through to the world */
}
.gl .beat.on { visibility: visible; animation: card-in .24s ease; }
@keyframes card-in { from { opacity: 0; translate: 0 10px; } }
.gl .panel, .gl .hero-text { pointer-events: auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* the hero's card is built from the hero's own words: the wrappers step aside, the tour's button comes after the introduction */
.gl .hero-grid, .gl .hero .lead { display: contents; }
.gl .hero-text { display: flex; flex-direction: column; align-items: flex-start; }
.gl .hero-text .ride { order: 1; }
.gl .hero-text .change { order: 2; margin-top: 16px; }

.beat > .more { display: none; }                    /* the button that opens a phone's sheet */
@media (max-width: 859px) {
  /* phones: a sheet above the stepper. Closed it shows down to its heading (--peek, measured by exhibits.js); one tap opens it. */
  .gl .beat { left: 8px; right: 8px; bottom: var(--pin); width: auto; max-height: calc(100svh - var(--bar) - var(--pin) - 10px); align-items: stretch; }
  .gl .beat:not(.open, .whole) :is(.panel, .hero-text) { max-height: calc(var(--peek, 110px) + 46px); overflow: hidden; }
  .gl .beat.open :is(.panel, .hero-text) { padding-bottom: 58px; }
  .gl .beat > .more {
    display: block; order: 1; position: relative; flex: none; height: 52px; margin: -53.5px 1.5px 1.5px; padding: 24px 16px 8px;
    border: 0; border-radius: 0 0 8.5px 8.5px; text-align: left; cursor: pointer; pointer-events: auto;
    font: inherit; font-weight: 720; font-size: .95rem; line-height: 20px; color: var(--ink);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 46%);
  }
  .gl .beat > .more::after { content: ""; display: inline-block; width: .5em; height: .5em; margin: 0 0 .16em .5em; border: solid currentColor; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
  .gl .beat.whole > .more { display: none; }
  .gl .beat.open > .more { height: 44px; margin-top: -45.5px; padding-top: 12px; background: #fff; box-shadow: 0 -1.5px 0 var(--rule); }
  .gl .beat.open > .more::after { transform: rotate(-135deg); margin-bottom: -.1em; }
  .gl .beat:has(> .sign) > .more { margin: -52px 0 0; border-radius: 0 0 10px 10px; color: var(--on, #fff); background: linear-gradient(to bottom, transparent, var(--line) 46%); }
  .gl .beat.open:has(> .sign) > .more { margin-top: -44px; background: var(--line); box-shadow: none; }
  .gl .beat.open > .sign { padding-bottom: 40px; }
}

@media print { /* on paper: no world, the cards one after another */
  html.gl, .gl body { height: auto; overflow: visible; }
  #life, .gl .stepper { display: none !important; }
  .gl main { display: block; }
  .gl .beat { position: static; visibility: visible; width: auto; max-height: none; margin-bottom: 12px; animation: none; }
  .gl .beat :is(.panel, .hero-text) { max-height: none !important; overflow: visible !important; }
  .gl .beat > .more { display: none; }
}
