/* Shared glass + soft-depth treatments for the live component library.
   Scoped to preview wrappers to avoid changing consuming applications. */
.fa-preview,
.ff-demo,
.ui-stage,
.mc-preview {
  --fx-ink: var(--cc-ink, #1d1d1f);
  --fx-accent: var(--cc-accent, #0066cc);
  --fx-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
  --fx-raised: var(
    --cc-shadow,
    0 10px 28px -14px #26344942,
    inset 0 1px 0 #fff
  );
  --fx-inset: var(
    --cc-inset,
    inset 3px 3px 8px #2634491a,
    inset -3px -3px 8px #ffffffd9
  );
  isolation: isolate;
}
/* Directional light gives each specimen a defined stage and a clear horizon. */
.fa-preview,
.ff-demo--glass,
.ui-stage.glass,
.mc-preview:not(.dark) {
  background: var(--cc-stage, linear-gradient(135deg, #f4f6f8, #dce3ea));
}
.ff-demo--soft,
.ui-stage.soft {
  background: var(--cc-stage, linear-gradient(135deg, #f4f6f8, #dce3ea));
}
.ui-stage.motion,
.mc-preview.dark {
  background:
    radial-gradient(ellipse at 20% 12%, #345574, transparent 55%),
    var(--cc-night, #17283e);
}
/* Glass surfaces maintain an opaque fallback for contrast. */
.fa-card,
.ff-demo--glass .ff-c-surface,
.ui-glass {
  background:
    linear-gradient(
      115deg,
      transparent 28%,
      color-mix(in srgb, var(--cc-glass-edge, #ffffffe0) 40%, transparent) 48%,
      transparent 67%
    ),
    var(--cc-glass, linear-gradient(135deg, #ffffffeb, #edf3f9d9));
  background-size:
    230% 100%,
    100% 100%;
  background-position:
    100% 0,
    0 0;
  border: 1px solid var(--cc-glass-edge, #ffffffe0);
  box-shadow: var(--fx-raised);
  -webkit-backdrop-filter: blur(var(--cc-frost, 15px)) saturate(115%);
  backdrop-filter: blur(var(--cc-frost, 15px)) saturate(115%);
}
.ff-demo--soft .ff-c-surface,
.ui-soft {
  background: var(--cc-glass, linear-gradient(135deg, #ffffffeb, #edf3f9d9));
  border: 1px solid var(--cc-glass-edge, #ffffffe0);
  box-shadow: var(--fx-raised);
}
.fa-card,
.ff-c-surface,
.ui-surface,
.mc-skeleton {
  transition:
    transform 0.45s var(--fx-ease),
    box-shadow 0.45s var(--fx-ease),
    background-position 0.75s var(--fx-ease),
    border-color 0.3s ease;
}
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview):hover
  :is(.fa-card, .ff-c-surface, .ui-surface, .mc-skeleton):not(
    [data-cc-motion~="tilt"]
  ),
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview):focus-within
  :is(.fa-card, .ff-c-surface, .ui-surface, .mc-skeleton):not(
    [data-cc-motion~="tilt"]
  ) {
  transform: translateY(-4px);
  background-position:
    0 0,
    0 0;
  box-shadow:
    0 22px 38px #3049623b,
    0 0 20px #7abcf21f,
    inset 0 1px 0 #fff,
    inset 0 -1px 0 #a7bdd44d;
}
/* Recessed fields, raised controls and tactile pressed states. */
:is(.fa-preview, .ff-demo, .ui-stage) :is(.fa-input, .ff-c-input, .ui-input) {
  background: var(--cc-surface, #f8f9fb);
  border-color: var(--cc-border, #cbd1d9);
  box-shadow: var(--fx-inset);
  transition:
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}
:is(.fa-preview, .ff-demo, .ui-stage)
  :is(.fa-input, .ff-c-input, .ui-input):focus {
  background: var(--cc-surface, #f8f9fb);
  border-color: var(--cc-accent, #0066cc);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--cc-accent, #0066cc) 20%, transparent),
    var(--fx-inset);
}
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  :is(
    .fa-btn,
    .ff-c-button,
    .ui-btn,
    .mc-btn,
    .fa-icon,
    .ff-c-circle,
    .ui-icon-btn,
    .mc-icon
  ) {
  transition:
    transform 0.32s var(--fx-ease),
    box-shadow 0.32s var(--fx-ease),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  :is(
    .fa-btn,
    .ff-c-button,
    .ui-btn,
    .mc-btn,
    .fa-icon,
    .ff-c-circle,
    .ui-icon-btn,
    .mc-icon
  ):hover {
  transform: translateY(-3px);
  box-shadow:
    0 10px 20px rgba(57, 70, 85, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  :is(
    .fa-btn,
    .ff-c-button,
    .ui-btn,
    .mc-btn,
    .fa-icon,
    .ff-c-circle,
    .ui-icon-btn,
    .mc-icon
  ):active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    inset 3px 3px 7px rgba(31, 44, 58, 0.2),
    inset -2px -2px 5px rgba(255, 255, 255, 0.24);
}
.fa-preview :is(.fa-outline, .fa-icon),
.ff-demo .ff-c-button--light,
.ui-stage .ui-btn.secondary,
.mc-preview .mc-icon {
  background: var(--cc-glass-fill, #f8f9fbe0);
  border: 1px solid var(--cc-glass-edge, #ffffffe0);
  box-shadow:
    5px 5px 12px rgba(74, 87, 100, 0.22),
    -5px -5px 12px rgba(255, 255, 255, 0.7);
}
.fa-preview :is(.fa-outline, .fa-icon):hover,
.ff-demo .ff-c-button--light:hover,
.ui-stage .ui-btn.secondary:hover,
.mc-preview .mc-icon:hover {
  color: var(--cc-accent-strong, #0056ad);
  background: var(--cc-surface, #f8f9fb);
}
:is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  :is(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid var(--cc-accent, #0066cc);
  outline-offset: 3px;
}
:is(.fa-preview, .mc-preview) :is(.fa-icon, .mc-icon)[aria-pressed="true"],
:is(.fa-preview, .mc-preview)
  :is(.fa-icon, .mc-icon)[aria-pressed="true"]:hover {
  background: var(--cc-accent, #0066cc);
  color: var(--cc-on-accent, #fff);
  border-color: var(--cc-accent, #0066cc);
  box-shadow:
    inset 2px 2px 5px #003e7c70,
    0 5px 12px #24496e30;
}
/* A single light pass follows hover or keyboard exploration; it never loops. */
.fa-preview:before {
  background: radial-gradient(ellipse, #ffffffd6, transparent 68%);
  inset: auto;
  width: 220px;
  height: 170px;
  top: -65px;
  right: -25px;
}
.fa-preview:before,
.ff-demo:before {
  animation: none;
  opacity: 0.4;
  transform: translate3d(0, 0, 0) scale(0.9);
  transition:
    transform 0.85s var(--fx-ease),
    opacity 0.6s ease;
}
:is(.fa-preview, .ff-demo):is(:hover, :focus-within):before {
  opacity: 0.9;
  transform: translate3d(-32px, 25px, 0) scale(1.2);
}
.ui-stage::after,
.mc-preview::after {
  animation: none;
  opacity: 0;
  transform: translateX(-48%) skewX(-8deg);
  transition:
    transform 0.85s var(--fx-ease),
    opacity 0.5s ease;
}
:is(.ui-stage, .mc-preview):is(:hover, :focus-within)::after {
  opacity: 0.8;
  transform: translateX(48%) skewX(-8deg);
}
@media (prefers-reduced-transparency: reduce) {
  .fa-card,
  .ff-demo--glass .ff-c-surface,
  .ui-glass {
    background: var(--cc-surface, #f8f9fb);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fa-preview:before,
  .ff-demo:before,
  .ui-stage::after,
  .mc-preview::after {
    animation: none !important;
    transition: none !important;
    opacity: 0 !important;
  }
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview) *,
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview) *::before,
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview):is(:hover, :focus-within)
    :is(.fa-card, .ff-c-surface, .ui-surface, .mc-skeleton),
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
    :is(
      .fa-btn,
      .ff-c-button,
      .ui-btn,
      .mc-btn,
      .fa-icon,
      .ff-c-circle,
      .ui-icon-btn,
      .mc-icon
    ):is(:hover, :active) {
    transform: none !important;
  }
}

/* Standalone exports follow the same motion switch as the library. */
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview),
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  *,
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  *::before,
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.fa-preview, .ff-demo, .ui-stage, .mc-preview)
  *::after {
  animation: none !important;
  transition: none !important;
}
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.fa-preview, .ff-demo)::before,
html:is([data-motion="paused"], [data-ff-motion="off"])
  :is(.ui-stage, .mc-preview)::after {
  animation: none !important;
  transition: none !important;
  opacity: 0 !important;
}
