:root {
  --primary: #2563eb;
  --primary-light: #60a5fa;
  --bg: #f8fafc;
  --card-bg: #fff;
  --text: #22223b;
  --subtitle: #64748b;
  --shadow: 0 4px 24px 0 rgba(30,41,59,0.10);
  --border: #e0e7ef;
  --badge: #e0f2fe;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem 0;
}

.navbar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.navbar a:hover, .navbar a:focus {
  color: var(--primary-light);
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 64px 0 48px 0;
  text-align: center;
  box-shadow: var(--shadow);
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.hero-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 2px 24px 0 rgba(30,41,59,0.13);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 2.8rem;
  margin: 0;
  letter-spacing: 1px;
}
.subtitle {
  color: #e0e7ef;
  font-size: 1.3rem;
  margin-bottom: 1.3rem;
  font-weight: 500;
}

.cta-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 0.75em 1.5em;
  border-radius: 25px;
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 2px 12px 0 rgba(30,41,59,0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--primary-light);
  color: #fff;
  box-shadow: 0 4px 24px 0 rgba(30,41,59,0.15);
}

/* Section Title */
.section h2 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--primary);
  font-size: 2.1rem;
  text-align: center;
  margin-bottom: 2.2rem;
  letter-spacing: 1.5px;
}

.section {
  padding: 56px 0 44px 0;
  width: 100%;
  box-sizing: border-box;
}

.about-grid {
  display: flex;
  gap: 3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}
.about-photo-wrap {
  min-width: 230px;
  flex: 1;
  display: flex;
  justify-content: center;
}
.about-photo {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 2px 16px 0 rgba(30,41,59,0.11);
}
.about-text {
  flex: 2;
  font-size: 1.18rem;
  color: var(--text);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
  line-height: 1.75;
}
.card {
  transition: box-shadow 0.18s, transform 0.14s;
}
.card:hover {
  box-shadow: 0 8px 32px 0 rgba(37,99,235,0.11);
  transform: translateY(-3px) scale(1.01);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 375px;
}
.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f1f5f9;
}
.project-info {
  padding: 1.3rem 1.2rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
.project-info h3 {
  margin: 0 0 0.3em 0;
  font-size: 1.25rem;
  color: var(--primary);
  font-family: 'Montserrat', Arial, sans-serif;
}
.badges {
  margin-top: 10px;
  display: flex;
  gap: 0.4rem;
}
.badge {
  background: var(--badge);
  color: var(--primary);
  border-radius: 10px;
  font-size: 0.92rem;
  padding: 0.32em 0.8em;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.badge.csharp { background: #efefff; color: #4933a3; }
.badge.windows { background: #f0f9ff; color: #2063b8; }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.contact-links a {
  display: inline-block;
  transition: transform 0.18s;
}
.contact-links a:hover, .contact-links a:focus {
  transform: scale(1.16) rotate(-8deg);
}
.contact-links img {
  width: 44px;
  height: 44px;
  filter: grayscale(0.15) brightness(0.97);
  transition: filter 0.18s;
}
.contact-links a:hover img, .contact-links a:focus img {
  filter: none;
}

footer {
  margin-top: auto;
  background: var(--primary);
  color: #fff;:root {
  --primary: #2563eb;
  --primary-light: #60a5fa;
  --bg: #f8fafc;
  --card-bg: #fff;
  --text: #22223b;
  --subtitle: #64748b;
  --shadow: 0 4px 24px 0 rgba(30,41,59,0.10);
  --border: #e0e7ef;
  --badge: #e0f2fe;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem 0;
}

.navbar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.navbar a:hover, .navbar a:focus {
  color: var(--primary-light);
}

.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #fff;
  padding: 64px 0 48px 0;
  text-align: center;
  box-shadow: var(--shadow);
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.hero-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 2px 24px 0 rgba(30,41,59,0.13);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 2.8rem;
  margin: 0;
  letter-spacing: 1px;
}
.subtitle {
  color: #e0e7ef;
  font-size: 1.3rem;
  margin-bottom: 1.3rem;
  font-weight: 500;
}

.cta-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 0.75em 1.5em;
  border-radius: 25px;
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 2px 12px 0 rgba(30,41,59,0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--primary-light);
  color: #fff;
  box-shadow: 0 4px 24px 0 rgba(30,41,59,0.15);
}

/* Section Title */
.section h2 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--primary);
  font-size: 2.1rem;
  text-align: center;
  margin-bottom: 2.2rem;
  letter-spacing: 1.5px;
}

.section {
  padding: 56px 0 44px 0;
  width: 100%;
  box-sizing: border-box;
}

.about-grid {
  display: flex;
  gap: 3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}
