/* ==========================================================================
   Blok „Nagłówek oferty z rysunkiem biura” (.phead.phead--plan). Źródło: assets/css/podstrona.css
   (Page head with a framed photograph – te same reguły co w bloku „Nagłówek strony usługi”)
   i assets/css/oferta.css (rysunek biura zamiast zdjęcia, linie rysunku, dziennik zdarzeń).
   ========================================================================== */

.phead {
  background: var(--paper-2);
  padding: calc(var(--nav-overlap) + clamp(1.25rem, 2.2vw, 1.75rem)) 0 calc(var(--ledger-lift) + clamp(2rem, 3.5vw, 2.75rem));
}
.phead__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem clamp(2rem, 6vw, 6rem); align-items: end; }
.phead h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem); line-height: 1.08; letter-spacing: -.02em; margin: 0; max-width: 11ch; color: var(--navy); }
.phead__lead {
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem); font-weight: 400; line-height: 1.3;
  letter-spacing: -.01em; color: var(--navy-900); margin: 0 0 .9rem; max-width: 30ch; text-wrap: balance;
}
.phead__text { color: var(--muted); font-size: 1.0625rem; max-width: 58ch; margin: 0; }
.phead__actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-top: 1.75rem; }
.phead__note { margin: 1rem 0 0; font-size: .875rem; color: var(--muted); }

.phead--media {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(48% 70% at 88% 8%, rgba(221, 230, 240, .95), rgba(221, 230, 240, 0) 70%),
    radial-gradient(38% 55% at 4% 100%, rgba(253, 227, 211, .55), rgba(253, 227, 211, 0) 70%),
    var(--paper-2);
}
.phead--media .phead__grid { grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); align-items: stretch; column-gap: clamp(2rem, 6vw, 6rem); }
.phead--media .phead__body { display: flex; flex-direction: column; justify-content: center; padding-block: .5rem; }
.phead--media h1 {
  max-width: 12ch; margin: 0 0 1.1rem;
  font-size: clamp(2.375rem, 1.3rem + 3.4vw, 4rem); line-height: 1.02; letter-spacing: -.04em;
}
.phead--media .phead__lead { max-width: 24ch; font-weight: 500; color: var(--navy); letter-spacing: -.015em; }
.phead--media .phead__actions .btn--lg { padding-inline: 1.5em; }
.phead--media .phead__actions .btn--lg:has(.btn__badge) { padding-right: 1.6em; }

.phead__visual { position: relative; z-index: 0; display: grid; min-height: 380px; margin: 1rem 0 1.25rem; }
/* the sheet under the drawing and the dotted patch at its corner */
.phead__visual::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  border-radius: 30px; background: linear-gradient(160deg, #dbe5f0, #eef3f8);
  transform: rotate(-3deg) translate(-10px, 12px);
}
.phead__visual::after {
  content: ""; position: absolute; z-index: -1; right: -26px; top: -24px; width: 150px; height: 120px;
  background: radial-gradient(circle, rgba(35, 66, 105, .28) 1.3px, transparent 1.6px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
  mask-image: radial-gradient(closest-side, #000 55%, transparent);
}

/* --------------------------------------------------------------------------
   The office drawing takes the photograph's place in the page head
   -------------------------------------------------------------------------- */

.phead--plan .phead__grid { align-items: stretch; }
@media (min-width: 901px) { .phead--plan .phead__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.phead__visual--plan { min-height: 0; }
.phead__visual--plan > .plan { border-radius: 26px; }
.phead--plan .phead__note { max-width: 40ch; }

.plan {
  margin: 0; display: flex; flex-direction: column; min-width: 0;
  background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
}
.plan__top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1.5rem;
  padding: .85rem 1.25rem .8rem; border-bottom: 1px solid var(--line);
}
.plan__title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.005em; line-height: 1.25; color: var(--navy-900); }
.plan__state, .plan__log-k {
  font-family: var(--font-ui); font-weight: 500; font-size: .6875rem; line-height: 1.2;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2);
}
.plan__draw { flex: 1; display: grid; place-items: center; min-height: 0; padding: clamp(.75rem, 2vw, 1.25rem) clamp(.5rem, 1.5vw, 1.25rem) .5rem; }
.plan__log {
  display: grid; min-height: 3.3rem;
  padding: .85rem 1.25rem .9rem; border-top: 1px solid var(--line); background: var(--paper-2);
}
.plan__log > * { grid-area: 1 / 1; min-width: 0; align-self: center; }
.plan__feed {
  margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem;
  font-size: .9375rem; line-height: 1.4; color: var(--text);
}
.plan__event time { margin-right: .6rem; font-family: var(--font-ui); font-weight: 500; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.plan__event.is-new { animation: plan-in .6s var(--ease); }
@keyframes plan-in { from { opacity: 0; transform: translateY(6px); } }

/* The pointed-at service in the strip (view.js builds one caption per card of the sheet below):
   number, name, who it is for and the link, so you see what you are about to open */
.plan__svc {
  display: none; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no t go" ". d d";
  align-items: center; gap: .2rem .8rem;
}
.plan__svc.is-on { display: grid; animation: plan-in .35s var(--ease); }
.plan__log.is-svc .plan__feed { display: none; }
.plan__svc-no {
  grid-area: no; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; font-family: var(--font-ui); font-weight: 600; font-size: .8125rem; line-height: 1;
}
.plan__svc-t { grid-area: t; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.005em; line-height: 1.25; color: var(--navy-900); }
.plan__svc-d { grid-area: d; margin: 0; font-size: .875rem; line-height: 1.45; color: var(--muted); }
.plan__svc-go {
  grid-area: go; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; white-space: nowrap;
  font-family: var(--font-ui); font-weight: 500; font-size: .9375rem; color: var(--navy); text-decoration: none;
}
.plan__svc-go .icon { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease); }
.plan__svc-go:hover { color: var(--navy-900); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; text-underline-offset: .25em; }
.plan__svc-go:hover .icon { transform: translateX(4px); }
@media (min-width: 901px) {
  /* beside the text the card's height is fixed by the row: every caption is laid out in the same cell
     (only the pointed one visible), so the strip keeps the height of the longest and the drawing never moves */
  .plan__svc { display: grid; visibility: hidden; }
  .plan__svc.is-on { visibility: visible; }
  .plan__log.is-svc .plan__feed { display: flex; visibility: hidden; }
}
@media (max-width: 560px) {
  .plan__svc { grid-template-areas: "no t" ". d" ". go"; grid-template-columns: auto minmax(0, 1fr); }
  .plan__svc-go { justify-self: start; }
}

