/* ============================================
   Foghorn — home.css — Homepage styles
   ============================================ */

/* ---- Hero entrance keyframes ---- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroRuleWipe {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 52px;
    opacity: 1;
  }
}

/* Staggered hero elements */
.hero__headline {
  animation: heroFadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero__tagline {
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.52s both;
}

.hero__rule {
  animation: heroRuleWipe 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.68s both;
}

.hero__body {
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.78s both;
}

.hero__ctas {
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.92s both;
}

@media (prefers-reduced-motion: reduce) {
  .hero__headline,
  .hero__tagline,
  .hero__rule,
  .hero__body,
  .hero__ctas {
    animation: none;
  }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
  color: #ffffff;
}

/* Background layer — static image fallback + video container */
.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("/assets/images/hero.png");
  background-size: cover;
  background-position: center 30%;
  z-index: 0;
  overflow: hidden;
}

/* Gradient overlay — dark left for text legibility, fades to show photo right */
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(5, 5, 5, 0.92) 0%,
    rgba(5, 5, 5, 0.82) 30%,
    rgba(5, 5, 5, 0.55) 55%,
    rgba(5, 5, 5, 0.18) 78%,
    transparent 100%
  );
}

/* Grain texture overlay */
.hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Hero video */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.hero__video.is-ready {
  opacity: 1;
}

/* Loop fade overlay — fades to black at loop point */
.hero__video-fade {
  position: absolute;
  inset: 0;
  background: #080808;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.hero__bg.is-fading .hero__video-fade {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }
}

/* Content sits above overlay */
.hero__inner {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
  margin-top: -8rem;
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 560px;
}

/* Headline */
.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.2vw, 3.625rem);
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.hero__accent {
  color: var(--accent);
}

/* Tagline */
.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 1.4vw, 1.125rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  margin-top: 0.25rem;
}

/* Red rule below tagline */
.hero__rule {
  display: block;
  width: 52px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.1rem;
}

/* Body copy */
.hero__body {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
  max-width: 44ch;
}

/* CTA row */
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Hero CTA pulse — draws the eye to the primary action */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(213, 1, 13, 0.5); }
  60%       { box-shadow: 0 0 0 12px rgba(213, 1, 13, 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__ctas .btn--primary {
    animation: ctaPulse 2.8s ease-out 1.5s infinite;
  }
}

/* ---- Callout scroll-reveal ---- */
[data-scroll-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

[data-scroll-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-scroll-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Callouts ---- */
.callouts {
  background: #111111;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.callouts__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.25rem 2rem;
  gap: 0.9rem;
  position: relative;
}

/* Vertical dividers between columns */
.callout + .callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.callout__icon {
  width: 60px;
  height: 60px;
  color: var(--accent);
  flex-shrink: 0;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.callout__icon i {
  font-size: 52px;
  line-height: 1;
  display: block;
}

.callout__icon svg {
  width: 52px;
  height: 52px;
}

.callout__title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.3;
}

.callout__body {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  max-width: 22ch;
  margin-inline: auto;
}

@media (max-width: 768px) {
  .callouts__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Reset side dividers, add top divider for rows 3+4 */
  .callout:nth-child(3)::before,
  .callout:nth-child(4)::before {
    left: 0;
    top: 0;
    width: 100%;
    height: 1px;
  }
}

@media (max-width: 420px) {
  .callouts__grid {
    grid-template-columns: 1fr;
  }

  .callout + .callout::before {
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
  }
}

@media (max-width: 540px) {
  .hero__inner {
    padding-block: 5rem 4rem;
  }

  .hero__ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__ctas .btn {
    width: 100%;
    justify-content: center;
  }
}
