/* Shared dimensional finish. Content and controls stay on a readable plane. */
body {
  --depth-accent: var(--primary, var(--fima-accent, #9b6cff));
  --depth-highlight: var(--accent, var(--fima-accent-2, #52dcff));
  --depth-edge: color-mix(in srgb, var(--depth-accent) 24%, #293044);
  --depth-shadow: 0 24px 56px -30px #000c, 0 7px 16px -9px #000b,
    inset 0 1px 0 #ffffff12, inset 0 -1px 0 #0005;
  isolation: isolate;
}
.fima-depth-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: clip;
  pointer-events: none;
  background: radial-gradient(ellipse at 12% 8%, color-mix(in srgb, var(--depth-accent) 9%, transparent), transparent 48%),
    radial-gradient(ellipse at 95% 65%, color-mix(in srgb, var(--depth-highlight) 5%, transparent), transparent 45%);
}
.fima-depth-atmosphere::after {
  content: '';
  position: absolute;
  width: min(1000px, 120vw);
  height: 320px;
  left: 50%;
  bottom: -180px;
  transform: translateX(-50%) perspective(500px) rotateX(58deg);
  background-image: linear-gradient(var(--depth-edge) 1px, transparent 1px),
    linear-gradient(90deg, var(--depth-edge) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse, #0005, transparent 68%);
}
html body :is(.panel:not(.auth-intro), .auth-card, .policy-card, .download-fallback-card, .download-panel,
  .dashboard-card, .ui-tour-shell, .macro-video-panel, .order-card, .payment-card,
  .module-panel, .state-card, .directory-hero, .account-dashboard-sidebar,
  .macro-card, .feature-card, .price-card, .pricing-card, .upcoming-card,
  .integration-card, .verification-card, .community-profile-card, .product-card,
  .billing-card, .license-card, .support-card, .workspace-access, .access-card,
  .server-card, .fima-application-family, .stat-card, .showcase-mini-card, .approval-card, .device-panel, .feedback-card, .plan-card, .invite-panel, .command-card, .key-hero-card, .key-trouble-card, .owner-card, .metric-panel, .operation-card) {
  border-color: var(--depth-edge);
  box-shadow: var(--depth-shadow);
}
html body :is(.integration-card, .verification-card, .community-profile-card,
  .product-card, .billing-card, .license-card, .support-card, .stat-card, .access-card) {
  box-shadow: 0 12px 24px -19px #000e, inset 0 1px 0 #ffffff10, inset 0 -1px 0 #0004;
}
html body :is(.app-preview-card, .macro-showcase-image, .current-ui-frame) {
  border: 1px solid var(--depth-edge);
  box-shadow: 0 32px 64px -25px #000b, 0 10px 0 -7px var(--depth-edge),
    0 19px 0 -14px color-mix(in srgb, var(--depth-accent) 28%, transparent), inset 0 1px 0 #ffffff26;
}
html body :is(.button, .btn, .primary-button, .secondary-button, .link-button) {
  box-shadow: inset 0 1px 0 #ffffff20, inset 0 -2px 0 #0003, 0 6px 14px -10px #000c;
}
html body :is(input, textarea, select) {
  box-shadow: inset 0 2px 5px #0003, 0 1px 0 #ffffff08;
}
html body :is(input, textarea, select):focus-visible {
  outline: 2px solid var(--depth-highlight);
  outline-offset: 3px;
}
.fima-depth-stage { position: relative; isolation: isolate; }
.fima-depth-sculpture {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: clip;
  border-radius: inherit;
  pointer-events: none;
  opacity: .38;
  contain: strict;
}
.fima-depth-sculpture > span {
  position: absolute;
  width: clamp(180px, 28vw, 380px);
  aspect-ratio: 1;
  right: -8%;
  top: 8%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--depth-highlight) 65%, transparent);
  box-shadow: inset 0 0 26px color-mix(in srgb, var(--depth-accent) 13%, transparent),
    0 0 28px color-mix(in srgb, var(--depth-accent) 10%, transparent);
  transform: perspective(650px) rotateX(58deg) rotateY(-25deg) rotateZ(-30deg);
}
.fima-depth-sculpture > span:nth-child(2) {
  transform: perspective(650px) rotateX(35deg) rotateY(58deg) rotateZ(25deg) scale(.86);
  border-width: 2px;
  border-color: color-mix(in srgb, var(--depth-accent) 70%, transparent);
}
.fima-depth-sculpture > span:nth-child(3) {
  transform: perspective(650px) rotateX(-25deg) rotateY(32deg) scale(.55);
  background: radial-gradient(circle at 32% 25%, #ffffff42, color-mix(in srgb, var(--depth-accent) 35%, #10121e) 38%, #080a12 76%);
  border-color: #ffffff16;
  box-shadow: 16px 24px 40px #0008, inset -10px -14px 28px #0007;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .fima-depth-active {
    rotate: var(--depth-axis-x, 1) var(--depth-axis-y, 1) 0 var(--depth-angle, 0deg);
    transition: rotate 160ms ease-out, box-shadow 180ms ease-out, border-color 180ms ease-out;
    border-color: color-mix(in srgb, var(--depth-highlight) 42%, var(--depth-edge));
  }
  html body :is(.button, .btn):active { translate: 0 1px; }
}
@media (max-width: 700px) {
  .fima-depth-sculpture { opacity: .2; }
  .fima-depth-atmosphere::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fima-depth-active { rotate: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .fima-depth-atmosphere, .fima-depth-sculpture { display: none; }
  .fima-depth-active { rotate: none; }
}

/* The screenshot, tabs, caption and frame move as one solid panel. */
html body .fima-preview-depth:is(.ui-tour-shell, .ml-media, .ml-details, .ml-app, .avatar-teaser, .avatar-hero, .avatar-choice) {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--depth-accent) 58%, #a8a5c0);
  background-image: linear-gradient(145deg, color-mix(in srgb, var(--depth-accent) 14%, transparent), transparent 58%);
  box-shadow: inset 0 1px 0 #ffffff45,
    1px 2px 0 #37304f, 2px 4px 0 #302843, 3px 6px 0 #292239,
    4px 8px 0 #221c30, 5px 10px 0 #1a1625,
    12px 28px 32px -12px #000a, 22px 48px 65px -22px #000c;
  transform: perspective(1800px) rotateX(var(--preview-rx, 2deg)) rotateY(var(--preview-ry, -2deg));
  transform-origin: center;
  rotate: none;
  transition: transform 220ms ease-out, border-color 180ms ease-out;
}
/* Keep the guide's smaller choices clear of the neighboring cards. */
html body .avatar-choice.fima-preview-depth {
  box-shadow: inset 0 1px 0 #ffffff32, 0 2px 0 var(--depth-edge),
    0 4px 0 #221c30, 0 14px 26px -16px #000d;
  transform: perspective(1800px) rotateX(var(--preview-rx, 2deg))
    rotateY(var(--preview-ry, -2deg)) translateY(var(--avatar-choice-lift, 0px));
}
html body .avatar-choice.fima-preview-depth:is(:hover, :focus-visible) {
  --avatar-choice-lift: -3px;
  border-color: var(--primary-strong);
}
@media (max-width: 700px) {
  html body .fima-preview-depth:is(.ui-tour-shell, .ml-media, .ml-details, .ml-app, .avatar-teaser, .avatar-hero, .avatar-choice) {
    transform: none;
    box-shadow: inset 0 1px 0 #ffffff35, 0 3px 0 #37304f, 0 6px 0 #221c30, 0 18px 28px -10px #000b;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body .fima-preview-depth:is(.ui-tour-shell, .ml-media, .ml-details, .ml-app, .avatar-teaser, .avatar-hero, .avatar-choice) {
    transform: none;
    transition: none;
  }
}
@media (forced-colors: active) {
  html body .fima-preview-depth:is(.ui-tour-shell, .ml-media, .ml-details, .ml-app, .avatar-teaser, .avatar-hero, .avatar-choice) {
    transform: none;
    box-shadow: none;
    border-color: CanvasText;
  }
}

/* Gentle feature motion uses compositor properties and respects reduced motion. */
@keyframes fima-feature-idle {
  0%, 100% { transform: translateY(0); opacity: .8; }
  50% { transform: translateY(-3px); opacity: 1; }
}
.feature-card .feature-icon { animation: fima-feature-idle 5s ease-in-out infinite; }
.feature-card:nth-child(3n + 2) .feature-icon { animation-delay: -1.7s; }
.feature-card:nth-child(3n) .feature-icon { animation-delay: -3.4s; }
.feature-card:hover .feature-icon,
.feature-card:focus-within .feature-icon { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .feature-card .feature-icon { animation: none; }
}
