/* ============================================
   SHARED STORY FOOTER STYLES (assets/footer.css)
   ============================================ */

.story-footer {
  position: relative;
  min-height: 100vh;
  background: #ffffff;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
  transform: translateZ(0);
  contain: layout paint;
}

.story-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(140px, 18vh, 220px);
  bottom: 0;
  background: var(--footer-bg, url('photos/familycircle.webp')) center 35% / cover no-repeat;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 8%, #000 20%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 8%, #000 20%);
  animation: ken-burns 20s ease-in-out infinite;
  transform-origin: center 60%;
  will-change: transform;
}

@keyframes ken-burns {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.story-tagline {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(16px, 3vw, 24px) 24px;
}

.story-tagline h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 3.5vw, 36px);
  line-height: 1.45;
  color: #082C30;
  margin: 0;
}

.story-tagline h2 .accent {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: #082C30;
}

.story-tagline .work-underline {
  position: relative;
  display: inline-block;
  color: #04704E;
}

.story-tagline .work-underline .squiggle {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 110%;
  height: auto;
  aspect-ratio: 134 / 19;
  display: block;
  overflow: visible;
}

.story-tagline .work-underline .squiggle path {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  transition: stroke-dashoffset 700ms cubic-bezier(0.16, 1, 0.3, 1) 300ms;
}

.story-tagline.is-revealed .work-underline .squiggle path,
.story-footer .work-underline .squiggle path {
  stroke-dashoffset: 0;
}

.story-footer-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  max-height: 606px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

.story-footer-bottom {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 clamp(20px, 4vw, 32px) clamp(28px, 4vw, 36px);
  text-align: center;
}

.footer-form-frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(520px, calc(100vw - 32px));
  height: 56px;
  margin: clamp(20px, 4vh, 48px) auto 0;
  padding: 6px 6px 6px 16px;
  background: rgba(2, 32, 28, 0.45);
  border: 1px solid rgba(196, 245, 61, 0.20);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 3;
  transform: translateZ(0);
  contain: paint;
  transition: box-shadow 200ms cubic-bezier(.16, 1, .3, 1), border-color 200ms cubic-bezier(.16, 1, .3, 1);
}

.footer-form-frame:focus-within {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.40), 0 0 0 3px rgba(196, 245, 61, 0.25);
  border-color: rgba(196, 245, 61, 0.40);
}

.footer-form-frame input[type=email] {
  flex: 1 1 0;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(2, 32, 28, 0.30);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  padding: 0 16px;
  border-radius: 14px;
  caret-color: #fff;
  transition: border-color 200ms ease, background 200ms ease;
}

.footer-form-frame input[type=email]:focus {
  border-color: #c4f53d;
  background: rgba(196, 245, 61, 0.05);
}

.footer-form-frame input[type=email]::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.footer-form-frame input[type=email].is-invalid {
  color: #ff6b6b;
  caret-color: #ff6b6b;
}

.footer-form-frame .btn-pill {
  height: 38px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 14px;
  background: #c4f53d;
  color: #082c30;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease;
}

.footer-form-frame .btn-pill:hover {
  transform: translateY(-1px);
  background: #b2e42c;
}

.footer-subscribed {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #082c30;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.footer-form-frame.is-subscribed .footer-subscribed {
  display: inline-flex;
}

.footer-subscribed-tick {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: #c4f53d;
  color: #082c30;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.footer-form-frame.is-subscribed input[type=email],
.footer-form-frame.is-subscribed > .btn-pill {
  display: none;
}

.footer-error {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #ffb3b3;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.footer-form-frame.has-error .footer-error {
  display: block;
}

.footer-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  flex-shrink: 0;
}

.footer-logo-pill .logo-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-logo-pill .logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.footer-logo-pill .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.footer-logo-pill .logo-text small {
  font-size: 9px;
  opacity: .85;
  font-weight: 500;
}

.story-footer .footer-keralam {
  margin-top: 6px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  color: #ffffff;
}

.story-footer .legal {
  margin: 56px auto 0;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.story-footer .legal a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 150ms ease;
}

.story-footer .legal a:hover {
  color: #ffffff;
}

.story-footer .legal .links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .story-footer {
    min-height: 100svh;
  }
  .footer-form-frame {
    gap: 8px;
    flex-wrap: nowrap;
    padding: 6px;
    height: 52px;
    width: min(520px, calc(100vw - 24px));
  }
  .footer-form-frame .footer-logo-pill {
    padding: 0;
  }
  .footer-form-frame .footer-logo-pill .logo-text {
    display: none;
  }
  .footer-form-frame input[type=email] {
    margin-left: 0;
    flex: 1 1 0;
    min-width: 0;
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
  }
  .footer-form-frame .btn-pill {
    height: 36px;
    padding: 0 14px;
    font-size: 12px;
  }
  .story-tagline h2 {
    font-size: 26px;
    line-height: 1.4;
  }
  .story-footer .legal {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .story-footer .legal {
    font-size: 12px;
    gap: 8px;
  }
  .story-footer .footer-keralam {
    font-size: clamp(24px, 7vw, 36px);
  }
  .story-tagline h2 {
    line-height: 1.35;
  }
}

@media (max-width: 480px) {
  .footer-form-frame .btn-pill {
    padding: 0 12px;
    font-size: 11px;
  }
}
