* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg1:    #f8aaff;
  --bg2:    #aaf5ff;
  --shadow: 0 15px 40px rgba(0, 0, 0, .12);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
}

/* ── App shell ──────────────────────────────────────────────── */
#app {
  position: relative;   /* loader positions against this */
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

/* ── Viewer: gives the img a real sized box ─────────────────── */
#viewer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* overflow hidden so rounded corners clip correctly */
  overflow: hidden;
}

/* ── Loader ─────────────────────────────────────────────────── */
#loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #420;
  z-index: 10;
  backdrop-filter: blur(6px);
  /* Driven by JS via style.opacity / style.pointerEvents */
  opacity: 1;
  transition: opacity .4s ease;
}

/* ── CV image ───────────────────────────────────────────────── */
#cvImage {
  /* Fill the viewer box while respecting aspect ratio */
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;

  /* NO contain:strict — that requires an explicit size and hides the image */
  background: white;
  border-radius: 22px;
  box-shadow: var(--shadow);

  opacity: 0;
  transform: scale(.98);
  transition:
    opacity  .4s ease,
    transform .4s ease;
}

#cvImage.loaded {
  opacity: 1;
  transform: scale(1);
}

/* ── Footer toggle button ───────────────────────────────────── */
#footerToggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border: none;
  outline: none;
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 700;
  transition: transform .25s ease, box-shadow .5s ease;
  z-index: 100;
}

#footerToggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .48);
}

/* ── Footer panel ───────────────────────────────────────────── */
#footerPanel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 280px;
  max-width: 90vw;
  background: white;
  border-radius: 18px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, .18);
  padding: 18px 22px;
  transform: translateY(120%) scale(.8);
  opacity: 0;
  pointer-events: none;
  transition:
    transform .35s ease,
    opacity   .35s ease;
  z-index: 99;
}

#footerPanel.show {
  transform: translateY(-75px) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.footer-content {
  text-align: center;
  font-size: .95rem;
  font-weight: 600;
  color: #444;
  line-height: 1.5;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Let the app scroll vertically so the full A4 is reachable,
     and remove padding so the image edge-to-edges the screen   */
  html, body { overflow: hidden; }

  #app {
    padding: 0;
    /* Stack from the top; the image will be centered within
       the viewport height via the viewer flex below            */
    align-items: center;
    justify-content: center;
    /* Use dvh so the browser chrome doesn't push content down  */
    height: 100dvh;
  }

  /* Viewer takes the full safe viewport, centers its child     */
  #viewer {
    width: 100%;
    height: 100%;
    overflow: visible;          /* never clip the image         */
    align-items: center;
    justify-content: center;
  }

  /* Image: full width, height auto → natural A4 ratio.
     max-height keeps it inside the viewport on very short
     screens (landscape) so it never overflows.                 */
  #cvImage {
    width: 100%;
    height: auto;
    max-height: 100dvh;
    object-fit: contain;
    border-radius: 0;           /* edge-to-edge on mobile       */
    box-shadow: none;           /* no shadow needed edge-to-edge*/
  }

  #footerPanel  { min-width: 250px; }

  #footerToggle {
    width: 54px;
    height: 54px;
  }
}