/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #FFFFFF;
  --bg-alt: #F8F9FA;
  --text: #1A1A1A;
  --text-secondary: #6B7280;
  --accent: #1D4ED8;
  --accent-hover: #1e40af;
  --accent-light: #DBEAFE;
  --border: #E5E7EB;
  --card-bg: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --nav-height: 64px;
  --max-width: 1100px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

/* ===================== LAYOUT ===================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

/* ===================== NAV ===================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-right: auto;
  flex-shrink: 0;
  transition: background 0.2s;
}
.nav-logo:hover { background: var(--accent-hover); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.lang-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-code);
  white-space: nowrap;
  margin-left: 8px;
  transition: all 0.2s;
}
.lang-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
  margin-left: 8px;
}

/* ===================== HERO ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(29,78,216,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 60px;
  width: 100%;
}

.hero-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 18px;
  font-family: var(--font-code);
}

.hero-title {
  font-size: clamp(52px, 7.5vw, 84px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -3px;
  margin-bottom: 16px;
}

.accent { color: var(--accent); }

.hero-role {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 36px;
  line-height: 1.75;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(29,78,216,0.28);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===================== HERO VISUAL ===================== */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===================== ORBIT ===================== */
.orbit-wrap {
  position: relative;
  width: 500px;
  height: 500px;
  flex-shrink: 0;
  overflow: visible;
}

.orbit-wrap::before,
.orbit-wrap::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(29, 78, 216, 0.18);
  pointer-events: none;
}
.orbit-wrap::before { inset: 75px; }
.orbit-wrap::after  { display: none; }

.orbit-wrap .hero-photo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  z-index: 2;
}

.orbit-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.orbit-pulse::before,
.orbit-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.15);
  animation: photoPulse 4.5s ease-out infinite;
}

.orbit-pulse::after {
  background: rgba(29, 78, 216, 0.08);
  animation-delay: 2.25s;
}

@keyframes photoPulse {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(1.9);  opacity: 0; }
}

.orbit-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--orbit-r, 175px);
  height: 0;
  transform-origin: 0 0;
  animation: orbitSpin 32s linear infinite;
  animation-delay: var(--delay, 0s);
}

.orbit-badge {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 11px 5px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  animation: orbitCounter 32s linear infinite;
  animation-delay: var(--delay, 0s);
  z-index: 3;
}

.orbit-icon { font-size: 15px; line-height: 1; }

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes orbitCounter {
  from { transform: translate(50%, -50%) rotate(0deg); }
  to   { transform: translate(50%, -50%) rotate(-360deg); }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  opacity: 0.5;
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ===================== SECTION HEADER ===================== */
.section-header { margin-bottom: 56px; }

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  font-family: var(--font-code);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
  line-height: 1.1;
}

/* ===================== ABOUT ===================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 72px;
  align-items: start;
}

.about-text p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.about-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.tag {
  background: rgba(29, 78, 216, 0.07);
  color: var(--accent);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 168px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 38px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -2px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  font-weight: 500;
}

/* ===================== SKILLS ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 36px;
}

.skill-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-family: var(--font-code);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: transparent;
  border: 1px solid rgba(107, 114, 128, 0.25);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}
.skill-tag:hover {
  border-color: rgba(29, 78, 216, 0.4);
  color: var(--accent);
  background: rgba(29, 78, 216, 0.04);
}
.skill-tag.primary {
  background: rgba(29, 78, 216, 0.07);
  border-color: rgba(29, 78, 216, 0.22);
  color: var(--accent);
  font-weight: 600;
}

/* ===================== PROJECTS ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s;
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
  border-color: rgba(29,78,216,0.18);
}

.project-card.featured {
  grid-column: span 2;
  border-color: rgba(29,78,216,0.3);
  background: linear-gradient(140deg, #fff 0%, #EFF6FF 100%);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-icon { font-size: 34px; }

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.badge-featured {
  background: var(--accent);
  color: #fff;
}
.badge-social {
  background: #fee2e2;
  color: #dc2626;
}

.project-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.project-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: transparent;
  border: 1px solid rgba(107, 114, 128, 0.28);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-code);
  transition: border-color 0.2s, color 0.2s;
}
.tech-tag:hover {
  border-color: rgba(29, 78, 216, 0.4);
  color: var(--accent);
}

.project-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.2s;
  margin-top: 4px;
  display: inline-block;
}
.project-link:hover { opacity: 0.75; text-decoration: underline; }

/* ===================== CONTACT ===================== */
.contact-content { max-width: 580px; }

