/* --- CSS Custom Properties (Variables) --- */
:root {
  /* Consistent with Features and About pages */
  --primary-color: #007bff; /* Bright Blue - For main actions, buttons, highlights */
  --secondary-color: #6c757d; /* Muted Gray - For secondary text, borders, subtle elements */
  --accent-color: #28a745; /* Green - For success, positive indicators */
  --tertiary-color: #ffc107; /* Yellow - For warnings, attention-grabbing elements */

  --background-light: #f8f9fa; /* Very light gray - General background */
  --background-alt: #ffffff; /* Pure white - For cards, distinct sections */
  --background-dark: #343a40; /* Dark gray/black - For footer, dark elements */

  --text-primary: #343a40; /* Dark text for readability on light backgrounds */
  --text-secondary: #495057; /* Slightly lighter text for paragraphs */
  --text-light: #ffffff; /* White text on dark backgrounds */

  --border-color: #e9ecef; /* Light border for subtle separation */

  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); /* Small shadow */
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); /* Medium shadow */
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175); /* Large shadow for depth */

  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;

  --transition-speed: 0.3s; /* Standard transition duration */
  --transition-fast: 0.15s; /* Faster transitions */

  /* Typography */
  --font-heading: 'Share Tech', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

/* --- Base & Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
  height: 100%; /* Important for full-height mobile menu */
}

body {
  font-family: var(--font-body);
  background-color: var(--background-light); /* Default background */
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll due to animations */
  height: 100%; /* Important for full-height mobile menu */
}

a {
  color: inherit;
  transition: color var(--transition-speed) ease;
}

img, video {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem; /* Consistent horizontal padding */
}

/* --- Header Styles (Consistent with other pages) --- */
.header {
  position: absolute; /* Changed to absolute to float over video */
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.75rem 0; /* Consistent vertical padding */
  background: transparent; /* Fully transparent initially */
  backdrop-filter: none;
  transition: background 0.3s ease, backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
}

.header.scrolled {
  background: var(--background-alt); /* Solid white on scroll */
  backdrop-filter: blur(10px); /* Glassmorphism effect */
  box-shadow: var(--shadow-sm); /* Subtle shadow on scroll */
  position: fixed; /* Fix header on scroll */
  padding: 0.5rem 0; /* Slightly reduced padding on scroll */
}

.header_content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--border-radius-lg); /* Larger border-radius */
  padding: 0.5rem 1rem; /* Consistent padding inside header_content */
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-heading); /* Use new heading font */
  font-weight: 700;
  font-size: 1.8rem; /* Consistent size */
  color: var(--text-light); /* White text initially */
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
  z-index: 2; /* Ensure logo is above menu */
}
.header.scrolled .logo {
    color: var(--primary-color); /* Primary color when scrolled */
}
.logo:hover,
.logo:focus-visible {
  transform: scale(1.02);
  color: color-mix(in srgb, var(--primary-color) 80%, black); /* Darker primary for hover */
}

.logo_icon {
  background-color: var(--text-light); /* White background for icon */
  width: 40px; /* Consistent size */
  height: 40px; /* Consistent size */
  border-radius: var(--border-radius-md); /* Consistent border-radius */
  margin-right: 0.6rem;
  transition: transform var(--transition-speed) ease;
}
.logo:hover .logo_icon {
  transform: rotate(5deg);
}

/* Hamburger Button (Mobile Only) - Consistent with other pages */
.hamburger {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10001; /* VERY high z-index to always be clickable on top of menu */
  transition: transform var(--transition-fast) ease;
}

.hamburger_line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-light); /* White lines initially */
  border-radius: 2px;
  transition: all var(--transition-speed) ease;
  margin: 5px 0;
}
/* ADDED: Hamburger lines become dark when header is scrolled */
.header.scrolled .hamburger_line {
    background-color: var(--text-primary); /* Dark lines when scrolled */
}


/* Hamburger active state (turns into X) */
.hamburger.is_active .hamburger_line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--text-light); /* White X on dark menu */
}
.hamburger.is_active .hamburger_line:nth-child(2) {
  opacity: 0;
}
.hamburger.is_active .hamburger_line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--text-light); /* White X on dark menu */
}


/* Navigation Menu (Desktop Default) - Consistent with other pages */
.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.8rem;
  flex-grow: 1; /* Allows nav to take available space for centering */
  justify-content: center; /* Centers items within the grown space */
  transition: all var(--transition-speed) ease;
}

.nav_link {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-light); /* White links initially */
  padding: 0.3rem 0.6rem;
  position: relative;
  transition: color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.header.scrolled .nav_link {
    color: var(--text-secondary); /* Muted gray when scrolled */
}

.nav_link.active {
    color: var(--tertiary-color); /* Yellow for active */
    font-weight: 600;
}
.header.scrolled .nav_link.active {
    color: var(--primary-color); /* Primary blue for active when scrolled */
}

.nav_link.active::after {
    width: 100%;
}

