:root {
  --bg-1: #eef2f4;
  --bg-2: #d7dde1;
  --ink: #17212b;
  --muted: #6b7785;
  --brand: #1c6b50;
  --paper-shadow: 0 28px 70px rgba(18, 28, 39, 0.26), 0 8px 18px rgba(18, 28, 39, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  color: var(--ink);
  font-family: "Poppins", "Montserrat", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.9), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(28, 107, 80, 0.16), transparent 28rem),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.catalog-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  padding: 14px clamp(14px, 3vw, 42px) 16px;
  gap: 10px;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
  flex-wrap: wrap;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(24, 35, 47, 0.1);
  backdrop-filter: blur(12px);
}
.navbar-brand:hover, .navbar-brand:focus { text-decoration: none; }
.brand-img { display: block; width: clamp(110px, 14vw, 170px); height: auto; }

.catalog-title {
  margin: 0;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(23, 33, 43, 0.66);
}

.tb-langs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tb-langs a {
  color: var(--ink);
  text-decoration: none;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.7);
}
.tb-langs a[aria-current="page"],
.tb-langs a:hover {
  background: #1c6b50;
  color: #fff;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  perspective: 2200px;
}

.book-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#book {
  --sheet-scale: 0.4;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#book.is-ready { opacity: 1; }

#book .page {
  position: relative;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

#book .page-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

#book.shadow,
#book .shadow { box-shadow: var(--paper-shadow); }

.sheet-fit {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
}

.sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 1414px;
  height: 2000px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(90deg, #1b3fc6 0%, #4e8a80 50%, #8cc92f 100%);
  transform-origin: 0 0;
  transform: scale(var(--sheet-scale));
}

@supports (width: 1cqw) {
  .sheet-fit .sheet {
    transform: scale(calc(100cqw / 1414));
  }
}

.t { position: absolute; font-weight: 700; line-height: 41px; font-size: 30px; text-transform: uppercase; }
.h1 { font-size: 90px; line-height: 120px; font-weight: 600; text-transform: none; white-space: nowrap; }
.h1.c { text-align: center; }
.h2 { font-size: 52px; line-height: 60px; font-weight: 700; }
.t.b { font-size: 24px; line-height: 34px; font-weight: 600; white-space: normal; }
.bar { position: absolute; left: 0; height: 163px; background: #7ab04c; clip-path: polygon(0 0,96% 0,100% 50%,96% 100%,0 100%); }
.rib { position: absolute; left: 0; width: 715px; height: 163px; background: #7ab04c; clip-path: polygon(0 0,92% 0,100% 50%,92% 100%,0 100%); }
.rib.blue { left: 700px; width: 714px; background: #244bd6; clip-path: polygon(8% 0,100% 0,100% 100%,8% 100%,0 50%); }
.ph { position: absolute; }
.disk { position: absolute; border-radius: 50%; background: linear-gradient(90deg, #1b3fc6 0%, #4e8a80 55%, #8cc92f 100%); }
.arcs { position: absolute; left: 0; top: 0; width: 1414px; height: 2000px; pointer-events: none; }
.ct { fill: #fff; font-weight: 800; font-family: Poppins, Arial, sans-serif; }
.pill {
  position: absolute;
  height: 60px;
  border-radius: 30px;
  background: #f1f1f1;
  color: #111;
  font-weight: 800;
  font-size: 25px;
  line-height: 60px;
  text-align: center;
}

.nav-btn {
  position: fixed;
  top: 50%;
  z-index: 20;
  display: grid;
  place-items: center;
  width: clamp(46px, 7vw, 76px);
  height: clamp(46px, 7vw, 76px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(19, 29, 41, 0.18);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(10px);
}
.nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.nav-btn:focus-visible { outline: 3px solid rgba(28, 107, 80, 0.35); outline-offset: 3px; }
.nav-btn[disabled] { pointer-events: none; opacity: 0.32; }
#prev-btn { left: clamp(8px, 2vw, 30px); }
#next-btn { right: clamp(8px, 2vw, 30px); }
.nav-btn img { width: 58%; height: 58%; object-fit: contain; }

.catalog-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  z-index: 10;
}
.page-counter {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 28px rgba(24, 35, 47, 0.09);
  backdrop-filter: blur(12px);
}

@media (max-width: 760px) {
  .catalog-title { display: none; }
  .nav-btn {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    transform: none;
  }
  .nav-btn:hover { transform: none; }
  #prev-btn { left: 18px; }
  #next-btn { right: 18px; }
}

@media print {
  body { overflow: visible; background: #fff; }
  .nav-btn, .catalog-header, .catalog-footer { display: none !important; }
  .catalog-shell { display: block; padding: 0; }
  #book, #book .page { position: relative !important; width: 1414px !important; height: 2000px !important; opacity: 1 !important; }
  .sheet { transform: none !important; page-break-after: always; }
}
