/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
  --color-white: #ffffff;
  --color-nude: #F4EBE3;
  --color-nude-dark: #e8d8c8;
  --color-red: #9e1b32;
  --color-red-dark: #7A1828;
  --color-text: #2C2C2C;
  --color-text-light: #525252;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Standard Spacing System */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 4rem;
}

html {
  scroll-behavior: smooth;
  background-color: var(--color-nude);
  padding: var(--space-sm);
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-white);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  margin: 0;
  padding-bottom: var(--space-xl);
  /* Page is a floating card inside html padding */
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  min-height: calc(100vh - calc(var(--space-sm) * 2));
}

/* Sticky Header */
.sticky-header {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-xl));
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.95); /* Header is a ribbon from the start */
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid transparent; /* No border at first */
  border-radius: 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); /* Soft shadow maintained */
  transition: all 0.4s ease;
}

.sticky-header.scrolled {
  border-color: var(--color-nude-dark); /* Border appears after scroll */
}

.sticky-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  width: 100%;
}

.sticky-brand {
  display: flex;
  flex-direction: column;
}

.sticky-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-red);
  line-height: 1.1;
}

.sticky-contact {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
}

.sticky-header.scrolled .sticky-contact {
  opacity: 1;
  max-height: 50px;
  margin-top: 0.2rem;
}

.sticky-contact a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.sticky-contact a:hover {
  color: var(--color-red);
}

.hero-contact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.contact-pill:hover {
  color: var(--color-red);
  transform: translateX(5px);
}

.sticky-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}



.sticky-nav a {
  text-decoration: none;
  color: var(--color-red);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  padding: 0.5rem 1.4rem;
  border-radius: 30px;
  background: var(--color-nude);
  transition: all 0.3s ease;
}

.sticky-nav a:hover {
  background-color: var(--color-red);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(158, 27, 50, 0.2);
}

@media (max-width: 768px) {
  html {
    padding: var(--space-xs);
  }
  
  body {
    margin: 0;
    padding-bottom: var(--space-lg);
    border-radius: 20px;
    min-height: calc(100vh - calc(var(--space-xs) * 2));
  }

  .sticky-header {
    width: calc(100% - var(--space-sm));
    padding: var(--space-sm);
    top: 1.25rem;
  }

  .sticky-header-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }

  .sticky-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  .sticky-nav a {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .hero {
    min-height: auto;
    border-radius: 20px;
    padding: calc(var(--space-xxl) * 2.5) 5% var(--space-lg); /* Compensate missing body padding */
  }
}

@media (max-width: 968px) {
  .hero-top-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-contact {
    align-items: center;
  }

  .hero-content {
    order: 2;
    align-items: center;
  }

  .hero-image-wrapper {
    order: 1;
  }

  .hero-title {
    font-size: clamp(2.5rem, 8vw, 3rem);
  }

  .hero-subtitle {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-about {
    text-align: left;
  }

  .hero-image {
    max-width: 350px;
    box-shadow: 15px 15px 0px var(--color-nude-dark), 30px 30px 0px rgba(158, 27, 50, 0.1);
  }
}

/* Sections */
.hero {
  min-height: calc(100vh - var(--space-xxl) - var(--space-md));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 5% var(--space-lg);
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-nude) 100%);
  border-radius: 40px;
  margin-bottom: var(--space-lg);
}

.hero-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxl);
  max-width: 1200px;
  width: 100%;
}

.hero-top-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero-title span {
  color: var(--color-red);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--color-text-light);
  line-height: 1.5;
  margin-top: 0.5rem;
  max-width: 90%;
}

.download-btn {
  background-color: var(--color-red);
  color: var(--color-white) !important;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: var(--space-sm);
  box-shadow: 0 4px 15px rgba(158, 27, 50, 0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.download-btn:hover {
  background-color: var(--color-red-dark);
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(158, 27, 50, 0.4);
}

.about-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1rem;
}

.about-label {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-red);
  font-weight: 600;
}

.hero-about {
  font-size: 1.125rem;
  color: var(--color-text-light);
  line-height: 1.8;
  background: transparent;
  text-align: justify;
}

.hero-about p {
  margin-bottom: 0.5rem;
}

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1.5s ease forwards;
}

.hero-image {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 30px;
  box-shadow: 20px 20px 0px var(--color-nude-dark), 40px 40px 0px rgba(158, 27, 50, 0.1);
  z-index: 2;
  transition: transform 0.4s ease;
}

.hero-image:hover {
  transform: translateY(-10px);
}

/* Info Section (info.html moved to index.html) */

.info-content {
  max-width: 1200px; /* Match hero max-width */
  margin: var(--space-xl) auto;
  padding: 0 5%;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  animation: slideUp 0.8s ease forwards;
}



.info-card {
  background: var(--color-white);
  border-radius: 24px;
  padding: var(--space-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-nude);
  transition: transform 0.3s ease;
  height: 100%; /* Ensure cards match height in grid */
  display: flex;
  flex-direction: column;
}

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

.info-card h2 {
  font-family: var(--font-heading);
  color: var(--color-text);
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-item span {
  font-weight: 500;
  color: var(--color-text);
}

.skill-bar {
  height: 8px;
  background: var(--color-nude-dark);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--color-red);
  border-radius: 4px;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* Resume Specific Styles */
.resume-section {
  margin-bottom: 2.5rem;
}

.resume-section h3 {
  font-family: var(--font-heading);
  color: var(--color-red);
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-nude);
  padding-bottom: var(--space-xs);
  scroll-margin-top: 100px;
}

.resume-item {
  margin-bottom: 2rem;
}

.resume-item p, .accordion-content p {
  text-align: justify;
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.resume-item-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
}

.resume-item-subtitle {
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 0.75rem;
  display: block;
}