.about-photo {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 2px 16px 0 rgba(30,41,59,0.11);
}
.about-text {
  flex: 2;
  font-size: 1.18rem;
  color: var(--text);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
  line-height: 1.75;
}
.card {
  transition: box-shadow 0.18s, transform 0.14s;
}
.card:hover {
  box-shadow: 0 8px 32px 0 rgba(37,99,235,0.11);
  transform: translateY(-3px) scale(1.01);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 375px;
}
.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f1f5f9;
}
.project-info {
  padding: 1.3rem 1.2rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
.project-info h3 {
  margin: 0 0 0.3em 0;
  font-size: 1.25rem;
  color: var(--primary);
  font-family: 'Montserrat', Arial, sans-serif;
}
.badges {
  margin-top: 10px;
  display: flex;
  gap: 0.4rem;
}
.badge {
  background: var(--badge);
  color: var(--primary);
  border-radius: 10px;
  font-size: 0.92rem;
  padding: 0.32em 0.8em;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.badge.csharp { background: #efefff; color: #4933a3; }
.badge.windows { background: #f0f9ff; color: #2063b8; }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.contact-links a {
  display: inline-block;
  transition: transform 0.18s;
}
.contact-links a:hover, .contact-links a:focus {
  transform: scale(1.16) rotate(-8deg);
}
.contact-links img {
  width: 44px;
  height: 44px;
  filter: grayscale(0.15) brightness(0.97);
  transition: filter 0.18s;
}
.contact-links a:hover img, .contact-links a:focus img {
  filter: none;
}

footer {
  margin-top: auto;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-size: 1.03rem;
  padding: 18px 0 13px 0;
  letter-spacing: 0.7px;
  box-shadow: 0 -1px 10px rgba(30,41,59,0.06);
  width: 100%;
}

@media (max-width: 900px) {
  .about-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 98vw;
  }
  .about-photo {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 32px 0 20px 0;
  }
  .hero {
    padding: 30px 0 18px 0;
  }
  .hero h1 {
    font-size: 1.54rem;
  }
  .section h2 {
    font-size: 1.19rem;
  }
  .about-photo {
    width: 90px;
    height: 90px;
  }
  .about-text {
    padding: 1.05rem;
    font-size: 1rem;
  }
  .project-info {
    padding: 0.9rem;
  }
  .contact-links img {
    width: 33px;
    height: 33px;
  }
}
  text-align: center;
  font-size: 1.03rem;
  padding: 18px 0 13px 0;
  letter-spacing: 0.7px;
  box-shadow: 0 -1px 10px rgba(30,41,59,0.06);
  width: 100%;
}

@media (max-width: 900px) {
  .about-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 98vw;
  }
  .about-photo {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 32px 0 20px 0;
  }
  .hero {
    padding: 30px 0 18px 0;
  }
  .hero h1 {
    font-size: 1.54rem;
  }
  .section h2 {
    font-size: 1.19rem;
  }
  .about-photo {
    width: 90px;
    height: 90px;
  }
  .about-text {
    padding: 1.05rem;
    font-size: 1rem;
  }
  .project-info {
    padding: 0.9rem;
  }
  .contact-links img {
    width: 33px;
    height: 33px;
  }
}

/* ===== MODAL MEDIA (POP UP REAL) ===== */
.media-modal {
  position: fixed;         /* retira do fluxo, cola ao ecrã */
  inset: 0;                /* top:0 right:0 bottom:0 left:0 */
  z-index: 9999;           /* acima de tudo, incluindo footer */
  display: none;           /* escondido de base */
  justify-content: center; /* centra a caixa */
  align-items: center;
  font-family: inherit;
}

.media-modal.is-open {
  display: flex;           /* mostra como flex overlay */
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
}

.media-modal-dialog {
  position: relative;
  max-width: min(90vw, 800px);
  max-height: 90vh;
  overflow: auto;          /* scroll se o conteúdo for grande */
  background: #fff;
  padding: 1rem;
  border-radius: .5rem;
  z-index: 1;              /* acima do backdrop */
  box-shadow: 0 0 30px rgba(0,0,0,.5);
  text-align: center;
}

.media-modal-close {
  position: absolute;
  top: .25rem;
  right: .5rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.media-modal-title {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
}

.media-modal-content img,
.media-modal-content video {
  max-width: 100%;
  height: auto;
}

/* Acções nos cartões */
.project-media-actions {
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}


/* LOADER STYLES */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0d0d;
  color: white;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeOutLoader 1s ease forwards;
  animation-delay: 2.5s;
}

.loader-content {
  text-align: center;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.5s;
}

.loader-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeOutLoader {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


@media (max-width: 480px) {
  .loader-avatar {
    width: 70px;
    height: 70px;
  }

  #loader h1 {
    font-size: 1.5rem;
  }

  #loader .subtitle {
    font-size: 1rem;
  }
}
