/*
========================================
  1. SETUP & GLOBAL STYLES
========================================
*/

/* --- CSS Variables (Theme) --- */
:root {
  /* Colors */
  --color-primary: #3b82f6;
  --color-secondary: #10b981;
  --color-text: #334155;
  --color-heading: #0f172a;
  --color-bg: #f1f5f9;
  --color-card: #ffffff;
  --color-border: #d1d5db;
  --color-hover-bg-light: #e5e7eb;

  /* Fonts */
  --font-sans: "Poppins", sans-serif;

  /* Sizing */
  --navbar-height: 4rem;
}

html.dark {
  --color-primary: #60a5fa;
  --color-secondary: #34d399;
  --color-text: #e2e8f0;
  --color-heading: #f8fafc;
  --color-bg: #0f172a;
  --color-card: #1e293b;
  --color-border: #4b5563;
  --color-hover-bg-light: #374151;
}

/* --- Global Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}
html.scroll-smooth {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 3rem;
  padding-right: 3rem;
}
.hidden {
  display: none !important;
}
.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--color-heading);
}
.text-highlight {
  color: var(--color-primary);
}
html.dark .text-highlight {
  color: var(--color-secondary);
}

/*
========================================
  2. NAVIGATION BAR
========================================
*/
.navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  z-index: 50;
  top: 0;
  transition: background-color 0.3s ease;
}
html.dark .navbar {
  background-color: rgba(30, 41, 59, 0.8);
}
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--navbar-height);
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 3rem;
  padding-right: 3rem;
}
.navbar-brand {
  flex-shrink: 0;
}
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.logo-link:hover {
  opacity: 0.8;
}
.logo-img {
  height: 2rem;
  width: auto;
  margin-right: 0.5rem;
}
.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}
html.dark .logo-text {
  color: var(--color-secondary);
}
.logo-text-secondary {
  color: var(--color-heading);
}
.desktop-nav {
  display: none;
}
.nav-link {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s ease;
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}
html.dark .nav-link:hover,
html.dark .nav-link.active {
  color: var(--color-secondary);
}
.nav-link.active {
  font-weight: 600;
}
.nav-actions {
  display: flex;
  align-items: center;
}
.theme-toggle,
.mobile-menu-toggle {
  background: transparent;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 9999px;
  transition: background-color 0.3s ease;
}
.theme-toggle:hover,
.mobile-menu-toggle:hover {
  background-color: var(--color-hover-bg-light);
}
.theme-toggle {
  margin-left: 1rem;
}
.theme-toggle .fas {
  font-size: 1.25rem;
}
.mobile-menu-toggle-wrapper {
  margin-left: 0.5rem;
}
.mobile-menu-toggle .fas {
  font-size: 1.5rem;
}
.mobile-menu {
  display: none;
}
.mobile-menu-links {
  padding: 0.5rem 0.75rem 0.75rem;
}
.nav-link-mobile {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
}
.mobile-menu-links > * + * {
  margin-top: 0.25rem;
}

/*
========================================
  3. HERO SECTION
========================================
*/
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
  background-image: linear-gradient(to bottom right, #eff6ff, #ffffff, #ecfdf5);
  overflow: hidden;
}
html.dark .hero {
  background: var(--color-bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-content {
  text-align: center;
  z-index: 10;
}
.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
}
html.dark .hero-subtitle {
  color: var(--color-secondary);
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0.75rem 0;
}
.hero-tagline {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero-typed-text {
  font-weight: 600;
  color: var(--color-primary);
}
html.dark .hero-typed-text {
  color: var(--color-secondary);
}
.hero-description {
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 auto 2rem;
}
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.hero-socials {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.social-link {
  color: var(--color-text);
  font-size: 1.5rem;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}
.social-link:hover {
  color: var(--color-primary);
  transform: scale(1.25);
}
html.dark .social-link:hover {
  color: var(--color-secondary);
}
.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-image-container {
  position: relative;
  width: 18rem;
  height: 18rem;
}
.hero-image-blob {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    to bottom right,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 9999px;
  opacity: 0.6;
  filter: blur(24px);
  animation: float 6s ease-in-out infinite;
}
html.dark .hero-image-blob {
  opacity: 0.4;
}
.hero-image {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 4px solid var(--color-card);
  animation: float 6s ease-in-out infinite 0.5s;
}

/*
========================================
  4. BUTTONS & FORMS
========================================
*/
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background-image: linear-gradient(
    to right,
    var(--color-primary),
    var(--color-secondary)
  );
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}
html.dark .btn-primary:hover {
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}
.btn-secondary {
  background-color: var(--color-card);
  color: var(--color-heading);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-secondary:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px) scale(1.05);
}
.btn.small {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
}
.btn i {
  margin-left: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  color: var(--color-text);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--color-primary);
}
html.dark .form-input:focus {
  box-shadow: 0 0 0 2px var(--color-secondary);
}

