@layer kft-studio {
  .kft-showcase {
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 0;
    width: 100%;
    max-width: 480px;
    justify-self: end;
    align-self: center;
  }
  .kft-showcase figure { margin: 0; }
  .kft-showcase-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: visible;
    background: transparent;
  }
  .kft-showcase-media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center;
  }
  /* Until the script lays the phones out, show nothing rather than the large
     no-script fallback image. The animation reveals it anyway if the script
     never runs. */
  .kft-showcase-media { transition: opacity 240ms ease; }
  .kft-showcase.is-booting .kft-showcase-media { opacity: 0; animation: kft-showcase-reveal 0s linear 4s forwards; }
  @keyframes kft-showcase-reveal { to { opacity: 1; } }
  .kft-orbit-space { position: absolute; inset: 0; }
  .kft-orbit-screen { height: 100%; }
  .kft-orbit-screen:not(:first-child) { display: none; }
  .kft-orbit-logo[hidden], .kft-showcase-motion[hidden] { display: none !important; }
  .is-orbit .kft-orbit-space {
    perspective: 1100px;
    transform-style: preserve-3d;
    touch-action: pan-y;
    cursor: grab;
    pointer-events: none;
  }
  .is-orbit .kft-orbit-screen {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(36%, 148px);
    height: auto;
    aspect-ratio: 2 / 3;
    pointer-events: auto;
    user-select: none;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
  }
  #hero .kft-orbit-logo:not([hidden]) {
    display: block !important;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 94px !important;
    height: 94px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translate(-50%, -50%) !important;
    transform-style: preserve-3d;
    cursor: grab;
    pointer-events: auto;
  }
  .kft-orbit-badge {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
  }
  .kft-orbit-edge, .kft-orbit-face {
    position: absolute;
    inset: 0;
    border-radius: 50% !important;
  }
  .kft-orbit-edge {
    border: 1px solid #67706b;
    background: #313736;
    transform: translateZ(calc(var(--slice) * 1px));
  }
  .kft-orbit-face { backface-visibility: hidden; object-fit: cover !important; }
  .kft-orbit-face-front { transform: translateZ(8px); }
  .kft-orbit-face-back { transform: rotateY(180deg) translateZ(8px); }
  .kft-showcase[data-running="true"] :is(.kft-orbit-screen, .kft-orbit-badge),
  .kft-showcase.is-dragging :is(.kft-orbit-screen, .kft-orbit-badge) { will-change: transform; }
  #hero .is-dragging .kft-orbit-logo, .is-dragging .kft-orbit-space { cursor: grabbing; }
  .kft-showcase-motion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--kft-muted);
    font: 400 11px/1.4 var(--kft-body);
  }
  .kft-showcase-motion { margin-top: 8px; }
  .kft-showcase-caption {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 12px;
    margin: 12px 0 0 !important;
    color: var(--kft-muted) !important;
    font: 400 11px/1.6 var(--kft-body) !important;
  }
  .kft-showcase-caption a {
    color: var(--kft-floodlight) !important;
    text-decoration: underline;
    text-decoration-color: var(--kft-match-line-strong);
    text-underline-offset: 4px;
  }
  .kft-showcase :is(button,a):focus-visible {
    outline: 2px solid var(--kft-touchline) !important;
    outline-offset: 4px;
  }
  #hero .hero-team-entry { grid-column: 1; grid-row: 2; align-self: start; min-width: 0; max-width: 520px; }
  #hero .hero-team-entry > summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 44px; cursor: pointer; color: var(--kft-floodlight); font: 600 13px/1.5 var(--kft-body); }
  #hero .hero-team-entry > summary span { color: var(--kft-muted); font-weight: 400; font-size: 11px; }
  #hero .hero-team-entry > summary::after { content: '+'; margin-left: auto; font-size: 20px; font-weight: 400; }
  #hero .hero-team-entry[open] > summary::after { content: '−'; }
  #hero .hero-team-entry > summary::-webkit-details-marker { display: none; }
  #hero .hero-team-entry .hero-team { margin-top: 12px; }
  #hero .hero-team-entry .hero-team-hint { font-size: 12px !important; line-height: 1.6 !important; margin-top: 8px !important; }
  body.kft-preview-open { overflow: hidden; }
  .kft-preview-dialog {
    position: fixed !important;
    inset: 0 !important;
    width: min(960px, calc(100vw - 48px)) !important;
    max-height: calc(100dvh - 48px) !important;
    margin: auto !important;
    padding: 32px !important;
    border: 1px solid var(--kft-match-line-strong) !important;
    border-radius: 12px !important;
    background: var(--kft-night) !important;
    color: var(--kft-floodlight) !important;
    overflow: auto !important;
    text-align: left !important;
  }
  .kft-preview-dialog::backdrop { background: #080b0bea; }
  .kft-preview-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .kft-preview-visual { min-width: 0; text-align: center; }
  .kft-preview-visual img { display: block; height: min(68dvh, 560px); width: 100%; object-fit: contain; }
  .kft-preview-dialog .kft-preview-visual p { color: var(--kft-muted) !important; font: 400 11px/1.5 var(--kft-body) !important; margin: 8px 0 0 !important; }
  .kft-preview-dialog .kft-preview-copy h2 { font: 600 32px/1.15 var(--kft-body) !important; letter-spacing: -.03em !important; margin: 0 0 20px !important; color: var(--kft-floodlight) !important; }
  .kft-preview-dialog .kft-preview-copy p { font: 400 15px/1.75 var(--kft-body) !important; color: var(--kft-muted) !important; margin: 0 !important; }
  .kft-preview-copy ul { display: grid; gap: 12px; margin: 24px 0 32px !important; padding-left: 20px !important; list-style: disc !important; font: 400 14px/1.6 var(--kft-body); }
  .kft-preview-dialog .kft-preview-open { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 48px !important; padding: 0 20px !important; border: 1px solid var(--kft-accent) !important; border-radius: 6px !important; background: var(--kft-accent) !important; color: var(--kft-floodlight) !important; font: 600 13px/1.4 var(--kft-body); text-decoration: none !important; }
  .kft-preview-dialog .kft-preview-close { display: grid !important; place-items: center; position: absolute; top: 12px; right: 12px; width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 !important; border: 1px solid var(--kft-match-line) !important; border-radius: 50% !important; background: var(--kft-stand) !important; color: var(--kft-floodlight) !important; box-shadow: none !important; transform: none !important; z-index: 1; }
  .kft-preview-dialog :is(button,a):focus-visible, #hero .hero-team-entry summary:focus-visible { outline: 2px solid var(--kft-touchline) !important; outline-offset: 4px; }
  @media (max-width: 768px) {
    .kft-showcase { grid-column: 1; grid-row: auto; max-width: 400px; justify-self: center; }
    /* On a phone the rotating previews are the way into each tool. */
    #hero .hero-text .hero-actions { display: none !important; }
    #hero .kft-orbit-logo:not([hidden]) { width: 82px !important; height: 82px !important; }
    #hero .hero-team-entry { grid-row: auto; width: 100%; border-top: 1px solid var(--kft-match-line); padding-top: 12px; }
    .kft-preview-dialog { width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important; padding: 52px 20px 24px !important; }
    .kft-preview-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .kft-preview-visual img { height: min(34dvh, 300px); }
    .kft-preview-dialog .kft-preview-copy h2 { font-size: 25px !important; margin-bottom: 12px !important; }
    .kft-preview-dialog .kft-preview-copy p { font-size: 14px !important; }
    .kft-preview-copy ul { margin: 16px 0 24px !important; font-size: 13px; gap: 8px; }
    .kft-preview-dialog .kft-preview-open { width: 100%; }
  }
}
