/* Dan na ranču — UI over the 3D farm. Builds on site.css tokens. */
html, body.ranc { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.ranc { background: var(--night); -webkit-tap-highlight-color: transparent; }
body.ranc::after { opacity: .035; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: default; user-select: none; -webkit-user-select: none; }
#scene.grab { cursor: grab; } #scene.grabbing { cursor: grabbing; } #scene.pointer { cursor: pointer; } #scene.none { cursor: none; }

.r-fade { position: fixed; inset: 0; z-index: 40; background: var(--night); opacity: 0; pointer-events: none; transition: opacity .6s var(--ease-io); }
.r-fade.on { opacity: 1; pointer-events: auto; }
.r-chapter { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 0 24px; opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .9s var(--ease); }
.r-fade.chap .r-chapter { opacity: 1; transform: none; transition-delay: .25s; }
.r-chapter__title { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -.02em; color: var(--bone); text-wrap: balance; }

/* frosted panels */
.r-task, .r-card, .r-menu, .r-keys {
  color: var(--bone);
  background: linear-gradient(180deg, rgba(28, 24, 19, .62), rgba(16, 14, 11, .72));
  -webkit-backdrop-filter: blur(22px) saturate(1.35); backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(236, 230, 218, .13); border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 70px -28px rgba(0, 0, 0, .7);
}

/* loader */
.r-loader { position: fixed; inset: 0; z-index: 60; background: var(--night); display: grid; place-content: center; justify-items: center; gap: 26px; transition: opacity 1.1s var(--ease), visibility 0s 1.1s; }
.r-loader.done { opacity: 0; visibility: hidden; }
.r-loader__mark { width: min(56vw, 420px); aspect-ratio: 1534 / 399; background: var(--bone); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.r-loader__bar { width: min(56vw, 420px); height: 1px; background: rgba(236,230,218,.16); overflow: hidden; }
/* it moves from the first moment: the crawl covers the download, main.js takes over with the real steps */
.r-loader__bar i { display: block; height: 100%; width: 100%; background: var(--bone); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); animation: load-crawl 12s cubic-bezier(.1, .75, .2, 1) forwards; }
@keyframes load-crawl { to { transform: scaleX(.16); } }
.r-loader__note { max-width: 34ch; text-align: center; font-size: .9375rem; line-height: 1.45; }
.r-loader__note a { color: var(--bone); text-underline-offset: 3px; }
.r-loader p { color: var(--smoke); }

/* top bar */
.r-top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px var(--g); padding-top: calc(16px + env(safe-area-inset-top, 0px)); pointer-events: none; }
.r-top > * { pointer-events: auto; }
.r-top > :first-child { justify-self: start; }
.r-top > :last-child { justify-self: end; }
.r-pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 18px; border-radius: 999px; text-decoration: none;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .03em; text-transform: uppercase; color: var(--bone);
  background: rgba(18,15,12,.42); border: 1px solid rgba(236,230,218,.2); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.r-pill:hover { background: rgba(18,15,12,.72); border-color: rgba(236,230,218,.45); }
.r-pill b { font-weight: 400; color: #fff; }
.r-season { color: var(--bone); text-shadow: 0 1px 14px rgba(0,0,0,.55); text-align: center; transition: opacity .6s; }
.r-top__end { display: flex; gap: 8px; align-items: center; }
/* sound toggle: four bars that dance while sound is on */
.r-snd { gap: 9px; padding: 0 15px; }
.r-snd__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.r-snd__bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; transition: height .3s var(--ease); }
.r-snd.is-on .r-snd__bars i { animation: sndbar 1.1s ease-in-out infinite; }
.r-snd.is-on .r-snd__bars i:nth-child(2) { animation-delay: -.35s; }
.r-snd.is-on .r-snd__bars i:nth-child(3) { animation-delay: -.7s; }
.r-snd.is-on .r-snd__bars i:nth-child(4) { animation-delay: -.2s; }
@keyframes sndbar { 0%, 100% { height: 3px; } 50% { height: 13px; } }
@media (max-width: 560px) { .r-snd__lbl { display: none; } .r-snd { padding: 0 13px; } }
@media (max-width: 560px) { .r-season { display: none; } .r-top { grid-template-columns: 1fr 1fr; } }

