:root {
  /* Modern color scheme */
  --primary: #0054a6;
  --primary-light: #1a75c4;
  --primary-dark: #003b73;
  --dark: #1e293b;
  --light: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-600: #475569;
  --text: #334155;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Animations */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--light);
  overflow-x: hidden;
  height: 100%;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition-normal);
}

a:hover {
  color: var(--primary-dark);
  cursor: pointer;
}

section {
  padding: var(--space-2xl) var(--space-lg);
}

section>h2 {
  font-size: 2rem;
  color: var(--dark);
  text-align: center;
}

/* Scroll Animation */
.out-of-viewport {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Utility Classes */
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Header & Navigation */
header {
  position: fixed;
  pointer-events: none;
  width: 100%;
  z-index: 1000;
  max-width: 100vw;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
  background-color: white;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md) var(--space-xl);
  transition: var(--transition-normal);
  pointer-events: all;
}

nav.scrolled {
  padding: var(--space-sm) var(--space-xl);
  box-shadow: var(--shadow-md);
}

.logo img {
  margin-left: var(--space-md);
  height: clamp(27px, 3vw, 35px);
  transition: var(--transition-normal);
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

/* ---------------------------------------------------------
 * Mobile navigation
 * -------------------------------------------------------*/

/* Hamburger button hidden by default (desktop) */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 4px 0;
  background-color: var(--primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Responsive behaviour */
@media (max-width: 768px) {

  /* Show hamburger */
  .hamburger {
    display: block;
  }

  /* Collapse nav list */
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background-color: white;
    width: 100%;
    /* Remove vertical padding while collapsed so nothing peeks out */
    padding: 0 var(--space-md);
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }

  /* Expand when nav is open */
  nav.open ul {
    display: flex;
    /* When menu is open restore full padding and allow it to expand */
    padding: var(--space-md);
    max-height: 90vh;
    /* allow space for submenu */
    overflow: visible;
    /* allow nested submenu to be fully visible */
  }

  /* Transform hamburger into X when open */
  nav.open .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  nav.open .hamburger span:nth-child(2) {
    opacity: 0;
  }

  nav.open .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

nav>ul a {
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: var(--space-xs) 0;
}

nav>ul a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition-normal);
}

nav>ul a:hover::after,
nav>ul a.active::after {
  width: 100%;
}

/* Resources Dropdown */
#resources-dropdown {
  position: relative;
  opacity: 0;
  transform: translateY(-50px);
  width: 100%;
  background: var(--primary-light);
  padding: var(--space-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition-normal);
  pointer-events: none;
  z-index: 0;
}

nav.scrolled~#resources-dropdown {
  padding: var(--space-xs) var(--space-sm);
}

#resources-dropdown.active {
  display: grid;
  pointer-events: auto;
  transform: translateY(0px);
  opacity: 1;
  pointer-events: auto;
}

#resources-dropdown-elements a {
  padding: 15px;
  text-decoration: none;
  color: white;
  transition: var(--transition-normal);
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
}

#resources-dropdown-elements {
  display: flex;
  justify-content: space-evenly;
}

@media (max-width: 768px) {
  #resources-dropdown-elements {
    flex-direction: column;
    align-items: stretch;
  }
}

#resources-dropdown a:hover {
  background-color: var(--primary);
}

/* ---------------------------------------------------------
 * Mobile Resources submenu (inside hamburger menu)
 * -------------------------------------------------------*/

@media (max-width: 768px) {
  .mobile-resources-submenu {
    list-style: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--primary-light);
    animation: dropdownReveal var(--transition-normal) forwards;
    overflow: hidden;
    gap: var(--space-sm);
  }

  .mobile-resources-submenu li a {
    display: block;
    padding: var(--space-sm) var(--space-sm);
    color: white;
    font-weight: 500;
  }

  .mobile-resources-submenu li a:hover {
    background: var(--primary);
  }

  @keyframes dropdownReveal {
    from {
      max-height: 0;
      opacity: 0;
    }

    to {
      max-height: 400px;
      opacity: 1;
    }
  }
}

/* Hero Section */
.hero {
  height: 110vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero * {
  position: relative;
  z-index: 3;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('road.jpg') no-repeat center / cover;
  opacity: 0.4;
  filter: blur(3px);
  z-index: 1;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, white);
  z-index: 2;
  pointer-events: none;
}