.nav_link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--tertiary-color); /* Yellow underline initially */
  transition: width var(--transition-fast) ease-out;
}
.header.scrolled .nav_link::after {
    background-color: var(--primary-color); /* Primary blue underline when scrolled */
}


.nav_link:hover::after,
.nav_link:focus-visible::after {
  width: 100%;
}
.nav_link:hover,
.nav_link:focus-visible {
  color: var(--tertiary-color); /* Yellow on hover */
  transform: translateY(-2px);
}
.header.scrolled .nav_link:hover,
.header.scrolled .nav_link:focus-visible {
    color: var(--primary-color); /* Primary blue on hover when scrolled */
}


/* Contact Button (in Header) - Consistent with other pages */
.contact_button {
  font-size: 0.95rem;
  color: var(--text-light);
  background: linear-gradient(
    45deg,
    var(--primary-color) 0%,
    color-mix(in srgb, var(--primary-color) 80%, white) 100%
  );
  border: none;
  border-radius: 2rem;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-left: 2rem;
  white-space: nowrap;
}

.contact_button:hover,
.contact_button:focus-visible {
  background: linear-gradient(
    45deg,
    color-mix(in srgb, var(--primary-color) 90%, black) 0%,
    var(--primary-color) 100%
  );
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
  outline: none;
}
.contact_button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
}


/* --- MAIN SECTION (HERO VIDEO) --- */
.main_section {
  position: relative;
  height: 90vh;
  min-height: 500px;
  display: flex;
  flex-direction: column; /* Allows heading to be centered vertically too */
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0 1.5rem; /* Consistent horizontal padding */
  color: var(--text-light); /* Ensure text is white */
}

.home_videos {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: -2;
}

.video_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55); /* Darker overlay for better text contrast */
  z-index: -1;
}

.heading_line {
  font-family: var(--font-heading); /* Use new heading font */
  color: var(--text-light);
  font-size: 4rem; /* Larger heading for impact */
  font-weight: 700;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.7); /* Stronger shadow for readability */
  z-index: 1;
  max-width: 900px; /* Limit width for better readability */
  margin: 0 auto;
  line-height: 1.2;
}


/* --- CARDS SECTION --- */
.cards_section {
    padding: 5rem 0; /* Consistent section padding */
    background-color: var(--background-light); /* Consistent section background */
}
.cards_section .container {
    padding-top: 0;
    padding-bottom: 0;
}

.section_heading {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3.5rem;
  position: relative;
  line-height: 1.2;
}
.section_heading span {
    color: var(--primary-color);
}
.section_heading::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.cards_grid { /* Renamed from .cards to avoid conflict with section class */
  display: grid;
  gap: 2.5rem; /* Consistent gap for grids */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
  justify-content: center;
}

.card_container {
  background: var(--background-alt); /* White background */
  border-radius: var(--border-radius-lg); /* Consistent border-radius */
  overflow: hidden;
  box-shadow: var(--shadow-sm); /* Subtle shadow */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color); /* Subtle border */
}

.card_container:hover {
  transform: translateY(-8px); /* Lift higher on hover */
  box-shadow: var(--shadow-md); /* Stronger shadow on hover */
  border-color: var(--primary-color); /* Highlight border on hover */
}

.card_image_container {
  position: relative;
  overflow: hidden;
  height: 12rem; /* Adjusted height for better proportions */
}

.card_image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease-in-out;
}

.card_container:hover .card_image {
  transform: scale(1.1); /* Slightly less aggressive zoom */
}

.card_title_container {
  padding: 1.5rem; /* More generous padding */
  flex-grow: 1;
}

.card_title_anchor {
    color: inherit; /* Inherit color, then change on hover */
    transition: color var(--transition-fast) ease;
}
.card_title_anchor:hover {
    color: var(--primary-color); /* Primary color on hover */
}

.card_title {
  font-family: var(--font-heading); /* Use heading font */
  font-size: 1.6rem; /* Consistent size */
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card_desc {
  font-size: 1rem; /* Consistent size */
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- CARD FOOTER STYLES --- */
.card_footer_container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem 1.5rem; /* More consistent padding */
  border-top: 1px solid var(--border-color); /* Use variable */
  margin-top: 0.5rem;
}

.author_container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author_avatar_container {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-sm); /* Subtle shadow */
}

