/*=============== VARIABLES CSS ===============*/
:root {
  /* EdCadence Brand Colors */
  --primary-color: #e0831f; /* Brand Orange */
  --primary-color-light: #ecb52b; /* Brand Lighter Orange (from logo) */
  --primary-color-dark: #c86a1a; /* Darker Orange for hover */
  --secondary-color: #F4F6FA; /* Soft Neutral Gray */
  --accent-color: #1e3348; /* Brand Dark Navy */
  --accent-color-dark: #142535; /* Darker Navy for hover */
  --text-color-dark: #1e3348; /* Brand Dark Navy for text */
  --text-color-light: #666666; /* Lighter gray for subtext */
  --white-color: #FFFFFF;
  
  --body-font: 'Inter', sans-serif;
  --container-width: 1140px;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(30, 51, 72, 0.07); /* Softer shadow */
  --section-padding: 6rem 0;
}

/*=============== BASE ===============*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color-dark);
  background-color: var(--white-color);
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.25rem; }

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container-width);
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.grid {
  display: grid;
  gap: 2rem;
}

.section {
  padding: var(--section-padding);
}

.section__title {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-color-dark);
}

.text-accent {
    color: var(--primary-color);
}

/*=============== BUTTONS ===============*/
.button {
  display: inline-block;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border: 2px solid transparent;
}

.button--primary {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-color-light));
  background-size: 200% 100%;
  color: var(--white-color);
}
.button--primary:hover {
  background-position: 100% 0;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(224, 131, 31, 0.2);
}

.button--secondary {
  background-color: var(--white-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}
.button--secondary:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}

.button--light {
  background-color: var(--white-color);
  color: var(--primary-color);
  font-size: 1.1rem;
  padding: 16px 32px;
}
.button--light:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

/*=============== HEADER & NAV ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: box-shadow 0.3s ease, padding 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-bottom: 0;
}

.nav {
  height: 6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: height 0.3s ease;
}

.header.scrolled .nav {
  height: 4.5rem;
}

.nav__logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-color-dark);
}
.logo-accent {
  color: var(--primary-color);
}

.nav__list {
  display: flex;
  gap: 2rem;
}

.nav__link {
  font-weight: 600;
  color: var(--text-color-light);
  transition: color 0.3s;
}
.nav__link:hover {
  color: var(--primary-color);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav__toggle {
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
}

/*=============== 1. HERO SECTION ===============*/
.hero {
  padding-top: 10rem;
  background-color: var(--secondary-color);
}
.hero__container {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.hero__title {
  color: var(--text-color-dark);
  margin-bottom: 1rem;
}
.hero__description {
  font-size: 1.1rem;
  color: var(--text-color-light);
  margin-bottom: 2.5rem;
  max-width: 500px;
}
.hero__buttons {
  display: flex;
  gap: 1rem;
}
.hero__image {
  text-align: center;
}
.hero__img {
  max-width: 450px;
  animation: float 4s ease-in-out infinite;
}

/* Hero Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.button--pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 131, 31, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(224, 131, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 131, 31, 0); }
}

/*=============== 2. WHY CHOOSE US (REDESIGNED) ===============*/
.why-us {
    background-color: var(--white-color);
}
.why-us__container {
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.why-us__card {
  background-color: var(--secondary-color);
  padding: 2.5rem 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.why-us__card:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow);
  border-color: var(--primary-color);
}
.why-us__icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}
.why-us__card h3 {
  margin-bottom: 0.75rem;
}
.why-us__card p {
  color: var(--text-color-light);
  font-size: 0.95rem;
}

/*=============== 3. INSTITUTES (LOGO STRIP) ===============*/
.institutes {
  background-color: var(--white-color);
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.institutes__title {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color-light);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.institutes__container {
  overflow: hidden;
  position: relative;
  width: 100%;
}
.institutes__track {
  display: flex;
  width: calc(200px * 12); /* 6 logos * 2 */
  animation: scroll 30s linear infinite;
}
.institutes__logo {
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.institutes__logo img {
  max-width: 120px;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s;
}
.institutes__logo:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-200px * 6)); }
}

/*=============== 4. HOW IT WORKS (UPGRADED) ===============*/
.how-it-works {
    background-color: var(--secondary-color);
}
.how-it-works__container {
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
}
/* Connector Line */
.how-it-works__container::before {
  content: '';
  position: absolute;
  top: 45px; /* Adjust vertical position of the line */
  left: 15%;
  width: 70%;
  height: 2px;
  background-image: linear-gradient(to right, var(--text-color-light) 33%, rgba(255,255,255,0) 0%);
  background-position: bottom;
  background-size: 15px 2px;
  background-repeat: repeat-x;
  z-index: 1;
}

.how-it-works__step {
  text-align: center;
  background-color: var(--white-color);
  padding: 2rem 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid #eee;
  transition: all 0.3s ease;
  z-index: 2; /* Ensures cards are above the line */
}
.how-it-works__step:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow);
}
.how-it-works__number {
  width: 60px;
  height: 60px;
  line-height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--white-color);
  font-size: 1.75rem;
  font-weight: 700;
  margin: -4rem auto 1.5rem auto; /* Pulls the circle up */
  border: 4px solid var(--secondary-color); /* Creates clean overlap */
}
.how-it-works__step h3 {
  margin-bottom: 0.5rem;
}
.how-it-works__step p {
  color: var(--text-color-light);
}

