/* Fine character-stipple dither aesthetic */

:root {
  --dither-highlight: #4f70c5;
  --dither-highlight-soft: #b8c4eb;
  --dither-highlight-pale: #eaeef9;
  /* 6×6 micro-stipple tile — very fine, low contrast */
  --dither-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Ccircle cx='0.8' cy='0.6' r='0.28' fill='%23181818' fill-opacity='0.045'/%3E%3Ccircle cx='3.2' cy='1.4' r='0.24' fill='%23181818' fill-opacity='0.06'/%3E%3Ccircle cx='1.5' cy='3.8' r='0.22' fill='%23181818' fill-opacity='0.05'/%3E%3Ccircle cx='4.6' cy='4.2' r='0.26' fill='%23181818' fill-opacity='0.055'/%3E%3Ccircle cx='2.4' cy='2.1' r='0.2' fill='%23181818' fill-opacity='0.04'/%3E%3Ccircle cx='5.1' cy='2.8' r='0.22' fill='%23181818' fill-opacity='0.048'/%3E%3C/svg%3E");
}

.dither-surface {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition:
    color 450ms var(--ease),
    border-color 450ms var(--ease);
}

.dither-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 450ms var(--ease);
  will-change: opacity;
}

.dither-surface.is-dither-active .dither-canvas {
  opacity: 0;
}

.dither-surface > :not(.dither-canvas) {
  position: relative;
  z-index: 1;
}

/* Hover / active dither fills disabled — overlap grid lines */

.dither-link-arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(252, 252, 252, 0.88);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.92) translateY(4px);
  transition:
    opacity 350ms var(--ease),
    transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 10px rgba(24, 24, 24, 0.1);
  pointer-events: none;
}

/* Partner cards — arrow aligned to content padding */
.partner-card.dither-surface {
  position: relative;
}

.partner-card .dither-link-arrow {
  top: auto;
  right: auto;
  left: 32px;
  bottom: 32px;
  margin-top: 0;
  transform: scale(0.92);
}

.dither-surface.is-dither-active .dither-link-arrow {
  opacity: 0;
  transform: scale(0.92) translateY(4px);
}

/* ─── CSS ambient: neutral base + subtle highlight blue ─── */

.dither-ambient-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 95% 75% at 22% 38%, rgba(79, 112, 197, 0.16), transparent 64%),
    radial-gradient(ellipse 85% 65% at 78% 62%, rgba(24, 24, 24, 0.04), transparent 58%),
    radial-gradient(ellipse 50% 42% at 48% 24%, rgba(252, 252, 252, 0.55), transparent 52%),
    radial-gradient(ellipse 45% 38% at 62% 78%, rgba(79, 112, 197, 0.1), transparent 50%);
  animation: ditherAmbientShift 28s ease-in-out infinite alternate;
}

.dither-ambient-wrap::before {
  content: '·∘′:∷․‧∙•◦○ ·∘′:∷․‧∙•◦○';
  position: absolute;
  inset: -20%;
  font-family: var(--font-mono);
  font-size: 4px;
  line-height: 1.25;
  letter-spacing: 0.32em;
  word-spacing: 0.45em;
  color: rgba(79, 112, 197, 0.08);
  white-space: pre-wrap;
  transform: rotate(-4deg);
  pointer-events: none;
}

.dither-ambient-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--dither-grain);
  background-size: 6px 6px;
  opacity: 0.38;
  mix-blend-mode: soft-light;
}

@keyframes ditherAmbientShift {
  0% { filter: hue-rotate(0deg) saturate(0.95); transform: scale(1); }
  100% { filter: hue-rotate(6deg) saturate(1.02); transform: scale(1.03); }
}

.hero-orbs,
.hero-grid-lines {
  z-index: 1;
}

.hero-content {
  z-index: 2;
}

.dither-page-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  background:
    radial-gradient(ellipse 130% 85% at 8% 18%, rgba(79, 112, 197, 0.05), transparent 52%),
    radial-gradient(ellipse 110% 75% at 92% 82%, rgba(24, 24, 24, 0.03), transparent 48%),
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(252, 252, 252, 0.04), transparent 55%);
}

.dither-page-veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--dither-grain);
  background-size: 6px 6px;
  opacity: 0.22;
  mix-blend-mode: soft-light;
}

body {
  position: relative;
}

body > :not(.dither-page-veil):not(.navbar-wrap) {
  position: relative;
  z-index: 1;
}
