/* Moje gospodarstwo — interaktywny widok */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #10130f;
  --panel: #1a1f17;
  --accent: #f2b134;
  --text: #f4f1e8;
  --line: rgba(244, 241, 232, .14);
  --glass: rgba(16, 19, 15, .78);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pad: clamp(18px, 3.4vw, 52px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Scena ---------- */

.scene {
  position: fixed; inset: 0;
  overflow: hidden;
  background: var(--bg);
  container-type: size;
}
.pan {
  position: absolute; inset: 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pan::-webkit-scrollbar { display: none; }

/* Film zawsze wypełnia ekran; nadmiar szerokości przesuwa się w poziomie. */
.stage {
  --w: max(100vw, calc(100vh * 16 / 9));
  --h: max(100vh, calc(100vw * 9 / 16));
  --top: calc((100vh - var(--h)) / 2);
  position: relative;
  width: var(--w); height: var(--h);
  margin-top: var(--top);
}
@supports (width: 1cqw) {
  .stage {
    --w: max(100cqw, calc(100cqh * 16 / 9));
    --h: max(100cqh, calc(100cqw * 9 / 16));
    --top: calc((100cqh - var(--h)) / 2);
  }
}
.stage__poster, .stage__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.stage__video {
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.stage.is-live .stage__video { opacity: 1; }

.shade {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 12, 9, .74) 0, rgba(10, 12, 9, .28) 16%, rgba(10, 12, 9, 0) 32%),
    linear-gradient(to top, rgba(10, 12, 9, .82) 0, rgba(10, 12, 9, .3) 20%, rgba(10, 12, 9, 0) 38%);
}

/* ---------- Nagłówek ---------- */

.top {
  position: absolute; left: 0; top: 0;
  padding: calc(var(--pad) * .8 + env(safe-area-inset-top, 0px)) var(--pad) 0;
  pointer-events: none;
  animation: rise .9s var(--ease) both .15s;
}
.top h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(30px, 4.6vw, 68px);
  line-height: 1;
  letter-spacing: -.022em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .45);
}
.top__hint {
  margin: clamp(8px, 1vw, 14px) 0 0;
  font-size: clamp(13px, 1.1vw, 16px);
  letter-spacing: .01em;
  opacity: .82;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}

/* ---------- Punkty na filmie ---------- */

.spot {
  position: absolute;
  left: var(--x); top: var(--y);
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, calc(-100% + 9px));
  animation: spot-in .8s var(--ease) both;
  animation-delay: calc(.7s + var(--n) * .12s);
}
.spot[data-i="0"] { --x: 18.4%; --y: 41.5%; --n: 0; }
.spot[data-i="1"] { --x: 33.4%; --y: 34.5%; --n: 1; }
.spot[data-i="2"] { --x: 73.6%; --y: 33%;   --n: 2; }
.spot[data-i="3"] { --x: 52%;   --y: 67.5%; --n: 3; }