.hero>h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 800px;
  margin: 0 auto 20px;
  color: var(--primary-dark);
  animation: fadeInUp 1s ease-out;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
  animation: fadeInUp 1s ease-out 0.2s forwards;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-normal);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn.primary {
  background-color: var(--primary-light);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn.secondary {
  background-color: transparent;
  color: var(--text);
  border: 2px solid var(--primary-light);
}

.btn.secondary:hover {
  background-color: rgba(0, 84, 166, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Features Section */
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xl);
  background-color: white;
}

.feature-box {
  max-width: 400px;
  background-color: white;
  padding: var(--space-xl);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-normal);
}

.feature-box:hover::before {
  transform: scaleX(1);
}

.feature-box img {
  height: 60px;
  margin-bottom: var(--space-md);
  transition: var(--transition-slow);
}

.feature-box:hover img {
  transform: scale(1.1) rotate(5deg);
}

.feature-box h3 {
  margin-bottom: var(--space-sm);
  color: var(--primary-dark);
}

/* Services Section */
#services {
  position: relative;
}

#services * {
  z-index: 2;
}

#services::after {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
  background: url('pattern.jpg') center / cover;
  opacity: 0.05;
  z-index: 1;
}

#services>h2 {
  margin-bottom: 40px;
  position: relative;
}

#services>h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin: var(--space-sm) auto 0;
}

#services-grid-wrapper {
  display: flex;
  justify-content: center;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.service-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  height: 100%;
  border-bottom: 3px solid transparent;
}

.service-card:hover {
  border-bottom: 3px solid var(--primary);
}

.service-card h3 {
  margin-bottom: 15px;
  color: var(--primary);
  position: relative;
  padding-bottom: var(--space-sm);
}

.service-card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition-normal);
}

.service-card:hover h3::after {
  width: 60px;
}

.service-card ul {
  margin-top: 10px;
  padding-left: 20px;
}

.service-card li {
  margin-bottom: 10px;
}

#smart-investments-card {
  grid-column: span 2;
}

/* Testimonials Section */
#testimonials {
  text-align: center;
  background: var(--light);
}

#testimonials>h2 {
  margin-bottom: var(--space-sm);
}

#testimonials>p {
  color: var(--neutral-600);
  margin-bottom: var(--space-xl);
  font-weight: 400;
}

#testimonials-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow: auto;
  gap: var(--space-sm);
  background: white;
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  padding: var(--space-lg);
  max-width: 400px;
  text-align: left;
  transition: var(--transition-normal);
}

.stars {
  display: flex;
  gap: var(--space-xs);
}

.stars>img {
  width: 20px;
}

.testimonial-text {
  flex-grow: 1;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.testimonial-data {
  display: flex;
  align-items: center;
}

.testimonial-author {
  font-weight: 600;
  color: var(--dark);
}

.testimonial-date {
  font-weight: 400;
  color: var(--neutral-600);
  font-size: 0.875rem;
  margin-left: var(--space-xs);
}

#google-rating {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-xl);
}

#google-rating-info {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

#google-rating-info>p {
  font-weight: 500;
  color: var(--dark);
}

#google-rating-info>img {
  width: 20px;
  height: 20px;
}

/* About Us Section */
#about-us {
  background: var(--neutral-100);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#about-us::before {
  content: '';
  position: absolute;
  right: 0;
  width: 300px;
  height: 300px;
  background-color: rgba(0, 84, 166, 0.05);
  border-radius: 100%;
  transform: translate(100px, -100px);
}

#about-us>h2 {
  margin-bottom: var(--space-sm);
}

#history-description-wrapper {
  display: flex;
  width: 100%;
  justify-content: center;
}

#history-description {
  max-width: 800px;
  margin-bottom: var(--space-lg);
}

.about-subheading {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--primary);
}

.about-description {
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  font-size: 1rem;
  color: var(--text);
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 200px;
  max-width: 240px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  padding: var(--space-lg) var(--space-md) var(--space-lg);
  text-align: center;
}

.team-card>img {
  width: 85%;
  object-fit: cover;
  transition: var(--transition-slow);
  border-radius: 50%;
  /* margin: 15px auto 10px; */
  display: block;
}

.team-card:hover>img {
  transform: scale(1.05);
}

.team-card>h3 {
  margin-top: var(--space-md);
  color: var(--primary);
}

.team-card>.title {
  color: var(--neutral-600);
  font-size: 0.95rem;
}

.team-card .bio {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: var(--transition-normal);
  margin-top: 0;
}

.team-card:hover .bio {
  opacity: 1;
  max-height: 200px;
  margin-top: var(--space-sm);
}