.resume-item-date {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 0.9rem;
  background: var(--color-nude);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
}

.resume-list {
  list-style-type: disc;
  margin-left: 0;
  padding-left: var(--space-md);
  color: var(--color-text-light);
  line-height: 1.6;
}

.resume-list li {
  margin-bottom: 0.5rem;
  text-align: justify;
}

.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.badge {
  background: var(--color-nude);
  color: var(--color-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--color-nude-dark);
}

.badge-red {
  background: rgba(158, 27, 50, 0.1);
  color: var(--color-red);
  border-color: rgba(158, 27, 50, 0.2);
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  color: var(--color-text-light);
}

.contact-info a {
  color: var(--color-red);
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-red);
  color: var(--color-white);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-red-dark);
  transform: translateY(-3px) scale(1.05);
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { margin: 0; padding: 0; background: var(--color-white) !important; color: #000; font-size: 10pt; }
  .sticky-header, .back-to-top, .hero-contact { display: none !important; }
  
  .hero { min-height: auto !important; padding: 0 !important; background: none !important; margin-bottom: 10px; }
  .hero-container { gap: 1rem !important; margin: 0; }
  .hero-top-section { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .hero-content { animation: none !important; width: 70%; }
  .hero-title { font-size: 24pt !important; color: #000 !important; margin: 0; }
  .hero-title span { color: var(--color-red) !important; }
  .hero-subtitle { font-size: 11pt !important; color: #333 !important; max-width: 100%; margin-top: 5px; }
  .hero-image-wrapper { animation: none !important; width: 25%; display: block; }
  .hero-image { width: 100px; height: 100px; border-radius: 50% !important; box-shadow: none !important; transform: none !important; }
  .about-wrapper { margin-top: 10px; }
  .about-label { font-size: 12pt !important; color: var(--color-red) !important; margin-bottom: 5px; }
  .hero-about { font-size: 9.5pt !important; color: #333 !important; line-height: 1.4 !important; }

  .info-content { margin: 0 !important; padding: 0 !important; gap: 1rem !important; animation: none !important; }
  .info-card { padding: 0 !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; transform: none !important; page-break-inside: auto; margin-bottom: 15px !important; }
  .info-card h2 { display: none; } /* Hide the big "Resume" text in print if needed, or keep it */
  
  .resume-section { margin-bottom: 1.5rem !important; page-break-inside: avoid; }
  .resume-section h3 { font-size: 14pt !important; color: var(--color-red) !important; padding-bottom: 2px; margin-bottom: 10px !important; border-bottom: 1px solid var(--color-nude-dark); margin-top: 10px; }
  
  .resume-item { margin-bottom: 10px !important; page-break-inside: avoid; }
  .resume-item-title { font-size: 11pt !important; color: #000 !important; font-weight: bold; }
  .resume-item-subtitle { font-size: 10pt !important; color: #444 !important; margin-bottom: 5px !important; }
  .resume-item-date { background: none !important; border: 1px solid #ccc; padding: 0 5px; font-size: 9pt !important; color: #333 !important; border-radius: 4px; }
  
  .resume-list, .resume-item div { font-size: 9.5pt !important; color: #333 !important; line-height: 1.4 !important; }
  .resume-list { margin-left: 1rem !important; }
  
  /* GAP AFTER PROJECT AND RESEARCH */
  #projects { margin-bottom: 5px !important; }
  #projects + .resume-item { margin-bottom: 15px !important; } /* extra gap for safety */
  .info-card:nth-of-type(1) { margin-bottom: 30px !important; } /* BIG GAP after first info card (which ends at projects) */
  
  .badges-container { gap: 5px !important; margin-top: 5px !important; }
  .badge { border: 1px solid #ccc !important; background: #fff !important; color: #000 !important; padding: 2px 6px !important; font-size: 8.5pt !important; }
  
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* --- Added Styles for Contacts, Accordion and Modal --- */

.contact-boxes {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.contact-box-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 0.5rem;
  background: linear-gradient(to bottom, #ffffff 0%, #f7ebeb 100%);
  color: #000;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #dca4a4;
  box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  flex: 1 1 0px;
  min-width: 140px;
}

.contact-box-link:hover {
  transform: translateY(-3px);
  box-shadow: 2px 6px 10px rgba(0, 0, 0, 0.2);
  background: linear-gradient(to bottom, #ffffff 0%, #ecdcdc 100%);
}

.contact-box-link.download-cv-btn {
  background: darkred;
  color: #fdf5e6; /* warm white */
  border-color: darkred;
  flex: 0 1 auto;
  min-width: 180px;
}

.contact-box-link.download-cv-btn:hover {
  background: #660000;
  color: #fdf5e6;
}

.highlight-dark {
  color: #404040; /* 1 shade darker than text-light */
  font-weight: 500;
}

details.resume-accordion {
  margin-top: 0.5rem;
}
details.resume-accordion summary {
  cursor: pointer;
  color: var(--color-text-light);
  font-weight: 600;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
details.resume-accordion summary:hover {
  color: var(--color-red);
}
details.resume-accordion summary::-webkit-details-marker {
  display: none;
}
details.resume-accordion summary::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  margin-left: 0.2rem;
}
details.resume-accordion[open] summary::after {
  transform: rotate(180deg);
}
.accordion-content {
  margin-top: 0.8rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-nude-dark);
  color: var(--color-text-light);
}

.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.5); 
  backdrop-filter: blur(5px);
}
.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease forwards;
}
.modal-content {
  position: relative;
  background-color: var(--color-white);
  width: 90%;
  height: 90%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  background: var(--color-red);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
.close-modal:hover {
  background: var(--color-red-dark);
  transform: scale(1.1);
}
#modalIframe {
  width: 100%;
  height: 100%;
}
