/* ==========================================================================
   SeePractical — custom styles layered on top of Tailwind (Play CDN)
   Tokens, focus states, scroll-reveal, hero motion, reduced-motion.
   ========================================================================== */

:root {
  --accent: #059669;        /* emerald-600 — light-mode accent (AA on white) */
  --accent-strong: #047857; /* emerald-700 — text/links on white            */
  --accent-light: #34d399;  /* emerald-400 — dark-mode accent               */
  --focus-ring: var(--accent);
}
.dark {
  --focus-ring: var(--accent-light);
}

/* Smooth in-page scrolling, but never fight the user's reduced-motion choice */
html { scroll-behavior: smooth; }

/* --------------------------------------------------------------------------
   Custom elevation utility (defined here so it works on every page without
   per-page Tailwind config). Includes a hover variant and dark-mode tuning.
   -------------------------------------------------------------------------- */
.shadow-card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
}
.hover\:shadow-card:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 40px -18px rgba(15, 23, 42, 0.28);
}
.dark .shadow-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
}
.dark .hover\:shadow-card:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 20px 48px -20px rgba(0, 0, 0, 0.85);
}

/* --------------------------------------------------------------------------
   Accessibility: consistent, always-visible keyboard focus
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Remove the default outline only where focus-visible is supported & handled */
:focus:not(:focus-visible) { outline: none; }

/* Skip link — hidden until focused */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Scroll-reveal (IntersectionObserver toggles .is-visible)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Hero ambient mesh — gentle floating blobs (no purple/pink)
   -------------------------------------------------------------------------- */
.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  opacity: 0.55;
}
.dark .hero-blob { opacity: 0.30; }

.hero-blob--a {
  width: 32rem; height: 32rem;
  top: -8rem; left: -6rem;
  background: radial-gradient(circle at 30% 30%, #34d399, transparent 70%);
  animation: floatA 20s ease-in-out infinite;
}
.hero-blob--b {
  width: 28rem; height: 28rem;
  top: -4rem; right: -8rem;
  background: radial-gradient(circle at 70% 30%, #38bdf8, transparent 70%);
  animation: floatB 24s ease-in-out infinite;
}
.hero-blob--c {
  width: 26rem; height: 26rem;
  bottom: -10rem; left: 30%;
  background: radial-gradient(circle at 50% 50%, #a7f3d0, transparent 70%);
  animation: floatA 28s ease-in-out infinite reverse;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(28px, -32px) scale(1.06); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-30px, 22px) scale(1.05); }
}

/* Subtle dotted grid texture for the hero, very low contrast */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 28px 28px;
  color: #0f172a;
  opacity: 0.04;
}
.dark .hero-grid { color: #ffffff; opacity: 0.05; }

/* --------------------------------------------------------------------------
   Mobile menu animation
   -------------------------------------------------------------------------- */
#mobile-menu { display: none; }
#mobile-menu.is-open {
  display: block;
  animation: menuIn 0.22s ease-out;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* Header elevation once the page is scrolled */
.site-header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 8px 24px -16px rgba(15, 23, 42, 0.25);
}

/* Animated underline for desktop nav links */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.dark .nav-link::after { background: var(--accent-light); }
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Respect users who ask for less motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-blob,
  #mobile-menu.is-open { animation: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
