:root {
  --ct-bg: #c8cfcc;
  --ct-surface-bg: #ffffff;
  --ct-surface-radius: 1.2rem;
  --ct-surface-shadow:
    0 24px 70px -18px rgba(20, 30, 35, 0.22),
    0 4px 14px -2px rgba(20, 30, 35, 0.08);
}

/* ── Background base ── */

body:has(.ct-page) {
  background: var(--ct-bg);
}

body:has(.ct-page) .nav-logo__img {
  content: url("/static/core/images/logo-black.svg");
}

body:has(.ct-page) .content-area {
  background: transparent;
}

body:has(.ct-page) .main-content {
  position: relative;
}

/* ── Public base (core/base.html) chrome: transparent so the blob
   backdrop runs edge-to-edge behind nav and footer ── */
body:has(.wm-page) .site-nav:not(.in-hero),
body:has(.sl-page) .site-nav:not(.in-hero) {
  background: transparent;
}
body:has(.wm-page) .site-footer,
body:has(.sl-page) .site-footer {
  background: transparent;
}

/* ── Nav offset (public fixed navbar clearance) ── */
.wm-page.need-nav-offset,
.sl-page.need-nav-offset {
  padding-top: 140px;
}

/* ── Metallic blobs (4-layer composition) ──
   Single mechanism for BOTH bases: the .ct-blobs div in the template. */
.ct-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ct-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

/* Top-left: deep steel blue */
.ct-blob--1 {
  width: 720px; height: 720px;
  top: -240px; left: -180px;
  background: radial-gradient(circle, #5a6a72, transparent 65%);
  opacity: 0.72;
  animation: ct-drift-1 26s ease-in-out infinite alternate;
}

/* Right-centre: warm bronze — the hero */
.ct-blob--2 {
  width: 780px; height: 780px;
  top: 12%; right: -200px;
  background: radial-gradient(circle, #b8916a, transparent 65%);
  opacity: 0.70;
  animation: ct-drift-2 32s ease-in-out infinite alternate;
}

/* Mid-centre: warm cream glow (the colour change moment) */
.ct-blob--3 {
  width: 620px; height: 620px;
  top: 45%; left: 30%;
  background: radial-gradient(circle, #d4b48c, transparent 65%);
  opacity: 0.60;
  animation: ct-drift-3 28s ease-in-out infinite alternate;
}

/* Bottom-left: deep sage steel */
.ct-blob--4 {
  width: 560px; height: 560px;
  bottom: -180px; left: -120px;
  background: radial-gradient(circle, #485852, transparent 70%);
  opacity: 0.64;
  animation: ct-drift-4 30s ease-in-out infinite alternate;
}

body:has(.ct-page) .ct-page {
  position: relative;
  z-index: 1;
}

@keyframes ct-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(70px, 50px) scale(1.1); }
}
@keyframes ct-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, 70px) scale(1.08); }
}
@keyframes ct-drift-3 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-50px, -40px) scale(1.12); }
}
@keyframes ct-drift-4 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, -60px) scale(1.1); }
}

/* ── Shared title + subtitle ── */

.ct-header {
  margin-bottom: 2.25rem;
  text-align: center;
}

.ct-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(
    135deg,
    #3d4a45 0%,
    #5a6a72 18%,
    #7a8a92 36%,
    #b8916a 56%,
    #d4b48c 70%,
    #a8826a 84%,
    #3d4a45 100%
  );
  background-size: 200% 200%;
  animation: ct-shimmer 7s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes ct-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ct-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #3d4a45;
  margin: 0 auto;
  line-height: 1.6;
  max-width: 440px;
}

/* ── Small-screen layout (≤540px) ── */

@media (max-width: 540px) {
  .ct-header {
    margin-bottom: 1.75rem;
  }
  .ct-title {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
  }
  .ct-subtitle {
    font-size: 0.78rem;
    max-width: 320px;
  }
  .wm-page.need-nav-offset,
  .sl-page.need-nav-offset {
    padding-top: 110px;
  }
}

/* ── Mobile performance (≤768px) ──
   filter: blur(100px) over four ~700px blobs, each running an infinite drift
   animation, is a heavy GPU + repaint cost on phones and was causing the
   page-load buffering on mobile data/WiFi. On small screens we shrink the
   blobs, cut the blur radius, and stop the drift + title shimmer animations.
   The atmospheric look is preserved; the rendering cost drops sharply. */
@media (max-width: 768px) {
  .ct-blob {
    filter: blur(55px);
    animation: none;
  }
  .ct-blob--1 { width: 420px; height: 420px; }
  .ct-blob--2 { width: 460px; height: 460px; }
  .ct-blob--3 { width: 380px; height: 380px; }
  .ct-blob--4 { width: 340px; height: 340px; }

  .ct-title {
    animation: none;
    background-position: 0% 50%;
  }
}

/* Respect users who've asked for reduced motion (accessibility + battery).
   Stops all decorative animation regardless of screen size. */
@media (prefers-reduced-motion: reduce) {
  .ct-blob { animation: none; }
  .ct-title {
    animation: none;
    background-position: 0% 50%;
  }
}

/* ── Watermark preview loading spinner ──
   Shown while PDF.js loads on first file select and the first page renders. */
.wm-preview__loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2.5rem 1rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: #3d4a45;
}

.wm-preview__loading i {
  font-size: 1.6rem;
  color: #5a6a72;
}