/* ===== FONT IMPORTS ===== */
@font-face {
  font-family: "CooperBlack";
  src: url("../fonts/cooper-black.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ===== VARIABLES ===== */
:root {
  --font-body: "Familjen Grotesk", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  --kSycamoreGreen: #829b3e; /* Sycamore Green */
  --kEerieBlack: #1c1c1c; /* Eerie Black */
  --kWhiteSmoke: #f5f5f5; /* White Smoke */
  --kNarvikGrey: #d6d9e6; /* Narvik Grey */
  --kPastelDeepGold: #e5c768; /* Pastel Deep Gold */
  --kBittersweetRed: #ff6962; /* Bittersweet Red */
  --kSandyBrown: #f4a261; /* Sandy Brown */
}

/* ===== BASE STYLES ===== */
body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  background: var(--kWhiteSmoke);
  color: var(--kEerieBlack);
}

h1 {
  font-family: "CooperBlack", sans-serif;
  color: var(--kWhiteSmoke);
}

h2,
h3,
h4,
h5 {
  font-family: "CooperBlack", sans-serif;
  color: var(--kEerieBlack);
}

/* ===== NAVBAR ===== */
.logo-btn {
  position: absolute;
  left: 1.5rem; /* keeps it fixed in place */
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo-btn:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

.logo-icon {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-wordmark {
  height: 28px;
  width: auto;
  object-fit: contain;
}

/* logo alignment fix */
.logo-btn,
.logo {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* ===== UNIFIED NAVBAR LAYOUT FIX ===== */
.navbar {
  background-color: var(--kWhiteSmoke) !important;
  border-bottom: 1px solid var(--kNarvikGrey);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px !important; /* lock height across all pages */
  padding: 0 !important;
  margin: 0 !important;
}

.navbar .container {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin: 0 auto !important;
  box-sizing: border-box;
}

/* prevent collapse menu from stretching across entire screen */
@media (max-width: 991px) {
  .navbar .container {
    position: relative;
  }

  /* 2. Tweak collapse menu background on mobile */
  .navbar-collapse {
    position: absolute;
    right: 1rem;
    top: 100%;
    z-index: 9999;
    background-color: var(--kWhiteSmoke);
    border-radius: 25px;
    padding: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: fit-content;
    max-width: 90%;
    margin-left: auto;
    margin-right: 1rem;
  }

  /* keep links inside dropdown consistent */
  .navbar-collapse .nav-link {
    color: var(--kEerieBlack) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: block;
    text-align: right;
    border-radius: 12px;
    transition: background 0.2s ease;
    border-radius: 25px !important;
  }

  /* make sure the toggle button (hamburger) aligns cleanly */
  .navbar-toggler {
    border: none;
    outline: none;
    box-shadow: none !important;
    margin-left: auto;
  }
}

/* remove background/padding for desktop mode */
@media (min-width: 992px) {
  .navbar-collapse {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* lock nav-link + button spacing */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem !important;
  margin-left: auto !important; /* push nav links to the right side */
  margin: 0 !important;
  padding: 0 !important;
}

/* identical button styling */
.navbar .nav-link:hover {
  text-decoration: none;
  color: var(--kSycamoreGreen) !important;
}

.navbar .btn-primary {
  font-family: "CooperBlack", sans-serif !important;
  font-size: 1rem !important;
  color: var(--kWhiteSmoke) !important;
  background-color: var(--kSycamoreGreen) !important;
  border: none !important;
  border-radius: 25px !important;
  height: 40px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.navbar .btn-primary:hover {
  background-color: var(--kPastelDeepGold) !important;
  color: var(--kEerieBlack) !important;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: calc(100vh - 64px); /* adjust for navbar height */
  display: flex;
  flex-direction: column; /* stack text + image */
  justify-content: center; /* vertically center content */
  align-items: center; /* horizontally center */
  text-align: center;
  color: var(--kWhiteSmoke);
  overflow: hidden; /* ensure pseudo-element stays clipped */
}

/* Background image layer (greyscaled only) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image: image-set(
    url("../images/site-content/TallyFox - Hero Background (1080 x 1920 px).png")
      1x,
    url("../images/site-content/TallyFox - Hero Background (1920 x 1080 px).png")
      2x
  );

  background-size: cover;
  background-position: 50% 40%;
  background-repeat: no-repeat;

  /* Only the image gets filtered */
  filter: grayscale(100%) brightness(0.9) contrast(1.05);
}

/* Gradient shimmer layer (colored and animated) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;

  background: linear-gradient(
    135deg,
    rgba(130, 155, 62, 0.9) 65%,
    /* Sycamore Green dominant */ rgba(229, 199, 104, 0.75) 100%
      /* Gold accent */
  );

  background-size: 200% 200%;
  background-position: 0% 50%;
  animation: shimmerGradient 20s ease-in-out infinite;
  pointer-events: none; /* keeps it non-interactive */
}

/* Foreground content stays above both */
.hero > * {
  position: relative;
  z-index: 2;
}

/* Shimmer animation */
@keyframes shimmerGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Mobile portrait override */
@media (max-width: 768px) and (orientation: portrait) {
  .hero::before {
    background-image: image-set(
      url("../images/site-content/TallyFox - Hero Background (1080 x 1920 px).png")
        1x,
      url("../images/site-content/TallyFox - Hero Background (1080 x 1920 px).png")
        2x
    );
  }
}

/* make the container + row fill the hero vertically */
.hero .container,
.hero .row {
  height: 100%;
  display: flex;
  align-items: center; /* ✅ vertically center all cols */
}

/* Limit the hero row width */
.hero .row-wrapper {
  max-width: 1000px; /* match your container or desired max width */
}

.hero h1 {
  font-size: 3rem;
}

.hero .img-wrapper {
  display: flex;
  justify-content: center;
}

.hero .screenshot {
  display: block;
  width: auto; /* allow it to scale down with container */
  max-width: clamp(180px, 40vw, 375px); /* responsive width cap */
  height: clamp(500px, 70vh, 750px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: contain; /* ensures it never looks stretched */
  margin: 2rem 0 !important; /* ✅ vertical margin */
}

.hero p {
  font-size: 1.2rem;
  color: var(--kWhiteSmoke);
  opacity: 0.95;
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 4rem 1.25rem;
  }

  .hero .row {
    align-items: center;
    justify-content: center;
    gap: 2rem; /* equal spacing between text & image */
  }

  .hero .screenshot {
    max-width: 300px;
    margin: 0 auto; /* center horizontally */
  }

  .hero h1 {
    margin-top: 2rem; /* optional fine-tune */
  }
}

/* ===== Why Track Your Finances Section ===== */
#why-tallyfox {
  background-color: var(--kWhiteSmoke);
  padding: 5rem 0;
  font-family: var(--font-body);
  color: var(--kEerieBlack);
}

#why-tallyfox blockquote {
  font-style: italic;
  color: var(--kEerieBlack);
  opacity: 0.85;
  margin-bottom: 2rem;
  font-size: clamp(1rem, 2vw, 1.125rem);
}

#why-tallyfox p {
  font-size: clamp(1rem, 1.75vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Flex container for benefit cards */
.benefits-row {
  display: flex;
  justify-content: center; /* Keep them centered */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 1.5rem; /* Space between cards */
  align-items: flex-end; /* Align cards to the bottom */
  margin: 0 auto;
}

/* Wrapper ensures cards don't stretch weirdly */
.benefit-wrapper {
  display: flex;
  justify-content: center; /* Center card inside wrapper */
  flex: 0 0 auto; /* Prevent flex growth */
}

/* Limit card width */
.benefit-card {
  background-color: rgba(130, 155, 62, 0.9); /* 0.9 opacity of your green */
  max-width: 200px; /* keeps consistent size */
  border-radius: 25px;
  padding: 2rem 1.5rem;
  box-shadow: 0 6px 12px rgba(28, 28, 28, 0.08);
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
  animation-name: fadeInUp;
  animation-duration: 0.8s;
  animation-fill-mode: both;
}

/* Hover effect */
.benefit-card:hover {
  background-color: var(--kSycamoreGreen);
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(28, 28, 28, 0.12);
}

.benefit-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.benefit-card h5 {
  font-family: var(--font-body);
  font-weight: 900;
  color: var(--kWhiteSmoke);
  margin-bottom: 0.5rem;
}

.benefit-card p {
  font-weight: 400;
  color: var(--kWhiteSmoke);
  opacity: 0.85;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  .benefit-card {
    padding: 1.5rem 1rem;
  }
}

/* ===== FEATURES SECTION ===== */
#features {
  background-color: var(--kWhiteSmoke);
  padding: 6rem 0;
}

/* --- Feature row: card layout --- */
#features .feature-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin: 0 auto; /* center the card */
  max-width: 750px;
  box-sizing: border-box;
  background-color: var(--kWhiteSmoke);
  border-radius: 25px;
  padding: 2.5rem 5rem;
  box-shadow: 0 6px 12px rgba(28, 28, 28, 0.08);
}

