/* ==========================================================================
   preloader.css — site-wide logo preloader
   --------------------------------------------------------------------------
   The Real Consulting "R" builds itself: the bowl is drawn as a line and then
   filled, the two orange blades cut in on the diagonal, an orbit ring turns
   around the mark and a real load percentage counts up underneath. On exit a
   two-layer curtain (ink, then orange) lifts off the page.

   First visit in a session: full sequence (~2s minimum).
   Later pages in the same session: `.pl--quick`, the mark is already built
   and the curtain lifts as soon as the page is ready.
   ========================================================================== */
.rc-pl {
  --pl-ink: #060b1a;
  --pl-ink-2: #0c1530;
  --pl-signal: #ee690c;
  --pl-gold: #f6b24f;
  --pl-text: #e6ebf5;
  --pl-soft: rgba(230, 235, 245, 0.55);
  --pl-ease: cubic-bezier(0.7, 0, 0.2, 1);
  --pl-out: cubic-bezier(0.16, 1, 0.3, 1);

  position: fixed;
  inset: 0;
  z-index: 2147483000; /* above the cookie notice */
  display: grid;
  place-items: center;
  pointer-events: all;
  /* If the script never runs, the page is never held hostage. */
  animation: rc-pl-failsafe 0s linear 9s forwards;
}
@keyframes rc-pl-failsafe {
  to {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

/* Lock scrolling while the preloader is up. */
html:has(.rc-pl:not(.is-gone)) {
  overflow: hidden;
}

/* ---------------------------------------------------------- curtain layers */
.rc-pl__layer {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.95s var(--pl-ease);
}
.rc-pl__layer--accent {
  background: linear-gradient(120deg, var(--pl-signal), var(--pl-gold));
  transition-delay: 0.14s;
}
.rc-pl__layer--base {
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(238, 105, 12, 0.14), transparent 70%),
    radial-gradient(ellipse 90% 80% at 50% 50%, var(--pl-ink-2), var(--pl-ink));
}
/* Fine grid, faded towards the edges */
.rc-pl__layer--base::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(230, 235, 245, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 235, 245, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
  animation: rc-pl-grid 2.4s var(--pl-out) both;
}
@keyframes rc-pl-grid {
  from {
    opacity: 0;
    transform: scale(1.12);
  }
}

/* ------------------------------------------------------------------ stage */
.rc-pl__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 4vh, 36px);
  padding: 24px;
  transition:
    transform 0.6s var(--pl-ease),
    opacity 0.45s ease;
}

/* The mark and its orbit */
.rc-pl__emblem {
  position: relative;
  width: clamp(132px, 30vw, 184px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.rc-pl__glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238, 105, 12, 0.45), transparent 68%);
  filter: blur(18px);
  opacity: 0;
  animation:
    rc-pl-fade 0.8s ease 0.9s forwards,
    rc-pl-breathe 2.6s ease-in-out 1.7s infinite;
}
@keyframes rc-pl-breathe {
  50% {
    transform: scale(1.15);
    opacity: 0.65;
  }
}

