/* ==========================================================================
   zejneba.com — Project overlay (home page)
   --------------------------------------------------------------------------
   Opening a project card on the home page grows the card into this
   full-screen sheet; inside are that project's screens from work.html,
   stacking like on the work page (css/work.css, js/work.js). It has its own
   link (?project=stokr). Built by js/project-sheet.js.

   1. Sheet
   2. Close button
   3. End of the sheet: next project, all work
   4. Shared link: page waits hidden until the sheet is up
   ========================================================================== */


/* 1. Sheet
   ========================================================================== */

.project-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sheet-bg);
}

/* The card colour with its logo: what the card grows into, and what covers
   the sheet while the screens load or the next project comes in */
.project-sheet__cover {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  background: var(--sheet-bg);
  pointer-events: none;
}

.project-sheet__logo {
  max-width: 56%;
  height: auto;
}

.project-sheet .work-stack {
  padding-bottom: 0;
}


/* 2. Close button
   ========================================================================== */

.project-sheet__close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3;
  background: var(--base-white);
  box-shadow: var(--shadow-raised);
}


/* 3. End of the sheet
   ========================================================================== */

.project-sheet__end {
  position: relative;
  z-index: 1;   /* above the last sticky card */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 120px 24px 140px;
  background: var(--base-white);
  color: var(--base-black);
  text-align: center;
}

.project-sheet__eyebrow {
  color: var(--neutral-muted);
}

.project-sheet__next {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.project-sheet__next z-icon {
  --icon-size: 40px;
  transition: translate var(--duration-base) var(--ease-out);
}

@media (hover: hover) {
  .project-sheet__next:hover z-icon {
    translate: 8px 0;
  }
}

.project-sheet__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}


/* 4. Shared link (?project=…): the head script in index.html hides the page
      until the sheet is up, so the home page never flashes first
   ========================================================================== */

.project-opening body {
  background: var(--base-white);
}

.project-opening .page,
.project-opening .intro-screen {
  visibility: hidden;
}


@media (max-width: 760px) {
  .project-sheet__close {
    top: 16px;
    right: 16px;
  }

  .project-sheet__end {
    padding: 80px 16px 96px;
  }

  /* Room for the close button above the first screen */
  .project-sheet .work-card:first-child .work-card__inner {
    padding-top: 88px;
  }
}
