/* ══════════════════════════════════════════
   ArchReview — Global Styles
   Inspired by CKB website design system
   ══════════════════════════════════════════ */

/* ── Gradient text ── */
.text-gradient {
  background: linear-gradient(135deg, #5a90ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Aurora background (multi-layer, CKB-style) ── */
.aurora {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(90, 144, 255, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(167, 139, 250, 0.10), transparent),
    radial-gradient(ellipse 50% 30% at 20% 80%, rgba(90, 144, 255, 0.08), transparent);
}

/* ── Grid overlay (ultra-subtle texture) ── */
.grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Dot grid (alternative texture) ── */
.dot-grid {
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── Glow utilities ── */
.glow-brand {
  box-shadow: 0 0 20px rgba(90, 144, 255, 0.3);
}
.glow-brand-lg {
  box-shadow: 0 0 40px rgba(90, 144, 255, 0.4), 0 0 80px rgba(90, 144, 255, 0.15);
}
.glow-violet {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* ── Card gradient border (mask-composite technique) ── */
.card-gradient-border {
  position: relative;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s ease;
}
.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(90, 144, 255, 0.0), rgba(167, 139, 250, 0.0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.3s ease;
}
.card-gradient-border:hover::before {
  background: linear-gradient(135deg, rgba(90, 144, 255, 0.4), rgba(167, 139, 250, 0.2));
}
.card-gradient-border:hover {
  border-color: rgba(90, 144, 255, 0.15);
  background: rgba(90, 144, 255, 0.02);
  box-shadow: 0 8px 32px rgba(90, 144, 255, 0.08);
  transform: translateY(-2px);
}

/* ── Card glow on hover (mouse tracking) ── */
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(90, 144, 255, 0.06), transparent 40%);
  pointer-events: none;
}
.card-glow:hover::before {
  opacity: 1;
}

/* ── Nav link underline animation ── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #5a90ff, #a78bfa);
  border-radius: 1px;
  transition: width 0.2s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ── Button glow (primary CTA) ── */
.btn-glow {
  box-shadow: 0 0 20px rgba(90, 144, 255, 0.25);
  transition: all 0.2s ease;
}
.btn-glow:hover {
  box-shadow: 0 0 30px rgba(90, 144, 255, 0.4), 0 4px 16px rgba(90, 144, 255, 0.2);
  transform: translateY(-1px);
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Terminal typing cursor ── */
.typing-cursor::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: #5a90ff;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ── Mobile drawer ── */
#mobile-drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
#mobile-drawer {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-drawer.open {
  transform: translateX(0);
}

/* ── Scroll-to-top button ── */
#scroll-top {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Copy button ── */
.copy-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.group:hover .copy-btn,
.copy-btn.copied {
  opacity: 1;
}

/* ── Testimonial card ── */
.testimonial-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.4) 100%);
}

/* ── Navbar scroll state ── */
nav.scrolled {
  border-bottom-color: rgba(255,255,255,0.08);
  background-color: rgba(2,6,23,0.92);
}

/* ── Smooth scroll offset for fixed nav ── */
:target {
  scroll-margin-top: 5rem;
}

/* ── Code block ── */
code, .font-mono {
  font-feature-settings: "liga" 0;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Base transitions ── */
a, button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* ── Focus visible (accessibility) ── */
:focus-visible {
  outline: 2px solid rgba(90, 144, 255, 0.6);
  outline-offset: 2px;
}