.rc-pl__orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.rc-pl__orbit circle {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.rc-pl__track {
  stroke: rgba(230, 235, 245, 0.1);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: rc-pl-draw 1.1s var(--pl-out) 0.1s forwards;
}
.rc-pl__arc {
  stroke: url(#rcPlArc);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.22 0.78;
  transform-origin: 50% 50%;
  opacity: 0;
  animation:
    rc-pl-fade 0.5s ease 0.5s forwards,
    rc-pl-spin 1.6s linear infinite;
}
.rc-pl__dot {
  fill: var(--pl-gold);
  transform-origin: 50px 50px;
  opacity: 0;
  animation:
    rc-pl-fade 0.5s ease 0.8s forwards,
    rc-pl-spin 3.2s linear infinite reverse;
}
.rc-pl__ticks {
  stroke: rgba(230, 235, 245, 0.28);
  stroke-width: 1;
  stroke-dasharray: 0.004 0.0373;
  opacity: 0;
  transform-origin: 50% 50%;
  animation:
    rc-pl-fade 0.8s ease 0.3s forwards,
    rc-pl-spin 24s linear infinite reverse;
}
@keyframes rc-pl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* The R */
.rc-pl__mark {
  position: relative;
  width: 44%;
  height: auto;
  overflow: visible;
}
.rc-pl__bowl {
  fill: var(--pl-text);
  fill-opacity: 0;
  stroke: var(--pl-text);
  stroke-width: 0.22;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    rc-pl-draw 1s var(--pl-ease) 0.25s forwards,
    rc-pl-fill 0.5s ease 1.05s forwards;
}
@keyframes rc-pl-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes rc-pl-fill {
  to {
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}
.rc-pl__blade {
  opacity: 0;
  transform: translate(-7px, -7px);
  animation: rc-pl-blade 0.7s var(--pl-out) forwards;
}
.rc-pl__blade--a {
  animation-delay: 0.95s;
}
.rc-pl__blade--b {
  animation-delay: 1.12s;
}
.rc-pl__shade {
  opacity: 0;
  animation: rc-pl-fade 0.4s ease 1.5s forwards;
}
@keyframes rc-pl-blade {
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rc-pl-fade {
  to {
    opacity: 1;
  }
}

/* Light sweep across the finished mark */
.rc-pl__shine {
  position: absolute;
  inset: 28%;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 60%, transparent 72%);
  mask: radial-gradient(circle, #000 60%, transparent 72%);
}
.rc-pl__shine::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(20deg);
  animation: rc-pl-shine 2.8s ease-in-out 1.6s infinite;
}
@keyframes rc-pl-shine {
  0% {
    left: -120%;
  }
  45%,
  100% {
    left: 160%;
  }
}

/* Wordmark */
.rc-pl__word {
  margin: 0;
  overflow: hidden;
  font-family: "Kanit", "Montserrat", system-ui, sans-serif;
  font-size: clamp(14px, 3.6vw, 19px);
  line-height: 1.2;
  color: var(--pl-text);
  white-space: nowrap;
}
.rc-pl__word span {
  display: inline-block;
  transform: translateY(110%);
  letter-spacing: 0.7em;
  animation: rc-pl-word 1s var(--pl-out) forwards;
}
.rc-pl__word b {
  font-weight: 700;
  letter-spacing: inherit;
}
.rc-pl__word i {
  font-style: normal;
  font-weight: 300;
  color: var(--pl-soft);
}
.rc-pl__word span:first-child {
  animation-delay: 1.15s;
}
.rc-pl__word span:last-child {
  animation-delay: 1.28s;
}
@keyframes rc-pl-word {
  to {
    transform: none;
    letter-spacing: 0.32em;
  }
}

/* Progress */
.rc-pl__meter {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: rc-pl-fade 0.6s ease 0.4s forwards;
}
.rc-pl__bar {
  position: relative;
  width: clamp(120px, 34vw, 190px);
  height: 2px;
  border-radius: 2px;
  background: rgba(230, 235, 245, 0.12);
  overflow: hidden;
}
.rc-pl__bar i {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--pl-p, 0));
  transition: transform 0.25s linear;
  background: linear-gradient(90deg, var(--pl-signal), var(--pl-gold));
  box-shadow: 0 0 12px rgba(238, 105, 12, 0.8);
}
.rc-pl__pct {
  min-width: 3.6ch;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--pl-soft);
  text-align: right;
}

/* ------------------------------------------------------------------- exit */
.rc-pl.is-done {
  pointer-events: none;
}
.rc-pl.is-done .rc-pl__stage {
  transform: scale(0.9) translateY(-10px);
  opacity: 0;
}
.rc-pl.is-done .rc-pl__layer--base {
  clip-path: inset(0 0 100% 0);
  transition-delay: 0.28s;
}
.rc-pl.is-done .rc-pl__layer--accent {
  clip-path: inset(0 0 100% 0);
  transition-delay: 0.42s;
}
.rc-pl.is-gone {
  display: none;
}

/* ------------------------------------------ quick mode (later page views) */
.rc-pl--quick .rc-pl__layer--accent {
  display: none;
}
.rc-pl--quick .rc-pl__bowl,
.rc-pl--quick .rc-pl__blade,
.rc-pl--quick .rc-pl__shade,
.rc-pl--quick .rc-pl__track,
.rc-pl--quick .rc-pl__word span,
.rc-pl--quick .rc-pl__meter,
.rc-pl--quick .rc-pl__layer--base::before {
  animation-duration: 0.01s !important;
  animation-delay: 0s !important;
}
.rc-pl--quick .rc-pl__arc,
.rc-pl--quick .rc-pl__dot,
.rc-pl--quick .rc-pl__ticks,
.rc-pl--quick .rc-pl__glow {
  animation-delay: 0s, 0s !important;
}
.rc-pl--quick.is-done .rc-pl__layer--base {
  transition-duration: 0.7s;
  transition-delay: 0.1s;
}

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rc-pl *,
  .rc-pl *::before,
  .rc-pl *::after {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .rc-pl__layer,
  .rc-pl__stage {
    transition: opacity 0.4s ease !important;
  }
  .rc-pl.is-done .rc-pl__layer {
    clip-path: inset(0 0 0 0);
    opacity: 0;
  }
}
