/*
  ============================================================
  STYLES.CSS
  
  Author: Mokwa Moffat Ohuru
  Description: This stylesheet contains the styles for the 
               professional portfolio of Mokwa Moffat Ohuru.
  ============================================================
*/

/* 
  ============================================================
  1. CSS VARIABLES & GLOBAL STYLES
  ============================================================
*/
:root {
  /* Theme Colors */
  --page-bg: #0f172a; /* Dark blue background */
  --section-bg: rgba(30, 41, 59, 0.5); /* Semi-transparent section background */
  --text-primary: #f8fafc;
  --link-primary: #38bdf8; /* Bright blue for links */
  --link-hover: #7dd3fc; /* Lighter blue for hover */
  --footer-bg: #0f172a;
  --footer-text: #f8fafc;
  --shadow-color: rgba(0, 0, 0, 0.6);
  --gradient-start: #38bdf8;
  --gradient-end: #818cf8;

  /* Responsive Spacing Variables */
  --section-padding-x: clamp(30px, 5vw, 50px);
  --section-padding-y: clamp(40px, 5vw, 60px);
  --section-margin-x: clamp(30px, 5vw, 50px);
  --section-margin-bottom: clamp(40px, 5vw, 60px);
  --nav-padding-x: clamp(30px, 5vw, 50px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  color: var(--text-primary);
  max-width: 1400px;
  margin: 0 auto;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh; /* Ensure body always takes full viewport height */
}

/* Main content fade-in animation */
.content-fade-in {
  animation: fadeIn 1s ease-out forwards;
  opacity: 0; /* Start invisible */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--page-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--link-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--link-hover);
}

/* Animated Gradient Background */
 @keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Scroll-Triggered Animations */
 @keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  padding: var(--section-padding-y) var(--section-padding-x);
  margin: 0 var(--section-margin-x) var(--section-margin-bottom);
  background-color: var(--section-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  animation: slide-in 1s ease-out forwards;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  section {
    animation: none !important;
  }

  * {
    transition: none !important;
  }

  .skills-section .cells .cell:hover,
  .projects-section .project:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .nav__links a::after {
    transition: none !important;
  }

  .nav__links a:hover {
    color: var(--link-hover);
  }

  .hero-section .headshot img {
    transition: none !important;
  }

  footer .footer-right a {
    transition: none !important;
  }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
}

a {
  color: var(--link-primary);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

/* Enhanced Accessibility: Focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--link-hover);
  outline-offset: 4px;
  border-radius: 4px;
}

/* 
  ============================================================
  2. NAVBAR
  ============================================================
*/

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--link-primary);
  color: var(--page-bg);
  padding: 8px;
  z-index: 9999;
  transition: top 0.3s ease-in-out;
}

.skip-link:focus {
  top: 0;
}
nav {
  /* Glassmorphism effect */
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);

  /* Layout and positioning */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 8px var(--shadow-color);
  padding: 0 var(--nav-padding-x);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav__logo a {
    font-size: 26px;
    font-weight: 700;
    color: var(--link-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(15px, 2vw, 20px);
}

.nav__links a {
  color: var(--text-primary);
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
  margin-inline-start: 0;
  font-size: clamp(1rem, 2vw, 1.1rem);
}

/* Underline animation on hover */
.nav__links a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background-color: var(--link-hover);
  bottom: -5px;
  left: 0;
  transition: width 0.3s ease;
}

.nav__links a:hover::after {
  width: 100%;
}

.nav__links a:hover {
  color: var(--link-hover);
}

  .nav__links a span {
  margin-inline-start: 5px;
}

/* CSS-only Hamburger Menu */
.hamburger-toggle {
  display: none;
}

.hamburger-icon {
  display: none;
  cursor: pointer;
  font-size: 24px;
}

/* 
  ============================================================
  3. SECTIONS
  ============================================================
*/
section {
  padding: var(--section-padding-y) var(--section-padding-x);
  margin: 0 var(--section-margin-x) var(--section-margin-bottom);
  background-color: var(--section-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Fluid Typography for Headings */
h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: clamp(30px, 5vw, 40px);
    text-align: center;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    background-clip: text;
    color: transparent;
}

/* 
  ============================================================
  4. HERO SECTION
  ============================================================
*/
.hero-section {
  /* Layout and positioning */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  margin-top: 50px;
  
  /* Transparent background to blend with the body */
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  text-align: left;
}

.hero-section .text {
    flex: 1;
}

.hero-section .text h1 {
  text-align: left;
  /* Gradient text effect */
  background: linear-gradient(90deg, #f8fafc, #a7b2c1);
  background-clip: text;
  color: transparent;
}

.hero-section .headshot {
    flex-shrink: 0;
    position: relative;
}

.hero-headshot-img {
  width: clamp(250px, 30vw, 350px);
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 3px solid var(--link-primary);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
  animation: pulse 2s infinite;
  object-fit: cover;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.8);
  }
  100% {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
  }
}