.spot__pill {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 15px 9px 11px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  transition: transform .35s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.spot__num {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(242, 177, 52, .14);
  transition: background-color .25s, color .25s;
}
.spot__stem {
  width: 1px; height: 26px;
  background: linear-gradient(to bottom, rgba(244, 241, 232, .75), rgba(244, 241, 232, .25));
  transition: height .35s var(--ease);
}
.spot__dot {
  position: relative;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff8e6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.spot__dot::before, .spot__dot::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse 2.8s ease-out infinite;
  animation-delay: calc(var(--n) * .45s);
}
.spot__dot::after { animation-delay: calc(var(--n) * .45s + 1.4s); }

.spot:hover .spot__pill, .spot:focus-visible .spot__pill, .spot.is-hot .spot__pill {
  background: var(--accent); color: #14160f; border-color: var(--accent);
  transform: translateY(-5px);
}
.spot:hover .spot__num, .spot:focus-visible .spot__num, .spot.is-hot .spot__num { background: rgba(20, 22, 15, .16); color: #14160f; }
.spot:hover .spot__stem, .spot:focus-visible .spot__stem, .spot.is-hot .spot__stem { height: 31px; }
.spot:focus-visible { outline: none; }
.spot:focus-visible .spot__pill { outline: 2px solid #fff8e6; outline-offset: 3px; }

/* ---------- Dolny pasek miejsc ---------- */

.dock {
  position: absolute; left: 50%; bottom: calc(clamp(12px, 2.2vw, 26px) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  animation: rise-dock .9s var(--ease) both .45s;
}
.chip {
  width: clamp(120px, 11vw, 168px);
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 0 8px;
  border-radius: 13px;
  text-align: left;
  transition: background-color .25s;
}
.chip img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 13px;
  outline: 1.5px solid transparent; outline-offset: -1.5px;
  transition: outline-color .25s, filter .25s;
  filter: saturate(.92) brightness(.92);
}
.chip__txt {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 7px;
  font-size: 14px; font-weight: 600;
}
.chip__num { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.chip:hover img, .chip:focus-visible img, .chip.is-hot img { outline-color: var(--accent); filter: none; }
.chip:hover, .chip:focus-visible, .chip.is-hot { background: rgba(244, 241, 232, .06); }

.panhint {
  position: absolute; left: 50%; bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0; padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .5s, visibility 0s .5s;
}
.panhint span { color: var(--accent); font-weight: 700; padding: 0 3px; }
.panhint.is-on { opacity: 1; visibility: visible; transition: opacity .5s 1.6s; }

/* ---------- Podgląd miejsca ---------- */

.viewer {
  position: fixed; inset: 0; z-index: 20;
  background: #0b0d0a;
  overflow: hidden;
  container-type: size;
  visibility: hidden;
  clip-path: circle(0px at var(--cx, 50%) var(--cy, 50%));
  transition: clip-path .7s cubic-bezier(.65, 0, .25, 1), visibility 0s .7s;
}
.viewer.is-open {
  visibility: visible;
  clip-path: circle(150vmax at var(--cx, 50%) var(--cy, 50%));
  transition: clip-path .9s cubic-bezier(.65, 0, .25, 1), visibility 0s 0s;
}

.viewer__media { position: absolute; inset: 0; }
.vm {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
}
.vm.is-on { opacity: 1; }
.vm > img, .vm > video {
  --mw: max(100vw, calc(100vh * 16 / 9));
  --mh: max(100vh, calc(100vw * 9 / 16));
  position: absolute; left: 50%; top: 50%;
  width: var(--mw); height: var(--mh);
  max-width: none;
  object-fit: cover;
  transform: translate(-50%, -50%);
  will-change: transform;
}
@supports (width: 1cqw) {
  .vm > img, .vm > video {
    --mw: max(100cqw, calc(100cqh * 16 / 9));
    --mh: max(100cqh, calc(100cqw * 9 / 16));
  }
}
.vm > img { animation: zoom 18s ease-in-out infinite alternate; }

/* Wąski ekran: kadr jest szerszy niż ekran, więc powoli się przesuwa. */
@media (max-aspect-ratio: 5/4) {
  .vm > img, .vm > video {
    --travel: calc((var(--mw) - 100vw) * .36);
    animation: drift 24s ease-in-out infinite alternate;
  }
}

.viewer__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8, 10, 7, .6) 0, rgba(8, 10, 7, 0) 22%),
    linear-gradient(to top, rgba(8, 10, 7, .88) 0, rgba(8, 10, 7, .35) 26%, rgba(8, 10, 7, 0) 52%);
}

.viewer__back {
  position: absolute;
  left: var(--pad); top: calc(var(--pad) * .8 + env(safe-area-inset-top, 0px));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px 11px 12px;
  border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  font-size: 15px; font-weight: 600;
  transition: background-color .25s, color .25s, border-color .25s;
}
@media (hover: hover) {
  .viewer__back:hover, }

.viewer__caption {
  position: absolute;
  left: var(--pad); right: calc(var(--pad) + 140px);
  bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.viewer__count {
  margin: 0 0 clamp(6px, 1vw, 14px);
  font-size: 13px; font-weight: 700; letter-spacing: .14em;
  color: var(--accent);
}
.viewer__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(46px, 9vw, 132px);
  line-height: .95;
  letter-spacing: -.03em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .45);
}
.viewer__sub {
  margin: clamp(8px, 1vw, 16px) 0 0;
  font-size: clamp(15px, 1.5vw, 20px);
  opacity: .85;
}
.viewer__sub:empty { display: none; }
.viewer__caption.is-in > * { animation: rise .7s var(--ease) both; }
.viewer__caption.is-in > :nth-child(2) { animation-delay: .07s; }
.viewer__caption.is-in > :nth-child(3) { animation-delay: .14s; }

.viewer__nav {
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px;
}
.viewer__nav button {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--glass); border: 1px solid var(--line);
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.viewer__nav button:active { transform: scale(.94); }

/* ---------- Animacje ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rise-dock { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spot-in {
  from { opacity: 0; transform: translate(-50%, calc(-100% + 9px - 16px)); }
  to { opacity: 1; transform: translate(-50%, calc(-100% + 9px)); }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .75; }
  70%, 100% { transform: scale(3.4); opacity: 0; }
}
@keyframes zoom {
  from { transform: translate(-50%, -50%) scale(1.001); }
  to { transform: translate(-50%, -50%) scale(1.07); }
}
@keyframes drift {
  from { transform: translate(calc(-50% + var(--travel)), -50%); }
  to { transform: translate(calc(-50% - var(--travel)), -50%); }
}

/* ---------- Telefon ---------- */

@media (max-width: 720px) {
  .dock {
    left: 10px; right: 10px; transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 6px; padding: 6px;
    border-radius: 17px;
    animation-name: rise;
  }
  .chip { width: auto; gap: 6px; padding-bottom: 7px; border-radius: 11px; }
  .chip img { border-radius: 11px; }
  .chip__txt { flex-direction: column; gap: 1px; padding: 0 5px; font-size: 12.5px; }
  .chip__num { font-size: 10px; }
  .spot__pill { font-size: 14px; padding: 8px 13px 8px 9px; }
  .viewer__caption { right: var(--pad); bottom: calc(var(--pad) + 76px + env(safe-area-inset-bottom, 0px)); }
  .viewer__nav button { width: 52px; height: 52px; }
}

/* Niski ekran (telefon poziomo): pasek bez miniatur. */
@media (max-height: 520px) {
  .chip img { display: none; }
  .chip { width: auto; padding: 8px 10px; }
  .chip__txt { flex-direction: row; gap: 7px; padding: 0; font-size: 13px; white-space: nowrap; }
  .dock { display: flex; left: 50%; right: auto; transform: translateX(-50%); animation-name: rise-dock; border-radius: 999px; padding: 4px 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .top h1 { font-size: 26px; }
  .top__hint { display: none; }
  .panhint { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .spot__stem { height: 16px; }
  .viewer__title { font-size: clamp(34px, 12vh, 60px); }
  .viewer__caption { bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px)); right: calc(var(--pad) + 140px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .viewer, .viewer.is-open { transition: none; }
  .vm { transition: opacity .2s; }
}
