:root {
  color-scheme: light;
  --rix-blue: #173c88;
  --rix-blue-dark: #0b2d68;
  --rix-red: #ec2d36;
  --menu-width: 220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; background: #d7dbe1; }
body { font-family: Arial, Helvetica, sans-serif; }

.profile { width: min(100%, 1167px); margin: 0 auto; }
.profile-page { margin: 0; padding: 0; scroll-margin-top: 0; }
.profile-page img { display: block; width: 100%; height: auto; margin: 0; padding: 0; }

/* Floating left navigation */
.floating-menu {
  position: fixed;
  z-index: 1000;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--menu-width);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scrollbar-width: thin;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin: 2px 0;
  padding: 7px 9px;
  border-radius: 9px;
  color: #24344e;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.menu-link:hover {
  background: #edf2fb;
  color: var(--rix-blue);
  transform: translateX(2px);
}

.menu-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--rix-blue-dark), var(--rix-blue));
  box-shadow: inset 3px 0 0 var(--rix-red);
}

.menu-no {
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: rgba(23,60,136,.09);
  color: var(--rix-blue);
  font-size: 10px;
  letter-spacing: .02em;
}

.menu-link.active .menu-no {
  background: rgba(255,255,255,.16);
  color: #fff;
}

.menu-text { flex: 1; }
.menu-toggle { display: none; }

@media (min-width: 1200px) {
  .profile { box-shadow: 0 0 28px rgba(0,0,0,.16); }
}

/* Prevent menu from overlapping the document on medium screens */
@media (max-width: 1660px) and (min-width: 901px) {
  .floating-menu {
    width: 64px;
    padding: 7px;
  }
  .menu-link { justify-content: center; padding: 6px; }
  .menu-text { display: none; }
  .menu-no { flex-basis: 34px; width: 34px; height: 34px; }
  .floating-menu:hover,
  .floating-menu:focus-within { width: var(--menu-width); }
  .floating-menu:hover .menu-link,
  .floating-menu:focus-within .menu-link { justify-content: flex-start; padding: 7px 9px; }
  .floating-menu:hover .menu-text,
  .floating-menu:focus-within .menu-text { display: block; }
}

/* Mobile / tablet: floating hamburger and slide-out menu */
@media (max-width: 900px) {
  .menu-toggle {
    position: fixed;
    z-index: 1101;
    left: 14px;
    top: 14px;
    display: grid;
    place-items: center;
    gap: 4px;
    width: 46px;
    height: 46px;
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background: rgba(11,45,104,.94);
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 10px;
    transition: transform .25s ease, opacity .25s ease;
  }
  .menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .floating-menu {
    left: 12px;
    top: 68px;
    transform: translateX(calc(-100% - 24px));
    width: min(270px, calc(100vw - 24px));
    max-height: calc(100vh - 82px);
    border-radius: 13px;
    transition: transform .25s ease;
  }
  .floating-menu.open { transform: translateX(0); }
  .menu-link { min-height: 42px; font-size: 13px; }
}

@media print {
  html, body { background: #fff; }
  .floating-menu, .menu-toggle { display: none !important; }
  .profile { width: 100%; max-width: none; }
  .profile-page img { break-after: page; box-shadow: none; }
}

/* ---------------------------------------------------------
   Subtle motion + depth layer
   Keeps the original PDF artwork untouched.
   --------------------------------------------------------- */
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(23,60,136,.10), transparent 28rem),
    radial-gradient(circle at 88% 78%, rgba(236,45,54,.055), transparent 24rem),
    #d7dbe1;
  background-attachment: fixed;
}

.profile {
  perspective: 1800px;
}

.profile-page {
  position: relative;
  isolation: isolate;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  transition:
    transform .78s cubic-bezier(.2,.72,.2,1),
    opacity .68s ease,
    filter .68s ease,
    box-shadow .55s ease;
}

/* Before a page enters the viewport */
.motion-ready .profile-page:not(.is-visible) {
  opacity: .62;
  transform: translate3d(0, 24px, -18px) scale(.992);
  filter: saturate(.94) brightness(.985);
}

.motion-ready .profile-page.is-visible {
  opacity: 1;
  transform: translate3d(var(--page-shift-x, 0px), var(--page-shift-y, 0px), 0)
             rotateX(var(--page-tilt-x, 0deg))
             rotateY(var(--page-tilt-y, 0deg))
             scale(1);
  filter: none;
  z-index: 2;
}

/* A little more visual separation only on desktop; PDF pixels remain untouched. */
@media (min-width: 901px) {
  .profile-page.is-current {
    box-shadow: 0 20px 54px rgba(8,29,68,.18), 0 3px 14px rgba(0,0,0,.10);
  }

  .profile-page img {
    transition: transform .55s cubic-bezier(.2,.72,.2,1), filter .55s ease;
  }

  .profile-page.is-current img {
    transform: translateZ(1px) scale(1.0015);
  }
}

/* Soft light sweep when a page becomes visible. */
.profile-page::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(112deg,
    transparent 34%,
    rgba(255,255,255,.00) 43%,
    rgba(255,255,255,.17) 50%,
    rgba(255,255,255,.00) 57%,
    transparent 66%);
  transform: translateX(-115%);
}

.profile-page.play-sheen::after {
  animation: rix-sheen 1.1s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes rix-sheen {
  0%   { opacity: 0; transform: translateX(-115%); }
  18%  { opacity: .52; }
  72%  { opacity: .24; }
  100% { opacity: 0; transform: translateX(115%); }
}

/* More responsive floating navigation micro-interactions. */
.floating-menu {
  transition: width .26s ease, transform .26s ease, box-shadow .3s ease;
}

.floating-menu:hover,
.floating-menu:focus-within {
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
}

.menu-link {
  position: relative;
  overflow: hidden;
}

.menu-link::after {
  content: "";
  position: absolute;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rix-red);
  opacity: 0;
  transform: scale(.25);
  transition: opacity .2s ease, transform .28s cubic-bezier(.2,.8,.2,1);
}

.menu-link.active::after {
  opacity: 1;
  transform: scale(1);
  animation: menu-dot 2.4s ease-in-out infinite;
}

@keyframes menu-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236,45,54,0); }
  50% { box-shadow: 0 0 0 5px rgba(236,45,54,.12); }
}

.menu-toggle {
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.menu-toggle:active { transform: scale(.94); }

/* Accessibility: disable decorative motion when requested by the OS/browser. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .profile-page,
  .profile-page img,
  .floating-menu,
  .menu-link,
  .menu-link::after,
  .menu-toggle {
    transition: none !important;
    animation: none !important;
  }
  .motion-ready .profile-page:not(.is-visible),
  .motion-ready .profile-page.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .profile-page::after { display: none; }
}
