/* Home page, "Despre Invoicy": the 31 invoice models as a slider of sets of four sheets (drag, arrows or keys). Replaces the old fixed stack of four.
   Tokens come from invoicy-modern.css / invoicy-dark.css (--ink, --ink3, --line, --accent, --shadow-s, --d-card, --d-line2). Sheets keep the look they had. */
.sh-stack { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1.3; margin: 0 auto 108px; outline: none; }
.sh-stack:before { content: ""; position: absolute; inset: 6% 2% 4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(26, 159, 223, .16), transparent 72%); pointer-events: none; }
.sh-stack:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 24px; }
.sh-sets { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; clip-path: inset(-8% -8% -8% -8%); }   /* a set slides in and out at the edge of its own column, never over the text next to it */
.sh-sets.is-drag { cursor: grabbing; }
.sh-set { position: absolute; inset: 0; will-change: transform, opacity; }

.sh-doc { position: absolute; width: 44%; left: var(--l); top: var(--t); transform: rotate(var(--r, 0deg)) scale(var(--s, 1)); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.sh-doc.d1 { --l: 0%; --t: 6%; --r: -6deg; }
.sh-doc.d2 { --l: 54%; --t: 0%; --r: 5deg; }
.sh-doc.d3 { --l: 2%; --t: 56%; --r: 4deg; }
.sh-doc.d4 { --l: 53%; --t: 50%; --r: -5deg; }
.sh-set.alt .sh-doc.d1 { --l: 54%; --t: 5%; --r: 6deg; }
.sh-set.alt .sh-doc.d2 { --l: 0%; --t: 0%; --r: -5deg; }
.sh-set.alt .sh-doc.d3 { --l: 52%; --t: 55%; --r: -4deg; }
.sh-set.alt .sh-doc.d4 { --l: 1%; --t: 51%; --r: 5deg; }
.sh-doc .sheet { background: #fff; border-radius: 10px; overflow: hidden; line-height: 0; box-shadow: 0 1px 2px rgba(15, 39, 66, .1), 0 22px 38px -18px rgba(15, 39, 66, .45); animation: invFloat 7s ease-in-out infinite alternate; animation-delay: var(--fd, 0s); }
.sh-doc img { display: block; width: 100%; height: auto; pointer-events: none; background: #fff; aspect-ratio: 760 / 988; }
.sh-doc { cursor: zoom-in; outline: none; }
.sh-doc:hover { --s: 1.03; }
.sh-doc:focus-visible .sheet { outline: 3px solid var(--accent); outline-offset: 3px; }
.sh-sets.is-drag, .sh-sets.is-drag .sh-doc { cursor: grabbing; }
.sh-set:not(.on) .sheet { animation-play-state: paused; }

/* spread-in when the block scrolls into view (classes set by invoicy-sheets.js) */
.sh-stack.pre .sh-doc { opacity: 0; transform: translateY(60px) rotate(0deg) scale(.9); }
.sh-stack.pre.go .sh-doc { opacity: 1; transform: rotate(var(--r, 0deg)) scale(var(--s, 1)); transition: transform .95s cubic-bezier(.16, 1, .3, 1) var(--sd, 0ms), opacity .6s ease var(--sd, 0ms); }

.sh-nav { position: absolute; left: 0; right: 0; top: 100%; margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 18px; font-family: Rubik, sans-serif; }
.sh-btn { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; box-shadow: var(--shadow-s); transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s, color .2s, opacity .2s; }
.sh-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.sh-btn:active:not(:disabled) { transform: scale(.94); }
.sh-btn:disabled { opacity: .38; cursor: default; }
.sh-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sh-info { min-width: 210px; margin: 0; text-align: center; line-height: 1.4; }
.sh-cnt { display: block; font-size: 15px; color: var(--ink3); }
.sh-cnt b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sh-hint { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink3); }

html[data-theme="dark"] .sh-btn { background: var(--d-card); border-color: var(--d-line2); }

@media (max-width: 991px) { .sh-stack { max-width: 480px; margin-bottom: 112px; } }
@media (max-width: 575px) { .about-section .sh-stack { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .sh-doc .sheet { animation: none; }
  .sh-doc, .sh-btn { transition: none; }
  .sh-stack.pre .sh-doc { opacity: 1; transform: rotate(var(--r, 0deg)); }
}

/* ---- full-screen gallery: opens from a sheet, all 31 models, buttons, keys, swipe ---- */
.sh-lb[hidden] { display: none !important; }
.sh-lb { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; font-family: Rubik, sans-serif; animation: shLbIn .25s ease both; }
.sh-lb-bg { position: absolute; inset: 0; background: rgba(5, 10, 19, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sh-lb-fig { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.sh-lb-fig img { display: block; width: auto; height: auto; max-width: min(92vw, 880px); max-height: calc(100vh - 140px); border-radius: 10px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); cursor: default; }
.sh-lb-fig img.in-next { animation: shLbNext .3s cubic-bezier(.16, 1, .3, 1) both; }
.sh-lb-fig img.in-prev { animation: shLbPrev .3s cubic-bezier(.16, 1, .3, 1) both; }
.sh-lb-fig figcaption { display: flex; align-items: baseline; gap: 14px; margin-top: 16px; color: #e2e8f0; font-size: 16px; }
.sh-lb-name { font-weight: 600; }
.sh-lb-cnt { color: #9db0c8; font-size: 15px; }
.sh-lb-cnt b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.sh-lb-x, .sh-lb-nav { position: absolute; z-index: 1; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; transition: background-color .2s, transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s; }
.sh-lb-x { top: 22px; right: 24px; width: 48px; height: 48px; font-size: 18px; }
.sh-lb-nav { top: 50%; width: 58px; height: 58px; margin-top: -29px; font-size: 18px; }
.sh-lb-nav.prev { left: 28px; }
.sh-lb-nav.next { right: 28px; }
.sh-lb-x:hover, .sh-lb-nav:hover { background: rgba(26, 159, 223, .28); border-color: rgba(92, 196, 245, .7); }
.sh-lb-x:active, .sh-lb-nav:active { transform: scale(.94); }
.sh-lb-x:focus-visible, .sh-lb-nav:focus-visible { outline: 3px solid #5cc4f5; outline-offset: 3px; }
@keyframes shLbIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shLbNext { from { opacity: 0; transform: translateX(34px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes shLbPrev { from { opacity: 0; transform: translateX(-34px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .sh-lb-fig img { max-width: calc(100vw - 24px); max-height: calc(100vh - 190px); }
  .sh-lb-x { top: 14px; right: 14px; width: 44px; height: 44px; }
  .sh-lb-nav { top: auto; bottom: 22px; width: 52px; height: 52px; margin-top: 0; }
  .sh-lb-nav.prev { left: calc(50% - 76px); }
  .sh-lb-nav.next { right: calc(50% - 76px); }
  .sh-lb-fig figcaption { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .sh-lb, .sh-lb-fig img.in-next, .sh-lb-fig img.in-prev { animation: none; } .sh-lb-x, .sh-lb-nav { transition: none; } }
