/*
 * Quark 2 — user customizations
 *
 * This file is safe to edit. It is loaded last so anything here overrides
 * theme.css without having to mark rules !important.
 */

/* ---------- Motion: scroll reveal ----------
 * `.reveal` / `.in-view` are toggled from site.js via IntersectionObserver.
 * Elements start hidden only once JS has actually attached the class, so
 * nothing is invisible if JS fails or prefers-reduced-motion is set. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Floating "edit this page" shortcut (logged-in editors only) ---------- */
.edit-page-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--q2-radius-pill);
  background: var(--q2-accent);
  color: var(--q2-accent-contrast);
  font-size: 1rem;
  text-decoration: none;
  box-shadow: var(--q2-shadow-raised);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.edit-page-fab:hover {
  color: var(--q2-accent-contrast);
  transform: translateY(-2px);
  box-shadow: var(--q2-shadow-dropdown);
}

/* ---------- Hero: aurora background (opt-in via `hero-aurora` in hero_classes) ----------
 * Three soft, blurred accent-colour blobs drifting slowly behind the hero
 * content. Sits above the theme's static `.hero::before` texture, below the
 * text (`.hero .container` is z-index: 1). `.hero` already clips overflow,
 * so the blobs never leak past the section edge. */
.hero.hero-aurora::after {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      38% 38% at 22% 28%,
      color-mix(in oklab, var(--q2-accent) 32%, transparent),
      transparent 70%
    ),
    radial-gradient(
      34% 34% at 78% 24%,
      color-mix(in oklab, var(--q2-accent) 22%, transparent),
      transparent 70%
    ),
    radial-gradient(
      42% 42% at 50% 85%,
      color-mix(in oklab, var(--q2-accent) 18%, transparent),
      transparent 70%
    );
  filter: blur(60px);
  animation: hero-aurora-drift 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes hero-aurora-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translate3d(-2%, 2%, 0) scale(1.08);
    opacity: 0.85;
  }
  100% {
    transform: translate3d(2%, -2%, 0) scale(1);
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero.hero-aurora::after {
    animation: none;
    opacity: 0.55;
  }
}

/* Hero: wireframe globe watermark (home only). Sits above the aurora glow
 * (z-index: 0) but below the hero text (`.hero .container` is z-index: 1).
 * Lighter tint of the secondary accent (#714b67) so it reads as a distinct
 * layer rather than a repeat of the primary accent used for the glow and
 * buttons. */
