/* Muzej Brodskog Posavlja: one-section homepage mockup. Sizes are in rem; on wide screens the root size follows the
   viewport so everything scales up to 4K. Hover rule: only the fill fades, text colour switches, nothing moves. */
:root {
  --ink: #132125; --deep: #1a2d32; --teal: #38535a; --gold: #b8a32d; --gold-l: #d8c458; --cream: #f1ecdf; --mute: rgba(241, 236, 223, 0.66);
  --line: rgba(241, 236, 223, 0.16); --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif; --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --label: "Marcellus", "Cormorant Garamond", Georgia, serif;   /* inscription capitals: logo, button labels, Roman numerals */
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (min-width: 1001px) { html { font-size: clamp(14px, min(1vw, 1.78vh), 40px); } }
body { margin: 0; background: var(--ink); color: var(--cream); font-family: var(--sans); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 3px; }
body.is-locked { overflow: hidden; }

/* header */
.hdr { position: fixed; z-index: 30; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.4rem 2.5rem; }
.brand { display: flex; align-items: center; gap: 0.8rem; color: var(--gold); }
.brand svg { width: 2.9rem; height: 2.9rem; }
.brand span { color: var(--cream); font-family: var(--label); font-weight: 400; font-size: 1.04rem; line-height: 1.18; letter-spacing: 0.1em; text-transform: uppercase; }
.hdr-right { display: flex; align-items: center; gap: 1.1rem; }
.hdr-cta { margin-left: 0; height: 2.9rem; padding: 0 1.7rem; }
.hdr-nav ul { display: flex; gap: 0.25rem; }
.hdr-nav a { display: block; color: rgba(241, 236, 223, 0.82); padding: 0.55rem 1.05rem; border-radius: 99rem; font-family: "Figtree", var(--sans); font-size: 1.12rem; font-weight: 300; letter-spacing: 0.01em; transition: background-color 0.15s linear; }
@media (hover: hover) { .hdr-nav a:hover { background-color: rgba(241, 236, 223, 0.12); color: var(--cream); } }
.burger { display: none; position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); transition: background-color 0.15s linear; }
.burger i { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform 0.35s var(--ease); }
.burger i:first-child { top: 18px; } .burger i:last-child { top: 25px; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.mnav { position: fixed; z-index: 25; inset: 0; display: flex; align-items: center; padding: 96px 28px 40px; background: var(--deep); visibility: hidden; transform: translateX(100%); transition: transform 0.35s var(--ease), visibility 0s linear 0.35s; overflow-y: auto; }
.mnav.is-open { visibility: visible; transform: none; transition: transform 0.35s var(--ease), visibility 0s; }
.mnav ul { width: 100%; }
.mnav li { border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(14px); }
.mnav.is-open li { opacity: 1; transform: none; transition: opacity 0.4s var(--ease) calc(0.12s + var(--n) * 0.04s), transform 0.4s var(--ease) calc(0.12s + var(--n) * 0.04s); }
.mnav a { display: block; padding: 13px 0; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; }

/* stage */
.zb { position: relative; height: 100vh; height: 100svh; min-height: 34rem; overflow: hidden;
  background: radial-gradient(120% 90% at 18% 50%, #2f4a51 0%, rgba(47, 74, 81, 0) 62%), linear-gradient(160deg, #1d3238 0%, #132125 70%); }
.zb::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }
.zb-mark { position: absolute; right: -9rem; bottom: -11rem; width: 38rem; color: var(--cream); opacity: 0.035; pointer-events: none; }
.zb-mark svg { width: 100%; height: auto; }

/* wheel: katalog.js-style layout, every frame, from site.js */
.zb-wheel { position: absolute; z-index: 1; left: 0; top: 0; width: 47%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.zb-wheel.is-drag { cursor: grabbing; }
.zb-orbit, .zb-dial, .zb-inner { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; will-change: transform; }
/* two dashed rings that never stop: the one through the pictures turns one way, the inner one the other */
.zb-orbit { overflow: visible; animation: zb-turn 420s linear infinite reverse; }
.zb-orbit circle { fill: none; stroke: var(--gold-l); stroke-opacity: 0.5; stroke-width: 1.5; }
/* time: a clock dial outside the pictures (ticks, Roman numerals, a fixed marker at "now"), a slow ring inside */
.zb-dial { overflow: visible; }
.zb-dial line { stroke: rgba(241, 236, 223, 0.3); stroke-width: 1; }
.zb-dial line.is-major { stroke: var(--gold-l); stroke-width: 1.5; }
.zb-dial circle { fill: none; stroke: rgba(241, 236, 223, 0.14); stroke-width: 1; }
.zb-inner { overflow: visible; animation: zb-turn 300s linear infinite; }
/* the inner ring is a second, finer scale in the dial's style: a hairline with ticks (wide strokes with very short dashes) */
.zb-inner circle { fill: none; }
.zb-inner .l { stroke: rgba(241, 236, 223, 0.14); stroke-width: 1; }
.zb-inner .t { stroke: rgba(241, 236, 223, 0.3); }
.zb-sand { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@keyframes zb-turn { to { transform: rotate(360deg); } }
.zb-num { position: absolute; left: 0; top: 0; width: 4em; margin: -0.6em 0 0 -2em; text-align: center; font-family: var(--label); font-weight: 400; font-size: calc(var(--D, 300px) * 0.046); line-height: 1.2; letter-spacing: 0.06em; color: var(--gold-l); pointer-events: none; will-change: transform, opacity; }
.zb-now { position: absolute; left: 0; top: 0; width: 0; height: 0; margin-top: -0.32rem; border: 0.32rem solid transparent; border-left: 0; border-right: 0.62rem solid var(--gold-l); pointer-events: none; }
.zb-item { position: absolute; left: 0; top: 0; width: var(--D, 300px); height: var(--D, 300px); border-radius: 50%; will-change: transform, opacity; cursor: pointer; }
/* the objects are transparent cut-outs: no frame, a soft light behind each one lifts it off the dark stage (a gradient,
   not a filter: filters on moving pictures froze phones on the Choccos catalogue) */
.zb-item::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(241, 236, 223, 0.17), rgba(241, 236, 223, 0.06) 55%, rgba(241, 236, 223, 0) 100%); }
.zb-pic { position: absolute; inset: 0; will-change: transform; }
.zb-pic img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.zb-item.is-on { cursor: inherit; }

/* text */
.zb-text { position: absolute; left: 51%; top: 0; bottom: 0; width: 33rem; max-width: 44%; display: flex; flex-direction: column; justify-content: center; padding: 6rem 0 5rem; }
.zb-eyebrow { display: flex; align-items: center; gap: 0.9rem; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-l); }
.zb-eyebrow svg { flex: none; width: 1.7rem; height: 1.7rem; }   /* the museum mark, in place of a rule */
.zb-head { display: flex; align-items: flex-end; min-height: 8.6rem; margin-top: 0.6rem; }
.zb-title { font-family: var(--serif); font-weight: 600; font-size: 4rem; line-height: 0.98; letter-spacing: -0.012em; text-wrap: balance; }
.zb-desc { margin-top: 1.5rem; min-height: 16.5rem; font-size: 1rem; line-height: 1.68; color: var(--mute); }
.zb-ctl { display: flex; align-items: center; gap: 1.4rem; margin-top: 1.6rem; }
.zb-arrows { display: flex; gap: 0.6rem; }
.rbtn { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 1px solid rgba(241, 236, 223, 0.34); transition: background-color 0.15s linear; }
.rbtn svg { width: 1.25rem; height: 1.25rem; }
.rbtn-down svg { transform: rotate(180deg); }
.rbtn:active { background-color: var(--gold-l); color: var(--ink); }
.zb-count { display: flex; align-items: baseline; gap: 0.45rem; font-family: var(--serif); font-weight: 600; }
.zb-count b { font-size: 2rem; line-height: 1; font-weight: 600; color: var(--cream); font-variant-numeric: lining-nums; }
.zb-count i { font-style: normal; font-size: 1rem; color: var(--mute); }
.btn { margin-left: auto; display: inline-flex; align-items: center; height: 3.25rem; padding: 0 1.7rem; border-radius: 99rem; background-color: var(--gold); color: var(--ink); font-family: var(--sans); font-size: 1.02rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; transition: background-color 0.15s linear; }
@media (hover: hover) {
  .rbtn:hover { background-color: var(--gold-l); color: var(--ink); }
  .btn:hover { background-color: var(--cream); }
}
/* text change: out, then in (keyframes, so they never fight a hover transition). The name comes in word by word
   from behind a mask, the number and the description follow. */
.zb-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.14em 0.05em 0.2em; margin: -0.14em -0.05em -0.2em; }
.zb-title .w > span { display: inline-block; will-change: transform; }
.zb-text.is-out .sw, .zb-text.is-out .zb-title { animation: sw-out 0.22s var(--ease) forwards; }
.zb-text.is-in .sw { animation: sw-in 0.7s var(--ease) both; animation-delay: calc(var(--n) * 0.07s); }
.zb-text.is-in .zb-title .w > span { animation: w-in 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--n) * 0.07s); }
@keyframes w-in { from { transform: translateY(calc(var(--d, 1) * 115%)); } }
@keyframes sw-out { to { opacity: 0; transform: translateY(calc(var(--d, 1) * -0.9rem)); } }
@keyframes sw-in { from { opacity: 0; transform: translateY(calc(var(--d, 1) * 1.6rem)); } }