/*=============== 5. AI PRACTICE TESTS ===============*/
.ai-practice {
  background-color: var(--white-color);
}
.ai-practice__container {
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}
.ai-practice__content .section__title {
  text-align: left;
  margin-bottom: 1rem;
}
.ai-practice__description {
  font-size: 1.1rem;
  color: var(--text-color-light);
  margin-bottom: 2.5rem;
}
.ai-practice__img {
  border-radius: var(--border-radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/*=============== 6. TESTIMONIALS (SMOOTH SLIDE) ===============*/
.testimonials {
    background-color: var(--secondary-color);
}
.testimonials__container {
  position: relative;
  overflow: hidden;
  max-width: 800px;
}
.testimonials__wrapper {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.testimonial-card {
  flex: 0 0 100%;
  width: 100%;
  background-color: var(--white-color);
  padding: 3rem;
  border-radius: var(--border-radius);
  position: relative;
}
.testimonial-card__quote-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.2;
}
.testimonial-card__stars {
  color: var(--accent-color);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.testimonial-card__text {
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--text-color-dark);
}
.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.testimonial-card__author img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}
.testimonial-card__author h4 {
  font-weight: 700;
}
.testimonial-card__author span {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}
.testimonial__navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0;
  left: -50px; /* Adjust position */
  width: calc(100% + 100px); /* Adjust position */
}
.testimonial__nav-btn {
  background-color: var(--white-color);
  color: var(--primary-color);
  border: 1px solid #ddd;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.testimonial__nav-btn:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
  transform: scale(1.1);
}

/*=============== 7. FINAL CTA (ANIMATED COUNTER) ===============*/
.cta {
  background-color: var(--accent-color);
  color: var(--white-color);
  text-align: center;
  padding: 6rem 0;
}
.cta__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.cta__title {
  font-size: 2.5rem;
  max-width: 600px;
}
.cta__subtext {
  font-size: 1.1rem;
  opacity: 0.9;
}
.cta__counter {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
}
.cta__counter strong {
  color: var(--white-color);
  font-size: 1.75rem;
  font-weight: 700;
}

/*=============== 8. FOOTER (BRAND ALIGNED) ===============*/
.footer {
  background-color: var(--accent-color); /* Brand Dark Navy */
  color: #ccc;
  padding-top: 6rem;
  padding-bottom: 2rem;
}
.footer__container {
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
.footer__brand .nav__logo {
  color: var(--white-color);
}
.footer__brand .logo-accent {
  color: var(--primary-color);
}
.footer__brand p {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  max-width: 300px;
  color: #aaa;
}
.footer__socials {
  display: flex;
  gap: 1rem;
}
.footer__socials a {
  font-size: 1.5rem;
  color: #ccc;
  transition: color 0.3s, transform 0.3s;
}
.footer__socials a:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}
.footer__links h4 {
  color: var(--white-color);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.footer__links ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer__links a {
  color: #ccc;
  transition: color 0.3s;
}
.footer__links a:hover {
  color: var(--white-color);
  padding-left: 5px;
}
.footer__copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #446;
  color: #888;
}

/*=============== SCROLL REVEAL ANIMATION ===============*/
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/*=============== RESPONSIVENESS (MOBILE-FIRST) ===============*/

/* Medium devices (tablets, 768px and up) */
@media (max-width: 992px) {
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__content {
    order: 2;
  }
  .hero__image {
    order: 1;
    margin-bottom: 2rem;
  }
  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__buttons {
    justify-content: center;
  }
  .why-us__container {
    grid-template-columns: repeat(2, 1fr);
  }
  .how-it-works__container {
    grid-template-columns: repeat(2, 1fr);
  }
  .how-it-works__container::before { /* Hide connector line on tablet */
    display: none;
  }
  .how-it-works__number {
    margin-top: -3.5rem; /* Adjust number overlap */
  }
  .ai-practice__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ai-practice__content .section__title {
    text-align: center;
  }
  .ai-practice__image {
    order: -1;
  }
  .testimonial__navigation {
      left: 0;
      width: 100%;
      padding: 0 1rem;
  }
  .footer__container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small devices (phones, 767px and down) */
@media (max-width: 767px) {
  .section {
    padding: 4rem 0;
  }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }

  .nav {
    height: 5rem;
  }
  .header.scrolled .nav {
    height: 4.5rem; /* Consistent height on mobile */
  }
  .nav__menu {
    position: fixed;
    top: 5rem; /* Match nav height */
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--white-color);
    padding: 2rem;
    transition: left 0.4s ease;
    box-shadow: 10px 0 20px rgba(0,0,0,0.05);
  }
  .nav__menu.show-menu {
    left: 0;
  }
  .nav__list {
    flex-direction: column;
    gap: 2.5rem;
  }
  .nav__link {
    font-size: 1.2rem;
    color: var(--text-color-dark);
  }
  .nav__actions .button {
    display: none;
  }
  .nav__toggle {
    display: block;
    color: var(--text-color-dark);
  }

  .hero {
    padding-top: 8rem;
  }
  .hero__buttons {
    flex-direction: column;
    gap: 1rem;
  }
  .why-us__container {
    grid-template-columns: 1fr;
  }
  .how-it-works__container {
    grid-template-columns: 1fr;
  }
  .how-it-works__number {
    margin-top: -3.5rem;
  }
  .testimonial__navigation {
    display: none; /* Hide arrows on mobile, rely on swipe */
  }
  .testimonial-card {
      padding: 2.5rem 1.5rem;
  }
  .footer__container {
    grid-template-columns: 1fr;
  }
}