.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.hero-globe {
  animation: hero-globe-spin 140s linear infinite;
}
.hero-globe__ring {
  fill: none;
  stroke: color-mix(in oklab, #714b67 45%, white 55%);
  stroke-width: 0.3;
  vector-effect: non-scaling-stroke;
}
.hero-globe__marker {
  fill: color-mix(in oklab, #714b67 65%, white 35%);
  filter: drop-shadow(0 0 0.8px #714b67);
  animation: hero-globe-marker-pulse 3.2s ease-in-out infinite;
}
.hero-globe__marker--2 {
  animation-delay: 0.8s;
}
.hero-globe__marker--3 {
  animation-delay: 1.6s;
}
.hero-globe__marker--4 {
  animation-delay: 2.4s;
}
@keyframes hero-globe-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes hero-globe-marker-pulse {
  0%,
  100% {
    r: 0.5;
    opacity: 0.6;
  }
  50% {
    r: 0.8;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-globe {
    animation: none;
  }
  .hero-globe__marker {
    animation: none;
  }
}

/* Hero: grid background (opt-in via `hero-grid` in hero_classes) — the
 * secondary-page counterpart to `hero-aurora`. A drifting blueprint/schema
 * grid plus one slow breathing glow (secondary accent, distinct from home's
 * primary-accent aurora), so every non-home hero stays clearly alive without
 * repeating the home page's look. Contrast pushed up from the first pass —
 * a faint 1px grid at low opacity was effectively invisible against the
 * near-black canvas. */
.hero.hero-grid::before {
  /* Overrides the theme's own static `.hero::before` texture with a
     brighter, animated replacement — same layer, same stacking slot.
     Line strength is theme-aware: the same tint reads much heavier as a
     dark line on the light theme's near-white canvas than it does on the
     dark theme's near-black one, so light mode needs a lower mix to look
     equally "light touch" rather than equally strong. */
  --hero-grid-line: color-mix(in oklab, var(--q2-accent) 12%, transparent);
  background:
    linear-gradient(var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-line) 1px, transparent 1px),
    radial-gradient(
      36% 46% at 50% 30%,
      color-mix(in oklab, #714b67 30%, transparent),
      transparent 72%
    );
  background-size:
    40px 40px,
    40px 40px,
    100% 100%;
  animation:
    hero-grid-drift 16s linear infinite,
    hero-grid-breathe 7s ease-in-out infinite;
}
@keyframes hero-grid-drift {
  from {
    background-position:
      0 0,
      0 0,
      0 0;
  }
  to {
    background-position:
      120px 40px,
      40px 120px,
      0 0;
  }
}
@keyframes hero-grid-breathe {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}
:root[data-theme="dark"] .hero.hero-grid::before {
  --hero-grid-line: color-mix(in oklab, var(--q2-accent) 32%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .hero.hero-grid::before {
    animation: none;
    opacity: 0.85;
  }
}

/* ---------- Modular: Form (Contact) ---------- */
.modular-form-block {
  background: var(--q2-bg-muted);
}
.modular-form-block .form-frame {
  max-width: 720px;
  margin-inline: auto;
}
.modular-form-block .form-frame > h2:first-child {
  text-align: center;
}
.modular-form-block .form-wrapper {
  background: var(--q2-bg-elev);
  border-radius: var(--q2-radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.25rem);
  box-shadow: var(--q2-shadow-card);
  margin-top: 2rem;
}

/* ---------- Nav: text logo fallback ---------- */
.navbar-brand-text {
  white-space: nowrap;
}

/* ---------- Social icon row (header, mobile overlay, footer) ---------- */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social-links li {
  list-style: none; /* override Pico's `ul li { list-style: square }` */
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--q2-radius-pill);
  color: var(--q2-text-muted);
  background: var(--q2-bg-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}
.social-links a:hover {
  color: var(--q2-accent-contrast);
  background: var(--q2-accent);
  transform: translateY(-1px);
}
.mobile-overlay-actions {
  margin-top: 2rem;
}
.mobile-overlay-actions .social-links {
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav li {
  list-style: none; /* override Pico's `ul li { list-style: square }` */
}
.footer-nav a {
  color: var(--q2-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.footer-nav a:hover,
.footer-nav a.active {
  color: var(--q2-text-strong);
}
.footer-copyright {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--q2-text-muted);
}

/* ---------- Modular: Clients (Portfolio) ---------- */
.modular-clients {
  background: var(--q2-bg);
}
.modular-clients .frame-box {
  max-width: 1100px;
  margin-inline: auto;
}
.clients-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2.5rem;
}
@media (min-width: 640px) {
  .clients-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .clients-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.client-card {
  background: var(--q2-bg-elev);
  border-radius: var(--q2-radius-md);
  box-shadow: var(--q2-shadow-card);
  padding: 1.5rem 1.25rem;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.client-card:hover {
  box-shadow: var(--q2-shadow-raised);
  transform: translateY(-2px);
}
.client-card h6 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: 0;
}
.client-industry {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--q2-accent);
}

/* ---------- Modular: Testimonials ---------- */
.modular-testimonials {
  background: var(--q2-bg-muted);
}
.modular-testimonials .frame-box {
  max-width: 1100px;
  margin-inline: auto;
}
.testimonial-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 2.5rem;
}
@media (min-width: 860px) {
  .testimonial-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.testimonial-card {
  background: var(--q2-bg-elev);
  border-radius: var(--q2-radius-md);
  box-shadow: var(--q2-shadow-card);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.testimonial-card:hover {
  box-shadow: var(--q2-shadow-raised);
  transform: translateY(-2px);
}
.testimonial-card .quote-mark {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--q2-accent);
  font-family: Georgia, serif;
}
.testimonial-card blockquote {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--q2-text);
}
.testimonial-card footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--q2-text-muted);
}
.testimonial-card footer strong {
  color: var(--q2-text-strong);
}