/* list of collections (wide screens) */
/* progress rail (wide screens): Roman numerals on a line that fills from the first collection to the one on show, and is
   full on the last. The line runs from the first numeral's centre to the last one's. */
.zb-list { position: absolute; right: 2.5rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0.5rem; }
.zb-list::before, .zb-list::after { content: ""; position: absolute; left: 0; top: 1.25rem; bottom: 1.25rem; width: 1px; background: var(--line); }
.zb-list::after { width: 2px; left: -0.5px; background: var(--gold-l); transform-origin: top; transform: scaleY(var(--p, 0)); transition: transform 0.5s var(--ease); }
.zb-list li { position: relative; padding-left: 1.1rem; }
.zb-list li::before { content: ""; position: absolute; z-index: 1; left: -0.2rem; top: 50%; width: 0.4rem; height: 0.4rem; margin-top: -0.2rem; margin-left: 0.5px; border-radius: 50%; background-color: #4d646a; transition: background-color 0.3s linear; }
.zb-list li.is-past::before { background-color: var(--gold-l); }
.zb-list button { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; font-family: var(--label); font-weight: 400; font-size: 0.95rem; letter-spacing: 0.05em; color: rgba(241, 236, 223, 0.5); transition: background-color 0.15s linear; }
.zb-list button[aria-current="true"] { color: var(--gold-l); background-color: rgba(241, 236, 223, 0.1); }
@media (hover: hover) { .zb-list button:hover { background-color: rgba(241, 236, 223, 0.16); color: var(--cream); } }

.credit { position: absolute; z-index: 3; left: 2.5rem; bottom: 1.3rem; display: flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; color: rgba(241, 236, 223, 0.5); }
.credit a { display: inline-flex; align-items: center; gap: 0.3rem; color: rgba(241, 236, 223, 0.78); }
.credit img { width: 0.875rem; height: 0.875rem; }
.credit i { font-style: normal; opacity: 0.5; }

/* intro, part 1: the loader. The mark draws itself and the name rises letter by letter while the pictures load; then
   the logo fades and the dark sheet after it. */
.ld { display: none; }
.js .ld { display: grid; place-items: center; position: fixed; z-index: 60; inset: 0; background: #132125; }
.ld-in { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.ld-mark { position: relative; width: 7.5rem; height: 7.5rem; margin: 0 auto; color: var(--gold); }
.ld-logo { position: absolute; inset: 0; width: 100%; height: 100%; }
.ld-logo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ld-draw 1.25s cubic-bezier(0.5, 0, 0.2, 1) forwards; }
.ld-logo path:nth-of-type(2) { animation-delay: 0.1s; } .ld-logo path:nth-of-type(3) { animation-delay: 0.2s; } .ld-logo path:nth-of-type(4) { animation-delay: 0.3s; }
.ld-logo path:nth-of-type(5) { animation-delay: 0.85s; animation-duration: 0.5s; }
.ld-logo circle { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: ld-pop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) 0.15s forwards; }
@keyframes ld-draw { to { stroke-dashoffset: 0; } }
@keyframes ld-pop { to { transform: none; } }
.ld-name { margin-top: 2rem; text-align: center; font-family: var(--label); font-size: 1.3rem; line-height: 1.5; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream); }
.ld-name .c { display: inline-block; overflow: hidden; vertical-align: top; }
.ld-name .c > i { display: inline-block; font-style: normal; transform: translateY(115%); animation: ld-rise 0.6s var(--ease) forwards; animation-delay: calc(0.45s + var(--n) * 0.035s); }
@keyframes ld-rise { to { transform: none; } }
.ld.is-out { pointer-events: none; animation: ld-fade 0.75s var(--ease) 0.35s forwards; }   /* the logo goes first, then the sheet */
.ld.is-out .ld-in { opacity: 0; transform: scale(0.96); }
@keyframes ld-fade { to { opacity: 0; } }
.ld.is-gone { display: none; }