/* 
  ============================================================
  5. CARDS (Skills, Projects, etc.)
  ============================================================
*/
.skills-section .cells .cell,
.projects-section .project {
  background-color: var(--section-bg);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  border-radius: 12px;
  padding: 25px;
  margin: 10px;
  transform-style: preserve-3d;
}

.skills-section .cells .cell:hover,
.projects-section .project:hover {
  transform: perspective(1000px) rotateY(5deg) rotateX(5deg) scale(1.05) translateZ(0);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--link-hover);
}

.skills-section .cells {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.skills-section .cells .cell {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 15px);
  flex: 1 1 200px; /* Allow items to grow and shrink, with a base of 200px */
  max-width: 250px; /* Prevent cells from becoming too wide on large screens */
}

.skills-section .cells .cell img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

.projects-section .project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 40vw, 350px), 1fr));
  gap: clamp(20px, 4vw, 30px);
}

.projects-section .project h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin-bottom: 10px;
    color: var(--link-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.projects-section .project h3 .project-icon {
    color: var(--link-hover);
    font-size: 20px;
}

/* 
  ============================================================
  6. BUTTONS & LINKS
  ============================================================
*/
.hero-section .text .links a,
.contact-section form button,
.education-section .education-item a {
  background: linear-gradient(90deg, var(--link-primary), var(--link-hover));
  color: #0f172a;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.hero-section .text .links a:hover,
.contact-section form button:hover,
.education-section .education-item a:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.5);
  color: #0f172a;
  text-decoration: none;
}

.hero-section .text .links {
  margin-top: 25px;
}

.hero-section .text .links a {
  margin-inline-end: 10px;
  margin-bottom: 10px;
}

/* 
  ============================================================
  7. OTHER SECTIONS (Testimony, Contact)
  ============================================================
*/
/* Testimonial Carousel Styles */
#testimonials {
  background-color: var(--page-bg); /* dark blue background */
  padding: 50px 20px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary); /* default text color */
}
.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}
.testimonial-carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}
.carousel-slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.testimonial-carousel input[name="testimonial"] {
  position: absolute;
  opacity: 0;
}
/* Testimonial card style */
.testimonial-card {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: clamp(20px, 4vw, 30px);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-primary); /* text inside card */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(250px, 40vh, 350px);
  overflow: hidden; /* Ensure content is clipped if it overflows */
}
.testimonial-img {
  display: block;
  flex-shrink: 0;
  width: clamp(80px, 20vw, 150px); /* Adjusted for better scaling */
  height: clamp(80px, 20vw, 150px); /* Adjusted for better scaling */
  min-width: 80px; /* Prevent image from becoming too small */
  max-width: 100%;
  aspect-ratio: 1/1; /* Maintain 1:1 aspect ratio */
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: clamp(0.8rem, 1.5vw, 1.5rem);
  border: 3px solid var(--link-primary);
}
.testimonial-text {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  margin-bottom: clamp(0.8rem, 1.5vw, 1.5rem);
  line-height: 1.4;
  color: var(--text-primary);
}
.testimonial-author {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  font-weight: 600;
  color: var(--text-primary);
}
/* Dot navigation style */
.carousel-dots {
  margin-top: 20px;
}
.carousel-dots label {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}
.carousel-dots label:hover,
.carousel-dots label:focus {
  background: var(--text-primary);
  outline: none;
}
/* Slide navigation via radio buttons */
#testimonial1:checked ~ .carousel-slides {
  transform: translateX(0%);
}
#testimonial2:checked ~ .carousel-slides {
  transform: translateX(-100%);
}
#testimonial3:checked ~ .carousel-slides {
  transform: translateX(-200%);
}
/* Active dot highlight */
#testimonial1:checked ~ .carousel-dots label[for="testimonial1"],
#testimonial2:checked ~ .carousel-dots label[for="testimonial2"],
#testimonial3:checked ~ .carousel-dots label[for="testimonial3"] {
  background: var(--link-primary);
}
/* Responsive adjustments */
 @media (min-width: 600px) {
  .testimonial-img {
    width: 120px;
    height: 120px;
  }
}
 @media (min-width: 1024px) {
  .testimonial-img {
    width: 150px;
    height: 150px;
  }
  .testimonial-card {
    min-height: 350px;
  }
}

