
/* ============================================================
   PILVAN PHARMACEUTICAL TRAINING BOOK LIBRARY
   ============================================================ */

.pilvan-library {
    --pilvan-navy-900: #061426;
    --pilvan-navy-800: #081A30;
    --pilvan-navy-700: #0B1F3A;
    --pilvan-navy-600: #102D50;
    --pilvan-navy-500: #163A61;
    --pilvan-white: #FFFFFF;
    --pilvan-soft: #F4F7FB;
    --pilvan-paper: #F7F9FC;
    --pilvan-ink: #0B1F3A;
    --pilvan-accent: #4E86C6;
    --pilvan-gap: clamp(8px, 1.5vw, 24px);

    background: linear-gradient(145deg, #cdcdcd, #6c6c6c);

    box-shadow:
        inset 25px 25px 45px rgba(25, 24, 24, 0.27),
        inset -20px -20px 40px rgba(36, 35, 35, 0.58),
        inset 7px 7px 16px rgba(0, 0, 0, 0.65),
        inset -7px -7px 16px rgba(29, 29, 29, 0.54);

    position: relative;

    /* FIX */
    width: calc(100% - 50px);
    margin: 25px;

    /* FIX */
    border-radius: 30px;

    padding:
        clamp(12px, 2vw, 36px)
        clamp(8px, 1.5vw, 24px)
        clamp(28px, 4vw, 64px);

    color: var(--pilvan-soft);

    font-family:
        'Inter',
        'Poppins',
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Important */
    overflow: hidden;
}

.pilvan-library *,
.pilvan-library *::before,
.pilvan-library *::after { box-sizing: border-box; }

.pilvan-library img { max-width: 100%; display: block; }

/* ============================================================
   HERO
   ============================================================ */

.pilvan-hero {
  position: relative;
  max-width: 1400px;
  margin: 0 auto clamp(14px, 2vw, 26px);
  padding: clamp(20px, 2.8vw, 42px) clamp(18px, 2.8vw, 48px);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(230px, 24vw, 340px);
  background: linear-gradient(158deg, #0E2A4C 0%, #0B1F3A 48%, #061426 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.14),
    inset -6px -8px 22px rgba(0, 0, 0, 0.52),
    inset 0 0 90px rgba(78, 134, 198, 0.06),
    0 22px 46px rgba(0, 0, 0, 0.48);
}

.pilvan-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 30%);
}

.pilvan-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.pilvan-hero__content {
  position: relative;
  z-index: 3;
  max-width: 880px;
}

.pilvan-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px 6px 11px;
  margin: 0 0 clamp(12px, 1.6vw, 20px);
  border-radius: 999px;
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #B9D3EE;
  background: linear-gradient(145deg, #0D2543, #081A30);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.13),
    inset -2px -3px 6px rgba(0, 0, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.35);
}

.pilvan-hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6FA8DC;
  box-shadow: 0 0 0 3px rgba(111, 168, 220, 0.16);
}