/* Carousel adjustments to prevent clipping */
#features .carousel-inner,
#features .carousel-item,
#features .container {
  overflow: visible !important;
}

#features .carousel-item {
  padding: 1rem;
  box-sizing: border-box;
}

/* --- Desktop layout (≥992px) --- */
@media (min-width: 992px) {
  #features .feature-row > .col-md-6 {
    flex: 0 0 50%;
    box-sizing: border-box;
  }

  #features .feature-row {
    flex-direction: row !important;
  }

  /* Reverse row if opted-in */
  #features .feature-row.flex-md-row-reverse,
  #features .feature-row[class*="flex-md-row-reverse"] {
    flex-direction: row-reverse !important;
  }

  /* Text alignment based on image side */
  #features .feature-row:not(.flex-md-row-reverse) .feature-text {
    text-align: right;
    margin-left: auto;
  }
  #features .feature-row.flex-md-row-reverse .feature-text {
    text-align: left;
    margin-right: auto;
  }
}

/* --- Feature image --- */
#features .feature-img {
  height: clamp(350px, 60vh, 900px); /* fluid but standardized height */
  width: auto; /* adjust width automatically */
  display: block;
  margin: 0 auto;
  object-fit: contain; /* maintain aspect ratio, crop overflow */
  object-position: center;
  display: block;
  transition: transform 0.28s ease;
  background-color: transparent; /* keep fully transparent */
}

