.project-asset-nest-figma [data-flip-back] {
  position: relative;
  padding: 0;
  isolation: isolate;
}

.project-asset-nest-figma [data-flip-back]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: rgb(126 121 108 / 7%);
}

.project-asset-nest-figma [data-flip-back][data-html-dashboard]::after,
.project-asset-nest-figma [data-flip-back]:not([data-html-dashboard]) > .asset-dashboard-preview {
  display: none;
}

.project-asset-nest-figma [data-flip-back] > .asset-dashboard-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}


.project-asset-nest-figma [data-flip-back] > div {
  width: 100%;
  opacity: 1 !important;
}

.project-asset-nest-figma [data-flip-back] > div > .grid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.project-asset-nest-figma [data-flip-back] figure {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-asset-nest-figma [data-flip-back] figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: none;
  border-radius: 0;
  object-fit: cover;
  filter: contrast(1.08) saturate(1.06);
}

@media (min-width: 768px) {
  .project-asset-nest-figma [data-flip-back] > div {
    position: absolute;
    inset: 0;
  }

  .project-asset-nest-figma [data-flip-back] > div > .grid {
    height: 100%;
  }
}

.project-asset-nest-figma .asset-system-graphic {
  padding-inline: 0 !important;
}

[data-preview-project] :is(.infonest-system-graphic, .literature-system-graphic) {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-inline: 0;
}

[data-preview-project="buchanalysen"] .literature-system-label {
  font-size: 11.5px;
}

main a[data-content-card]:is([href="/projects/stack-agents"], [href="/projects/stack-homeserver"]) {
  display: none !important;
}

[data-preview-stack-flip] {
  display: block;
  position: relative;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
  perspective: 1600px;
  touch-action: pan-y pinch-zoom;
}

.preview-stack-rotor {
  position: relative;
  height: 384px;
  container-type: inline-size;
  transform-style: preserve-3d;
  transition: transform 700ms ease-out;
  transform: rotateY(var(--preview-card-angle, 0deg));
}

.preview-stack-rotor > :is(.preview-stack-front, .preview-stack-back) {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: var(--preview-stack-shadow);
}

