/* ============================================================
   Apex Outdoor Care — custom styles (ported from src/index.css)
   Tailwind utilities are provided by the Play CDN; this file
   holds the design tokens and the custom component/utility
   classes that the Tailwind @layer blocks defined originally.
   ============================================================ */

:root {
  --background: 60 24% 94%; /* #f3f3eb warm off-white */
  --background-alt: 60 18% 90%; /* slightly deeper banding tone */
  --foreground: 160 12% 11%; /* warm near-black */

  --card: 0 0% 100%; /* pure white card for contrast */
  --card-foreground: 160 12% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 160 12% 11%;

  --primary: 152 50% 19%; /* deep green #184832 */
  --primary-foreground: 60 24% 94%;

  --secondary: 206 71% 35%; /* blue #1a6698 */
  --secondary-foreground: 0 0% 100%;

  --muted: 60 16% 89%; /* soft warm stone */
  --muted-foreground: 160 8% 34%; /* readable warm gray */

  --accent: 205 62% 47%; /* lighter complementary blue */
  --accent-foreground: 0 0% 100%;

  --destructive: 0 72% 48%;
  --destructive-foreground: 0 0% 100%;

  --border: 60 12% 84%;
  --input: 60 12% 84%;
  --ring: 206 71% 35%;
  --radius: 0.85rem;

  --gold: 206 71% 35%; /* alias kept; now blue so existing utilities recolor */
  --gold-soft: 205 62% 52%;
}

* {
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, hsl(152 28% 84% / 0.45), transparent),
    radial-gradient(ellipse 60% 50% at 100% 100%, hsl(206 50% 80% / 0.22), transparent);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', Georgia, serif;
  letter-spacing: -0.01em;
}

::selection {
  background: hsl(var(--secondary) / 0.85);
  color: hsl(var(--secondary-foreground));
}

/* ---------- Components (from @layer components) ---------- */

/* Soft elevated surface used for cards / panels */
.glass {
  background: linear-gradient(155deg, hsl(0 0% 100% / 0.97), hsl(60 24% 97% / 0.97));
  border: 1px solid hsl(152 50% 19% / 0.10);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px -18px hsl(160 25% 18% / 0.28), inset 0 1px 0 hsl(0 0% 100% / 0.6);
}

.glass-hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.glass-hover:hover {
  transform: translateY(-6px);
  border-color: hsl(206 62% 45% / 0.45);
  box-shadow: 0 24px 60px -22px hsl(206 50% 30% / 0.32), 0 0 0 1px hsl(206 62% 45% / 0.20);
}

/* Accent gradient text for headlines / accents (blue -> green) */
.text-gold-gradient {
  background: linear-gradient(100deg, #1a6299, #184832);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Forest gradient text option */
.text-forest-gradient {
  background: linear-gradient(100deg, hsl(152 50% 22%), hsl(152 35% 36%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Eyebrow / kicker label */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: hsl(var(--accent));
}

/* Section vertical rhythm */
.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
@media (min-width: 768px) {
  .section {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

/* Blue glow ring on icons / accents */
.glow-gold {
  box-shadow: 0 0 0 1px hsl(206 71% 40% / 0.35), 0 0 24px -6px hsl(206 71% 45% / 0.5);
}

/* ---------- Utilities (from @layer utilities) ---------- */
.container-x {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
@media (min-width: 640px) {
  .container-x {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .container-x {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* ---------- Keyframes / animations ---------- */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-float-slow { animation: float-slow 6s ease-in-out infinite; }

/* ---------- Scroll-reveal (replaces framer-motion whileInView) ---------- */
.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, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Initial hero entrance (replaces framer-motion animate on mount).
   Resting state is fully visible; the keyframes animate *from* hidden using
   `backwards` fill so that if the animation clock is paused (e.g. the page
   loads while backgrounded) the content is never stuck invisible. */
.hero-in {
  opacity: 0;
  transform: translateY(26px);
  animation: hero-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--hero-delay, 0s) forwards;
}
@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Toasts ---------- */
.toast-viewport {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  max-height: 100vh;
  width: 100%;
  flex-direction: column-reverse;
  padding: 1rem;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .toast-viewport {
    bottom: 0;
    top: auto;
    right: 0;
    flex-direction: column;
    max-width: 420px;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 1.5rem;
  padding-right: 2rem;
  box-shadow: 0 10px 38px -10px rgba(22, 23, 24, 0.35), 0 10px 20px -15px rgba(22, 23, 24, 0.2);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  transform: translateX(0);
  opacity: 1;
}
.toast.toast-enter {
  transform: translateX(110%);
  opacity: 0;
}
.toast.toast-leave {
  transform: translateX(110%);
  opacity: 0;
}
.toast.destructive {
  border-color: hsl(var(--destructive));
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.toast-description {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}
.toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border-radius: 0.375rem;
  padding: 0.25rem;
  color: currentColor;
  opacity: 0.5;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.toast-close:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-float-slow { animation: none !important; }
  .reveal { transition: none !important; opacity: 1; transform: none; }
  .hero-in { animation: none !important; opacity: 1; transform: none; }
  * { transition-duration: 0.01ms !important; }
}
