/*
 * Website depth layer (rc.21): a three-dimensional finish for the public pages. Loaded after premium.css, on every page.
 * Visual layer only: no text, link, markup meaning or SEO change. js/depth.js sets the CSS variables (pointer position, scroll) and marks elements;
 * without the script (or with prefers-reduced-motion, or on a touch screen) every rule that moves anything is off and the pages look as before.
 * transform / opacity only, logical properties, RTL mirrored through --d3-dir, no external resource.
 */
:root { --d3-dir: 1; --d3-ease: cubic-bezier(.2, .7, .2, 1); }
[dir="rtl"] { --d3-dir: -1; }

/* ---------------------------------------------------------------- hero: the product window floats in space, with stacked glass panes behind it */
@media (min-width: 960px) {
  .hero-visual {
    --rx: 0; --ry: 0; --sc: 0;
    transform-style: preserve-3d;
    transform: perspective(1500px) rotateY(calc((var(--d3-dir) * -17deg + var(--ry) * 1deg) * (1 - var(--sc) * .85))) rotateX(calc((8deg + var(--rx) * 1deg) * (1 - var(--sc) * .85))) translateY(calc(var(--sc) * -26px)) scale(.95);
    transition: transform .5s var(--d3-ease);
    will-change: transform;
    animation: d3-lift .9s .1s cubic-bezier(.2, .7, .2, 1) both;   /* replaces the old entrance (it ended in transform: none, which would cancel the 3D pose) */
  }
  @keyframes d3-lift { from { opacity: 0; translate: 0 30px; } to { opacity: 1; translate: 0 0; } }
  .hero-visual.is-tilting { transition: transform .12s linear; }
  .hero-visual::before, .hero-visual::after { content: ""; position: absolute; border-radius: 18px; pointer-events: none; transform-style: preserve-3d; }
  .hero-visual::before {
    inset: 4% -3% -6% 7%; z-index: -1; transform: translate3d(calc(var(--d3-dir) * 38px), 30px, -90px);
    background: linear-gradient(140deg, rgba(34, 130, 255, .38), rgba(11, 60, 140, .18) 60%, rgba(201, 163, 73, .16));
    border: 1px solid rgba(143, 194, 255, .28); box-shadow: 0 50px 90px -30px rgba(1, 8, 24, .9), inset 0 1px 0 rgba(255, 255, 255, .14);
    backdrop-filter: blur(2px);
  }
  .hero-visual::after {
    inset: 9% -8% -10% 14%; z-index: -2; transform: translate3d(calc(var(--d3-dir) * 78px), 58px, -190px);
    background: linear-gradient(140deg, rgba(20, 90, 200, .3), rgba(6, 30, 80, .12));
    border: 1px solid rgba(143, 194, 255, .16); filter: blur(1.2px);
  }
  .hero-frame { transform: translateZ(0); transition: transform .35s var(--d3-ease), box-shadow .35s ease, border-color .35s ease; }
  /* a moving light across the glass, following the pointer */
  .hero-frame .d3-glare { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; border-radius: inherit; transition: opacity .35s ease;
    background: radial-gradient(520px 340px at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%); mix-blend-mode: soft-light; }
  .hero-visual.is-tilting .d3-glare { opacity: 1; }
  .hero-frame:hover { transform: translateZ(40px); }
  .hero-frame .hf-chip { transform: translateZ(60px); }
}
/* the glow under the window */
.hero-visual { --d3-glow: radial-gradient(60% 50% at 50% 50%, rgba(22, 119, 255, .35), transparent 70%); }

/* ---------------------------------------------------------------- cards: a tilt that follows the pointer, a pop-out icon, a moving highlight
   (js/depth.js marks the cards with .d3-card; the "What is inside" cards of the home page keep their own effect from css/features.css) */