/* Line drawings: navy ink on white, the cuts in deep navy, the lit item in Orange Deep */
.iso { display: block; width: 100%; height: auto; overflow: visible; }
.iso--plan { max-height: min(560px, 64vh); }
.iso path { fill: none; stroke: var(--navy-700); stroke-linejoin: round; stroke-linecap: round; }
.iso .f { fill: var(--paper); }
.iso .o { stroke-width: 1.3; }
.iso .i { stroke-width: .75; }
.iso .d { stroke-width: .65; }
.iso .g { stroke: var(--navy-100); stroke-width: .8; }
.iso .p { fill: var(--navy-900); stroke: var(--navy-900); stroke-width: .8; }
.iso .part, .iso .bal { cursor: pointer; }
.iso .part path { transition: stroke .25s, fill .25s; }
.iso .part.is-on .o, .iso .part.is-on .i, .iso .part.is-on .d,
.iso .part.is-ping .o, .iso .part.is-ping .i, .iso .part.is-ping .d { stroke: var(--orange-600); }
.iso .part.is-on .f, .iso .part.is-ping .f { fill: var(--orange-50); }
.iso .ld { stroke-width: .9; transition: stroke .25s; }
.iso .ld-dot { fill: var(--navy-700); transition: fill .25s; }
.iso .bal-c { fill: var(--paper); stroke: var(--navy-700); stroke-width: 1.3; transition: fill .25s, stroke .25s; }
.iso text { fill: var(--navy-900); font-family: var(--font-ui); font-weight: 500; font-size: 12.5px; text-anchor: middle; pointer-events: none; }
.iso .bal.is-on .bal-c, .iso .bal.is-ping .bal-c { fill: var(--orange); stroke: var(--orange); }
.iso .bal.is-on .ld, .iso .bal.is-ping .ld { stroke: var(--orange-600); }
.iso .bal.is-on .ld-dot, .iso .bal.is-ping .ld-dot { fill: var(--orange-600); }

/* The head's one authored moment: the office draws itself line by line */
.iso-draw .iso--plan path[style] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: iso-ln 1.1s var(--ease) var(--d) forwards; }
.iso-draw .iso--plan .p { fill-opacity: 0; animation: iso-ln 1.1s var(--ease) var(--d) forwards, iso-fill .7s ease-out calc(var(--d) + .5s) forwards; }
.iso-draw .iso--plan .bal-c, .iso-draw .iso--plan text, .iso-draw .iso--plan .ld-dot { opacity: 0; animation: iso-fade .5s ease-out 2.2s forwards; }
@keyframes iso-ln { to { stroke-dashoffset: 0; } }
@keyframes iso-fill { to { fill-opacity: 1; } }
@keyframes iso-fade { to { opacity: 1; } }

@media (max-width: 900px) {
  .phead__grid { grid-template-columns: minmax(0, 1fr); }
  /* .phead--media h1 keeps its 12ch here, as in the prototype (its rule comes after the 14ch one) */
  .phead--media .phead__grid { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .phead__visual { order: -1; min-height: 0; margin: 0 .5rem 1.25rem 0; }
  .phead__visual::after { right: -14px; top: -16px; }
  .phead__visual--plan { order: 2; margin: 0 .5rem 0 0; }
  .phead__visual--plan > .plan { border-radius: 22px; }
  .iso--plan { max-height: none; }
}
@media (max-width: 640px) {
  .plan__top, .plan__log { padding-inline: 1rem; }
  .plan__svc-no { width: 1.6rem; height: 1.6rem; }
  .iso--plan .o { stroke-width: 2.1; } .iso--plan .i { stroke-width: 1.25; } .iso--plan .d { stroke-width: 1.05; } .iso--plan .ld { stroke-width: 1.4; }
  .iso--plan .bal-c { r: 18px; stroke-width: 2; }
  .iso--plan text { font-size: 20px; }
  .iso--plan .ld-dot { r: 3.4px; }
}
@media (max-width: 560px) {
  .phead__actions .btn { flex: 1 1 100%; justify-content: center; }
  .phead__visual::before { transform: rotate(-2deg) translate(-6px, 8px); }
}
@media (prefers-reduced-motion: reduce) {
  .plan__event.is-new, .plan__svc.is-on { animation: none !important; opacity: 1; }
}