/* intro + finale: big type straight on the scene, with a soft shade behind */
/* intro and finale lines rise in one after another */
.r-intro:not([hidden]) > *, .r-finale:not([hidden]) > * { animation: rrise 1.2s var(--ease) both; }
.r-intro > :nth-child(2), .r-finale > :nth-child(2) { animation-delay: .08s; }
.r-intro > :nth-child(3), .r-finale > :nth-child(3) { animation-delay: .18s; }
.r-intro > :nth-child(4), .r-finale > :nth-child(4) { animation-delay: .28s; }
.r-intro > :nth-child(5), .r-finale > :nth-child(5) { animation-delay: .36s; }
@keyframes rrise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .r-intro > *, .r-finale > * { animation: none !important; } }
.r-intro, .r-finale {
  position: fixed; z-index: 10; left: var(--g); bottom: calc(var(--g) + env(safe-area-inset-bottom, 0px)); width: min(620px, calc(100% - 2 * var(--g)));
  display: grid; gap: 20px; color: var(--bone);
}
.r-intro::before, .r-finale::before {
  content: ""; position: absolute; z-index: -1; inset: -40% -30% -30% calc(-1 * var(--g)); pointer-events: none;
  background: radial-gradient(closest-side, rgba(12, 10, 8, .62), rgba(12, 10, 8, 0));
}
.r-title { font-family: var(--serif); font-weight: 400; font-size: clamp(3.2rem, 8vw, 7.8rem); line-height: .9; letter-spacing: -.03em; text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.r-title em { font-style: italic; }
.r-lead { font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.55; color: #e2dbcf; max-width: 46ch; }
.r-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.r-link { background: none; border: 0; padding: 8px 0; color: var(--bone); text-decoration: none; border-bottom: 1px solid rgba(236,230,218,.35); }
.r-link:hover { color: #fff; border-color: #fff; }
.r-intro, .r-task, .r-card, .r-menu, .r-finale { transition: opacity .7s var(--ease), transform .8s var(--ease); }
.r-hide { opacity: 0 !important; transform: translateY(16px) !important; pointer-events: none !important; }

/* task panel */
.r-task { position: fixed; z-index: 10; left: var(--g); bottom: calc(var(--g) + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100% - 2 * var(--g))); padding: 20px 22px 14px; display: grid; gap: 9px; }
.r-task__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.65rem, 2.2vw, 2.1rem); line-height: 1.02; letter-spacing: -.01em; }
.r-task__hint { font-size: .9375rem; line-height: 1.5; color: #d9d2c5; text-wrap: pretty; }
.r-progress { height: 3px; background: rgba(236,230,218,.14); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.r-progress i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--bone); transition: transform .45s var(--ease); }
.r-task__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--smoke); min-height: 34px; }

.r-keys { position: fixed; z-index: 10; right: var(--g); bottom: calc(var(--g) + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; padding: 13px 15px; color: #d2cbbe; }
.r-keys span { display: flex; gap: 6px; align-items: center; }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid rgba(236,230,218,.3); border-radius: 5px; font-family: var(--mono); font-size: .6875rem; color: var(--bone); }

/* things pinned to the 3D scene (positioned by JS) */
.r-markers, .r-labels { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.r-labels { z-index: 9; }
.r-markers > * { position: absolute; left: 0; top: 0; pointer-events: auto; transition: opacity .35s; will-change: transform; }
.r-markers > .off { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }

.mk { display: flex; align-items: center; gap: 10px; padding: 0; margin: -8px 0 0 -8px; background: none; border: 0; color: var(--bone); }
.mk__dot { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--bone); box-shadow: 0 0 0 4px rgba(236,230,218,.25), 0 4px 14px rgba(0,0,0,.35); flex: none; }
.mk__dot::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(236,230,218,.75); animation: mkpulse 2.2s var(--ease) infinite; }
@keyframes mkpulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.mk__lbl { font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .03em; padding: 6px 10px; border-radius: 999px; background: rgba(16,14,11,.58); border: 1px solid rgba(236,230,218,.16); white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mk:hover .mk__dot { background: #fff; }
.mk.seen .mk__dot { background: transparent; border: 1px solid var(--bone); }
.mk.flip { flex-direction: row-reverse; translate: calc(-100% + 16px) 0; }
.mk.nolabel .mk__lbl { opacity: 0; transition: opacity .25s; }
.mk.nolabel:hover .mk__lbl, .mk.nolabel:focus-visible .mk__lbl { opacity: 1; }

/* small floating tag (labels on feed items, "Sveža paša") */
.r-tag { translate: -50% -100%; font-family: var(--mono); font-size: .6875rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; color: var(--ink);
  padding: 7px 12px; border-radius: 999px; background: rgba(251, 247, 239, .92); border: 0; box-shadow: 0 8px 24px -8px rgba(0,0,0,.45); pointer-events: none; }
.r-tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.r-tag--btn { pointer-events: auto; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease), scale .3s var(--ease); }
.r-tag--btn:hover { background: var(--night); color: var(--bone); scale: 1.05; }
.r-tag--btn.is-wrong { background: rgba(40,34,28,.85); color: rgba(236,230,218,.55); text-decoration: line-through; }

/* a pulsing ring with a label: "Še tu", "Odpri vrata" */
.r-spot { display: flex; flex-direction: column; align-items: center; gap: 8px; translate: -50% -50%; background: none; border: 0; padding: 0; color: var(--bone); }
.r-spot i { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.35); }
.r-spot i::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.8); animation: mkpulse 1.8s var(--ease) infinite; }
.r-spot span { font-family: var(--mono); font-size: .6875rem; letter-spacing: .03em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px; background: rgba(16,14,11,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); white-space: nowrap; }
.r-spot--btn { cursor: pointer; }
.r-spot--btn:hover i { background: #fff; }
.r-spot--btn:hover span { background: var(--bone); color: var(--ink); }

/* "+1", "Muuu" */
.r-pop { position: absolute; left: 0; top: 0; translate: -50% -50%; font-family: var(--cond); font-weight: 700; font-size: 1.9rem; line-height: 1; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.45); animation: rpop 1.4s var(--ease) forwards; }
.r-pop.moo { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.5rem; }
@keyframes rpop { 0% { opacity: 0; translate: -50% -20%; scale: .6; } 18% { opacity: 1; scale: 1.08; } 70% { opacity: 1; } 100% { opacity: 0; translate: -50% -160%; scale: 1; } }