/* intro, part 2: the stage. The wheel spins in (site.js), then the text, the header and the rail arrive. */
/* the rings and the dial fade in one after another once the logo is gone; the objects and the dust follow (site.js) */
.js .zb-inner, .js .zb-orbit, .js .zb-dial, .js .zb-now, .js .zb-text > *, .js .zb-list, .js .hdr { opacity: 0; }
.js.is-ready .zb-inner { opacity: 1; transition: opacity 0.9s var(--ease) 0.1s; }
.js.is-ready .zb-orbit { opacity: 1; transition: opacity 0.9s var(--ease) 0.4s; }
.js.is-ready .zb-dial { opacity: 1; transition: opacity 0.9s var(--ease) 0.7s; }
.js.is-ready .zb-now { opacity: 1; transition: opacity 0.6s var(--ease) 2.2s; }
.js.is-ready .hdr { opacity: 1; transition: opacity 0.7s var(--ease) 2.1s; }
.js.is-ready .zb-list { opacity: 1; transition: opacity 0.7s var(--ease) 2.3s; }
/* (its own keyframes with an explicit end state: these elements are still `opacity: 0` underneath until `is-done`, so
   an animation that only names the start faded from nothing to nothing and the text popped in at the end) */
.js.is-ready:not(.is-done) .zb-text > * { animation: intro-in 0.9s var(--ease) both; }
@keyframes intro-in { from { opacity: 0; transform: translateY(1.8rem); } to { opacity: 1; transform: none; } }
.js.is-ready:not(.is-done) .zb-title .w > span { animation: w-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(1.5s + var(--n) * 0.08s); }
.js.is-ready:not(.is-done) .zb-text > :nth-child(1) { animation-delay: 1.35s; } .js.is-ready:not(.is-done) .zb-text > :nth-child(2) { animation-delay: 1.5s; }
.js.is-ready:not(.is-done) .zb-text > :nth-child(3) { animation-delay: 1.68s; } .js.is-ready:not(.is-done) .zb-text > :nth-child(4) { animation-delay: 1.85s; }
.js.is-done .zb-text > * { opacity: 1; }