.contact-intro {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s var(--ease);
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.contact-icon {
  font-size: 22px;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.contact-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

/* ===================== FOOTER ===================== */
.footer {
  background: #111;
  color: #fff;
  padding: 28px 0;
  text-align: center;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  opacity: 0.5;
}
.footer-sep { opacity: 0.4; }
.footer-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-link:hover { opacity: 1; text-decoration: underline; }

/* ===================== SCROLL ANIMATIONS ===================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 44px;
    text-align: center;
  }
  .hero-desc { margin: 0 auto 36px; }
  .hero-cta { justify-content: center; }
  .hero-visual { order: -1; }
  .orbit-wrap { transform: scale(0.7); transform-origin: center center; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stat-card { min-width: 140px; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: span 1; }
}

@media (max-width: 640px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-menu-btn { display: block; }

  /* Container & section */
  .container { padding: 0 18px; }
  .section { padding: 60px 0; }

  /* Hero */
  .hero-inner {
    gap: 0;
    padding-top: 32px;
    padding-bottom: 48px;
  }
  .hero-title {
    font-size: clamp(32px, 9vw, 50px);
    letter-spacing: -1.5px;
  }
  .hero-role { font-size: 16px; }
  .hero-desc { font-size: 15px; margin-bottom: 28px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }

  /* Orbit — colapsa o espaço de layout excedente */
  .orbit-wrap {
    transform: scale(0.56);
    margin-top: -100px;
    margin-bottom: -90px;
  }

  /* Section header */
  .section-title { letter-spacing: -1px; }
  .section-header { margin-bottom: 36px; }

  /* About stats — 2 por linha */
  .stat-card { flex: 1 1 140px; }

  /* Timeline */
  .timeline-card { padding: 16px 18px; }
  .timeline-role { font-size: 16px; }
  .timeline-meta { flex-wrap: wrap; gap: 6px; }
  .timeline-tags { gap: 6px; }

  /* Skills */
  .skills-grid { gap: 24px; }

  /* Testimonial invite */
  .testimonial-invite { padding: 20px 18px; }
  .testimonial-form-card { padding: 24px 20px; }

  /* Contact */
  .contact-card { gap: 14px; padding: 16px 18px; }
  .contact-intro { font-size: 16px; margin-bottom: 28px; }
}

/* Telas muito pequenas (< 390px) */
@media (max-width: 390px) {
  .hero-title { font-size: 30px; }
  .stat-number { font-size: 36px; }
  .timeline-role { font-size: 15px; }
  .orbit-wrap {
    transform: scale(0.48);
    margin-top: -130px;
    margin-bottom: -120px;
  }
}

/* ===================== HERO PHOTO ===================== */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  order: -1;
}

.hero-photo {
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 40px rgba(29,78,216,0.18), 0 2px 8px rgba(0,0,0,0.1);
}

/* ===================== EXPERIENCE TIMELINE ===================== */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 20px;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-alt);
  outline: 2px solid var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

.timeline-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 6px;
  min-height: 32px;
}

.timeline-item:last-child .timeline-line { display: none; }

.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.timeline-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeline-period {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-code);
}

.timeline-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.timeline-badge.current {
  background: rgba(29,78,216,0.12);
  color: var(--accent);
}