/* gesture hint: a ghost hand (fingertip = anchor) */
.r-hint { position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); --press: 0; }
.r-hint.on { opacity: 1; }
.r-hint__hand { position: absolute; left: -17px; top: -6px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); transform-origin: 17px 6px; transition: transform .25s var(--ease); }
.r-hint__ring { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); opacity: 0; }
.r-hint.tap .r-hint__hand { animation: htap 1.5s var(--ease-io) infinite; }
.r-hint.tap .r-hint__ring { animation: hring 1.5s var(--ease) infinite; }
.r-hint.hold .r-hint__hand { animation: hhold 2.2s var(--ease-io) infinite; }
.r-hint.hold .r-hint__ring { animation: hgrow 2.2s var(--ease) infinite; }
.r-hint.drag .r-hint__hand { transform: scale(calc(1 - var(--press) * .1)); }
.r-hint.drag .r-hint__ring { opacity: calc(var(--press) * .9); transform: scale(.7); transition: opacity .2s; }
.r-hint.rub .r-hint__hand { transform: scale(.9); }
@keyframes htap { 0%, 100% { transform: translate(6px, 12px) scale(1); } 40% { transform: translate(0, 0) scale(1); } 55% { transform: translate(0, 0) scale(.86); } 70% { transform: translate(0, 0) scale(1); } }
@keyframes hring { 0%, 50% { opacity: 0; transform: scale(.4); } 56% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes hhold { 0%, 100% { transform: translate(6px, 12px) scale(1); } 25% { transform: translate(0, 0) scale(.86); } 80% { transform: translate(0, 0) scale(.86); } }
@keyframes hgrow { 0%, 25% { opacity: 0; transform: scale(.4); } 30% { opacity: .9; } 80% { opacity: .9; transform: scale(1.35); } 100% { opacity: 0; transform: scale(1.5); } }

/* toast */
.r-toast { position: fixed; z-index: 30; left: 50%; top: calc(80px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); opacity: 0; pointer-events: none; max-width: min(520px, calc(100% - 32px));
  padding: 14px 20px; border-radius: 12px; background: rgba(251,247,239,.96); color: var(--ink); font-size: .9375rem; line-height: 1.45; text-align: center; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6);
  transition: opacity .5s var(--ease), transform .5s var(--ease); }
.r-toast.on { opacity: 1; transform: translate(-50%, 0); }
.r-toast b { font-weight: 600; }