@media (max-width: 1280px) { .zb-text { max-width: 38%; } }
@media (max-width: 1000px) { .zb-list { display: none; } }

/* tablets and phones: wheel on top, text below, the page scrolls */
@media (max-width: 1000px) {
  .hdr { position: absolute; padding: 14px 18px; }
  body.is-locked .hdr { position: fixed; }
  .hdr-nav, .hdr-cta { display: none; }
  .burger { display: block; }
  .brand svg { width: 38px; height: 38px; } .brand span { font-size: 14px; }
  .zb { height: auto; min-height: 100svh; overflow: hidden; padding-bottom: 64px; }
  /* horizontal slider: the rings arc in from the top, the neighbours peek in at the sides; a sideways swipe turns it */
  .zb-wheel { position: relative; width: 100%; height: 47svh; min-height: 320px; max-height: 560px; overflow: hidden; touch-action: pan-y;
    -webkit-mask-image: linear-gradient(90deg, #0000, #000 9%, #000 91%, #0000); mask-image: linear-gradient(90deg, #0000, #000 9%, #000 91%, #0000); }
  .zb-now { margin: 0 0 0 -0.32rem; border: 0.32rem solid transparent; border-top: 0; border-bottom: 0.62rem solid var(--gold-l); }
  .rbtn svg { transform: rotate(-90deg); } .rbtn-down svg { transform: rotate(90deg); }
  .zb-text { position: relative; left: auto; width: auto; max-width: 620px; margin: 0 auto; padding: 8px 22px 0; display: block; }
  .zb-head { min-height: 0; margin-top: 12px; }
  .zb-title { font-size: clamp(36px, 9.6vw, 56px); }
  .zb-desc { min-height: 0; margin-top: 16px; font-size: 16px; }
  .zb-ctl { flex-wrap: wrap; gap: 16px; margin-top: 24px; }
  .rbtn { width: 48px; height: 48px; } .btn { height: 48px; padding: 0 22px; font-size: 15.5px; }
  .zb-mark { width: 380px; right: -120px; bottom: -120px; }
  .credit { left: 22px; bottom: 20px; font-size: 12px; }
}
/* tablets: a taller wheel, so the objects are not phone-sized on a large screen */
@media (min-width: 641px) and (max-width: 1000px) { .zb-wheel { height: 56svh; max-height: 700px; } .zb-text { padding-top: 20px; } }
/* phones: one row of controls (arrows + button; the number is already on the dial), shorter text */
@media (max-width: 640px) {
  .zb-count { display: none; }
  .zb-ctl { flex-wrap: nowrap; gap: 12px; margin-top: 20px; }
  .btn { flex: 1; margin-left: 4px; justify-content: center; padding: 0 12px; }
  .zb-desc { margin-top: 12px; font-size: 15.5px; line-height: 1.62; }
  .zb-desc.is-clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .zb-inner, .js .zb-orbit, .js .zb-dial, .js .zb-now, .js .zb-text > *, .js .zb-list, .js .hdr, .mnav li { opacity: 1; transform: none; }
  .js .ld { display: none; }
}