/* Contact Us Section */
#contact {
  position: relative;
  text-align: center;
}

#contact::after {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
  background: url('pattern2.png') center / cover;
  opacity: 0.03;
  z-index: -1;
}

#contact-us-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: var(--transition-normal);
}

#contact-us-text-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-sm);
}

#contact-us-subheading {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
  color: var(--primary);
}

/* Disclosures Section */
#disclosures {
  background: linear-gradient(to bottom left, var(--light), var(--neutral-200));
}

#disclosures>h2 {
  margin-bottom: var(--space-xl);
}

#disclosures-list {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  transition: var(--transition-normal);
}

#disclosure {
  display: flex;
  gap: var(--space-sm);
  flex-direction: column;
  align-items: center;
  width: clamp(200px, 25vw, 250px);
  text-align: center;
}

#disclosure>p {
  color: var(--dark)
}

#disclosure>img {
  width: 170px;
  height: 170px;
  border-radius: 100%;
  box-shadow: var(--shadow-md);
}

#disclosure>a {
  margin-top: auto;
}

#disclosure button {
  font-size: 1rem;
}

/* Calculator specific styles */
#calculator-wrapper {
  display: flex;
  justify-content: center;
  padding-top: 120px;
  padding-bottom: 60px;
}

.calculator-container {
  max-width: 800px;
  padding: 40px;
  background-color: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.calculator-container h1 {
  margin-bottom: 20px;
  color: var(--primary);
  text-align: center;
  font-size: 2rem;
}

.calculator-container p {
  text-align: center;
  margin-bottom: 30px;
  color: var(--neutral-600);
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.calculator-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.calculator-form input,
.calculator-form select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition-normal);
}

.calculator-form input:focus,
.calculator-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 84, 166, 0.2);
}

#calculate {
  grid-column: span 2;
  background-color: var(--primary);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

#calculate:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#result {
  grid-column: span 2;
  margin-top: 25px;
  padding: 20px;
  background-color: var(--neutral-100);
  border-radius: 8px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition-normal);
}

/* Newsletter Styles */
#newsletters {
  padding: 100px 20px 20px;
}

#newsletters>h1 {
  font-size: 2em;
  text-align: center;
}

#newsletters-description {
  text-align: center;
}

#newsletters-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-md);
}

.newsletter {
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  width: clamp(250px, 30vw, 300px);
  height: 300px;
}

.newsletter:hover {
  cursor: pointer;
}

.newsletter-img {
  width: 100%;
  height: 200%;
  background-size: cover;
  background-position: center;
}

.newsletter-info {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 10px 20px;
  overflow: hidden;
}

.newsletter-title {
  flex-grow: 1;
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1em;
}

/* Quarterly Meetings Styles */
#meetings {
  padding: 100px 20px 20px;
}

#meetings > h1, #meetings-description {
  text-align: center;
}

#meetings-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-md);
}

.meeting {
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  width: clamp(250px, 30vw, 300px);
  height: 300px;
}

.meeting:hover {
  cursor: pointer;
}

.meeting > img {
  width: 100%;
  height: 200%;
  background-size: cover;
  background-position: center;
}

.meeting-details {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 10px 20px;
  overflow: hidden;
}

.meeting-details > h3 {
  flex-grow: 1;
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1em;
}

.meeting-details > *:not(h3) {
  line-height: 1.3;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .calculator-form {
    grid-template-columns: 1fr;
  }

  #calculate {
    grid-column: span 1;
  }

  #result {
    grid-column: span 1;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  /* Hamburger menu styles for mobile */
  nav ul {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
    width: 100%;
    padding: var(--space-md) 0;
  }

  .nav-links {
    display: none;
    /* Hide navigation links by default on mobile */
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    /* Position below the header */
    left: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
    /* Show navigation links when active */
  }

  .hamburger-icon {
    display: block;
    /* Show hamburger icon on mobile */
  }
}

@media (max-width: 709px) {
  #smart-investments-card {
    grid-column: span 1;
  }
}

@media (min-width: 1370px) {
  .service-grid {
    max-width: 1370px;
    grid-template-columns: repeat(3, minmax(300px, 1fr));
  }
}

/* Footer Styles */
footer {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  background-color: white;
  color: var(--dark);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  margin-top: auto;
}

footer>div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-right: var(--space-md);
}

footer img {
  width: clamp(100px, 5vw, 150px);
}

footer>p {
  margin: 0;
  font-size: 0.9rem;
}
