/* ==========================================================================
   IPS — "a ventilated facade, layer by layer" (anatomy.js): dark band, isometric exploded layers,
   the layer names and one fixed panel with what the picked layer does. Used on the facade page.
   ========================================================================== */
.anat { background: var(--ink); color: var(--white); overflow: hidden; position: relative; }
.anat::before { /* faint isometric grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(30deg, rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(150deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 32px;
}
.anat__grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; }
.anat__text { grid-column: 1 / span 5; }
.anat__text > .marker { display: flex; }
.anat__title { margin: 16px 0 14px; max-width: 560px; }
.anat__lead { color: rgba(255, 255, 255, .66); max-width: 460px; }
.anat__list { margin-top: clamp(20px, 2.4vw, 32px); border-top: 1px solid var(--line-inv); }
.anat__item { position: relative; width: 100%; display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line-inv); color: rgba(255, 255, 255, .7); transition: color .35s var(--ease), padding-left .5s var(--ease); }
.anat__item::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateY(-50%) scale(0); transition: transform .4s var(--ease); }
.anat__item:hover, .anat__item.is-active { color: var(--white); }
.anat__item.is-active { padding-left: 8px; }
.anat__item.is-active::before { transform: translateY(-50%) scale(1); }
.anat__n { font-family: var(--f-latin); font-size: 11px; letter-spacing: .1em; padding-top: 4px; color: rgba(255, 255, 255, .45); transition: color .35s; }
.anat__item.is-active .anat__n { color: var(--accent-2); }
.anat__t { font-weight: 500; font-size: 16px; line-height: 1.35; }
/* one fixed-height panel for the description: no layout shift while switching layers */
.anat__detail { min-height: 6.6em; margin-top: 18px; padding: 14px 16px; border-radius: 4px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-inv); transition: opacity .14s linear; }
.anat__detail.is-swap { opacity: 0; }
.anat__dn { display: block; font-family: var(--f-latin); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 6px; }
html[lang="ka"] .anat__dn { font-family: var(--f-text); text-transform: none; letter-spacing: .02em; font-size: 12.5px; }
.anat__dt { font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .78); }
.anat__link { margin-top: 22px; color: var(--white); }
.anat__stage { grid-column: 7 / span 6; }
.anat__stage svg { width: 100%; height: auto; max-height: calc(var(--vh, 1vh) * 78); overflow: visible; }
.lyr { transition: opacity .42s var(--ease), transform .6s var(--ease); transform: translate(calc(var(--dx) * -5), calc(var(--dy) * -5)); opacity: 0; }
.anat.is-in .lyr { transform: none; opacity: 1; transition-delay: calc(var(--i) * .09s); }
.anat.is-in .anat__stage.has-active .lyr { opacity: .22; transition-delay: 0s; }
.anat.is-in .anat__stage.has-active .lyr.is-active { opacity: 1; transform: translate(var(--dx), var(--dy)); }
.lyr__badge circle { fill: var(--white); }
.lyr__badge text { font-family: var(--f-latin); font-size: 11px; font-weight: 600; fill: var(--ink); }
.lyr.is-active .lyr__badge circle { fill: var(--accent); }
.lyr.is-active .lyr__badge text { fill: var(--white); }
.air { animation: airRise 1.6s linear infinite; }
@keyframes airRise { to { stroke-dashoffset: -26; } }
/* the rising air rests while the block is off screen (class set by anatomy.js) */
.anat:not(.is-vis) .air { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .air { animation: none; } }

@media (max-width: 1024px) {
  .anat__text, .anat__stage { grid-column: 1 / -1; }
  .anat__stage { margin-top: 32px; max-width: 620px; justify-self: center; width: 100%; }
}
/* tablets: the list and the drawing side by side, so a tapped layer lights up right next to it */
@media (min-width: 761px) and (max-width: 1024px) {
  .anat__text { grid-column: 1 / span 6; }
  .anat__stage { grid-column: 7 / span 6; margin-top: 0; }
}
@media (max-width: 760px) {
  /* heading, the drawing, a swipeable row of layer chips, then what the layer does */
  .anat__grid { display: flex; flex-direction: column; align-items: stretch; }
  .anat__text { display: contents; }
  .anat__text > .marker { order: 1; }
  .anat__title { order: 2; }
  .anat__lead { order: 3; }
  .anat__stage { order: 4; margin-top: 18px; }
  .anat__list {
    order: 5; display: flex; flex-wrap: nowrap; gap: 8px; margin: 16px calc(var(--pad) * -1) 0; padding: 0 0 0 var(--pad); border-top: 0;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: var(--pad); scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }
  .anat__list.is-end { -webkit-mask-image: none; mask-image: none; }
  .anat__list::after { content: ""; flex: 0 0 calc(var(--pad) - 8px); }
  .anat__list::-webkit-scrollbar { display: none; }
  .anat__list > li { flex: none; }
  .anat__item {
    display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 44px; padding: 0 15px; white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 2px; color: rgba(255, 255, 255, .82);
    transition: background-color .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
  }
  .anat__item.is-active { padding-left: 15px; background: var(--white); border-color: var(--white); color: var(--ink); }
  .anat__item::before { display: none; }
  .anat__n { padding-top: 0; }
  .anat__item.is-active .anat__n { color: var(--accent); }
  .anat__t { font-size: 15px; }
  .anat__detail { order: 6; margin-top: 12px; min-height: 8.4em; }
  .anat__link { order: 7; align-self: flex-start; }
  .anat__link::before { content: ""; position: absolute; inset: -12px -8px; }
}