#features .feature-img:hover {
  transform: scale(1.03);
}

/* --- Feature text --- */
#features .feature-text {
  max-width: 520px;
  margin: 0 auto;
}

#features .feature-text h5 {
  font-family: var(--font-body);
  font-weight: 900;
  color: var(--kEerieBlack);
  margin-bottom: 0.75rem;
}

#features .feature-text p {
  color: var(--kEerieBlack);
  opacity: 0.9;
  line-height: 1.6;
}

/* ===== Carousel controls ===== */
#features .carousel-control-prev,
#features .carousel-control-next {
  top: 50%;
  transform: translateY(-50%);
  width: clamp(2rem, 5vw, 3rem);
  height: clamp(2rem, 5vw, 3rem);
  padding: 0.5rem;
  color: rgba(50, 155, 62, 0.4);
  transition: color 0.3s ease;
}

#features .carousel-control-prev {
  left: -1rem;
}
#features .carousel-control-next {
  right: -1rem;
}

#features .carousel-control-prev-icon,
#features .carousel-control-next-icon {
  background-image: none !important;
  width: 100%;
  height: 100%;
  display: inline-block;
  position: relative;
}

#features .carousel-control-prev-icon::after,
#features .carousel-control-next-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1);
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Arrows via SVG */
#features .carousel-control-prev-icon::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M11.354 1.646a.5.5 0 0 0-.708 0L4.293 8l6.353 6.354a.5.5 0 0 0 .708-.708L5.707 8l5.647-5.646a.5.5 0 0 0 0-.708z"/></svg>');
}

#features .carousel-control-next-icon::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M4.646 14.354a.5.5 0 0 0 .708 0L11.707 8 5.354 1.646a.5.5 0 0 0-.708.708L10.293 8l-5.647 5.646a.5.5 0 0 0 0 .708z"/></svg>');
}

#features .carousel-control-prev:hover,
#features .carousel-control-next:hover {
  color: var(--kSycamoreGreen);
}

/* --- Carousel indicators --- */
#features .carousel-indicators {
  bottom: -2rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

#features .carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 25px;
  background-color: var(--kSycamoreGreen);
  opacity: 0.75;
  border: none;
  transition: all 0.3s ease;
}

#features .carousel-indicators button:hover {
  opacity: 0.9;
  transform: scale(1.1);
}

#features .carousel-indicators .active {
  background-color: var(--kPastelDeepGold);
  opacity: 1;
  transform: scale(1.25);
}

