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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e8e8e8;
  --text-primary: #111111;
  --text-secondary: #666666;
  --accent: #111111;
  --radius: 16px;
  --gap: 24px;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --accent: #f0f0f0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ——— HERO ——— */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 24px 56px;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 20px;
  border: 3px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

/* ——— AVATAR ZOOM OVERLAY ——— */
.avatar-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-overlay.show {
  display: flex;
  opacity: 1;
}

.avatar-overlay-img {
  width: min(80vw, 420px);
  height: min(80vw, 420px);
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 400;
}

/* ——— CONTACTS ——— */
.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}

.contact-btn:hover {
  background: var(--bg);
  border-color: #aaa;
}

.contact-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ——— MAIN ——— */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* ——— SECTION TITLE ——— */
.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ——— GRID ——— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

/* ——— CARD ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

/* company card header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.company-logo {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.period {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* service card */
.service-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.service-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* ——— SOBRE ——— */
.about-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
}

.about-text.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.about-toggle {
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.about-toggle:hover {
  opacity: 0.7;
}

/* ——— TIMELINE ——— */
.section-toggle {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.section-toggle:hover {
  background: var(--bg);
  border-color: #aaa;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.timeline.is-hidden {
  display: none;
}

.timeline-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-primary);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.timeline-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.timeline-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.timeline-heading h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.timeline-header .period {
  margin-left: auto;
}

.timeline-bullets {
  list-style: disc;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-bullets li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ——— PROJETOS PESSOAIS ——— */
.project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.project-header .period {
  display: block;
  margin-top: 2px;
}

.project-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.project-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-item .role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.stack-tag {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
}

/* ——— FORMAÇÃO E CERTIFICAÇÕES ——— */
.subsection-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

.subsection-title:first-of-type {
  margin-top: 0;
}

.education-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cert-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  font-size: 0.875rem;
}

.cert-item + .cert-item {
  border-top: 1px solid var(--border);
}

.cert-name {
  font-weight: 500;
}

.cert-meta {
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ——— FOOTER ——— */
footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ——— THEME TOGGLE ——— */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: #aaa;
}

.lang-toggle {
  position: fixed;
  top: 20px;
  right: 72px;
  z-index: 100;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-toggle:hover {
  transform: scale(1.04);
  border-color: #aaa;
}

.lang-toggle img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
}

.back-to-top img {
  width: 20px;
  height: 20px;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: #aaa;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 600px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
  }

  .lang-toggle {
    top: 12px;
    right: 64px;
    padding: 0 8px;
    height: 36px;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }

  .hero {
    padding: 48px 20px 40px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .contacts {
    gap: 8px;
  }

  .contact-btn {
    padding: 9px 14px;
  }

  main {
    padding: 48px 16px;
    gap: 56px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    padding: 20px;
  }

  .timeline-header .period {
    margin-left: 0;
  }

  .cert-item {
    flex-direction: column;
    gap: 4px;
  }
}
