/* Timberlight Digital — custom styles layered on top of Tailwind CDN utilities */

:root {
  --color-dark: #0f3d27;
  --color-primary: #1d744a;
  --color-hover: #166038;
  --color-tint: #f0fdf4;
  --color-border: #86efac;
  --color-body: #374151;
  --color-muted: #6b7280;
  --color-amber: #b45309;
  --color-amber-bg: #fffbeb;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--color-body);
  font-family: "Inter", sans-serif;
}

/* Consistent focus state for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Subtle grain texture for the dark hero / CTA bands */
.grain-overlay {
  position: relative;
  isolation: isolate;
}

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

.grain-overlay > * {
  position: relative;
  z-index: 1;
}

/* Green overlay tint applied over all placeholder photography for visual cohesion */
.img-tint {
  position: relative;
  display: block;
  overflow: hidden;
}

.img-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(15, 61, 39, 0.55), rgba(29, 116, 74, 0.28));
  mix-blend-mode: multiply;
  pointer-events: none;
}

.img-tint img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Mobile nav drawer */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mobile-menu.open {
  max-height: 32rem;
}

/* Numbered step circles on the "How it works" section */
.step-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* "Most popular" ribbon badge */
.badge-popular {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Simple fade-in used by the contact form success state */
.fade-in {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-triggered fade-up entrance. Toggled by IntersectionObserver in main.js. */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger modifiers for card grids — capped at 200ms so no grid delay exceeds 300ms total */
.fade-up-d1 {
  transition-delay: 0.1s;
}

.fade-up-d2 {
  transition-delay: 0.2s;
}

/* Hero decorative background — faint node/network pattern + soft light bloom */
.hero-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-bloom {
  position: absolute;
  top: 40%;
  left: 32%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(134, 239, 172, 0.22) 0%, rgba(134, 239, 172, 0.08) 42%, transparent 70%);
  animation: bloomPulse 8s ease-in-out infinite;
}

@keyframes bloomPulse {
  0%,
  100% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

.hero-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.16;
}

/* Rotating word in the hero subheadline — width is set per-word by main.js so the
   box hugs each word instead of leaving a gap sized for the longest one */
.rotating-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  color: #fcd34d;
  font-weight: 700;
  transition: opacity 0.4s ease, width 0.4s ease;
}

.rotating-text--fade {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .rotating-text {
    transition: none;
  }
  .hero-bloom {
    animation: none;
  }
}
