/* CORE v2: doradztwo, rok zarządcy, teczka inwestycji i efekty całej strony. */

/* ───────── wejście: warstwy rdzenia zwijają się w górę (raz na sesję) ───────── */
.curtain { display: none; }
@media (prefers-reduced-motion: no-preference) {
  html.is-intro .curtain { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; pointer-events: none; }
  html.is-intro .curtain i { flex: 1 1 0; display: block; transform-origin: top; animation: strata-off 720ms var(--ease-in-out) forwards; }
  html.is-intro .curtain i:nth-child(1) { background: var(--l1); animation-delay: 420ms; flex-grow: 1.3; }
  html.is-intro .curtain i:nth-child(2) { background: var(--l2); animation-delay: 480ms; flex-grow: 0.8; }
  html.is-intro .curtain i:nth-child(3) { background: var(--l3); animation-delay: 540ms; flex-grow: 1.1; }
  html.is-intro .curtain i:nth-child(4) { background: var(--l4); animation-delay: 600ms; flex-grow: 0.7; }
  html.is-intro .curtain i:nth-child(5) { background: var(--l7); animation-delay: 660ms; flex-grow: 1.4; }
  html.is-intro .curtain span {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-family: var(--font-display); font-weight: 300; font-size: clamp(3rem, 8vw, 7rem); letter-spacing: 0.04em; color: var(--marl);
    animation: curtain-word 520ms var(--ease-out) forwards;
  }
  html.is-intro .hero [data-line] { animation-delay: calc(820ms + var(--i) * 110ms); }
  html.is-intro .hero [data-load] { animation-delay: calc(var(--d) + 700ms); }
  html.is-intro .hero__core-frame, html.is-intro .hero__core-frame video { animation-delay: 900ms; }
  html.is-intro .hero__core figcaption { animation-delay: 2000ms; }
}
@keyframes strata-off { to { transform: scaleY(0); } }
@keyframes curtain-word { 0% { opacity: 0; transform: translate(-50%, -40%); } 45% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -62%); } }

/* ───────── nagłówki: słowa wychodzą z własnej maski ───────── */
[data-split] .sw { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-split] .sw { overflow: hidden; vertical-align: top; padding: 0.14em 0.02em 0.1em; margin: -0.14em -0.02em -0.1em; }
  .js [data-split] .sw > span { display: inline-block; transform: translateY(108%); transition: transform 1100ms var(--ease-expo); transition-delay: calc(var(--w, 0) * 80ms); }
  .js [data-split].is-in .sw > span { transform: none; }
}

/* ───────── doradztwo ───────── */
.adv { padding-bottom: clamp(48px, 6vw, 96px); }
.adv__top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: clamp(32px, 4vw, 56px); }
.adv__title { grid-column: 1 / -1; font-size: clamp(3.5rem, 0.6rem + 9.4vw, 11rem); }
.adv__title .sw:nth-child(n+2) { color: var(--ink2); }
.adv__intro { grid-column: 5 / span 8; display: grid; grid-template-columns: 1fr 1fr; row-gap: 28px; column-gap: var(--gutter); align-items: start; }
.adv__intro .lead { font-family: var(--font-display); font-size: var(--step-head); line-height: 1.2; letter-spacing: -0.01em; }
.adv__intro .lead { grid-column: 1 / -1; max-width: 30em; }
.adv__intro p:last-child { grid-column: 2; max-width: 44ch; }

.organs { margin-block: clamp(64px, 8vw, 128px) clamp(56px, 7vw, 112px); background: #1d262e; overflow: hidden; padding-block: clamp(18px, 2vw, 28px); }
.organs__run { display: flex; width: max-content; will-change: transform; }
.organs__run li {
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.75rem, 1rem + 2.4vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em;
}
.organs__run li::before { content: ""; width: 0.22em; height: 0.22em; background: var(--accent); margin-inline: 0.7em; flex: none; }

.adv__cases { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.adv__aside { grid-column: 1 / span 4; position: sticky; top: 14svh; align-self: start; }
.adv__aside .head { font-size: var(--step-head); }
.adv__pics { position: relative; margin-top: 28px; aspect-ratio: 4 / 3; overflow: hidden; background: #1d262e; }
.adv__pics img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(100% 0 0 0); transform: scale(1.1); transition: clip-path 1000ms var(--ease-in-out), transform 1400ms var(--ease-soft); }
.adv__pics img.is-on { clip-path: inset(0); transform: none; z-index: 1; }
.adv__pics img.was-on { clip-path: inset(0); z-index: 0; }
.adv__pics img[data-pic="5"] { filter: grayscale(1) contrast(1.05); }
.adv__of { margin-top: 16px; max-width: 34ch; opacity: 0.85; }
.adv__list { grid-column: 6 / span 7; }
.case { padding-block: clamp(44px, 10svh, 120px); }
.case:first-child { padding-top: 0; }
.case h4 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 1rem + 2.6vw, 3.4rem); line-height: 1.04; letter-spacing: -0.02em; display: flex; gap: 0.4em; align-items: baseline; }
.case h4::before { content: ""; flex: none; width: 0.26em; height: 0.26em; background: var(--accent); opacity: 0; transform: scale(0.6); transition: transform 500ms var(--ease-expo), opacity 300ms ease; }
.case p { margin-top: 18px; font-size: var(--step-lead); line-height: 1.4; max-width: 44ch; }
.js .case { opacity: 0.28; transition: opacity 600ms var(--ease-out); }
.js .case.is-on { opacity: 1; }
.js .case.is-on h4::before { transform: none; opacity: 1; }