.pilvan-hero__title {
  margin: 0 0 clamp(10px, 1.4vw, 18px);
  font-size: clamp(22px, 3.3vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--pilvan-white);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.pilvan-hero__text {
  margin: 0;
  max-width: 780px;
  font-size: clamp(12.5px, 1vw, 15.5px);
  line-height: 1.72;
  color: rgba(244, 247, 251, 0.76);
}

.pilvan-hero__molecule {
  position: absolute;
  top: -34px;
  right: -30px;
  width: clamp(170px, 22vw, 310px);
  height: clamp(170px, 22vw, 310px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.pilvan-hero__molecule--b {
  top: auto; right: auto;
  bottom: -70px; left: -50px;
  width: clamp(140px, 18vw, 240px);
  height: clamp(140px, 18vw, 240px);
  opacity: 0.34;
}

.pilvan-hero__capsule {
  position: absolute;
  right: clamp(20px, 6vw, 120px);
  bottom: clamp(16px, 4vw, 52px);
  width: clamp(80px, 11vw, 150px);
  height: auto;
  opacity: 0.16;
  pointer-events: none;
  z-index: 1;
}

.pilvan-hero__rule {
  position: absolute;
  top: 0; bottom: 0;
  right: clamp(28px, 10vw, 190px);
  width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   SHELVES
   ============================================================ */

.pilvan-library__shelves {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vw, 24px);
  z-index: 2;
}

.pilvan-shelf {
  position: relative;
  padding-bottom: 0;
}

.pilvan-shelf::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 0;
  bottom: clamp(12px, 1.8vw, 20px);
  border-radius: 14px 14px 0 0;
  /* background: linear-gradient(180deg, rgba(16, 45, 80, 0.55) 0%, rgba(8, 26, 48, 0.28) 60%, rgba(6, 20, 38, 0) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35); */
  pointer-events: none;
}

.pilvan-shelf__books {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--pilvan-gap);
  align-items: end;
  justify-items: stretch;
  padding: 0 clamp(6px, 1.2vw, 18px);
}

.pilvan-shelf__books--desktop {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pilvan-shelf__books--tablet {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pilvan-shelf__books--mobile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 480px;
  margin-inline: auto;
}

.pilvan-shelf--single .pilvan-shelf__books--desktop {
  grid-template-columns: minmax(0, calc((100% - 4 * var(--pilvan-gap)) / 5));
  justify-content: center;
}

.pilvan-shelf__board {
  position: relative;
  z-index: 1;
  height: clamp(13px, 1.6vw, 22px);
  margin: -6px clamp(0px, 0.4vw, 6px) 0;
  border-radius: 5px 5px 12px 12px;
  background: linear-gradient(180deg, #173A63 0%, #0D2747 45%, #061426 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -5px 12px rgba(0, 0, 0, 0.45),
    0 12px 25px rgba(0, 0, 0, 0.45);
}

.pilvan-shelf__board::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.38) 50%, rgba(255,255,255,0) 100%);
}

.pilvan-shelf__board::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 9px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

/* ============================================================
   BOOK
   ============================================================ */

.pilvan-book {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 0.72 / 1;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transform-style: preserve-3d;
}

.pilvan-book:focus-visible {
  outline: 2px solid #7FB2E8;
  outline-offset: 8px;
  border-radius: 8px;
}