.timeline-role {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===================== EDUCATION ===================== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.edu-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.edu-icon { font-size: 30px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.edu-icon-block { font-size: 30px; flex-shrink: 0; line-height: 1; margin-top: 2px; }

.edu-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }

.edu-institution { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

.edu-year { font-size: 12px; font-weight: 600; color: var(--accent); font-family: var(--font-code); }

.edu-card {
  flex-direction: column;
  gap: 0;
}

.edu-cert-preview {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.edu-cert-thumb {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: filter 0.2s;
}

.edu-cert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(29,78,216,0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: var(--radius-sm);
}

.edu-cert-preview:hover .edu-cert-overlay { opacity: 1; }
.edu-cert-preview:hover .edu-cert-thumb { filter: brightness(0.85); }

/* ===================== PROJECT SCREENSHOTS ===================== */
.project-screenshots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0;
}

.project-screenshot {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.project-screenshot:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}

@media (max-width: 640px) {
  .project-screenshots { grid-template-columns: 1fr; }
}

/* ===================== CERT LIGHTBOX ===================== */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.cert-modal.open {
  opacity: 1;
  pointer-events: all;
}

.cert-modal-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  object-fit: contain;
}

.cert-modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cert-modal-close:hover { background: rgba(255,255,255,0.3); }

/* ===================== TESTIMONIALS ===================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}

.testimonial-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.testimonial-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  font-style: italic;
  flex: 1;
}

.testimonial-author { display: flex; align-items: center; gap: 14px; }

.testimonial-avatar {
  width: 42px;
  height: 42px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.testimonial-name { display: block; font-size: 14px; font-weight: 700; color: var(--text); text-decoration: none; }
a.testimonial-name:hover { color: var(--accent); text-decoration: underline; }
.testimonial-role { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.testimonial-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.testimonial-photo-link { display: flex; flex-shrink: 0; }
.testimonial-photo-link:hover .testimonial-photo { border-color: var(--accent); }

.testimonial-invite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  padding: 28px 32px;
  border: 1px dashed rgba(99,102,111,0.35);
  border-radius: var(--radius);
  text-align: center;
}

.testimonial-invite-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.01em;
}

.testimonial-invite-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--font);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
}
.testimonial-invite-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.testimonial-invite-btn:hover::after { width: 100%; }

.testimonial-cancel-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 6px 0;
  margin: 0;
  font-family: var(--font);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}
.testimonial-cancel-btn:hover { color: var(--text); }

.testimonial-form-wrap {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.testimonial-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .testimonial-input-row { grid-template-columns: 1fr; }
}

.tf-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tf-photo-picker {
  position: relative;
  flex-shrink: 0;
}

.tf-photo-file-input {
  display: none;
}

.tf-photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px dashed var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  background: var(--bg-alt);
}
.tf-photo-label:hover { border-color: var(--accent); }

.tf-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.tf-photo-placeholder {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1;
  transition: color 0.2s;
}
.tf-photo-label:hover .tf-photo-placeholder { color: var(--accent); }

.tf-photo-remove {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--text-secondary);
  color: var(--bg);
  font-size: 9px;
  font-family: var(--font);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}
.tf-photo-remove:hover { background: #dc2626; }

.tf-photo-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.testimonial-form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.testimonial-form-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.testimonial-form-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.testimonial-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.testimonial-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.testimonial-input:focus { border-color: var(--accent); }
.testimonial-textarea { resize: vertical; min-height: 100px; }

.testimonial-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.testimonial-form-msg {
  margin-top: 14px;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.testimonial-form-msg.success {
  background: rgba(16,185,129,0.1);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.25);
}
.testimonial-form-msg.error {
  background: rgba(239,68,68,0.08);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ===================== CHAT WIDGET ===================== */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(29,78,216,0.4);
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-fab:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(29,78,216,0.5);
}

.chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 2000;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  transform-origin: bottom right;
}
.chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  background: var(--accent);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-header-info { flex: 1; }
.chat-header-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.chat-header-status { font-size: 11px; opacity: 0.75; margin-top: 1px; }

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.75;
  padding: 4px;
  line-height: 1;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.bot {
  background: var(--bg-alt);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-msg.bot strong { font-weight: 700; }
.chat-msg.bot em { font-style: italic; }
.chat-msg.bot .md-list {
  margin: 6px 0;
  padding-left: 18px;
  list-style: disc;
}
.chat-msg.bot .md-list li { margin: 3px 0; line-height: 1.55; }
.chat-msg.bot p { margin: 0 0 6px; }
.chat-msg.bot p:last-child { margin-bottom: 0; }
.chat-msg.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-msg.typing {
  background: var(--bg-alt);
  align-self: flex-start;
  padding: 12px 16px;
}

.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1;   }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  flex-shrink: 0;
}
.chat-suggestion {
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s;
  white-space: nowrap;
}
.chat-suggestion:hover { background: var(--accent); color: #fff; }

.chat-wa-trigger {
  background: #dcfce7;
  color: #15803d;
  border: none;
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s;
  white-space: nowrap;
}
.chat-wa-trigger:hover { background: #16a34a; color: #fff; }
[data-theme="dark"] .chat-wa-trigger { background: #052e16; color: #86efac; }
[data-theme="dark"] .chat-wa-trigger:hover { background: #15803d; color: #fff; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  background: var(--bg-alt);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.chat-input:focus { border-color: var(--accent); background: #fff; }
.chat-input:disabled { opacity: 0.6; }

.chat-send {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-send:hover { background: var(--accent-hover); transform: scale(1.05); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

@media (max-width: 420px) {
  .chat-window { width: calc(100vw - 20px); right: 10px; bottom: 84px; max-height: calc(100vh - 120px); }
  .chat-fab { bottom: 20px; right: 16px; }
}

/* ===================== CHAT WHATSAPP PANEL ===================== */
.chat-wa-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: #f0fdf4;
  flex-shrink: 0;
}
.chat-wa-panel.open { display: flex; }

[data-theme="dark"] .chat-wa-panel { background: #052e16; }

.chat-wa-title {
  font-size: 13px;
  font-weight: 700;
  color: #15803d;
}
[data-theme="dark"] .chat-wa-title { color: #86efac; }

.chat-wa-phone {
  border: 1px solid #86efac;
  border-radius: 22px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  background: #fff;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s;
}
.chat-wa-phone:focus { border-color: #15803d; }
[data-theme="dark"] .chat-wa-phone { background: #0f172a; color: var(--text); }

.chat-wa-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-wa-options label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.chat-wa-options input[type="radio"] { accent-color: #15803d; }

.chat-wa-actions {
  display: flex;
  gap: 8px;
}
.chat-wa-send {
  flex: 1;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}
.chat-wa-send:hover { background: #15803d; }
.chat-wa-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-wa-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-secondary);
  transition: all 0.18s;
}
.chat-wa-cancel:hover { border-color: var(--accent); color: var(--accent); }

/* ===================== DARK MODE ===================== */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --card-bg: #1e293b;
  --accent-light: rgba(29,78,216,0.22);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .nav { background: rgba(15,23,42,0.92); }
[data-theme="dark"] .project-card.featured {
  background: linear-gradient(140deg, #1e293b 0%, #172554 100%);
}
[data-theme="dark"] .footer { background: #020617; }
[data-theme="dark"] .chat-window,
[data-theme="dark"] .chat-input-row { background: #1e293b; }
[data-theme="dark"] .chat-input { background: #0f172a; color: var(--text); }
[data-theme="dark"] .chat-msg.bot { background: #334155; }

/* ===================== THEME TOGGLE BUTTON ===================== */
.theme-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  line-height: 1;
}
.theme-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* ===================== PROJECT FILTERS ===================== */
.project-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.project-filter-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font);
  transition: all 0.18s;
}
.project-filter-btn:hover,
.project-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.project-card[hidden] { display: none !important; }

/* ===================== MEDALLION ARCHITECTURE ===================== */
.medallion-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 44px;
}

.medallion-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 44px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.medallion-arrow {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 20px;
  padding: 0 8px;
  flex-shrink: 0;
}

.medallion-layer {
  flex: 1;
  min-width: 130px;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  border: 2px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.medallion-layer:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.medallion-layer.source {
  background: var(--bg-alt);
  border-color: var(--border);
}
.medallion-layer.bronze {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  color: #fff;
}
.medallion-layer.silver {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  color: #fff;
}
.medallion-layer.gold {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  color: #fff;
}
.medallion-layer.consumer {
  background: var(--accent);
  color: #fff;
}

.medallion-icon { font-size: 26px; margin-bottom: 10px; }
.medallion-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.medallion-desc {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.5;
}

/* ===================== CODE BLOCK ===================== */
.code-block {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 28px 32px;
  overflow-x: auto;
  border: 1px solid #1e293b;
}

.code-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1e293b;
}

.code-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.code-dot-red    { background: #ff5f57; }
.code-dot-yellow { background: #febc2e; }
.code-dot-green  { background: #28c840; }

.code-filename {
  font-family: var(--font-code);
  font-size: 12px;
  color: #64748b;
  margin-left: 6px;
}

pre.code-content {
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.75;
  color: #e2e8f0;
  white-space: pre;
  margin: 0;
  tab-size: 4;
}

.c-keyword { color: #c084fc; }
.c-func    { color: #60a5fa; }
.c-string  { color: #86efac; }
.c-comment { color: #475569; font-style: italic; }
.c-number  { color: #fb923c; }

@media (max-width: 900px) {
  .medallion-flow { gap: 4px; }
  .medallion-arrow { font-size: 14px; padding: 0 4px; }
  .medallion-layer { min-width: 100px; padding: 18px 10px; }
  .medallion-name { font-size: 12px; }
  .code-block { padding: 20px 18px; }
  pre.code-content { font-size: 11px; }
}

@media (max-width: 640px) {
  .medallion-flow { flex-direction: column; align-items: center; }
  .medallion-arrow { transform: rotate(90deg); padding: 4px 0; }
  .medallion-layer { width: 100%; max-width: 300px; }
}