/* Project Section Styles */
.projects-section {
  padding: 50px 20px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  background-color: var(--page-bg); /* Dark blue background */
  color: var(--text-primary);
}

.projects-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 40vw, 350px), 1fr));
  gap: clamp(20px, 4vw, 30px);
}

.project {
  background: var(--section-bg); /* Glassmorphism effect */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 30px;
  text-align: left;
  color: var(--text-primary);
  transition: transform 0.3s ease;
}

.project:hover {
  transform: translateY(-5px);
}

.project h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.project h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.project h3 a:hover {
  text-decoration: underline;
}

.project-icon {
  margin-inline-end: 10px;
  color: var(--link-primary); /* A contrasting color for icons */
}

.project p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.project ul {
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
}

.project ul li::before {
  content: '•'; /* Custom bullet point */
  color: var(--link-primary);
  position: absolute;
  left: 0;
}

.project a {
  display: inline-block;
  background-color: var(--link-primary);
  color: var(--page-bg);
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

.project a:hover {
  background-color: var(--link-hover);
}

/* Responsive adjustments for projects */
@media (min-width: 768px) {
  .project-list {
    grid-template-columns: 1fr 1fr; /* Two columns on medium screens */
  }
}

@media (min-width: 1024px) {
  .project-list {
    grid-template-columns: 1fr 1fr; /* Two columns on large screens */
  }
}

/* Contact Section Styles */
.contact-section .group {
  display: flex;
  gap: clamp(20px, 5vw, 50px);
  align-items: flex-start;
}

.contact-section .group .text {
    flex: 1;
}

.contact-section .group form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Floating Labels for Contact Form */
.form-group {
  position: relative;
  margin-bottom: 30px;
}

.form-group input,
.form-group textarea {
  font-family: 'Poppins', sans-serif;
  border: 2px solid transparent;
  background-color: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  padding: 15px;
  outline: none;
  resize: none;
  border-radius: 8px;
  width: 100%;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-group label {
  position: absolute;
  top: 15px;
  left: 15px;
  color: var(--text-primary);
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
  top: -10px;
  left: 10px;
  font-size: 12px;
  color: var(--link-primary);
  background-color: var(--page-bg);
  padding: 0 5px;
}

.contact-section .group form button {
    width: 100%;
}

/* Form input focus styles */
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--link-primary);
  background-color: rgba(15, 23, 42, 0.9);
}

/* Footer Styles */
footer {
  /* Layout and positioning */
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 25px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

footer .footer-left p {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

footer .footer-right a {
  color: var(--footer-text);
  margin-inline-start: 12px;
  font-size: 18px;
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-flex;
  align-items: center;
}

footer .footer-right ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
}

footer .footer-right li {
  display: inline-block;
}

footer .footer-right a:first-child {
  margin-inline-start: 0;
}

/* Hover effect for social media icons */
footer .footer-right a:hover,
footer .footer-right a:focus-visible {
  color: var(--link-hover);
  transform: scale(1.2);
  outline: none;
}

/* Media Queries */
@media (max-width: 768px) {
  nav {
      padding: 0 30px;
      justify-content: space-between;
  }

  .hamburger-icon {
    display: block;
    z-index: 1001;
    order: 2; /* Ensure hamburger is on the right */
  }

  .nav__links {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
  }

  .nav__links a {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav__links a:hover {
    background-color: var(--link-primary);
    color: #0f172a;
  }

  /* The "checkbox hack" for the hamburger menu */
  .hamburger-toggle:checked ~ .nav__links {
    max-height: 500px; /* Adjust as needed */
  }

  section {
    padding: 40px 30px;
    margin: 0 20px 40px;
  }

  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
    gap: 30px;
  }

  .hero-section .text h1 {
      text-align: center;
  }

  .contact-section .group {
    flex-direction: column;
  }

  footer {
    flex-direction: column;
    gap: 20px;
    padding: 20px 15px;
    text-align: center;
  }
  footer .footer-right {
    margin-top: 10px;
  }
}

@media (max-width: 600px) {
  nav {
    padding: 0 20px;
  }

  .nav__links a span {
    display: inline-block;
  }

  .nav__links a {
    font-size: 18px;
    margin-inline-start: 0;
  }

  section {
      padding: 30px 20px;
      margin: 0 15px 30px;
  }

  .hero-section .headshot img {
    width: 250px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Times New Roman', Times, serif;
  }

  nav, footer, .hero-section .links, .contact-section form button {
    display: none !important;
  }

  section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    margin: 0 0 20px 0 !important;
    padding: 20px !important;
  }

  h1, h2, h3 {
    color: #000000 !important;
    background: none !important;
  }

  a {
    color: #0000ff !important;
    text-decoration: underline !important;
  }
}