/*
 * Kandiyero Consultancy - Custom Styles
 * Professional, Modern, Simple Black & Gold Theme (with 3D Flip Portfolio)
 * --------------------------------------------
 */

/* 1. Variable Definitions (The Black & Gold Palette) */
:root {
  --primary: #0a0a0a; /* Deep, near-black for backgrounds and text */
  --secondary: #d4af37; /* Rich, professional gold for accents and CTAs */
  --text-dark: #f0f0f0; /* Light text for dark backgrounds */
  --text-light: #1f2937; /* Dark text for light backgrounds (body copy) */
  --muted: #6b7280; /* Grey for supporting text */
  --card-bg: #ffffff; /* White card background for contrast */
  --border: #e5e7eb; /* Light border for subtle separation */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* 2. Global Resets and Typography */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
  background-color: #fff;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary); /* Gold hover on dark text */
}

/* 3. Layout and Utility Classes */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem; /* Added default padding for all containers */
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Subtle shadow for a modern lift */
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px); /* Subtle hover effect */
}

/* Fade-in animation for modern effect */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}
/* Assign a delay to subsequent elements */
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }


/* 4. Buttons and Call-to-Action */
.btn-cta {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--secondary); /* Solid Gold */
  color: var(--primary); /* Black text on Gold */
  font-weight: 600;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.3s ease, transform 0.1s ease;
  border: 2px solid var(--secondary);
}

.btn-cta:hover {
  background-color: #c9a531; /* Slightly darker gold on hover */
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-block;
  padding: 12px 28px;
  background-color: transparent;
  color: var(--primary);
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid var(--primary); /* Black border */
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* New style for an alternate ghost button (less prominent "Back to Home") */
.btn-ghost-alt {
  display: inline-block;
  padding: 12px 20px; /* Slightly smaller padding */
  background-color: transparent;
  color: var(--muted); /* Muted gray text */
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border); /* Light border */
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.btn-ghost-alt:hover {
  background-color: var(--border);
  color: var(--primary);
  border-color: var(--border);
}


/* 5. Header / Navigation */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #fff; /* White header background */
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.header-wrapper.shrink {
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 15px 1rem;
}

.logo-placeholder img {
  height: 35px; /* Modern logo size */
  width: auto;
}

.main-nav {
  display: flex;
  gap: 25px;
  font-weight: 600;
}

.main-nav a {
  padding: 5px 0;
  position: relative;
}

.main-nav a::after { /* Underline effect for modern touch */
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.main-nav a:hover::after {
  width: 100%;
}

.actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--primary);
  display: none; /* Hidden on desktop */
}

/* 6. Hero Section (Uses a dark/black background) */
.hero {
  background-color: var(--primary); /* Deep Black background */
  color: var(--text-dark); /* Light text */
  padding: 100px 0;
  text-align: center;
}

.hero h1 {
  color: var(--secondary); /* Gold heading for contrast */
  max-width: 800px;
  margin: 0 auto 15px auto;
  font-size: 3rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

.hero .btn-cta {
  background-color: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}


/* 7. Portfolio Images (3D Flip Effect) */

/* The container establishes the 3D space */
.flip-card {
  background-color: transparent;
  width: 100%;
  height: 300px; /* Set a fixed height for all cards */
  perspective: 1000px; /* Perspective for 3D effect */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* The actual flipping element */
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s; /* Duration of the flip */
  transform-style: preserve-3d;
  border-radius: 12px;
}

/* Do the flip on hover */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Position both front and back sides */
.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden; /* Hide the back side until flipped */
  border-radius: 12px;
  overflow: hidden;
}

/* Front side (Image) */
.flip-card-front {
  background-color: var(--card-bg);
  color: var(--primary);
  display: flex;
  align-items: flex-end; /* Align title to the bottom */
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.title-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 15px;
  background: rgba(0, 0, 0, 0.75); /* Dark readable background */
  color: var(--secondary); /* Gold text for high contrast */
  font-size: 1.2rem;
  font-weight: 700;
  text-align: left;
}


/* Back side (Content) */
.flip-card-back {
  background-color: var(--primary); /* Black background for back */
  color: var(--text-dark); /* Light text on black */
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 30px;
  text-align: left;
}

.flip-card-back h3 {
  color: var(--secondary); /* Gold heading on dark background */
  margin-bottom: 10px;
}
.flip-card-back p {
  color: var(--text-dark);
  font-size: 0.95rem;
}


/* 8. Testimonials */
.testimonial {
  background-color: var(--card-bg);
  padding: 24px;
  border-left: 5px solid var(--secondary); /* Gold accent border */
  border-radius: 0 12px 12px 0; /* Only right corners rounded for a clean look */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 9. Contact Form Styles */
/* Standardized for professionalism */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  border-color: var(--secondary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* 10. Footer */
.site-footer {
  background-color: var(--primary); /* Deep Black Footer */
  color: var(--muted); /* Muted gray text */
  padding: 25px 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--secondary); /* Gold links */
  font-weight: 600;
}

.site-footer a:hover {
  color: #fff;
}


/* 11. Media Queries (Mobile Responsiveness) */
@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-2 > div:last-child {
    order: -1; /* Image/visual goes above text on mobile */
  }
  .grid-2 img {
    max-height: 300px;
  }
  .flip-card {
    height: 250px; /* Shorter cards on tablet/mobile */
  }
}

@media (max-width: 768px) {
  .main-nav, .actions .btn-cta {
    display: none; /* Hide desktop nav and CTA */
  }

  .mobile-toggle {
    display: block; /* Show mobile menu button */
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; margin-bottom: 1rem; }

  .hero {
    padding: 80px 0;
  }

  .header-inner {
    padding: 10px 1rem;
  }

  .actions a, .actions button { /* Ensure actions are spaced correctly on mobile */
      margin: 0;
  }

  .actions .btn-ghost-alt {
      padding: 10px 15px;
      font-size: 0.9rem;
  }

  /* Disable flip effect on mobile devices to prevent unwanted activation/touch issues */
  .flip-card:hover .flip-card-inner {
    transform: none;
  }
  .flip-card-back {
    display: none; /* Hide back side on mobile */
  }
  .title-overlay {
    background: rgba(0, 0, 0, 0.5); /* Lighter overlay for better visibility */
  }
}

/* Mobile Menu Specific Styles */
#mobileModal {
  position: absolute;
  width: 100%;
  left: 0;
  top: 60px; /* Adjust based on header height */
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--border);
}

#mobileModal a {
  display: block;
  padding: 12px 0;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 1px dashed var(--border);
}

#mobileModal a:last-child {
  border-bottom: none;
  margin-top: 15px;
}