/* DiviPerfect Page Transition. Colours and speed come from the module settings (custom properties on .dp-tr, printed
   inline by PHP / builder.js, which win over the defaults here). States, set by transition.js: is-in (covering),
   is-covered (a solid cover), is-out (revealing). The layers each style needs are built by the script. */
.dp-tr { --dptr-bg: #0c0c0e; --dptr-accent: var(--dp-g-accent, #2c59fa); --dptr-ink: #f1f1f0; --dptr-d: 700ms; --dptr-ease: cubic-bezier(.76, 0, .24, 1); position: fixed; inset: 0; z-index: 2147483600; display: grid; place-items: center; overflow: hidden; visibility: hidden; pointer-events: none; color: var(--dptr-ink); container-type: size; }
.dp-tr, .dp-tr * { box-sizing: border-box; }
.dp-tr.is-in, .dp-tr.is-covered, .dp-tr.is-out { visibility: visible; pointer-events: auto; }
/* Idle: out of the page's rendering altogether, so nothing of the last transition can stay painted. */
.dp-tr:not(.is-in):not(.is-covered):not(.is-out):not(.dptr-inline) { display: none; }
.dp-tr.is-covered { background: var(--dptr-bg); }
/* Printed covered by the server for Reveal On Every Load; gives up after 4 s if the script never runs. */
.dp-tr.dptr-boot { animation: dptr-boot 1ms 4s both; }
@keyframes dptr-boot { to { visibility: hidden; } }
/* Divi's wrappers have their own z-index (the column 2, the builder content 1), which would keep the cover under the
   header and later sections. They are raised while it shows; transition.js does the same for any other wrapper. */
:where(.et_builder_inner_content, .et_pb_section, .et_pb_row, .et_pb_column, .et_pb_module):has(.dp-tr:is(.is-in, .is-covered, .is-out):not(.dptr-inline)) { z-index: 2147483600 !important; }

.dp-tr-l { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.dp-tr-l i { display: block; background: var(--dptr-bg); }
.dp-tr:not(.is-in):not(.is-out) .dp-tr-l { display: none; }

.dp-tr-text { position: relative; z-index: 2; margin: 0; padding: 0 24px; text-align: center; opacity: 0; transition: opacity .3s ease; }
.dp-tr-text:empty { display: none; }
:where(.dp-tr) .dp-tr-text { font-size: clamp(20px, 3vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; color: inherit; }
.dp-tr.is-in .dp-tr-text { opacity: 1; transition-delay: calc(var(--dptr-d) * .9); }
.dp-tr.is-covered .dp-tr-text { opacity: 1; transition: none; }
.dp-tr.is-out .dp-tr-text { opacity: 0; transition-duration: .2s; }

/* Double Wipe: the second colour rises, the cover colour follows; on the way out they leave in the other order. */
.dp-tr[data-dptr-style="wipe"] .dp-tr-l i { position: absolute; inset: 0; }
.dp-tr[data-dptr-style="wipe"] .dp-tr-l i:first-child { background: var(--dptr-accent); }
.dp-tr[data-dptr-style="wipe"].is-in .dp-tr-l i { animation: dptr-up-in var(--dptr-d) var(--dptr-ease) both; }
.dp-tr[data-dptr-style="wipe"].is-in .dp-tr-l i:last-child { animation-delay: calc(var(--dptr-d) * .3); }
.dp-tr[data-dptr-style="wipe"].is-out .dp-tr-l i { animation: dptr-up-out var(--dptr-d) var(--dptr-ease) both; }
.dp-tr[data-dptr-style="wipe"].is-out .dp-tr-l i:first-child { animation-delay: calc(var(--dptr-d) * .3); }
@keyframes dptr-up-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes dptr-up-out { from { transform: none; } to { transform: translateY(-100%); } }

/* Curved Wipe: a panel with a rounded leading edge rises over the page, then carries on up with a rounded tail. */
.dp-tr[data-dptr-style="curve"] .dp-tr-l { overflow: visible; }
.dp-tr[data-dptr-style="curve"] .dp-tr-l i { position: absolute; inset: 0; }
.dp-tr[data-dptr-style="curve"] .dp-tr-l i::before, .dp-tr[data-dptr-style="curve"] .dp-tr-l i::after { content: ''; position: absolute; left: -10%; right: -10%; height: 25%; background: inherit; }
.dp-tr[data-dptr-style="curve"] .dp-tr-l i::before { bottom: 100%; margin-bottom: -1px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.dp-tr[data-dptr-style="curve"] .dp-tr-l i::after { top: 100%; margin-top: -1px; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.dp-tr[data-dptr-style="curve"].is-in .dp-tr-l i { animation: dptr-curve-in calc(var(--dptr-d) * 1.2) var(--dptr-ease) both; }
.dp-tr[data-dptr-style="curve"].is-out .dp-tr-l i { animation: dptr-curve-out calc(var(--dptr-d) * 1.2) var(--dptr-ease) both; }
@keyframes dptr-curve-in { from { transform: translateY(126%); } to { transform: none; } }
@keyframes dptr-curve-out { from { transform: none; } to { transform: translateY(-126%); } }

/* Shutter: thin slats close over the page from below, then open upwards on the new one. */
.dp-tr[data-dptr-style="shutter"] .dp-tr-l { display: flex; flex-direction: column; }
.dp-tr[data-dptr-style="shutter"] .dp-tr-l i { flex: 1; margin-bottom: -1px; }
.dp-tr[data-dptr-style="shutter"].is-in .dp-tr-l i { animation: dptr-sy-in calc(var(--dptr-d) * .8) var(--dptr-ease) both; animation-delay: calc(var(--i) * var(--dptr-d) * .045); }
.dp-tr[data-dptr-style="shutter"].is-out .dp-tr-l i { animation: dptr-sy-out calc(var(--dptr-d) * .8) var(--dptr-ease) both; animation-delay: calc(var(--i) * var(--dptr-d) * .045); }
/* Clipped rather than scaled: scaled slats left hairlines painted on the page after the reveal (until a scroll). */
@keyframes dptr-sy-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes dptr-sy-out { from { clip-path: inset(0); } to { clip-path: inset(0 0 100% 0); } }

/* Column Steps: columns drop in from the right like a staircase, then carry on down in the same order. */
.dp-tr[data-dptr-style="columns"] .dp-tr-l { display: flex; }
.dp-tr[data-dptr-style="columns"] .dp-tr-l i { flex: 1; margin-right: -1px; }
.dp-tr[data-dptr-style="columns"].is-in .dp-tr-l i { animation: dptr-col-in calc(var(--dptr-d) * .8) var(--dptr-ease) both; animation-delay: calc(var(--r) * var(--dptr-d) * .08); }
.dp-tr[data-dptr-style="columns"].is-out .dp-tr-l i { animation: dptr-col-out calc(var(--dptr-d) * .8) var(--dptr-ease) both; animation-delay: calc(var(--r) * var(--dptr-d) * .08); }
@keyframes dptr-col-in { from { transform: translateY(-101%); } to { transform: none; } }
@keyframes dptr-col-out { from { transform: none; } to { transform: translateY(101%); } }

/* Pixel Scatter and Pixel Wave: a grid of squares (sized by the script) that appear and disappear. */
.dp-tr[data-dptr-style="pixels"] .dp-tr-l, .dp-tr[data-dptr-style="wave"] .dp-tr-l { display: grid; grid-template-columns: repeat(var(--c, 14), 1fr); grid-template-rows: repeat(var(--rows, 9), 1fr); }
.dp-tr[data-dptr-style="pixels"] .dp-tr-l i, .dp-tr[data-dptr-style="wave"] .dp-tr-l i { transform: scale(1.03); }
.dp-tr[data-dptr-style="pixels"].is-in .dp-tr-l i { animation: dptr-on 1ms steps(1) both; animation-delay: calc(var(--dl) * var(--dptr-d)); }
.dp-tr[data-dptr-style="pixels"].is-out .dp-tr-l i { animation: dptr-off 1ms steps(1) both; animation-delay: calc(var(--dl2) * var(--dptr-d)); }
@keyframes dptr-on { from { opacity: 0; } to { opacity: 1; } }
@keyframes dptr-off { from { opacity: 1; } to { opacity: 0; } }
/* Wave: the squares sweep across from the left, in the second colour at the leading edge. */
.dp-tr[data-dptr-style="wave"].is-in .dp-tr-l i { animation: dptr-wave-in calc(var(--dptr-d) * .35) linear both; animation-delay: calc(var(--dl) * var(--dptr-d) * .7); }
.dp-tr[data-dptr-style="wave"].is-out .dp-tr-l i { animation: dptr-wave-out calc(var(--dptr-d) * .35) linear both; animation-delay: calc(var(--dl) * var(--dptr-d) * .7); }
@keyframes dptr-wave-in { 0% { opacity: 0; background: var(--dptr-accent); } 1% { opacity: 1; background: var(--dptr-accent); } 100% { opacity: 1; background: var(--dptr-bg); } }
@keyframes dptr-wave-out { 0% { opacity: 1; background: var(--dptr-bg); } 60% { opacity: 1; background: var(--dptr-accent); } 61%, 100% { opacity: 0; background: var(--dptr-accent); } }

/* Page Name: a panel drops down with the name of the page being opened, then lifts away on the new page. */
.dp-tr[data-dptr-style="name"] .dp-tr-l i { position: absolute; inset: 0; }
.dp-tr[data-dptr-style="name"].is-in .dp-tr-l i { animation: dptr-down-in var(--dptr-d) var(--dptr-ease) both; }
.dp-tr[data-dptr-style="name"].is-out .dp-tr-l i { animation: dptr-up-out var(--dptr-d) var(--dptr-ease) both; }
.dp-tr[data-dptr-style="name"].is-in .dp-tr-text { transition-delay: calc(var(--dptr-d) * .6); }
.dp-tr:is([data-dptr-style="pixels"], [data-dptr-style="wave"]).is-in .dp-tr-text { transition-delay: calc(var(--dptr-d) * 1.05); }
:where(.dp-tr[data-dptr-style="name"]) .dp-tr-text { font-size: 14px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.dp-tr[data-dptr-style="name"] .dp-tr-text::before { content: '[ '; }
.dp-tr[data-dptr-style="name"] .dp-tr-text::after { content: ' ]'; }
@keyframes dptr-down-in { from { transform: translateY(-100%); } to { transform: none; } }

/* Ribbon Draw: a broad ribbon draws itself back and forth until the page is covered, then draws away. */
.dp-tr-l svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dp-tr-l path { fill: none; stroke: var(--dptr-bg); stroke-width: 48; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.dp-tr[data-dptr-style="ribbon"].is-in .dp-tr-l path { animation: dptr-draw-in calc(var(--dptr-d) * 1.2) cubic-bezier(.6, 0, .3, 1) both; }
.dp-tr[data-dptr-style="ribbon"].is-out .dp-tr-l path { animation: dptr-draw-out calc(var(--dptr-d) * 1.2) cubic-bezier(.6, 0, .3, 1) both; }
@keyframes dptr-draw-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dptr-draw-out { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1; } }

/* Builder: a looping preview between two sample pages, in its own box. */
.dp-tr.dptr-inline { position: relative; inset: auto; z-index: auto; height: 360px; border-radius: 14px; visibility: visible; pointer-events: none; }
.dp-tr-demo { position: absolute; inset: 0; z-index: 0; }
.dp-tr-page { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(24px, 5cqw, 44px); font-weight: 600; letter-spacing: -.02em; transition: none; }
.dp-tr-page.is-a { background: #f1f1f0; color: #060606; }
.dp-tr-page.is-b { background: var(--dp-g-accent, #2c59fa); color: #fff; opacity: 0; }
.dp-tr.dptr-b .dp-tr-page.is-b { opacity: 1; }
.dp-tr-note { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 13px; color: #060606; opacity: .55; }
.dp-tr.dptr-b .dp-tr-note { color: #fff; }

/* Reduced motion: a quick fade in the cover colour. */
.dp-tr.dptr-calm .dp-tr-l { display: none !important; }
.dp-tr.dptr-calm.is-in { background: var(--dptr-bg); animation: dptr-on .25s ease both; }
.dp-tr.dptr-calm.is-out { background: var(--dptr-bg); animation: dptr-off .25s ease both; }
.dp-tr.dptr-calm .dp-tr-text { transition: none !important; }