/* ───────── rok zarządcy ───────── */
.cal { min-height: 100svh; }
.cal__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 48px; align-items: start; }
.cal__head { grid-column: 1 / span 4; }
.cal__head h2 { font-size: clamp(3.5rem, 1rem + 6.4vw, 8rem); }
.cal__head > p { margin-top: 24px; max-width: 38ch; }
.picker--cal { margin-top: 28px; }
.picker--cal label { background: #c4ae86; min-height: 52px; }
.picker--cal label:hover { background: #cdb993; }
.picker--cal label:has(input:focus-visible) { outline-color: var(--graphite); }

.dial { grid-column: 5 / span 5; position: relative; aspect-ratio: 1; width: 100%; max-width: 640px; justify-self: center; }
.dial__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial__center { position: absolute; inset: 24%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dial__label { font-size: var(--step-small); font-weight: 500; }
.dial__date { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.25rem, 1rem + 2.8vw, 4rem); line-height: 1; letter-spacing: -0.03em; }
.dial__in { margin-top: 14px; font-weight: 500; color: #4a3523; min-height: 1.5em; }
.dial__what { margin-top: 10px; max-width: 24ch; font-size: 15px; line-height: 1.35; }
.dial__center.is-swap > * { animation: swap-in 520ms var(--ease-out); }
@keyframes swap-in { from { opacity: 0; transform: translateY(8px); } }

.m-arc { fill: none; stroke: #c6b18b; stroke-width: 44; transition: stroke 400ms ease; }
.m-arc.is-now { stroke: #2a231c; }
.m-lab { font-family: var(--font-text); font-size: 15px; font-weight: 500; fill: #15120d; text-anchor: middle; dominant-baseline: central; transition: fill 400ms ease; }
.m-lab.is-now { fill: #e6e5e2; }
.m-ring { fill: none; stroke: #a58d66; stroke-width: 1.5; }
.tick { cursor: pointer; transition: transform 800ms var(--ease-expo); }
.tick rect { fill: #131518; transform-box: fill-box; transform-origin: center; transition: transform 600ms var(--ease-expo), fill 300ms ease; }
.tick rect { transition: transform 600ms var(--ease-expo), fill 300ms ease, opacity 300ms ease; }
.tick.is-off rect { transform: scale(0.5); opacity: 0; }
.tick.is-off { pointer-events: none; }
.tick.is-next rect { fill: var(--accent); stroke: #131518; stroke-width: 3; }
.tick.is-hot rect { transform: scale(1.5); }
.tick .halo { fill: none; stroke: #131518; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.tick.is-next .halo { animation: halo 2400ms var(--ease-out) infinite; }
@keyframes halo { 0% { opacity: 0.7; transform: scale(0.6); } 70%, 100% { opacity: 0; transform: scale(2.4); } }
.hand { transform-origin: 300px 300px; }
.hand line { stroke: #4a3523; stroke-width: 3; }
.hand circle { fill: #4a3523; }
.hand text { font-family: var(--font-text); font-size: 13px; font-weight: 500; fill: #4a3523; }

.cal__list { grid-column: 10 / span 3; }
.cal__list h3 { font-weight: 500; font-size: var(--step-body); }
.cal__list h3 + * { margin-top: 12px; }
.cal__list ul + p, .cal__list ol + h3 { margin-top: 32px; }
.cal__list ol { display: grid; gap: 4px; }
.cal__list ol li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; background: #c4ae86; cursor: default; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.cal__list ol li .when { font-weight: 500; font-size: 15px; }
.cal__list ol li span:last-child { font-size: 15px; line-height: 1.35; }
.cal__list ol li.is-next { background: var(--graphite); color: var(--graphite-ink); }
.cal__list ol li.is-hot:not(.is-next) { background: #d3c09c; }
.cal__list ul { display: grid; gap: 8px; }
.cal__list ul li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.4; }
.cal__list ul li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; background: #4a3523; }
.cal__note { margin-top: 28px; font-size: var(--step-small); }

/* ───────── teczka inwestycji ───────── */
.docs { background: var(--clay); color: var(--clay-ink); --ink: var(--clay-ink); --ink2: var(--ochre-ink); }
.docs .scene-stage { padding-block: var(--pad); }
.docs__head { padding-inline: var(--margin); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
.docs__head h2 { grid-column: 1 / span 7; font-size: clamp(3.5rem, 1rem + 7vw, 9rem); }
.docs__head p:not(.docs__count) { grid-column: 8 / span 4; font-size: var(--step-lead); line-height: 1.38; }
.docs__count { display: none; }
.docs__rail { margin-top: clamp(40px, 5vw, 72px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--margin); padding-inline: var(--margin); scrollbar-width: none; }
.docs__rail::-webkit-scrollbar { display: none; }
.docs__track { display: flex; gap: clamp(12px, 1.4vw, 20px); width: max-content; padding-right: var(--margin); }
.sheet {
  flex: none; width: clamp(290px, 26vw, 400px); min-height: clamp(430px, 34vw, 540px);
  background: #e3dfd7; color: var(--marl-ink); padding: clamp(22px, 2vw, 30px);
  display: flex; flex-direction: column; scroll-snap-align: start; position: relative;
}
.sheet__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; }
.sheet__no { width: 14px; height: 14px; background: var(--c); flex: none; }
.sheet__basis { color: #5a4a3c; text-align: right; }
.sheet h3 { margin-top: clamp(28px, 3vw, 44px); font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 1.1rem + 1vw, 2.1rem); line-height: 1.08; letter-spacing: -0.015em; }
.sheet__meta { margin-top: 22px; display: grid; gap: 12px; font-size: 15px; line-height: 1.38; }
.sheet__meta dt { font-weight: 500; }
.sheet__items { margin-top: auto; padding-top: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 1.35; }
.sheet__items li { position: relative; padding-left: 16px; }
.sheet__items li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; background: var(--c); }

/* scena aktywna: teczka przesuwa się w bok, gdy strona jedzie w dół */
.docs.is-live .scene-stage { height: 100svh; padding-block: 9svh 6svh; display: flex; flex-direction: column; justify-content: center; }
.docs.is-live .docs__head h2 { font-size: clamp(3rem, 1rem + 4.4vw, 6.5rem); }
.docs.is-live .docs__count { display: flex; gap: 6px; grid-column: 12; justify-self: end; align-self: end; margin-bottom: 0.5em; }
.docs__count i { width: 10px; height: 10px; background: color-mix(in srgb, var(--clay-ink) 25%, transparent); transition: background-color 300ms ease; }
.docs__count i.is-on { background: var(--accent); }
.docs.is-live .docs__head p:not(.docs__count) { grid-column: 8 / span 4; }
.docs.is-live .docs__rail { overflow: clip; scroll-snap-type: none; margin-inline: var(--margin); padding-inline: 0; }
.docs.is-live .sheet { min-height: min(54svh, 520px); width: calc((100vw - 2 * var(--margin) - 2 * clamp(12px, 1.4vw, 20px)) / 3); max-width: 460px; }
.docs.is-live .docs__rail { margin-top: clamp(28px, 4svh, 56px); }

/* ───────── stopka: warstwy w literach ───────── */
.foot__mark svg { fill: initial; }

/* ───────── tablet ───────── */
@media (max-width: 1100px) {
  .adv__intro { grid-column: 1 / -1; }
  .adv__aside { grid-column: 1 / span 5; }
  .adv__list { grid-column: 6 / span 7; }
  .cal__head { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); align-items: start; }
  .cal__head h2 { grid-column: 1 / -1; }
  .cal__head > p { margin-top: 24px; }
  .dial { grid-column: 1 / span 7; }
  .cal__list { grid-column: 8 / span 5; }
  .docs__head h2 { grid-column: 1 / -1; }
  .docs__head p:not(.docs__count) { grid-column: 1 / span 9; margin-top: 20px; }
  .docs__rail { overflow: visible; scroll-snap-type: none; }
  .docs__track { width: auto; display: grid; grid-template-columns: 1fr 1fr; padding-right: 0; }
  .sheet { width: auto; min-height: 0; }
  .sheet__items { margin-top: 0; }
}

/* ───────── telefon ───────── */
@media (max-width: 767px) {
  .adv__intro { grid-template-columns: 1fr; row-gap: 20px; }
  .adv__intro p:last-child { grid-column: 1; }
  .adv__intro .lead { font-size: var(--step-lead); }
  .adv__cases { display: block; }
  .adv__aside { position: static; }
  .odo { display: none; }
  .adv__of { margin-top: 12px; }
  .adv__list { margin-top: 40px; }
  .case { padding-block: 28px; }
  .case h4 { font-size: 1.75rem; }
  .case p { font-size: var(--step-body); }
  .js .case { opacity: 1; }
  .js .case h4::before { transform: none; opacity: 1; }
  .cal__head { display: block; }
  .dial { grid-column: 1 / -1; max-width: 520px; }
  .dial__center { inset: 21%; }
  .dial__date { font-size: 2rem; }
  .dial__what { font-size: 14px; }
  .dial__label { font-size: 13px; }
  .m-lab { font-size: 19px; }
  .cal__list { grid-column: 1 / -1; }
  .docs__track { grid-template-columns: 1fr; }
  .docs__head p:not(.docs__count) { grid-column: 1 / -1; }
}
