/* ═══════════════════════════════════════════════════════════════
   Historia każdego projektu: arkusz cyjanotypii, na którym przy
   przewijaniu powstaje budynek. Wartości pośrednie ustawia js/proces.js.
   ═══════════════════════════════════════════════════════════════ */
.ph {
  --paper: #032d90;
  --dusk: #12183a;
  --chalk: #eaf1ff;
  --chalk-soft: #d3e0ff;
  --window: #ffc46b;
  --final: 0;
  position: relative;
  /* style.css limits every <section> to 1200px with padding; this sheet runs edge to edge */
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--chalk);
  isolation: isolate;
}
/* Drawing paper grid: fine lines every 24px, heavier every 120px */
.ph::before,
.ph-stage::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: calc(1 - var(--final));
  background-image:
    linear-gradient(rgba(234,241,255,0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234,241,255,0.13) 1px, transparent 1px),
    linear-gradient(rgba(234,241,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234,241,255,0.055) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
/* Paper darkens into dusk during the last step */
.ph::after,
.ph-stage::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--dusk);
  opacity: var(--final);
}

.ph-head {
  max-width: 1440px;
  margin: 0 auto;
  padding: 120px 48px 24px;
}
.ph-head h2 {
  margin: 0 0 14px;
  max-width: 14ch;
  font-size: clamp(44px, 7.4vw, 112px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--chalk);
}
.ph-head p {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.4;
  color: var(--chalk-soft);
}

.ph-track {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 56px;
}

/* The drawing: stays in place while the steps scroll past */
.ph-stage {
  position: sticky;
  top: 64px;
  height: calc(100vh - 80px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
}
.ph-stage::before, .ph-stage::after { display: none; }
.ph-svg { flex: 1; min-height: 0; width: 100%; display: block; overflow: visible; }

.ph-svg .l { fill: none; stroke: var(--chalk); stroke-width: 1.3; }
.ph-svg .heavy { stroke-width: 2.4; }
.ph-svg .faint { stroke-width: 0.8; opacity: 0.5; }
.ph-svg .dash { stroke-dasharray: 7 6; stroke-width: 1; opacity: 0.6; }
.ph-svg .dot { fill: var(--chalk); }
.ph-svg .bubble { fill: var(--paper); stroke: var(--chalk); stroke-width: 1.2; }
.ph-svg text { font-family: inherit; }
.ph-svg .t { fill: var(--chalk); font-size: 15px; font-weight: 500; }
.ph-svg .big { font-size: 19px; font-weight: 600; }
.ph-svg .small { font-size: 13px; }
.ph-svg .chip { fill: #125c32; font-size: 16px; font-weight: 600; }
.ph-svg .tree { transform-box: fill-box; transform-origin: 50% 100%; }
.ph-svg .stamp { transform-box: fill-box; transform-origin: center; }
.ph-svg .stamp rect { fill: none; stroke: #c8f2d4; stroke-width: 2.5; }
.ph-svg .stampt { fill: #c8f2d4; font-size: 25px; font-weight: 700; }

/* Title block: the sheet's corner label, as on a real drawing */
.ph-block {
  flex-shrink: 0;
  align-self: flex-end;
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--chalk);
  margin-bottom: 8px;
}
.ph-block-text {
  display: flex; flex-direction: column;
  min-width: 248px;
  padding: 8px 16px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--chalk-soft);
  border-right: 1.5px solid var(--chalk);
}
.ph-block-text strong { color: var(--chalk); font-size: 17px; font-weight: 600; }
.ph-ticks { display: flex; }
.ph-ticks button {
  width: 44px;
  border: 0;
  border-left: 1.5px solid rgba(234,241,255,0.35);
  background: none;
  color: var(--chalk);
  font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ph-ticks button:first-child { border-left: 0; }
.ph-ticks button:hover { background: rgba(234,241,255,0.14); }
.ph-ticks button[aria-current="step"] { background: var(--chalk); color: var(--paper); }
.ph-ticks button:focus-visible { outline: 2px solid var(--window); outline-offset: -3px; }

/* Steps: annotations on the sheet, without cards */
/* Bottom padding keeps the drawing pinned until the last step has been read */
.ph-steps { list-style: none; margin: 0; padding: 0 0 14vh; }
.ph-step {
  min-height: 86vh;
  display: flex;
  align-items: center;
  transition: opacity 0.35s;
}
.ph.is-live .ph-step:not(.is-active) { opacity: 0.7; }
.ph-step-in { padding: 32px 0 32px 24px; border-left: 2px solid rgba(234,241,255,0.3); transition: border-color 0.35s; }
.ph-step.is-active .ph-step-in { border-left-color: var(--window); }
.ph-label { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--chalk-soft); }
.ph-step h3 {
  margin: 0 0 16px;
  font-size: clamp(31px, 3.1vw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--chalk);
  text-wrap: balance;
}
.ph-step-in > p:not(.ph-label) { margin: 0 0 20px; max-width: 52ch; font-size: 19px; line-height: 1.6; color: var(--chalk-soft); }
.ph-step ul { list-style: none; margin: 0; padding: 0; }
.ph-step ul li {
  position: relative;
  padding: 7px 0 7px 26px;
  font-size: 17px;
  color: var(--chalk);
  border-top: 1px solid rgba(234,241,255,0.2);
}
.ph-step ul li::before {
  content: "";
  position: absolute; left: 0; top: 1.05em;
  width: 14px; height: 1.5px;
  background: var(--chalk);
}
.ph-link {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 22px;
  border-radius: 99px;
  background: var(--chalk);
  color: var(--paper);
  font-size: 17px; font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.ph-link:hover { background: #fff; }
.ph-link:focus-visible { outline: 2px solid var(--window); outline-offset: 3px; }

/* Tablet and phone: the drawing stays on top, the steps pass underneath */
@media (max-width: 960px) {
  .ph-head { padding: 80px 24px 20px; }
  .ph-track { display: block; padding: 0; }
  .ph-stage {
    top: 52px;
    z-index: 2;
    height: 46vh;
    height: 46svh;
    min-height: 280px;
    padding: 4px 12px 0;
    background: var(--paper);
    border-bottom: 1.5px solid var(--chalk);
    isolation: isolate;
    overflow: hidden;
  }
  .ph-stage::before, .ph-stage::after { display: block; }
  .ph-block { align-self: stretch; margin-bottom: 8px; }
  .ph-block-text { flex: 1; min-width: 0; padding: 4px 10px; font-size: 13px; }
  .ph-block-text strong { font-size: 15px; }
  .ph-ticks button { width: 40px; }
  .ph-steps { padding: 0 24px 40px; }
  .ph-step { min-height: 64vh; }
  .ph-step-in { padding: 24px 0 24px 18px; }
  .ph-step-in > p:not(.ph-label) { font-size: 18px; }
}
@media (max-width: 960px) and (max-height: 560px) {
  .ph-stage { height: 60vh; min-height: 220px; }
  .ph-block-text span { display: none; }
}
