.arch-story {
  --arch-ink: #030811;
  --arch-ice: #c4f4fb;
  --arch-edge: max(clamp(26px, 5.7vw, 130px), env(safe-area-inset-left));
  position: relative;
  color: #f0f8fc;
  background: var(--arch-ink);
}
.arch-journey__track {
  position: relative;
  display: grid;
  grid-template: auto / minmax(0, 1fr);
  isolation: isolate;
  background: var(--arch-ink);
}
.arch-journey__stage, .arch-journey__controls, .arch-journey__chapters { grid-area: 1 / 1; }
:is(.arch-journey__stage, .arch-journey__controls) {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100svh;
  min-width: 0;
  pointer-events: none;
}
.arch-journey__stage { overflow: clip; isolation: isolate; background: #02050c; }
.arch-journey__controls { z-index: 4; }
.arch-journey__backdrop {
  position: absolute;
  inset: -11%;
  z-index: -3;
  background: #02050c url("assets/all-on-optyka.webp") center / cover no-repeat;
  background-image: url("assets/all-on-scena-pryzmat.webp"), url("assets/all-on-optyka.webp");
  transform: translate3d(calc(var(--art-drift, 0vw) * .30 + var(--beam-x, 0%)), var(--beam-y, 0%), 0) rotate(var(--beam-roll, 0deg)) scale(1.05);
}
.arch-journey__stage::before, .arch-journey__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.arch-journey__stage::before {
  z-index: -1;
  background: radial-gradient(ellipse at 50% 46%, transparent 20%, #03081137 57%, #02050bbd 100%),
    linear-gradient(90deg, #030811bb 0%, transparent 24%, transparent 75%, #030811a8);
}
.arch-journey__light {
  z-index: -2;
  position: absolute;
  inset: 7% 13%;
  transform: translate3d(calc(var(--art-drift, 0vw) * .80 + var(--light-x, 0%)),var(--light-y, 0%),0) rotate(34deg);
  background: radial-gradient(ellipse at 49% 53%, #114b9287 0%, #226ca563 23%, #16458120 53%, transparent 67%),
    radial-gradient(ellipse at 29% 42%, #d2f3ff98 0%, #3eaaff4a 7%, transparent 22%),
    radial-gradient(ellipse at 71% 63%, #c3ecff7c 0%, #56c8ff36 9%, transparent 28%);
  opacity: var(--beam-strength, .82);
  mix-blend-mode: screen;
}
.arch-journey__refractions {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: 12% 10%;
  background: radial-gradient(ellipse at 18% 70%, #8ad2ffd0 0%, #377fc046 .6%, transparent 3.8%),
    radial-gradient(ellipse at 77% 27%, #d3f0ffda 0%, #5499f076 .6%, transparent 2.8%),
    radial-gradient(ellipse at 81% 75%, #7baeef94 0%, #9770ba35 .85%, transparent 3%),
    radial-gradient(ellipse at 32% 28%, #9cc9fa5c 0%, transparent 2.6%);
  transform: translate3d(var(--light-x, 0%), calc(var(--light-y, 0%) * 1.65), 0);
  opacity: .46;
}
.arch-journey__stage::after {
  z-index: 1;
  background: linear-gradient(180deg, #02050bc4, transparent 22%, transparent 74%, #030811d9);
}
.arch-journey__art {
  position: absolute;
  left: 44%;
  right: 2%;
  top: 11%;
  bottom: 13%;
  display: grid;
  place-items: center;
  min-width: 0;
  perspective: 1150px;
}
.arch-journey__stage .arch-journey__volume,
.arch-journey__stage .arch-journey__photo,
.arch-journey__diagram {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.arch-journey__stage .arch-journey__photo {
  object-fit: contain;
  max-width: none;
  transform: translate3d(var(--art-x, 0), var(--art-y, 0), 0) rotateZ(var(--art-roll, -15deg)) rotateY(var(--art-yaw, -8deg)) scale(var(--art-scale, .94));
  filter: drop-shadow(0 8px 18px #020712ab) drop-shadow(0 0 15px #8acbff60);
}
.arch-journey__stage .arch-journey__photo:first-child { opacity: 1; }
.arch-journey__stage .arch-journey__volume { opacity: var(--volume-opacity, 0); filter: drop-shadow(0 0 13px #72c6ff59); }
.arch-journey__diagram {
  display: grid;
  place-items: center;
  opacity: 1;
  filter: drop-shadow(0 4px 20px #2b90b34f);
}
.arch-journey__diagram svg { width: min(81%, 780px); height: 81%; }
.arch-journey__stage .arch-journey__volume[hidden], .arch-journey__diagram[hidden], .arch-journey__tools[hidden], .arch-journey__tools button[hidden] { display: none; }
.arch-journey__tools, .arch-journey__nav {
  position: absolute;
  z-index: 3;
  bottom: max(28px, calc(var(--dock-bottom, 18px) + 10px));
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}
.arch-journey__tools { right: var(--arch-edge); }
.arch-journey__tools button, .arch-journey__nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 42px;
  padding: .5rem .85rem;
  color: #c6d9e8;
  border: 0;
  border-radius: 2rem;
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  font: 400 .86rem/1.2 Poppins, sans-serif;
}
.arch-journey__tools button, .arch-journey__nav {
  border: 1px solid #93bfd742;
  border-radius: 2rem;
  background: #07131de8;
}
.arch-journey__tools button[aria-pressed="true"], .arch-journey__nav a[aria-current] {
  color: #d3faff;
  background: #1d3848;
}
.arch-journey__tools button:hover, .arch-journey__nav a:hover { color: white; background: #263d4c; }
.arch-journey__tools svg { width: 1.15rem; height: 1.15rem; }
.arch-journey__nav { left: var(--arch-edge); padding: 2px; }
.arch-journey__chapters { z-index: 2; pointer-events: none; }
.arch-chapter {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(106px, 13svh) var(--arch-edge) max(108px, 13svh);
}
.arch-story, .arch-chapter { scroll-margin-top: -68px; }
.arch-chapter__copy {
  width: min(38vw, 39rem);
  margin: 0;
  pointer-events: auto;
  overflow-wrap: break-word;
  position: relative;
}
.arch-chapter :is(p, h1, h2, h3, ul, dl) { margin: 0; }
.arch-kicker {
  color: #acdfed;
  font-size: .88rem;
  line-height: 1.45;
  letter-spacing: .025em;
}
.arch-chapter :is(h1, h2, h3) {
  max-width: 15ch;
  margin: .22em 0 .30em -.045em;
  font-size: clamp(2.4rem, min(5.15vw, 8.5svh), 6.35rem);
  line-height: 1.04;
  letter-spacing: -.075em;
  font-weight: 300;
  color: #f1f8fb;
  text-wrap: balance;
}
.arch-chapter:is([data-chapter="0"],[data-chapter="2"],[data-chapter="4"]) :is(h1, h2, h3) {
  font-size: clamp(3.1rem, min(7.7vw, 12.5svh), 10rem);
  line-height: .96;
}
.arch-chapter :is(h1, h2, h3) :is(em, span) { color: var(--arch-ice); font-style: normal; }
.arch-lead {
  max-width: 34ch;
  color: #e2eff7;
  font-size: clamp(1.08rem, min(1.52vw, 2.4svh), 1.65rem);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -.035em;
  text-wrap: pretty;
}
.arch-body {
  max-width: 49ch;
  margin-top: 1.05rem !important;
  color: #c2d2df;
  font-size: clamp(1rem, 1.04vw, 1.15rem);
  line-height: 1.6;
  text-wrap: pretty;
}
.arch-note { color: #b7cbd7; font-size: .92rem; }
.arch-body :is(p, ul) + :is(p, ul), .arch-body + .arch-body { margin-top: .75rem; }
.arch-price {
  color: #b6ecfa;
  font-size: clamp(1.18rem, 1.7vw, 1.85rem);
  line-height: 1.34;
  font-weight: 400;
}
.arch-chapter .arch-price { margin-block: 1.15rem .4rem; }
.arch-price strong { display: inline-block; font-weight: 400; font-size: 1.15em; letter-spacing: -.045em; }
.arch-chapter .arch-price span { display: block; margin-top: .2em; color: #b7cbd6; font-size: .9rem; letter-spacing: 0; }
.arch-price small { font-size: .88rem; color: #c2d6e0; }
.arch-links { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-top: 1.4rem; }
.arch-chapter .arch-tariff {
  width: min(100%, 29.5rem);
  margin: 1.1rem 0 0;
  color: #c9dde8;
  font-size: clamp(.88rem, 1.07vw, 1rem);
}
.arch-tariff div {
  padding: .48rem 0;
  border-top: 1px solid #a1cbe633;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
}
.arch-tariff dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.arch-tariff div:last-child { color: #d3f3ff; font-weight: 500; border-bottom: 1px solid #a1cbe633; }
@media (prefers-reduced-motion: no-preference) {
  .arch-story[data-motion] [data-arch-reveal] {
    opacity: var(--reveal-opacity, 1);
    transform: translate3d(0, var(--reveal-y, 0px), 0);
  }
  .arch-story[data-motion] [data-arch-reveal]:focus-within { opacity: 1; transform: none; }
}
@media (max-width: 740px) and (prefers-reduced-motion: no-preference) {
  .arch-story[data-motion] .arch-chapter__copy > * {
    opacity: var(--reveal-opacity, 1);
    transform: translate3d(0, var(--reveal-y, 0px), 0);
  }
  .arch-story[data-motion] .arch-chapter__copy > :focus-within { opacity: 1; transform: none; }
}
@media (min-width: 741px) and (prefers-reduced-motion: no-preference) {
  .arch-story[data-journey] .arch-chapter__copy > * {
    opacity: 0;
    transform: translate3d(0, 34px, 0);
  }
  .arch-story[data-journey] .arch-chapter__copy[data-reveal-entered] > * {
    animation: arch-copy-enter 520ms cubic-bezier(.2, .65, .25, 1) var(--reveal-delay, 0ms) both;
  }
  .arch-story[data-journey] .arch-chapter__copy > :focus-within {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
@keyframes arch-copy-enter {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (min-width: 1100px) and (min-height: 650px) {
  .arch-journey__art {
    left: 21%;
    right: 21%;
    top: 10%;
    bottom: 12%;
    transform: translate3d(var(--art-drift, 0vw),0,0);
  }
  .arch-journey__stage .arch-journey__volume { scale: .93; }
  .arch-chapter__copy { width: min(29.5vw, 31.5rem); }
  .arch-story[data-journey] .arch-chapter:is([data-chapter="2"], [data-chapter="4"]) .arch-chapter__copy {
    justify-self: end;
    width: min(28vw, 31rem);
  }
  .arch-story[data-journey] .arch-chapter[data-chapter="0"] .arch-chapter__copy {
    display: grid;
    width: 100%;
    min-height: clamp(400px, 71svh, 930px);
    grid-template-columns: minmax(0,30%) minmax(0,1fr) minmax(0,25%);
    grid-template-rows: auto auto minmax(26px,1fr) auto auto;
    align-items: start;
  }
  .arch-chapter[data-chapter="0"] .arch-kicker { grid-area: 1 / 1; }
  .arch-chapter[data-chapter="0"] :is(h1, h2, h3) {
    grid-area: 2 / 1 / auto / 3;
    width: fit-content;
    margin-top: .13em;
    font-size: clamp(4.8rem, min(7vw, 11svh), 9rem);
  }
  .arch-chapter[data-chapter="0"] .arch-lead {
    grid-area: 2 / 3 / 5 / 4;
    align-self: center;
    justify-self: end;
    margin-top: 2svh;
    color: #e4f2f7;
    font-size: clamp(1.35rem, 2.25vw, 2.7rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.05em;
    text-align: right;
    text-wrap: balance;
    text-shadow: 0 1px 14px #020711;
  }
  .arch-chapter[data-chapter="0"] .arch-body {
    grid-area: 4 / 1;
    max-width: 32ch;
    margin-top: 0 !important;
  }
  .arch-chapter[data-chapter="0"] .arch-links { grid-area: 5 / 1; }
  .arch-chapter:is([data-chapter="3"],[data-chapter="5"]) :is(h1, h2, h3) {
    font-size: clamp(2.85rem, min(4.5vw, 7.3svh), 5.8rem);
  }
  .arch-chapter:is([data-chapter="3"],[data-chapter="5"]) .arch-note {
    margin-top: .75rem !important;
  }
}
@media (max-width: 1000px) and (min-width: 741px) {
  .arch-story { --arch-edge: 4.5vw; }
  .arch-chapter__copy { width: 43vw; }
  .arch-journey__art { left: 46%; right: 0; }
  .arch-journey__nav a { padding-inline: .62rem; }
  .arch-journey__nav { bottom: max(75px, calc(var(--dock-bottom, 18px) + 60px)); }
}
@media (max-width: 740px) {
  .arch-story {
    --arch-edge: max(clamp(19px, 5.2vw, 38px), env(safe-area-inset-left));
    --arch-mobile-stage: clamp(240px, 44svh, 445px);
  }
  :is(.arch-journey__stage, .arch-journey__controls) { height: var(--arch-mobile-stage); }
  .arch-journey__stage { z-index: 3; background: #030811; }
  .arch-journey__backdrop {
    inset: -17% -8%;
    transform: translate3d(var(--beam-x, 0%), var(--beam-y, 0%), 0) rotate(var(--beam-roll, 0deg)) scale(1.07);
  }
  .arch-journey__stage::before {
    background: linear-gradient(0deg, #030811, #03081130 13%, transparent 30%, #03081125 82%, #030811b0);
  }
  .arch-journey__stage::after { background: linear-gradient(0deg, #030811 0%, #03081121 12%, transparent 20%); }
  .arch-journey__light { inset: -15% -16%; transform: translate3d(var(--light-x, 0%),var(--light-y, 0%),0) rotate(34deg); }
  .arch-journey__art {
    top: max(66px, 8svh);
    right: 2%;
    bottom: 9px;
    left: 2%;
  }
  .arch-journey__nav {
    top: auto;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    gap: 0;
    padding: 0;
    border-color: #93bfd733;
  }
  .arch-journey__tools { right: var(--arch-edge); top: max(78px, calc(env(safe-area-inset-top) + 72px)); bottom: auto; }
  .arch-journey__tools button, .arch-journey__nav a {
    min-height: 36px;
    font-size: .78rem;
    padding: .43rem .62rem;
    gap: .25rem;
  }
  .arch-journey__tools button { width: 42px; min-height: 42px; padding: 0; }
  .arch-journey__tools svg { width: 19px; height: 19px; }
  .arch-journey__tools button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .arch-chapter {
    align-items: start;
    min-height: 0;
    padding-block: 37px;
    scroll-margin-top: calc(var(--arch-mobile-stage) - 76px);
  }
  .arch-chapter:first-child {
    padding-top: calc(var(--arch-mobile-stage) + 24px);
    scroll-margin-top: -68px;
  }
  .arch-chapter:last-child {
    padding-bottom: max(86px, calc(var(--dock-bottom, 14px) + 65px));
  }
  .arch-chapter__copy { width: min(100%, 37rem); }
  .arch-chapter :is(h1, h2, h3) {
    max-width: 17ch;
    margin-block: .2em .26em;
    font-size: clamp(2.2rem, min(9vw, 6.5svh), 4.1rem);
  }
  .arch-chapter:is([data-chapter="0"],[data-chapter="2"],[data-chapter="4"]) :is(h1, h2, h3) {
    font-size: clamp(2.9rem, min(13.2vw, 8svh), 5.15rem);
  }
  .arch-lead { max-width: 43ch; font-size: clamp(1.06rem,3vw,1.30rem); line-height: 1.37; }
  .arch-body { margin-top: .8rem !important; line-height: 1.5; }
  .arch-chapter .arch-price { margin-top: .8rem; }
  .arch-links { margin-top: 1rem; }
  .arch-kicker { font-size: .83rem; }
}
@media (max-width: 385px) {
  .arch-journey__tools button, .arch-journey__nav a { padding-inline: .43rem; }

}
@media (max-width: 740px) and (max-height: 580px) {
  .arch-story { --arch-mobile-stage: clamp(162px, 42svh, 242px); }
  .arch-journey__art { top: 56px; bottom: 39px; }
}
@media (max-height: 430px) {
  .arch-journey__nav { bottom: 3px; }
  .arch-journey__tools button, .arch-journey__nav a { min-height: 32px; }
  .arch-journey__nav a { font-size: .73rem; }
}
/* Static HTML retains the correct illustration for each treatment without scripting. */
.arch-story:not([data-journey]) :is(.arch-journey__stage, .arch-journey__controls) { display: none; }
.arch-story:not([data-journey]) .arch-chapter {
  background: var(--fallback-arch, url("assets/luk-pelny-ceramika.webp")) 94% center / 49% auto no-repeat,
    linear-gradient(90deg, #030811 18%, #030811cc 43%, #03081140 68%), url("assets/all-on-optyka.webp") center / cover;
}
.arch-story:not([data-journey]) [data-mode="six"] { --fallback-arch: url("assets/luk-projekcja-6.webp"); }
.arch-story:not([data-journey]) [data-mode="four"] { --fallback-arch: url("assets/luk-projekcja-4.webp"); }
@media (max-width: 740px) {
  .arch-story:not([data-journey]) .arch-chapter {
    min-height: 100svh;
    padding-block: calc(var(--arch-mobile-stage) + 24px) 65px;
    scroll-margin-top: -68px;
    background: var(--fallback-arch, url("assets/luk-pelny-ceramika.webp")) center 72px / auto calc(var(--arch-mobile-stage) - 74px) no-repeat,
      linear-gradient(0deg,#030811 50%,#03081144 90%),url("assets/all-on-optyka.webp") top / 100% auto no-repeat;
  }
}

.arch-journey__stills, .arch-journey__cad {
  position: absolute;
  inset: 0;
}
.arch-journey__stage[data-wiping] .arch-journey__stills {
  mask-image: linear-gradient(118deg, transparent calc(var(--model-wipe) - 3.5%), #000 calc(var(--model-wipe) + 2.5%));
}
.arch-journey__stage[data-wiping] .arch-journey__cad {
  mask-image: linear-gradient(118deg, #000 calc(var(--model-wipe) - 3.5%), transparent calc(var(--model-wipe) + 2.5%));
}
.arch-journey__stage[data-wiping] .arch-journey__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, transparent calc(var(--model-wipe) - 3.5%), #71bbf222 calc(var(--model-wipe) - .8%), #c3eaff55 var(--model-wipe), transparent calc(var(--model-wipe) + 2.5%));
  opacity: var(--model-flare, .4);
  mask-image: radial-gradient(ellipse at center, #000 21%, transparent 70%);
  pointer-events: none;
}

.arch-story--detail .arch-links a:not(.clinic-cta) {
  color: #cceffc;
  text-decoration: underline;
  text-underline-offset: .2em;
}
@media (min-width: 1100px) and (min-height: 650px) {
  .arch-story--variant[data-journey] .arch-chapter[data-chapter="0"] .arch-chapter__copy {
    grid-template-rows: auto auto minmax(26px,1fr) auto auto auto;
  }
  .arch-story--variant .arch-chapter[data-chapter="0"] .arch-body + .arch-body {
    grid-area: 5 / 1;
    margin-top: .75rem !important;
  }
  .arch-story--variant .arch-chapter[data-chapter="0"] .arch-links { grid-area: 6 / 1 / 7 / 3; }
}
@media (max-width: 740px) {
  .arch-story--detail .arch-journey__tools { top: calc(105px + env(safe-area-inset-top)); }
}
@media (min-width: 1100px) and (min-height: 650px) {
  .arch-story--detail[data-journey] {
    --arch-detail-mast: calc(110px + env(safe-area-inset-top));
    --arch-detail-stage: calc(100svh - var(--arch-detail-mast));
  }
  .arch-story--detail[data-journey] :is(.arch-journey__stage, .arch-journey__controls) {
    top: var(--arch-detail-mast);
    height: var(--arch-detail-stage);
  }
  .arch-story--detail[data-journey] .arch-chapter { min-height: var(--arch-detail-stage); }
  .arch-story--detail[data-journey] .arch-chapter[data-chapter="0"] .arch-chapter__copy {
    min-height: clamp(370px, 60svh, 930px);
  }
}
