:root{
  --pad-x: 24px;
  --pad-top: 28px;
  --pad-bottom: 26px;
}

/* Reset */
*{
  box-sizing: border-box;
}

html, body{
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;                /* anti-website: no scrolling */
  font-family: Helvetica, Arial, sans-serif;
  background: transparent;
}

/* --------------------------
   CUSTOM CURSOR (DESKTOP ONLY)
   - Adjust hotspot if needed
   -------------------------- */
@media (hover: hover){
  html{
    cursor: url("cursor.png") 8 8, auto;
  }

  a, button, [role="button"]{
    cursor: url("cursor.png") 8 8, pointer;
  }

  /* ensure the iframe area uses the custom cursor too */
  .flipbook{
    cursor: url("cursor.png") 8 8, auto;
  }
}

/* Lock page as a single object: header + flipbook + footer */
body{
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
}

/* Sequenced fade-in */
.fade-seq{
  opacity: 0;
  transform: translateY(10px);
  animation: riseFade 0.9s cubic-bezier(0.2, 0, 0.1, 1) forwards;
}

.fade-1{ animation-delay: 0.05s; }
.fade-2{ animation-delay: 0.22s; }
.fade-3{ animation-delay: 0.38s; }

@keyframes riseFade{
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header (non-interactive) */
.topbar{
  padding: var(--pad-top) var(--pad-x) 2px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

/* Handwritten header image */
.header-mark{
  width: min(280px, 70vw);
  height: auto;
  display: block;
}

/* Stage: only interactive zone */
.stage{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad-x);
}

/* Flipbook iframe (unchanged) */
.flipbook{
  width: min(1200px, 100%);
  height: 78vh;
  border: none;
  display: block;
}

/* Footer icon row */
.footer-mark{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 10px var(--pad-x) var(--pad-bottom);
}

/* Clickable side icons */
.icon-link{
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-link img{
  width: 26px;
  height: auto;
  opacity: 0.8;
  display: block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.icon-link:hover img{
  opacity: 1;
  transform: translateY(-1px);
}

/* Center logo mark (non-interactive) */
.center-mark{
  width: 30px;
  height: auto;
  opacity: 0.75;
  display: block;
  pointer-events: none;
}

/* --------------------------
   MOBILE ONLY (your working layout)
   -------------------------- */
@media (max-width: 520px){
  :root{
    --pad-x: 18px;
    --pad-top: 14px;
    --pad-bottom: 13px;
  }

  .header-mark{
    width: min(140px, 42vw);
  }

  .topbar{
    padding: var(--pad-top) var(--pad-x) 1px;
  }

  /* Footer lifted above Safari bar */
  .footer-mark{
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    z-index: 1000;

    padding: 8px var(--pad-x);
    gap: 18px;
  }

  /* Reserve footer space so flipbook centers between header + footer */
  .stage{
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .icon-link img{
    width: 22px;
  }

  .center-mark{
    width: 24px;
    opacity: 0.72;
  }
}