.preview-stack-rotor > .preview-stack-front {
  display: block;
  background: var(--werk-ton, #d6dfe7);
  padding: 57.6px clamp(22px, 2.5vw, 32px) 24px;
}

.preview-stack-front :is(.preview-stack-thumbnail, .werk-label, .werk-author) { display: none; }

[data-preview-stack-flip]:not([data-preview-info-flip]) .preview-stack-front .werk-title {
  margin: 0;
  padding-inline-end: 24px;
  font-size: min(clamp(24px, 2vw, 29px), 10cqi) !important;
  font-weight: 600;
  line-height: 1.08 !important;
  letter-spacing: -.035em;
  text-transform: uppercase;
  hyphens: auto;
}

[data-preview-stack-flip]:not([data-preview-info-flip]) .preview-stack-front .werk-meta {
  margin-top: 32px;
  font-size: 14px;
  line-height: 20px;
}

[data-preview-stack-flip]:not([data-preview-info-flip]) .preview-stack-front .werk-pfeil {
  top: 61.6px;
  right: clamp(22px, 2.5vw, 32px);
  width: 20px;
  height: 20px;
  color: inherit;
  transform: none;
}

.preview-stack-rotor > .preview-stack-back {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotateY(180deg);
  pointer-events: none;
}

[data-preview-stack-flip="homeserver"] .preview-stack-back {
  filter: sepia(.2) hue-rotate(53deg) saturate(.77);
}

[data-preview-stack-flip]:focus-visible > .preview-stack-rotor {
  transform: rotateY(180deg);
}

.preview-stack-front :is(.werk-title, .werk-meta, .werk-pfeil) { color: #263530 !important; }
[data-preview-info-flip] > .preview-stack-rotor { height: auto; container-type: normal; }
[data-preview-info-flip] .preview-stack-front { position: relative; display: flow-root; min-height: var(--preview-info-height, 0px); }
[data-preview-info-flip] .werk-pfeil { color: #263530 !important; translate: -23px 23px; }
[data-preview-info-flip] .preview-stack-back { object-fit: contain; }
[data-preview-info-flip="prototype"] .preview-stack-back {
  background: #faf9f7;
  filter: url("/infonest-prototype-beige.svg#beige");
  object-view-box: inset(108px 100px 131px 100px);
}
[data-preview-info-flip="pitch"] .preview-stack-back {
  background: #f5f1e9;
  object-view-box: inset(48px 12px 8px 12px);
}
[data-preview-info-flip="case"] .preview-stack-back { background: #f5f1e9; }
[data-preview-info-flip="case"] .preview-stack-back img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.preview-mascot { margin-top: var(--preview-info-mascot-shift, 0px); }
[data-preview-asset-swipe] { touch-action: pan-y pinch-zoom; }
[data-preview-asset-turned] > div { transform: rotateY(var(--preview-asset-angle)) !important; }

.preview-workflow-image {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: zoom-in;
}
.preview-workflow-image > div { display: block; }
.preview-workflow-image > div > :not(:has(img)) { display: none; }
.preview-workflow-image > div > div:has(img) { width: 100% !important; max-width: none; margin: 0; }
.preview-workflow-image img { width: 100%; height: auto; opacity: 1 !important; filter: none !important; }
.preview-workflow-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 18px;
  width: min(92vw, 1360px);
  max-width: none;
  max-height: 94dvh;
  border: 0;
  border-radius: 12px;
  background: #fbfcfb;
  color: #202923;
}
.preview-workflow-dialog::backdrop { background: rgb(248 250 249 / 84%); backdrop-filter: blur(8px); }
.preview-workflow-dialog form { display: flex; justify-content: end; margin-bottom: 8px; }
.preview-workflow-dialog button { padding: 4px 12px; border-radius: 5px; background: #e9eeea; cursor: pointer; }
.preview-workflow-viewport { display: block; width: 100%; height: 78dvh; border: 0; border-radius: 8px; }
.preview-workflow-controls { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.preview-workflow-controls a { text-decoration: underline; }

.preview-project-title-ink {
  background-image: linear-gradient(105deg, #151d19 12%, #315c45 22%, #151d19 31%, #2c515b 41%, #151d19 51%, #644359 61%, #151d19 73%, #5a5736 83%, #151d19 94%);
  background-size: 210% 100%;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: preview-project-ink 17s ease-in-out infinite alternate;
}

@keyframes preview-project-ink { to { background-position: 100% 0; } }

@media (prefers-reduced-motion: reduce) {
  .preview-stack-rotor { transition: none; }
  .preview-project-title-ink { animation: none; }
}
/* The text face uses an invisible image to preserve the original title position. */
.a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) {
  position: relative;
}

.a1-face .a1-visual > div > div:has(> :is(img:not(.invisible), video, iframe)),
.mwms-card-face > .mwms-card-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) > div:last-child,
.mwms-card-face:has(> .mwms-card-stage) > .mwms-card-content {
  display: none;
}

html[data-preview-card-layout]:not([data-preview-card-layout="current"]) {
  --preview-card-inset: clamp(22px, 2.5vw, 32px);
}

:is(
  html[data-preview-card-layout]:not([data-preview-card-layout="current"])
    :is(.a1-face .a1-visual > div:not(:has(> div > :is(img:not(.invisible), video, iframe))) > div:last-child,
        .mwms-card-face:not(:has(> .mwms-card-stage)) > .mwms-card-content),
  html[data-preview-image-title]
    :is(.a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) > div:last-child,
        .mwms-card-face:has(> .mwms-card-stage) > .mwms-card-content)
) {
  position: absolute;
  inset: var(--preview-card-inset);
  inset-block-start: var(--preview-text-top, var(--preview-card-inset));
  display: flex;
  flex-direction: column;
  justify-content: var(--preview-text-position, flex-start);
  padding: 0;
}

html[data-preview-card-layout="top"] { --preview-text-position: flex-start; }
html[data-preview-card-layout="center"] { --preview-text-position: center; }
html[data-preview-card-layout="bottom"] { --preview-text-position: flex-end; }

html[data-preview-card-layout]:not([data-preview-card-layout="current"]) .a1-face h2 {
  min-height: 0;
}

html[data-preview-card-layout="center"] .a1-face :is(h2, h2 + p[aria-hidden]) {
  font-size: clamp(27px, 2.35vw, 34px) !important;
  line-height: 1.08 !important;
}

html[data-preview-card-layout="bottom"] .a1-face .editorial-body {
  margin-top: 10px;
}

html[data-preview-card-layout="editorial"] {
  --preview-text-top: 17%;
  --preview-title-size: clamp(26px, 2.3vw, 33px);
  --preview-copy-gap: 12px;
}

html[data-preview-card-layout="poster"] {
  --preview-text-top: 12%;
  --preview-title-size: clamp(29px, 3vw, 45px);
  --preview-copy-gap: 18px;
}

html[data-preview-card-layout="spaced"] {
  --preview-text-top: 15%;
  --preview-title-size: clamp(24px, 2vw, 29px);
  --preview-copy-gap: 32px;
}

html[data-preview-card-layout="centered"] {
  --preview-text-top: 20%;
  --preview-title-size: clamp(25px, 2.15vw, 32px);
  --preview-copy-gap: 14px;
}

html:is([data-preview-card-layout="editorial"], [data-preview-card-layout="poster"],
        [data-preview-card-layout="spaced"], [data-preview-card-layout="centered"]) .a1-face {
  container-type: inline-size;
}

html:is([data-preview-card-layout="editorial"], [data-preview-card-layout="poster"],
        [data-preview-card-layout="spaced"], [data-preview-card-layout="centered"])
  .a1-face :is(h2, h2 + p[aria-hidden]) {
  font-size: min(var(--preview-title-size), 10cqi) !important;
  line-height: 1.08 !important;
}

html:is([data-preview-card-layout="editorial"], [data-preview-card-layout="poster"],
        [data-preview-card-layout="spaced"], [data-preview-card-layout="centered"]) .a1-face .editorial-body {
  margin-top: var(--preview-copy-gap);
}

html[data-preview-card-layout="centered"] .a1-face .flex.items-start.justify-between:has(h2) {
  position: relative;
  justify-content: center;
  padding-inline: 24px;
  text-align: center;
}

html[data-preview-card-layout="centered"] .a1-face .flex.items-start.justify-between:has(h2) > svg {
  position: absolute;
  inset-inline-end: 0;
}

html[data-preview-card-layout="centered"] .a1-face .editorial-body {
  align-self: center;
  max-width: 34ch;
  text-align: center;
}

html[data-preview-image-title] :is(
  .a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) > div:last-child,
  .mwms-card-face:has(> .mwms-card-stage) > .mwms-card-content
) {
  pointer-events: none;
}

html[data-preview-image-title] :is(
  .a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) > div:last-child,
  .mwms-card-face:has(> .mwms-card-stage) > .mwms-card-content
) .editorial-body {
  display: none;
}

html[data-preview-image-title] :is(
  .a1-face .a1-visual > div:has(> div > :is(img:not(.invisible), video, iframe)) > div:last-child,
  .mwms-card-face:has(> .mwms-card-stage) > .mwms-card-content
) .justify-between > svg {
  visibility: hidden;
}

html[data-preview-image-title] .a1-face :is(h2, h2 + p[aria-hidden]) {
  font-weight: 600 !important;
}

html[data-preview-image-title] .mwms-card-shot {
  animation-name: preview-invader-shot;
}

@keyframes preview-invader-shot {
  0% { transform: translateY(0); opacity: 0; }
  5%, 90% { opacity: 1; }
  100% { transform: translateY(-420px); opacity: 0; }
}

/* Shared Main interaction adapter. Native timers cannot override the held side. */
[data-card-motion] { touch-action: pan-y pinch-zoom; }
[data-card-motion-rotor] {
 transform: rotateY(var(--shared-card-angle, 0deg)) !important;
 transition: transform var(--card-motion-duration, 700ms) var(--card-motion-easing, ease-out) !important;
}
@media (prefers-reduced-motion: reduce) {
 [data-card-motion-rotor] { transition: none !important; }
}

/* Literature links: original front layout, equal height, full-bleed selected artwork. */
[data-preview-book] > .preview-stack-rotor { height: var(--preview-book-height, 190px); }
[data-preview-book] .preview-stack-front { position: absolute; min-height: 0; height: 100%; }
[data-preview-book] .preview-stack-front :is(.werk-author, .werk-label) { display: block; }
[data-preview-book] .preview-stack-back { object-fit: cover; object-position: center; }

[data-preview-book] .werk-author { color: #59645f !important; }


/* Give both kinds of flip card the same physical depth. The back face
   already rotates 180 degrees, so translate it on the rotor's Z axis. */
:is(.preview-stack-rotor, :has(> .a1-face + .a1-face)) {
  --card-depth: 8px;
  --card-half-depth: calc(var(--card-depth) / 2);
  --card-edge-color: color-mix(in srgb, var(--werk-ton, #c7cec9) 72%, #45564e);
}

.preview-stack-rotor > .preview-stack-front,
.a1-face:has(+ .a1-face) {
  translate: 0 0 var(--card-half-depth);
}

.preview-stack-rotor > .preview-stack-back,
.a1-face + .a1-face {
  translate: 0 0 calc(-1 * var(--card-half-depth));
}

:is(.preview-stack-rotor, :has(> .a1-face + .a1-face))::before,
:is(.preview-stack-rotor, :has(> .a1-face + .a1-face))::after {
  content: "";
  position: absolute;
  inset-block: 6px;
  width: var(--card-depth);
  border-radius: 3px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--card-edge-color) 75%, white),
    var(--card-edge-color));
  backface-visibility: hidden;
  pointer-events: none;
}

:is(.preview-stack-rotor, :has(> .a1-face + .a1-face))::before {
  left: calc(-1 * var(--card-half-depth));
  transform: rotateY(-90deg);
}

:is(.preview-stack-rotor, :has(> .a1-face + .a1-face))::after {
  right: calc(-1 * var(--card-half-depth));
  transform: rotateY(90deg);
}
