:root{
  --bg: #0a0a0a;
  --ink: #f3efe8;
  --ink-dim: #9a9488;
  --accent: #e08838;
  --accent-dim: rgba(224,136,56,0.35);
  --chrome-h: 56px;
  --footer-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing: border-box; }
html,body{ height:100%; margin:0; overscroll-behavior:none; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.app{
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Reader ---------- */
.reader{
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--bg);
  touch-action: pan-y;
}

.track{
  position: absolute;
  inset: 0;
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 420ms cubic-bezier(.22,.68,.2,1);
}

.page{
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.page img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}

/* ---------- MIMA closing CTA page ---------- */
.page--mima{
  background: #F3EDE4;
}
.mimaCta{
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6vw;
  width: 100%;
  height: 100%;
  padding: 4vh 6vw;
  text-decoration: none;
  cursor: pointer;
  flex-wrap: nowrap;
  overflow-y: auto;
  box-sizing: border-box;
}
.mimaCta__text{
  max-width: 480px;
  color: #1A1A1A;
}
.mimaCta__eyebrow{
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #9A9488;
  margin-bottom: 6px;
}
.mimaCta__headline{
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #1A1A1A;
  line-height: 1.1;
}
.mimaCta__rule{
  width: 46px;
  height: 3px;
  background: #E0883B;
  margin: 14px 0 20px;
}
.mimaCta__text p{
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: #2A2A2A;
  margin: 0 0 14px;
}
.mimaCta__big{
  font-family: 'Anton', sans-serif !important;
  font-size: 28px !important;
  color: #E0883B;
  margin-bottom: 10px !important;
}
.mimaCta__mid{
  font-family: 'Anton', sans-serif !important;
  font-size: 20px !important;
  color: #1A1A1A;
  margin: 4px 0 10px !important;
}
.mimaCta__mid--accent{ color: #E0883B; }
.mimaCta__cta{
  font-weight: 600;
  color: #1A1A1A !important;
  margin-top: 6px !important;
}
.mimaCta__qrWrap{
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 180px;
  max-width: 40vw;
}
.mimaCta__qr{
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  box-sizing: border-box;
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.mimaCta__qrCaption{
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #6A655C;
}

@media (max-width: 640px){
  .mimaCta{ flex-direction: column; text-align: center; padding: 3vh 6vw; gap: 24px; }
  .mimaCta__rule{ margin-left: auto; margin-right: auto; }
}

/* ---------- Copyright / authorship page ---------- */
.page--copyright{ background: #F3EDE4; }
.copyrightPage{
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--chrome-h) + var(--safe-top) + 26px) 8vw calc(var(--footer-h) + var(--safe-bottom) + 30px);
  color: #1A1A1A;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
  --fit: 1;
}
.copyrightPage__eyebrow{
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #9A9488;
  margin-bottom: calc(8px * var(--fit, 1));
}
.copyrightPage__rule{
  width: 46px;
  height: 3px;
  background: #E0883B;
  margin-bottom: calc(18px * var(--fit, 1));
}
.copyrightPage p{
  font-family: 'Inter', sans-serif;
  font-size: calc(14px * var(--fit, 1));
  line-height: 1.5;
  color: #2A2A2A;
  margin: 0 0 calc(12px * var(--fit, 1));
}
.copyrightPage__signature{
  font-family: 'Anton', sans-serif !important;
  font-size: calc(21px * var(--fit, 1)) !important;
  font-weight: 400;
  color: #1A1A1A !important;
  line-height: 1.3 !important;
  margin: calc(18px * var(--fit, 1)) 0 !important;
}
.copyrightPage__legal{
  font-size: calc(11.5px * var(--fit, 1)) !important;
  color: #8A857A !important;
  margin-top: calc(20px * var(--fit, 1)) !important;
}
.copyrightPage__contact{
  font-size: calc(13px * var(--fit, 1)) !important;
  color: #E0883B !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Intro note (LinkedIn-style personal page) ---------- */
.page--intronote{ background: #F3EDE4; }
.introNote{
  max-width: 900px;
  margin: 0 auto;
  padding: calc(var(--chrome-h) + var(--safe-top) + 26px) 6vw calc(var(--footer-h) + var(--safe-bottom) + 30px);
  color: #1A1A1A;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
  --fit: 1;
}
.introNote__eyebrow{
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #9A9488;
  margin-bottom: 8px;
}
.introNote__headline{
  font-family: 'Anton', sans-serif;
  font-size: calc(32px * var(--fit, 1));
  font-weight: 400;
  color: #1A1A1A;
  line-height: 1.05;
}
.introNote__sub{
  font-family: 'Anton', sans-serif;
  font-size: calc(17px * var(--fit, 1));
  color: #E0883B;
  margin-top: 4px;
}
.introNote__rule{
  width: 46px;
  height: 3px;
  background: #E0883B;
  margin: calc(14px * var(--fit, 1)) 0 calc(18px * var(--fit, 1));
}
.introNote__cols{
  display: flex;
  gap: 6vw;
}
.introNote__cols--single{ display: block; }
.introNote__col{
  flex: 1;
  min-width: 0;
}
.introNote__col p{
  font-family: 'Inter', sans-serif;
  font-size: calc(13.5px * var(--fit, 1));
  line-height: 1.55;
  color: #2A2A2A;
  margin: 0 0 calc(11px * var(--fit, 1));
}
.introNote__staccato{
  font-weight: 700;
  color: #1A1A1A !important;
}
.introNote__pull{
  font-family: 'Anton', sans-serif !important;
  font-size: calc(18px * var(--fit, 1)) !important;
  font-weight: 400;
  color: #E0883B !important;
  line-height: 1.3 !important;
  margin: calc(4px * var(--fit, 1)) 0 calc(14px * var(--fit, 1)) !important;
}

@media (max-width: 640px){
  .introNote__cols{ flex-direction: column; gap: 0; }
}

/* ---------- Closing final page ---------- */
.page--closingfinal{ background: #F3EDE4; }
.closingFinal{
  max-width: 620px;
  margin: 0 auto;
  padding: calc(var(--chrome-h) + var(--safe-top) + 26px) 8vw calc(var(--footer-h) + var(--safe-bottom) + 30px);
  color: #1A1A1A;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
  --fit: 1;
}
.closingFinal__eyebrow{
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #9A9488;
  margin-bottom: 8px;
}
.closingFinal__headline{
  font-family: 'Anton', sans-serif;
  font-size: calc(30px * var(--fit, 1));
  font-weight: 400;
  color: #1A1A1A;
  line-height: 1.05;
}
.closingFinal__rule{
  width: 46px;
  height: 3px;
  background: #E0883B;
  margin: calc(14px * var(--fit, 1)) 0 calc(18px * var(--fit, 1));
}
.closingFinal p{
  font-family: 'Inter', sans-serif;
  font-size: calc(14px * var(--fit, 1));
  line-height: 1.5;
  color: #2A2A2A;
  margin: 0 0 calc(10px * var(--fit, 1));
}
.closingFinal__final{
  font-family: 'Anton', sans-serif !important;
  font-size: calc(21px * var(--fit, 1)) !important;
  font-weight: 400;
  color: #E0883B !important;
  line-height: 1.3 !important;
  margin-top: calc(18px * var(--fit, 1)) !important;
}

.tapzone{
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 5;
}
.tapzone--prev{ left: 0; }
.tapzone--next{ left: 68%; right: 0; width: auto; }

.loader{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.loader__pulse{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.audioToggle{
  position: absolute;
  top: calc(var(--chrome-h) + var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(10,10,10,0.55);
  color: #F3EDE4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  animation: audioFadeIn 400ms ease;
}
@keyframes audioFadeIn{ from{ opacity:0; transform: translateX(-50%) translateY(-6px);} to{ opacity:1; transform: translateX(-50%) translateY(0);} }
.topbar{
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--chrome-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 14px;
  padding-right: 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  z-index: 20;
  pointer-events: none;
}
.topbar > *{ pointer-events: auto; }

.topbar__title{
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--ink);
  opacity: 0.9;
}

.iconbtn{
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.iconbtn:active{ background: rgba(255,255,255,0.18); }
.topbar__right{
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.audioWrap{ position: relative; }

/* ---------- Footer ---------- */
.footer{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--footer-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: calc(10px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  z-index: 20;
  pointer-events: none;
}

.progress{
  position: relative;
  height: 2px;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
  overflow: visible;
}
.progress__fill{
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 420ms cubic-bezier(.22,.68,.2,1);
}
.progress__dot{
  position: absolute;
  top: 50%;
  left: 0%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(224,136,56,0.18);
  transform: translate(-50%,-50%);
  transition: left 420ms cubic-bezier(.22,.68,.2,1);
}

.pageLabel{
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}

.footer__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mimaBtn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #F0983F, #DD7420);
  border: none;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  height: 34px;
  border-radius: 18px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 4px 14px rgba(224,120,40,0.55), 0 0 0 1px rgba(255,255,255,0.15) inset;
  animation: mimaPulse 2.6s ease-in-out infinite;
}
@keyframes mimaPulse{
  0%, 100% { box-shadow: 0 4px 14px rgba(224,120,40,0.55), 0 0 0 1px rgba(255,255,255,0.15) inset; }
  50% { box-shadow: 0 4px 20px rgba(224,120,40,0.85), 0 0 0 1px rgba(255,255,255,0.25) inset; }
}
.mimaBtn__dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.mimaBtn:active{ transform: scale(0.96); }

@media (max-width: 360px){
  .footer__row{ justify-content: center; }
  .pageLabel{ order: 2; font-size: 10px; }
  .mimaBtn{ order: 1; font-size: 10px; padding: 5px 10px; }
}

/* ---------- Table of contents ---------- */
.scrim{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 29;
}

.toc{
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(78vw, 320px);
  background: #111111;
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 30;
  transform: translateX(-100%);
  transition: transform 320ms cubic-bezier(.22,.68,.2,1);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}
.toc.open{ transform: translateX(0); }

.toc__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.toc__list{
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
}
.toc__list li{
  padding: 12px 18px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.toc__list li:active{ background: rgba(255,255,255,0.06); }
.toc__list li .num{
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  min-width: 20px;
}
.toc__list li .chap{
  font-size: 10px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-top: 2px;
}
.toc__list li.active{ background: rgba(224,136,56,0.1); }
.toc__list li.active .label{ color: var(--accent); }

/* ---------- Install toast ---------- */
.toast{
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--footer-h) + var(--safe-bottom) + 14px);
  background: #171310;
  border: 1px solid rgba(224,136,56,0.35);
  color: var(--ink);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 25;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.toast__close{
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

@media (prefers-reduced-motion: reduce){
  .track, .progress__fill, .progress__dot, .toc{ transition: none !important; }
}

/* ---------- Čitaj naglas (nistor.rs, 12.10.2026) ---------- */
.readBtn.is-on{ background: #E0883B; color: #111; }
.readPanel{ position: fixed; top: calc(var(--safe-top, 0px) + 58px); right: 12px; z-index: 60; width: min(300px, calc(100vw - 24px));
  background: #141414; color: #f3ede4; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 14px 14px 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45); font-family: 'Inter', sans-serif; }
.readPanel__title{ margin: 0; font-weight: 700; font-size: 15px; }
.readPanel__sub{ margin: 4px 0 12px; font-size: 12.5px; color: rgba(243,237,228,.65); line-height: 1.4; }
.readPanel__row{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readPanel__btn{ border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #f3ede4; border-radius: 10px;
  padding: 10px 8px; font: 600 13.5px 'Inter', sans-serif; cursor: pointer; }
.readPanel__btn.is-sel{ border-color: #E0883B; background: rgba(224,136,59,.18); }
.readPanel__note{ margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: rgba(243,237,228,.75); }
@media (max-width: 420px){ #fsBtn{ display: none; } }  /* mesto za „Čitaj naglas“; ceo ekran se ionako uključuje okretanjem telefona */

[hidden]{ display: none !important; }  /* dugmad sa hidden (Čitaj naglas, pesma, instalacija) ne smeju da se vide zbog .iconbtn{display:flex} */