/*
========================================
  5. ANIMATIONS
========================================
*/
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}
.typed-cursor {
  opacity: 1;
  animation: blink 0.7s infinite;
}

/*
========================================
  6. RESPONSIVE BREAKPOINTS
========================================
*/
@media (min-width: 768px) {
  /* md */
  .container {
    padding: 0 1.5rem;
  }
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  .mobile-menu-toggle-wrapper {
    display: none;
  }
  .hero {
    padding-top: 8rem;
  }
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
  .hero-content {
    text-align: left;
  }
  .hero-description {
    margin-left: 0;
  }
  .hero-buttons,
  .hero-socials {
    justify-content: center;
  }
  .hero-image-container {
    width: 20rem;
    height: 20rem;
  }
  .hero-title {
    font-size: 3rem;
  }
  .hero-tagline {
    font-size: 1.875rem;
  }
}

@media (min-width: 1024px) {
  /* lg */
  .container {
    padding: 0 2rem;
  }
  .hero-title {
    font-size: 3.75rem;
  }
  .hero-image-container {
    width: 24rem;
    height: 24rem;
  }
}
/*
========================================
  SECTIONS & CARDS (Generic Styles)
========================================
*/
.section-bg {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background-color: var(--color-bg);
}

.section-card {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background-color: var(--color-card);
}

.section-divider-wrapper {
  margin-bottom: 3rem;
  margin-top: -3rem;
}
.section-divider-wrapper.top {
  transform: rotate(180deg);
}

/*
========================================
  CONTACT SECTION STYLES
========================================
*/
.contact-card {
  background-color: var(--color-card);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-width: 48rem;
  margin: 0 auto;
}

.contact-intro {
  text-align: center;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}
.form-grid .form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.g-recaptcha-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 78px; /* Default height of reCAPTCHA */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

.g-recaptcha {
  transform: scale(0.85);
  transform-origin: center;
}
.form-submit-wrapper {
  text-align: center;
}

.form-status {
  text-align: center;
  margin-top: 1rem;
  font-weight: 500;
}

.contact-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.contact-footer-text {
  margin-bottom: 0.5rem;
}

.contact-email-link {
  display: inline-block;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
html.dark .contact-email-link {
  color: var(--color-secondary);
}
.contact-email-link:hover {
  text-decoration: underline;
}
.contact-email-link i {
  margin-right: 0.5rem;
}

/* --- Responsive grid for the form --- */
@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/*
========================================
  ABOUT ME SECTION
========================================
*/
.about-section {
  position: relative;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.about-image-wrapper {
  display: flex;
  justify-content: center;
}

.about-image {
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s ease;
}

.about-image:hover {
  transform: scale(1.05);
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content p:last-of-type {
  margin-bottom: 0;
}

.about-button-wrapper {
  margin-top: 2rem;
}

/* --- Responsive styles for the About Me section --- */
@media (min-width: 768px) {
  /* md breakpoint */
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }

  .about-image-wrapper {
    justify-content: flex-start;
  }

  .about-image {
    max-width: 24rem;
  }

  .about-content {
    grid-column: span 2;
  }
}
/*
========================================
  SCROLL TO TOP BUTTON
========================================
*/
.scroll-top-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
    background-color 0.3s ease;
}

html.dark .scroll-top-btn {
  background-color: var(--color-secondary);
}

.scroll-top-btn .fas {
  font-size: 1.5rem;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.scroll-top-btn:hover {
  filter: brightness(90%);
  transform: scale(1.1);
}
/*
========================================
  FOOTER SECTION
========================================
*/
.footer {
  background-color: #e2e8f0;
  color: #475569;
  padding-top: 2rem;
  padding-bottom: 2rem;
  transition: background-color 0.4s ease, color 0.4s ease;
}

html.dark .footer {
  background-color: #1e293b;
  color: #e2e8f0;
}

.footer-container {
  text-align: center;
}

.footer-subtext {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.footer-heart {
  color: #ef4444;
}
/*
========================================
  CUSTOM SCROLLBAR
========================================
*/
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 20px;
}

html.dark ::-webkit-scrollbar-thumb {
  background-color: var(--color-secondary);
}
