/* =========================================================
   L'esperto Giardiniere — Custom styles
   Tailwind (Play CDN) handles utilities; this file holds
   what utilities can't: keyframes, the before/after slider,
   grain texture, and a few crafted components.
   ========================================================= */

:root {
  --forest-deep: #0E2417;
  --forest: #14331F;
  --forest-700: #1C4A2C;
  --emerald: #2FAE57;
  --emerald-bright: #5BCB74;
  --moss: #6E8B5A;
  --bark: #6B4F3A;
  --cream: #F3EEE1;
  --bone: #FAF7EF;
  --ink: #14211A;
}

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Selection */
::selection { background: var(--emerald); color: #fff; }

/* ---------- Display headings: optical sizing for Fraunces ---------- */
.font-display {
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}
.headline-soft { font-variation-settings: "SOFT" 30, "WONK" 0; }

/* ---------- Subtle paper grain overlay ---------- */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Soft colored glow blobs (vivacity in light sections) ---------- */
.glow-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
.glow-green { background: radial-gradient(circle, rgba(47,174,87,.6), transparent 70%); }
.glow-gold  { background: radial-gradient(circle, rgba(215,162,74,.55), transparent 70%); }
.glow-rose  { background: radial-gradient(circle, rgba(226,118,150,.4), transparent 70%); }

/* ---------- Decorative thin leaf divider ---------- */
.leaf-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47,174,87,.45), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-weight: 600;
  border-radius: 999px;
  transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease, color .2s ease;
  cursor: pointer;
  will-change: transform;
}
.btn-primary {
  background: linear-gradient(135deg, var(--emerald-bright), var(--emerald));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(47,174,87,.7);
}
.btn-primary:hover { background: var(--emerald-bright); box-shadow: 0 16px 30px -12px rgba(47,174,87,.85); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }
.btn-dark {
  background: var(--forest);
  color: #fff;
}
.btn-dark:hover { background: var(--forest-700); }

/* link underline reveal */
.link-underline {
  position: relative;
}
.link-underline::after {
  content:"";
  position:absolute; left:0; bottom:-2px;
  height:2px; width:100%;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s ease;
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Nav scroll state ---------- */
#navbar { transition: background-color .35s ease, box-shadow .35s ease, padding .35s ease, border-color .35s ease; }
#navbar.scrolled {
  background: rgba(251,250,245,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px -18px rgba(14,36,23,.55);
  border-color: rgba(20,51,31,.08) !important;
}
#navbar.scrolled .nav-link { color: var(--forest); }
#navbar.scrolled .nav-logo-word { color: var(--forest); }
#navbar.scrolled .nav-cta { background: var(--forest); color:#fff; }
#navbar.scrolled .nav-burger span { background: var(--forest); }

/* ---------- Service / generic card hover ---------- */
.card-hover { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -28px rgba(14,36,23,.45);
}

/* image zoom inside fixed frame (no layout shift) */
.img-frame { overflow: hidden; }
.img-frame img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.img-zoom:hover .img-frame img { transform: scale(1.06); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

/* ---------- Before / After slider ---------- */
.ba {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  user-select: none;
  touch-action: pan-y;
  aspect-ratio: 16 / 10;
}
.ba img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba .ba-after { z-index: 1; }
.ba .ba-before-wrap {
  position: absolute; inset: 0; z-index: 2;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid rgba(255,255,255,.9);
}
.ba .ba-before-wrap img { width: 100vw; max-width: none; }
.ba-handle {
  position: absolute; top: 0; bottom: 0;
  left: 50%; z-index: 3;
  width: 44px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  cursor: ew-resize;
}
.ba-handle::before {
  content:""; position:absolute; top:0; bottom:0; left:50%;
  width:2px; transform: translateX(-50%);
  background: rgba(255,255,255,.9);
}
.ba-knob {
  width: 44px; height: 44px; border-radius: 999px;
  background: #fff; color: var(--forest);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.5);
  position: relative; z-index: 1;
}
.ba-tag {
  position: absolute; bottom: .75rem; z-index: 4;
  font-size: .7rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px;
  color: #fff; background: rgba(14,36,23,.6);
  backdrop-filter: blur(4px);
}
.ba-tag.left { left: .75rem; }
.ba-tag.right { right: .75rem; }

/* ---------- Marquee (trust strip) ---------- */
.marquee { display:flex; gap:3rem; width:max-content; animation: marquee 28s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Floating subtle bob for hero badge ---------- */
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-7px);} }
.bob { animation: bob 5s ease-in-out infinite; }

/* form */
.field {
  width: 100%;
  background: #fff;
  border: 1px solid #e3e1d6;
  border-radius: .8rem;
  padding: .85rem 1rem;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
  font-size: 1rem;
}
.field::placeholder { color: #9a9788; }
.field:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(47,174,87,.15);
}
.field-label { font-weight: 600; font-size: .82rem; color: var(--forest); letter-spacing:.01em; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--forest); color:#fff;
  padding: .9rem 1.3rem; border-radius: 999px;
  box-shadow: 0 18px 40px -16px rgba(14,36,23,.7);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
  z-index: 80; font-weight: 500; display:flex; gap:.6rem; align-items:center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee { animation: none; }
  .bob { animation: none; }
  .img-frame img { transition: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