.author_avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author_info_container {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.author_name {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.author_date {
  font-size: 0.75rem;
  color: var(--text-secondary); /* Muted color */
}

.card_tag_container {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-color); /* Primary color for tag text */
  background-color: color-mix(in srgb, var(--primary-color) 15%, white); /* Light tint of primary */
  border-radius: 1rem;
  padding: 0.3rem 0.8rem;
}

/* --- Footer Styles (Consistent with other pages) --- */
.site_footer {
    background-color: var(--background-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}


/* --- General Animations (Scroll Reveal) --- */
.scroll_reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll_reveal.is_visible {
  opacity: 1;
  transform: translateY(0);
}


/* --- MEDIA QUERIES --- */

/* For mobile header and navigation (max-width: 992px matches other pages) */
@media (max-width: 992px) {
  .header_content {
    padding: 0.75rem 1.5rem; /* Consistent padding */
    flex-wrap: nowrap; /* Prevent wrapping in header_content */
    justify-content: space-between;
  }

  .hamburger {
    display: block; /* Show hamburger button */
  }

  /* When header is scrolled, hamburger lines should be dark */
  .header.scrolled .hamburger_line {
      background-color: var(--text-primary);
  }


  /* Mobile menu overlay styles */
  .nav {
    position: fixed;
    top: 0;
    right: 0; /* Slide in from the right */
    width: clamp(250px, 75vw, 400px); /* Responsive width, not full screen */
    height: 100vh; /* MODIFIED: Explicitly 100% of viewport height */
    background-color: var(--background-dark); /* Using a very dark, solid background variable */
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: flex-start; /* MODIFIED: Align content from top to allow scrolling */
    align-items: center;
    padding: 5rem 1.5rem 2rem; /* Adjusted padding for top and bottom */
    transform: translateX(100%); /* Start off-screen to the right */
    opacity: 0;
    visibility: hidden;
    z-index: 99999; /* Increased z-index to ensure it's on top */
    box-shadow: -5px 0 15px rgba(0,0,0,0.2); /* Shadow for distinct edge */
    overflow-y: auto; /* ADDED: Enable vertical scrolling for menu content */
    transition: transform var(--transition-speed) ease-out, opacity var(--transition-speed) ease-out, visibility var(--transition-speed) ease-out;
  }

  .nav.active {
    transform: translateX(0); /* Slide in */
    opacity: 1;
    visibility: visible;
  }

  .nav_link {
    font-size: 1.2rem; /* Slightly smaller font size for mobile links */
    color: var(--text-light); /* White text on mobile menu background */
    padding: 1rem 0;
    width: 80%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
  }
  .nav_link:last-of-type {
      border-bottom: none;
  }
  .nav_link:hover {
      background-color: rgba(255, 255, 255, 0.1);
      color: var(--tertiary-color);
  }
  .nav_link.active {
      color: var(--tertiary-color);
  }
  .nav_link::after {
      background-color: var(--tertiary-color);
      bottom: -1px;
  }

  /* Prevent body scroll when mobile menu is active */
  body.no_scroll {
    overflow: hidden;
  }

  /* Contact button within mobile menu */
  .contact_button {
    display: block; /* Show in mobile menu */
    margin-top: 2rem;
    margin-left: 0;
    font-size: 1rem; /* Slightly smaller font size for mobile button */
    padding: 1rem 2rem;
    min-width: 200px;
    color: var(--text-light);
    background: linear-gradient(
        45deg,
        var(--accent-color) 0%,
        color-mix(in srgb, var(--accent-color) 80%, black) 100%
    );
    box-shadow: var(--shadow-md);
  }
  .contact_button:hover {
    background: linear-gradient(
        45deg,
        color-mix(in srgb, var(--accent-color) 90%, black) 0%,
        var(--accent-color) 100%
    );
  }
  .contact_button:active {
      transform: translateY(0) scale(0.98);
      box-shadow: var(--shadow-sm);
  }
}

/* Adjust heading size for smaller screens */
@media (max-width: 768px) {
  .heading_line {
    font-size: 3rem; /* Slightly smaller for tablets */
  }
  .section_heading {
      font-size: 2.2rem;
      margin-bottom: 2.5rem;
  }
  .section_heading::after {
      width: 60px;
  }
  .card_image_container {
      height: 14rem; /* Adjust height for tablets */
  }
  .card_title {
      font-size: 1.4rem;
  }
  .card_desc {
      font-size: 0.9rem;
  }
  .cards_grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Allow two columns if space, otherwise one */
    gap: 2rem;
  }
  .card_container {
      padding: 1rem;
  }
  .card_title_container {
      padding: 1rem;
  }
  .card_footer_container {
      padding: 0.5rem 1rem 1rem;
  }
}

@media (max-width: 600px) {
  .cards_grid {
    grid-template-columns: 1fr; /* Force single column on smaller mobile */
    gap: 1.5rem;
  }
}


@media (max-width: 480px) {
  .header_content {
    padding: 0.5rem 1rem;
  }
  .logo {
    font-size: 1.6rem;
  }
  .logo_icon {
    width: 35px;
    height: 35px;
  }

  .main_section {
      height: 80vh;
      min-height: 400px;
      padding: 0 1rem;
  }
  .heading_line {
    font-size: 2.2rem; /* Even smaller for very small phones */
  }
  .section_heading {
      font-size: 1.8rem;
      margin-bottom: 2rem;
  }
  .section_heading::after {
      width: 50px;
  }
  .card_image_container {
      height: 10rem; /* Smallest height for cards */
  }
  .card_title {
      font-size: 1.3rem;
  }
  .card_desc {
      font-size: 0.85rem;
  }
}