/* story card */
.r-card { position: fixed; z-index: 15; right: var(--g); top: 50%; transform: translateY(-50%); width: min(440px, calc(100% - 2 * var(--g))); max-height: calc(100% - 130px); overflow: auto; display: grid; overscroll-behavior: contain; }
.r-card.r-hide { transform: translateY(calc(-50% + 16px)) !important; }
.r-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 13px 13px 0 0; background: var(--night-3); isolation: isolate; }
.r-card__img::before { content: ""; position: absolute; inset: -8%; z-index: -1; background: var(--lq, none) center / cover no-repeat; filter: blur(16px) saturate(1.1); }
.r-card__img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .8s var(--ease), transform 1.6s var(--ease); }
.r-card__img.loaded img { opacity: 1; transform: none; }
.r-card__img::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; }
.r-card__img figcaption { position: absolute; z-index: 1; left: 16px; bottom: 13px; color: var(--bone); text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.r-card__img figcaption::before { content: "V resnici · "; color: #f3a066; }
.r-card__body { display: grid; gap: 13px; padding: 20px 24px 24px; }
.r-card__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 2.8vw, 2.6rem); line-height: 1; letter-spacing: -.015em; }
.r-card__title em { font-style: italic; }
.r-card__text { color: #d9d2c5; line-height: 1.6; text-wrap: pretty; }
.r-card .r-row { margin-top: 6px; }
.r-card .pill { --fg: var(--bone); --bg: var(--night); min-height: 48px; padding: 0 22px; }
.r-card .pill--line { --strong: rgba(236,230,218,.4); }

/* task menu */
.r-menu { position: fixed; z-index: 25; right: var(--g); top: calc(72px + env(safe-area-inset-top, 0px)); width: min(430px, calc(100% - 2 * var(--g))); padding: 20px 22px; display: grid; gap: 14px; }
.r-menu__head { display: flex; justify-content: space-between; align-items: baseline; }
.r-menu__list { display: grid; border-top: 1px solid rgba(236,230,218,.14); }
.r-menu__list button {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; text-align: left; padding: 13px 0;
  background: none; border: 0; border-bottom: 1px solid rgba(236,230,218,.14); color: var(--bone); transition: padding .5s var(--ease), background .5s var(--ease);
}
.r-menu__list button:hover { padding-inline: 10px; background: rgba(236,230,218,.05); }
.r-menu__list .n { font-family: var(--cond); font-weight: 300; font-size: 2.1rem; line-height: .8; color: var(--smoke); }
.r-menu__list b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.1; }
.r-menu__list small { font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; color: var(--smoke); }
.r-menu__list .st { font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; color: var(--smoke); }
.r-menu__list .is-done .st { color: var(--bone); }

/* season switcher in free explore */
.r-seasons { position: fixed; z-index: 10; left: 50%; bottom: calc(var(--g) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 4px; padding: 5px;
  border-radius: 999px; background: rgba(18,15,12,.48); border: 1px solid rgba(236,230,218,.18); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  transition: opacity .6s var(--ease), transform .7s var(--ease); max-width: calc(100% - 2 * var(--g)); overflow-x: auto; scrollbar-width: none; }
.r-seasons::-webkit-scrollbar { display: none; }
.r-seasons.r-hide { transform: translate(-50%, 16px) !important; }
.r-seasons button { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--bone); font-family: var(--mono); font-size: .6875rem; letter-spacing: .03em; text-transform: uppercase; transition: background .35s var(--ease), color .35s var(--ease); }
.r-seasons button:hover { background: rgba(236,230,218,.1); }
.r-seasons button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.r-fps { position: fixed; z-index: 50; left: 10px; top: 70px; padding: 4px 8px; background: rgba(0,0,0,.6); color: #9f9; font-size: .6875rem; border-radius: 4px; pointer-events: none; }
.r-noscript { position: fixed; inset: auto 20px 20px 20px; z-index: 99; color: var(--bone); }

@media (max-width: 760px) {
  .r-card { top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); right: 10px; left: 10px; width: auto; transform: none; max-height: 70svh; }
  .r-card.r-hide { transform: translateY(16px) !important; }
  .r-card__img { aspect-ratio: 16 / 8; }
  .r-card__body { padding: 16px 18px 18px; gap: 10px; }
  .r-card .pill { min-height: 44px; padding: 0 18px; }
  .r-task { left: 10px; right: 10px; width: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 15px 16px 10px; gap: 7px; }
  .r-task__title { font-size: 1.5rem; }
  .r-task__hint { font-size: .875rem; }
  .r-keys { display: none !important; }
  .r-menu { left: 10px; right: 10px; width: auto; }
  .mk__lbl { display: none; }
  .r-intro, .r-finale { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { .mk__dot::after, .r-spot i::after, .r-hint *, .r-snd__bars i { animation: none !important; } .r-snd.is-on .r-snd__bars i { height: 9px; } }