/* --- Mobile (≤991.98px) --- */
@media (max-width: 991.98px) {
  html,
  body {
    scroll-behavior: auto !important;
    overscroll-behavior: none;
  }

  #featuresCarousel {
    position: relative;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #featuresCarousel .carousel-inner {
    display: block !important;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  /* ✅ Fix jumpy behavior by stabilizing slide height */
  #featuresCarousel,
  #featuresCarousel .carousel-inner,
  #featuresCarousel .carousel-item {
    min-height: 700px; /* adjusted to fit tall screenshots */
  }

  /* ✅ Restore indicators visibility and prevent cutoff */
  #featuresCarousel .carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    margin: 0;
    z-index: 3;
  }

  /* ✅ Prevent layout jump on mobile next/prev press */
  #featuresCarousel .carousel-control-prev,
  #featuresCarousel .carousel-control-next {
    touch-action: manipulation;
  }

  #featuresCarousel .carousel-control-prev:focus,
  #featuresCarousel .carousel-control-next:focus {
    outline: none;
    box-shadow: none;
  }

  #features .feature-row {
    flex-direction: column !important;
    flex-wrap: wrap;
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: 900px;
    align-items: center;
    justify-content: center;
    text-align: center; /* ✅ centers content within card */
  }

  #features .feature-row > .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
  }

  /* Force text first, image second */
  #features .feature-row > .col-md-6:first-child {
    order: 2 !important;
  }
  #features .feature-row > .col-md-6:last-child {
    order: 1 !important;
  }

  #features .feature-img {
    width: auto;
    max-width: 95%;
    height: auto;
    max-height: 60vh; /* ✅ keeps image visible, no cropping */
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    display: block;
    transition: transform 0.28s ease;
    background-color: transparent;
  }

  #features .feature-text {
    text-align: center !important;
    width: 100%;
    margin: 0 auto !important;
  }
}

/* --- Mobile adjustments ≤768px --- */
@media (max-width: 768px) {
  #features .carousel-control-prev,
  #features .carousel-control-next {
    width: clamp(1.5rem, 10vw, 2.5rem);
    height: clamp(1.5rem, 10vw, 2.5rem);
    padding: 0.25rem;
  }
  #features .carousel-control-prev {
    left: 0.25rem;
  }
  #features .carousel-control-next {
    right: 0.25rem;
  }

  #features .feature-row {
    min-height: auto; /* allow flexible growth */
    padding: 2rem 1rem;
    gap: 2rem;
  }

  #features .feature-img {
    height: auto; /* stop forcing tall images */
    max-height: 65vh; /* still keep proportional balance */
    width: 100%; /* scale to screen width */
    object-fit: contain; /* keep full image visible */
    object-position: center;
  }
}

/* ===== CTA SECTION ===== */
.cta {
  background: var(--kSycamoreGreen);
  color: var(--kWhiteSmoke);
  padding: 4rem 0;
  text-align: center;
}

.cta h2 {
  font-family: "CooperBlack", sans-serif;
  color: var(--kWhiteSmoke);
}

.cta p {
  opacity: 0.95;
  color: var(--kWhiteSmoke);
}

.cta .btn {
  font-family: "CooperBlack", sans-serif;
  background-color: var(--kPastelDeepGold);
  color: var(--kEerieBlack);
  font-weight: 700;
  border: none;
  transition: background 0.3s ease;
  border-radius: 25px;
}

.cta .btn:hover {
  background-color: var(--kWhiteSmoke);
  color: var(--kSycamoreGreen);
}

/* ===== FOOTER ===== */
footer {
  padding: 2rem 0;
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #d6d9e6;
  background-color: var(--kWhiteSmoke);
  text-align: center;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

footer p {
  margin: 0;
  opacity: 0.8;
}

/* ===== UTILITY STYLES ===== */
.btn-negative {
  background-color: var(--kBittersweetRed);
  color: var(--kWhiteSmoke);
}

.btn-neutral {
  background-color: var(--kSandyBrown);
  color: var(--kEerieBlack);
}

.btn-gold {
  background-color: var(--kPastelDeepGold);
  color: var(--kEerieBlack);
}

/* ===== STORE BADGES ===== */
.store-badge.google {
  height: 52px;
  object-fit: contain;
}

.store-badge.apple {
  height: 55px;
  object-fit: contain;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.4rem;
  }
  .hero p {
    font-size: 1rem;
  }
}
