/*
 * Dynamic layer on top of the Grayscale theme:
 * hero entrance, scroll reveals, stats counters, hover effects,
 * scroll progress bar and a floating call button.
 */
:root {
  --gold: #e6b800;
  --gold-soft: rgba(230, 184, 0, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #b38f00, var(--gold), #fff1a8);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1100;
  pointer-events: none;
}

/* ---------- Hero ---------- */
.masthead {
  overflow: hidden;
  background: none;
}
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 75%, #000 100%), url("/resources/img/bg-masthead.jpg");
  background-position: center;
  background-size: cover;
  animation: kenburns 24s ease-in-out infinite alternate;
  z-index: 0;
}
.masthead > .container {
  position: relative;
  z-index: 1;
}
@keyframes kenburns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.hero-in {
  opacity: 0;
  transform: translateY(24px);
  animation: heroIn 1.1s var(--ease-out) forwards;
}
.hero-in.d1 { animation-delay: 0.2s; }
.hero-in.d2 { animation-delay: 0.7s; }
.hero-in.d3 { animation-delay: 1.1s; }
@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

.masthead .hero-line {
  display: block;
  height: 2px;
  width: 0;
  margin: 1.25rem auto 0;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-soft);
  animation: heroLine 1.2s 0.9s var(--ease-out) forwards;
}
@keyframes heroLine {
  to { width: 8rem; }
}

.masthead .rotator {
  display: inline-block;
  color: var(--gold);
  font-weight: 600;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.masthead .rotator.out {
  opacity: 0;
  transform: translateY(-8px);
}

.masthead .btn-discover {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2rem;
  padding: 0.6rem 1.6rem;
  letter-spacing: 0.15rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.masthead .btn-discover:hover {
  background-color: var(--gold);
  border-color: var(--gold);
  color: #000 !important;
}
.masthead .btn-discover svg,
.masthead .btn-discover i {
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ---------- Scroll reveal (only when JS is active) ---------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.js-reveal [data-reveal="up"]    { transform: translateY(40px); }
.js-reveal [data-reveal="left"]  { transform: translateX(-60px); }
.js-reveal [data-reveal="right"] { transform: translateX(60px); }
.js-reveal [data-reveal="zoom"]  { transform: scale(0.94); }
.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Stats strip ---------- */
.stats {
  margin: -2rem 0 5rem;
}
.stat {
  padding: 1.5rem 0.5rem;
}
.stat-number {
  display: block;
  font-family: "Cinzel Decorative", serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}
.stat-label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  color: rgba(255, 255, 255, 0.6);
}
@media (min-width: 768px) {
  .stat + .stat {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ---------- Fleet ---------- */
/* Keep the side slide-ins from causing horizontal scroll */
.projects-section {
  overflow-x: hidden;
  overflow-x: clip;
}
.projects-section .fleet-img {
  transition: transform 0.8s var(--ease-out), filter 0.8s var(--ease-out);
}
.projects-section .row:hover .fleet-img {
  transform: scale(1.04) translateX(6px);
}
.projects-section .featured-text {
  position: relative;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.projects-section .row:hover .featured-text {
  border-color: var(--gold);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.08);
}

/* ---------- Services ---------- */
.service-img {
  overflow: hidden;
}
.service-img img {
  transition: transform 1.2s var(--ease-out);
}
.service-row:hover .service-img img {
  transform: scale(1.08);
}
.projects-section .project-text hr {
  transition: width 0.6s var(--ease-out);
}
.service-row:hover .project-text hr {
  width: 60%;
}

/* ---------- Contact ---------- */
.contact-section .card {
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.contact-section .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 1.25rem 2rem rgba(230, 184, 0, 0.15);
}
.contact-section .card:hover svg,
.contact-section .card:hover i {
  animation: wiggle 0.6s ease;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-12deg); }
  75%      { transform: rotate(12deg); }
}
.signup-section .form-control {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.signup-section .form-control:focus {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--gold-soft) !important;
}

/* ---------- Floating call button ---------- */
.call-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 3.5rem;
  padding: 0 1.1rem;
  border-radius: 2rem;
  background: var(--gold);
  color: #000;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(1.5rem) scale(0.9);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), background-color 0.3s ease;
}
.call-fab.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.call-fab:hover {
  color: #000;
  background: #ffd11a;
}
.call-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--gold);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (max-width: 575.98px) {
  .call-fab .call-fab-text { display: none; }
  .call-fab { width: 3.5rem; padding: 0; justify-content: center; }
}

/* ---------- Respect reduced-motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}