.pilvan-book__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.pilvan-book__pages {
  position: absolute;
  left: 8%; right: 0;
  top: 2.6%; bottom: 2.6%;
  border-radius: 1px 4px 4px 1px;
  background: repeating-linear-gradient(90deg,
      #E9EFF7 0px, #E9EFF7 1px,
      #D3DEEB 1px, #D3DEEB 2px,
      #E3EBF4 2px, #E3EBF4 3px);
  box-shadow:
    inset -2px 0 3px rgba(255, 255, 255, 0.75),
    inset 0 0 8px rgba(11, 31, 58, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.32);
  transform: translateZ(-4px);
  pointer-events: none;
}

.pilvan-book__spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 9%;
  border-radius: 4px 1px 1px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 0 10px;
  overflow: hidden;
  background: linear-gradient(90deg, #061426 0%, #102D50 42%, #163A61 74%, #0B1F3A 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.14),
    inset -3px 0 6px rgba(0, 0, 0, 0.55),
    -6px 10px 20px rgba(0, 0, 0, 0.45);
  transform: translateZ(3px);
  pointer-events: none;
}

.pilvan-book__spine::before {
  content: "";
  position: absolute;
  left: 18%; right: 18%;
  top: 6%; bottom: 6%;
  background: repeating-linear-gradient(180deg,
      rgba(255, 255, 255, 0.09) 0px,
      rgba(255, 255, 255, 0.09) 1px,
      rgba(0, 0, 0, 0) 1px,
      rgba(0, 0, 0, 0) 9px);
  opacity: 0.7;
  pointer-events: none;
}

.pilvan-book__spine-number {
  position: relative;
  font-size: clamp(7px, 0.62vw, 9.5px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(244, 247, 251, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  line-height: 1;
}

.pilvan-book__spine-title {
  position: relative;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: clamp(6.5px, 0.6vw, 9px);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(210, 226, 243, 0.66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 74%;
}

.pilvan-book__cover {
  position: absolute;
  left: 8%; right: 2.6%;
  top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.7vw, 9px);
  padding: clamp(6px, 0.8vw, 12px);
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  background: linear-gradient(152deg, #163A61 0%, #102D50 42%, #0B1F3A 78%, #081A30 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.14),
    inset -3px -4px 8px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 15px 30px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
}

.pilvan-book__cover::before {
  content: "";
  position: absolute;
  inset: clamp(4px, 0.5vw, 7px);
  border-radius: 2px 4px 4px 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 4;
}

.pilvan-book__cover::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 4;
}

.pilvan-book__image {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 2px 4px 4px 2px;
  overflow: hidden;
  background: linear-gradient(150deg, #163A61 0%, #0B1F3A 60%, #061426 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.pilvan-book__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.06) brightness(0.7);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pilvan-book__image-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 20, 38, 0.18) 0%, rgba(6, 20, 38, 0.78) 100%),
    linear-gradient(90deg, rgba(11, 31, 58, 0.55) 0%, rgba(11, 31, 58, 0) 55%);
  pointer-events: none;
}

.pilvan-book__meta {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex: 0 0 auto;
}

.pilvan-book__number {
  font-size: clamp(9px, 0.95vw, 12px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #8FBCE8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1;
}

.pilvan-book__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(143, 188, 232, 0.55);
  line-height: 0;
}

.pilvan-book__icon svg {
  width: clamp(10px, 1.05vw, 14px);
  height: clamp(10px, 1.05vw, 14px);
  display: block;
}

.pilvan-book__ribbon {
  position: absolute;
  top: 54%;
  left: -24%;
  right: -24%;
  transform: translateY(-50%) rotate(-24deg);
  transform-origin: 50% 50%;
  padding: clamp(5px, 0.7vw, 9px) clamp(8px, 1vw, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(26px, 3.2vw, 40px);
  background: linear-gradient(90deg,
      rgba(6, 20, 38, 0.9) 0%,
      rgba(11, 31, 58, 0.78) 50%,
      rgba(6, 20, 38, 0.9) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 6;
  pointer-events: none;
}

.pilvan-book__ribbon-text {
  display: block;
  width: 100%;
  font-size: clamp(9px, 1vw, 12.5px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #F4F7FB;
  text-align: center;
  line-height: 1.18;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.pilvan-book__ribbon-text--sm { font-size: clamp(8px, 0.9vw, 11px); }
.pilvan-book__ribbon-text--xs { font-size: clamp(7px, 0.82vw, 10px); letter-spacing: 0.04em; }

.pilvan-book__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  z-index: 7;
  background: linear-gradient(122deg,
      rgba(255, 255, 255, 0) 26%,
      rgba(255, 255, 255, 0.14) 44%,
      rgba(255, 255, 255, 0.28) 50%,
      rgba(255, 255, 255, 0.12) 56%,
      rgba(255, 255, 255, 0) 74%);
}

/* ============================================================
   BOOK OVERLAY / MODAL
   ============================================================ */

.pilvan-book-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 28px);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.pilvan-book-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.pilvan-book-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 22, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.pilvan-book-close {
  position: absolute;
  top: clamp(12px, 1.8vw, 26px);
  right: clamp(12px, 1.8vw, 26px);
  z-index: 20;
  width: clamp(40px, 4vw, 48px);
  height: clamp(40px, 4vw, 48px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #E7EFF9;
  background: linear-gradient(145deg, #163A61 0%, #0B1F3A 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.16),
    inset -2px -3px 6px rgba(0, 0, 0, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}

.pilvan-book-close:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.2),
    inset -2px -3px 6px rgba(0, 0, 0, 0.5),
    0 16px 30px rgba(0, 0, 0, 0.6);
}

.pilvan-book-close:focus-visible { outline: 2px solid #7FB2E8; outline-offset: 3px; }
.pilvan-book-close svg { width: 46%; height: 46%; display: block; }

/* ============================================================
   OPEN BOOK
   ============================================================ */

.pilvan-open-book {
  position: relative;
  z-index: 2;
  width: min(1260px, 92vw);
  height: min(780px, 86vh);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr; /* explicit single row fills container height */
  perspective: 2400px;
  transform-style: preserve-3d;
}

.pilvan-open-book__page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 55%, #EDF2F8 100%);
  color: var(--pilvan-ink);
  transform: translateZ(2px);
  box-shadow:
    inset 0 0 46px rgba(11, 31, 58, 0.06),
    0 34px 64px rgba(0, 0, 0, 0.5);
  min-height: 0;
  min-width: 0;
}

.pilvan-open-book__page--left {
  border-radius: 12px 2px 2px 12px;
  box-shadow:
    inset -20px 0 30px -20px rgba(11, 31, 58, 0.5),
    inset 0 0 46px rgba(11, 31, 58, 0.05),
    0 34px 64px rgba(0, 0, 0, 0.5);
}

.pilvan-open-book__page--right {
  border-radius: 2px 12px 12px 2px;
  box-shadow:
    inset 20px 0 30px -20px rgba(11, 31, 58, 0.5),
    inset 0 0 46px rgba(11, 31, 58, 0.05),
    0 34px 64px rgba(0, 0, 0, 0.5);
}

.pilvan-open-book__page--left::after {
  content: "";
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(11,31,58,0) 0%, rgba(11,31,58,0.22) 50%, rgba(11,31,58,0) 100%);
  pointer-events: none;
}

.pilvan-open-book__page--right::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(11,31,58,0) 0%, rgba(11,31,58,0.22) 50%, rgba(11,31,58,0) 100%);
  pointer-events: none;
}

.pilvan-open-book__spine {
  position: absolute;
  left: 50%;
  top: -4px; bottom: -4px;
  width: clamp(16px, 1.8vw, 26px);
  margin-left: calc(clamp(16px, 1.8vw, 26px) / -2);
  border-radius: 4px;
  background: linear-gradient(90deg,
      rgba(11, 31, 58, 0.02) 0%,
      rgba(11, 31, 58, 0.22) 28%,
      rgba(11, 31, 58, 0.42) 50%,
      rgba(11, 31, 58, 0.22) 72%,
      rgba(11, 31, 58, 0.02) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: translateZ(6px);
  pointer-events: none;
  z-index: 6;
}

.pilvan-open-book__shadow {
  position: absolute;
  left: 4%; right: 4%;
  bottom: -26px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 72%);
  filter: blur(8px);
  transform: translateZ(-20px);
  pointer-events: none;
  z-index: 0;
}

.pilvan-open-book__cover {
  position: absolute;
  left: 50%; top: 0;
  width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 5;
  pointer-events: none;
}

.pilvan-open-book__cover-front,
.pilvan-open-book__cover-back {
  position: absolute;
  inset: 0;
  border-radius: 2px 12px 12px 2px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}

.pilvan-open-book__cover-front {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: clamp(18px, 2.6vw, 42px);
  background: linear-gradient(152deg, #163A61 0%, #102D50 42%, #0B1F3A 78%, #081A30 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.14),
    inset -4px -5px 14px rgba(0, 0, 0, 0.45),
    0 26px 50px rgba(0, 0, 0, 0.55);
}

.pilvan-open-book__cover-front::before {
  content: "";
  position: absolute;
  inset: clamp(10px, 1.1vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px 8px 8px 3px;
  pointer-events: none;
}

.pilvan-open-book__cover-front::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.pilvan-open-book__cover-number {
  position: relative;
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #8FBCE8;
}

.pilvan-open-book__cover-title {
  position: relative;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.18;
  font-weight: 700;
  color: #F4F7FB;
  letter-spacing: -0.01em;
}

.pilvan-open-book__cover-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #F2F6FB 0%, #E6EDF6 100%);
  box-shadow: inset 0 0 40px rgba(11, 31, 58, 0.14);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */

.pilvan-page__inner {
  position: relative;
  height: 100%;
  padding: clamp(18px, 2.4vw, 42px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 31, 58, 0.3) transparent;
}

.pilvan-page__inner::-webkit-scrollbar { width: 8px; }
.pilvan-page__inner::-webkit-scrollbar-track { background: transparent; }
.pilvan-page__inner::-webkit-scrollbar-thumb {
  background: rgba(11, 31, 58, 0.26);
  border-radius: 8px;
}

/* ---------- LEFT PAGE : image fills the remaining height ---------- */

.pilvan-page__inner--left {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.1vw, 14px);
  overflow: hidden;
  padding-bottom: clamp(14px, 1.8vw, 26px);
}

.pilvan-page__inner--left .pilvan-page__number {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.pilvan-page__inner--left .pilvan-page__title {
  margin: 0;
  flex: 0 0 auto;
}

.pilvan-page__inner--left .pilvan-page__image {
  flex: 1 1 0;
  min-height: 140px;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(150deg, #163A61 0%, #0B1F3A 60%, #061426 100%);
  box-shadow:
    0 14px 32px rgba(11, 31, 58, 0.24),
    inset 0 0 0 1px rgba(11, 31, 58, 0.08);
}

.pilvan-page__inner--left .pilvan-page__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pilvan-page__number {
  display: block;
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #4E86C6;
  margin-bottom: 8px;
}

.pilvan-page__title {
  margin: 0 0 clamp(12px, 1.6vw, 22px);
  font-size: clamp(18px, 2.2vw, 32px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0B1F3A;
}

.pilvan-page__image {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 14px 32px rgba(11, 31, 58, 0.24),
    inset 0 0 0 1px rgba(11, 31, 58, 0.08);
}

.pilvan-page__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.pilvan-page__image-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, rgba(11, 31, 58, 0) 48%, rgba(11, 31, 58, 0.6) 100%);
}

.pilvan-page__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: clamp(9px, 0.8vw, 11px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F4F7FB;
  background: rgba(6, 20, 38, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

/* RIGHT PAGE BANNER IMAGE */
.pilvan-page__banner {
  position: relative;
  width: 100%;
  height: clamp(90px, 11vw, 150px);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: clamp(12px, 1.5vw, 20px);
  background: linear-gradient(150deg, #163A61 0%, #0B1F3A 60%, #061426 100%);
  box-shadow:
    0 12px 26px rgba(11, 31, 58, 0.22),
    inset 0 0 0 1px rgba(11, 31, 58, 0.08);
}

.pilvan-page__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
}

.pilvan-page__banner-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 31, 58, 0) 40%, rgba(11, 31, 58, 0.35) 100%),
    linear-gradient(90deg, rgba(11, 31, 58, 0.35) 0%, rgba(11, 31, 58, 0) 60%);
}

.pilvan-page__banner-tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: clamp(9px, 0.8vw, 11px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F4F7FB;
  background: rgba(6, 20, 38, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

.pilvan-page__desc {
  margin: 0 0 clamp(14px, 1.7vw, 22px);
  font-size: clamp(12.5px, 1vw, 15px);
  line-height: 1.78;
  color: rgba(11, 31, 58, 0.82);
}

.pilvan-page__sub {
  position: relative;
  margin: 0 0 clamp(9px, 1.1vw, 15px);
  padding-bottom: 8px;
  font-size: clamp(11.5px, 0.95vw, 13.5px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #102D50;
}

.pilvan-page__sub::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 46px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4E86C6 0%, rgba(78, 134, 198, 0) 100%);
}

.pilvan-training-list {
  list-style: none;
  margin: 0 0 clamp(16px, 1.8vw, 26px);
  padding: 0;
  display: grid;
  gap: 8px;
}

.pilvan-training-list li {
  position: relative;
  padding-left: 22px;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.6;
  color: rgba(11, 31, 58, 0.86);
}

.pilvan-training-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(140deg, #163A61 0%, #4E86C6 100%);
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.3);
  transform: rotate(45deg);
}

.pilvan-training-list--compact { margin-bottom: clamp(12px, 1.5vw, 18px); }

.pilvan-page__panel {
  padding: clamp(12px, 1.5vw, 18px);
  margin-bottom: clamp(12px, 1.5vw, 18px);
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(244, 247, 251, 0.95) 0%, rgba(233, 240, 248, 0.85) 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.9),
    inset -2px -3px 8px rgba(11, 31, 58, 0.08),
    0 6px 16px rgba(11, 31, 58, 0.08);
}

.pilvan-page__panel .pilvan-page__sub { margin-bottom: 10px; }
.pilvan-page__panel .pilvan-training-list { margin-bottom: 0; }

.pilvan-page__body {
  margin: 0;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.72;
  color: rgba(11, 31, 58, 0.82);
}

.pilvan-book-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  margin-top: 4px;
  border-radius: 10px;
  text-decoration: none;
  font-size: clamp(12px, 0.95vw, 13.5px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #F4F7FB;
  background: linear-gradient(145deg, #163A61 0%, #0B1F3A 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.16),
    inset -2px -3px 7px rgba(0, 0, 0, 0.45),
    0 10px 22px rgba(11, 31, 58, 0.28);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}

.pilvan-book-button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.2),
    inset -2px -3px 7px rgba(0, 0, 0, 0.45),
    0 16px 28px rgba(11, 31, 58, 0.34);
}

.pilvan-book-button:focus-visible { outline: 2px solid #4E86C6; outline-offset: 3px; }

.pilvan-book-button__arrow {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .pilvan-open-book {
    width: min(960px, 94vw);
    height: min(680px, 84vh);
  }
}

@media (max-width: 900px) {
  .pilvan-shelf__books--desktop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pilvan-open-book {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 42%) minmax(0, 58%);
    perspective: 1600px;
  }

  .pilvan-open-book__page--left {
    border-radius: 12px 12px 2px 2px;
    box-shadow:
      inset 0 -18px 26px -20px rgba(11, 31, 58, 0.45),
      inset 0 0 40px rgba(11, 31, 58, 0.05),
      0 20px 44px rgba(0, 0, 0, 0.5);
    max-height: 42vh;
  }

  .pilvan-open-book__page--right {
    border-radius: 2px 2px 12px 12px;
    box-shadow:
      inset 0 18px 26px -20px rgba(11, 31, 58, 0.45),
      inset 0 0 40px rgba(11, 31, 58, 0.05),
      0 20px 44px rgba(0, 0, 0, 0.5);
    min-height: 0;
  }

  .pilvan-open-book__page--left::after,
  .pilvan-open-book__page--right::after { display: none; }

  .pilvan-open-book__spine,
  .pilvan-open-book__cover,
  .pilvan-open-book__shadow { display: none; }

  .pilvan-page__inner--left { gap: 6px; }
  .pilvan-page__inner--left .pilvan-page__title { font-size: clamp(16px, 4.6vw, 22px); }
  .pilvan-page__inner--left .pilvan-page__image { min-height: 80px; }

  .pilvan-page__banner { height: clamp(70px, 18vw, 110px); }
  .pilvan-page__caption { left: 8px; bottom: 8px; padding: 4px 9px; }
}

@media (max-width: 640px) {
  .pilvan-library { padding-left: 6px; padding-right: 6px; }
  .pilvan-shelf__books--mobile { max-width: 420px; }
  .pilvan-shelf__board { height: 12px; }
  .pilvan-book__ribbon { top: 52%; }
  .pilvan-book__ribbon-text { letter-spacing: 0.04em; }
}

@media (max-width: 480px) {
  .pilvan-shelf__books--desktop,
  .pilvan-shelf__books--tablet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 420px;
    margin-inline: auto;
  }
}

@media (max-width: 420px) {
  .pilvan-shelf__books--mobile { max-width: 360px; }
  .pilvan-book__ribbon { padding: 4px 6px; min-height: 22px; }
  .pilvan-book__ribbon-text { font-size: 8px; }
  .pilvan-book__ribbon-text--sm { font-size: 7.5px; }
  .pilvan-book__ribbon-text--xs { font-size: 7px; }
  .pilvan-book__number { font-size: 8.5px; letter-spacing: 0.1em; }
  .pilvan-book__spine-title { display: none; }
  .pilvan-book__cover { padding: 5px; gap: 4px; }
  .pilvan-shelf__board { height: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pilvan-library *,
  .pilvan-library *::before,
  .pilvan-library *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .pilvan-book__image img { transition: none; }
}
