/* ==========================================================================
   Refinements
   Brand colour states, dark-mode tuning and button/card polish. Intentionally loaded after the sections above, because it overrides them.
   ========================================================================== */

/* ===== v6 premium pass ===== */
::selection {
  background: var(--lime);
  color: #10130a;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 2;
}

/* 1 · selected/hover states use the brand blue again (only the 3 navy picks stay) */
.pg {
  background: #f1ff5e;
}

/* 2 · lime is a fill, never a thin line on light */

/* 3 · dark mode: lime on actions, neutral surfaces behind photos */
[data-theme='dark'] .ph,
[data-theme='dark'] .me-photo {
  background: var(--soft);
}
[data-theme='dark'] .blob {
  background: color-mix(in srgb, var(--lime) 15%, var(--bg));
}
.blob {
  animation: morph 16s ease-in-out infinite;
}
@keyframes morph {
  50% {
    border-radius: 58% 42% 52% 48%/46% 56% 44% 54%;
  }
}

/* 4 · logo strip */
.lg {
  transition:
    transform 0.4s var(--ease),
    border-color 0.3s;
}
.lg:hover {
  transform: translateY(-3px);
}
[data-theme='dark'] .lg {
  background: #dce1ec;
  border-color: transparent;
}
[data-theme='dark'] .lg img {
  mix-blend-mode: multiply;
  opacity: 0.92;
}

/* 5 · contact: flat colour, grain, slow drifting rings */
.contact:before {
  animation: drift 22s ease-in-out infinite alternate;
}
.contact:after {
  animation: drift 28s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  to {
    transform: translate(-26px, 22px) scale(1.06);
  }
}

/* premium feel · buttons, cards, nav */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.35s var(--ease),
    background 0.25s,
    color 0.25s,
    border-color 0.25s,
    box-shadow 0.35s var(--ease);
}
.btn:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 70%
  );
  transform: translateX(-130%);
  transition: transform 0.8s var(--ease);
}
.btn:hover:after {
  transform: translateX(130%);
}
.btn.fill:hover,
.contact .btn:hover {
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--sel) 70%, transparent);
}
.btn svg {
  transition: transform 0.35s var(--ease);
}
.btn:hover svg {
  transform: translateX(3px) rotate(-6deg);
}
.card {
  position: relative;
  transition:
    transform 0.4s var(--ease),
    border-color 0.3s,
    box-shadow 0.5s var(--ease),
    background 0.35s;
}
.card:hover {
  box-shadow: 0 30px 60px -34px rgba(16, 19, 35, 0.35);
}
[data-theme='dark'] .card:hover {
  box-shadow: 0 30px 60px -36px #000;
}
.card:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--a) 10%, transparent),
    transparent 70%
  );
}
.card:hover:after {
  opacity: 1;
}
nav.on {
  box-shadow: 0 14px 34px -26px rgba(16, 19, 35, 0.5);
}
.rv {
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}

/* 6 · motion safety */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .mq div {
    animation: none;
  }
}