@media (hover: hover) and (pointer: fine) {
  html.d3 .d3-card {
    --d3x: 0; --d3y: 0; position: relative; transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(calc(var(--d3x) * 1deg)) rotateY(calc(var(--d3y) * 1deg)) translateZ(0);
    transition: transform .45s var(--d3-ease), box-shadow .35s ease, border-color .35s ease;
  }
  html.d3 .d3-card.is-tilting { transition: transform .1s linear, box-shadow .35s ease; }
  html.d3 .d3-card:hover {
    transform: perspective(1000px) rotateX(calc(var(--d3x) * 1deg)) rotateY(calc(var(--d3y) * 1deg)) translateZ(14px);
    box-shadow: 0 2px 4px rgba(11, 31, 68, .06), 0 38px 60px -24px rgba(11, 31, 68, .42), 0 0 0 1px rgba(22, 119, 255, .12);
  }
  html.d3 .d3-card .pfcard-ico, html.d3 .d3-card .ptile-ico, html.d3 .d3-card .mcard-ico { transform: translateZ(34px); transition: transform .45s var(--d3-ease), background .3s, color .3s; }
  html.d3 .d3-glare--card { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; border-radius: inherit; transition: opacity .3s ease;
    background: radial-gradient(260px 200px at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%); }
  html.d3 .d3-card.is-tilting > .d3-glare--card { opacity: 1; }
}

/* ---------------------------------------------------------------- screenshots on the inner pages and the gallery: slight perspective that settles on hover */
@media (min-width: 900px) and (hover: hover) {
  .product-visual, .detail-visual, .tab-shot { perspective: 1400px; }
  .product-visual .shot, .detail-visual .shot, .tab-shot .shot { transform: rotateY(calc(var(--d3-dir) * -7deg)) rotateX(3deg); transition: transform .6s var(--d3-ease), box-shadow .4s ease; box-shadow: 0 40px 70px -28px rgba(3, 10, 26, .6), 0 0 60px -24px rgba(22, 119, 255, .4); }
  .product-visual:hover .shot, .detail-visual:hover .shot, .tab-shot:hover .shot { transform: rotateY(0) rotateX(0) translateZ(0); }
}

/* ---------------------------------------------------------------- scroll: blocks rise out of the page */
html.d3 .d3-pre { opacity: 0; transform: perspective(1100px) translate3d(0, 34px, -60px) rotateX(9deg); }
html.d3 .d3-pre.d3-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .85s var(--d3-ease); transition-delay: calc(var(--d3-i, 0) * 70ms); }

/* ---------------------------------------------------------------- buttons: a fine bevel and a pressed state */
.btn-primary { box-shadow: 0 12px 26px -10px var(--pf-primary-glow), 0 2px 0 #093d8c, inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -1px 0 rgba(0, 0, 0, .18); }
.btn-primary:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 6px 14px -8px var(--pf-primary-glow), 0 0 0 #093d8c, inset 0 2px 4px rgba(0, 0, 0, .25); }
.btn-primary:hover { transform: translateY(-1px); }

/* ---------------------------------------------------------------- dark bands: a soft sphere of light that gives the section depth */
.band, .section--dark { position: relative; overflow: hidden; isolation: isolate; }
.band::after, .section--dark::after { content: ""; position: absolute; inset-inline-end: -8%; inset-block-start: -30%; inline-size: 46%; aspect-ratio: 1; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(80, 160, 255, .28), rgba(22, 119, 255, .08) 45%, transparent 70%); filter: blur(2px); }

@media (prefers-reduced-motion: reduce) {
  .hero-visual, .hero-visual.is-tilting, .hero-frame, .hero-frame:hover, .hero-frame .hf-chip,
  html.d3 .d3-card, html.d3 .d3-card:hover, html.d3 .d3-card .pfcard-ico, html.d3 .d3-card .ptile-ico, html.d3 .d3-card .mcard-ico,
  .product-visual .shot, .detail-visual .shot, .tab-shot .shot { transform: none; transition: none; }
  html.d3 .d3-pre, html.d3 .d3-pre.d3-in { opacity: 1; transform: none; transition: none; }
  .hero-visual::before, .hero-visual::after { display: none; }
}
@media print { .hero-visual { transform: none; } .hero-visual::before, .hero-visual::after { display: none; } html.d3 .d3-pre { opacity: 1; transform: none; } }
