:root {
  --content-width: 835px;
  --text-primary: #1a1d1f;
  --text-secondary: #6b7280;
  --text-dim: #9aa1a9;
  --link-color: #3b82f6;
  --link-color-dark: #000;
  --card-bg: #eef2f3;
  --card-bg-soft: #f3f6f7;
  --border-soft: #e2e7ea;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

.page {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 20px 40px;
}

.section { margin-bottom: 56px; }
.section:last-of-type { margin-bottom: 0; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-bottom: 16px; }
h3 { font-size: 1.05rem; margin-bottom: 24px; }
p { margin: 0 0 20px; }
p:last-child { margin-bottom: 0; }

.dim { color: var(--text-secondary); font-weight: 400; }

/* ---------- Underline-to-background link effect ---------- */
.link-fx {
  position: relative;
  display: inline-block;
  color: var(--link-color-dark);
  text-decoration: none;
  z-index: 0;
  padding: 0 2px;
}
.link-fx::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--link-color-dark);
  transform-origin: bottom;
  transform: scaleY(1);
  transition: height 0.28s cubic-bezier(.4,0,.2,1), background 0.28s ease;
  z-index: -1;
}
.link-fx:hover::before,
.link-fx:focus-visible::before {
  height: 100%;
  background: var(--link-color-dark);
}
.link-fx:hover, .link-fx:focus-visible {
  color: #fff;
  transition: color 0.28s cubic-bezier(.4,0,.2,1);
}

/* ---------- Header ---------- */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 70px;
}
.header-identity {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.avatar {
  width: 104px;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}
.name { font-size: 1.55rem; }

/* ---------- Variable font cursor proximity ---------- */
.vf-proximity .vf-word { display: inline-block; }
.vf-proximity .vf-char {
  display: inline-block;
  font-variation-settings: "wght" var(--vf-weight, 400);
  transition: font-variation-settings 0.08s linear;
}
.name.vf-proximity { --vf-weight: 600; }
.cta-lede.vf-proximity { --vf-weight: 400; }
.title { color: var(--text-secondary); margin: 4px 0 8px; font-size: 0.95rem; }
.cv-link { font-size: 0.9rem; }
.cv-icon { display: inline-block; width: 14px; height: 14px; object-fit: contain; margin-left: 2px; vertical-align: middle; }

.header-socials {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--link-color-dark);
  text-decoration: none;
}
.social-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.intro-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.intro-col p { color: var(--text-primary); }
.lede { font-size: 1.05rem; }

.stat-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}
.stat-list li {
  display: flex;
  align-items: baseline;
  gap: 0px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--text-secondary);
}
.stat-list li:last-child { border-bottom: none; }
.stat-list strong { color: var(--text-primary); min-width: 34px; }
.stat-icon {
  width: 16px;
  height: 16px;
  min-width: 34px;
  object-fit: contain;
  object-position: left center;
}

/* ---------- Logos carousel with progressive blur ---------- */
.logos-section { margin-top: 70px; margin-bottom: 70px; }
.logo-carousel {
  position: relative;
  width: 100%;
  max-width: var(--content-width);
  overflow: hidden;
}
.logo-track {
  display: flex;
  align-items: center;
  gap: 56px;
  width: max-content;
  animation: scroll-logos linear infinite;
  animation-duration: 52s;
  padding: 8px 0;
}
@keyframes scroll-logos {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.logo-item {
  width: auto;
  height: auto;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.logo-item:hover { opacity: 1; }

.blur-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  pointer-events: none;
  z-index: 2;
}
.blur-fade-left { left: 0; }
.blur-fade-right { right: 0; transform: scaleX(-1); }
.blur-layer {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  mask-image: linear-gradient(to left, transparent 0%, black 100%);
  -webkit-mask-image: linear-gradient(to left, transparent 0%, black 100%);
}
.blur-layer:nth-child(1) { mask-image: linear-gradient(to left, transparent 0%, black 30%, black 100%); -webkit-mask-image: linear-gradient(to left, transparent 0%, black 30%, black 100%); }
.blur-layer:nth-child(2) { mask-image: linear-gradient(to left, transparent 20%, black 50%, black 100%); -webkit-mask-image: linear-gradient(to left, transparent 20%, black 50%, black 100%); }
.blur-layer:nth-child(3) { mask-image: linear-gradient(to left, transparent 40%, black 70%, black 100%); -webkit-mask-image: linear-gradient(to left, transparent 40%, black 70%, black 100%); }
.blur-layer:nth-child(4) { mask-image: linear-gradient(to left, transparent 60%, black 100%); -webkit-mask-image: linear-gradient(to left, transparent 60%, black 100%); }

/* ---------- Case studies ---------- */
.case-section h2 { font-size: 1.4rem; }
.case-summary { color: var(--text-secondary); margin-bottom: 20px; }
.case-image {
  border-radius: var(--radius-md);
  width: 100%;
  object-fit: cover;
}
.case-image.wide { margin-bottom: 75px; }

.case-image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.case-image-wrap .case-image {
  border-radius: 0;
  display: block;
  transition: transform 0.4s ease;
}
.case-image-wrap:hover .case-image {
  transform: scale(1.15);
}

.case-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  align-items: center;
  margin-bottom: 100px;
}
.case-row:last-child { margin-bottom: 0; }
.case-row.reverse .case-text { order: 2; }
.case-row.reverse .case-image { order: 1; }
.case-text h3 { font-size: 1.05rem; }
.case-text p { color: var(--text-primary); font-size: 0.95rem; }

/* ---------- Projetos selecionados ---------- */
.projects-panel { margin-top: 100px; margin-bottom: 100px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 32px; }
.plus { color: var(--text-secondary); font-weight: 400; }

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "etax        academico"
    "etaxcap     acadcap"
    "biblioteca  muli"
    "bibcap      mulicap";
  gap: 16px 42px;
}
.project-card {
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #1a1d1f);
}
.project-card img, .project-card video { width: 100%; height: 100%; object-fit: cover; }
.project-card.area-etax { grid-area: etax; }
.project-card.area-academico { grid-area: academico; }
.project-card.area-biblioteca { grid-area: biblioteca; }
.project-card.area-muli { grid-area: muli; }
.project-caption p { margin: 0 0 4px; font-size: 0.92rem; }
.project-caption .tags { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 20px; }
.caption-etax { grid-area: etaxcap; align-self: start; }
.caption-biblioteca { grid-area: bibcap; align-self: start; }
.caption-academico { grid-area: acadcap; align-self: start; }
.caption-muli { grid-area: mulicap; align-self: start; }

.section-divider {
  border: none;
  height: 1px;
  background-color: #99B3B9;
  margin: 40px 0;
}

.outro-title { font-size: 1.05rem; }
.outro-carousel-wrap { margin-top: 20px; }
.outro-carousel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.outro-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.outro-carousel::-webkit-scrollbar { display: none; }
.outro-card {
  flex: 0 0 calc(25% - 12px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  border: none;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(155deg, var(--c1, #eef2f3), var(--c2, #f3f6f7));
  scroll-snap-align: start;
  transition: transform 0.25s ease;
  overflow: hidden;
  display: block;
}
.outro-card:hover { transform: translateY(-3px); }
.outro-card img, .outro-card video { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-arrow img { width: 14px; height: 14px; object-fit: contain; }
.carousel-arrow:hover { background: var(--border-soft); transform: translateY(-1px); }
.carousel-arrow:disabled { opacity: 0.35; cursor: default; transform: none; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.carousel-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7cdd1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.carousel-dots .dot.active { background: #4b5563; }

/* ---------- Testimonials ---------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 42px;
  margin-top: 40px;
  margin-bottom: 100px;
}
.testimonial-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.t-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.t-name { font-weight: 600; font-size: 0.95rem; }
.t-role { font-size: 0.88rem; margin-bottom: 2px; }
.t-company { font-weight: 600; color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 22px; }
.t-company-logo { width: auto; height: auto; }
.t-quote { font-size: 0.88rem; color: var(--text-primary); }

/* ---------- Sobre mim ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  margin-bottom: 90px;
}
.about-text p { font-size: 0.95rem; }
.hobby-grid {
  display: grid;
  grid-template-columns: 86px 68px 145px;
  grid-template-rows: repeat(2, 75px);
  gap: 6px;
  margin-bottom: 30px;
}
.hobby-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.hobby-grid img:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.music-title { font-size: 0.95rem; }
.spotify-embeds { display: flex; flex-direction: column; gap: 12px; }
.spotify-frame { border-radius: 12px; margin-top: -10px; }

/* ---------- Experiencia / Educacao ---------- */
.exp-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.entry-list { list-style: none; margin: 0 0 16px; padding: 0; }
.entry-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.entry-list li:last-child { border-bottom: none; }
.entry-icon { flex-shrink: 0; }
.entry-main { flex: 1; }
.entry-time { color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap; }

/* ---------- Footer CTA ---------- */
.footer-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.cta-lede { font-size: 23px; margin-bottom: 30px; }
.footer-photo {
  width: 130px;
  height: 165px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.page-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.page-footer p { margin: 0; line-height: 1; }
.scroll-top {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.scroll-top img { width: 14px; height: 14px; object-fit: contain; }
.scroll-top:hover { background: var(--border-soft); transform: translateY(-2px); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 20, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease;
  z-index: 100;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 80vw;
  height: 80vh;
  max-width: 80vw;
  max-height: 80vh;
  display: grid;
  grid-template-columns: 7fr 3fr;
  overflow: hidden;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
  opacity: 0;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-image-wrap {
  background: #f3f6f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 100%;
}
.modal-image-wrap img, .modal-image-wrap video { width: 100%; object-fit: contain; }
.modal-image-wrap video {
  /* Trims a stray 1-2px recording artifact line at the bottom edge of the video. */
  clip-path: inset(0 0 1.2% 0);
}
.modal-info { padding: 32px; overflow-y: auto; height: 100%; }
.modal-eyebrow { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 4px; }
.modal-info h3 { font-size: 1.3rem; margin-bottom: 8px; }
.modal-tags { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 16px; }
.modal-description { font-size: 0.95rem; color: var(--text-primary); }
.modal-bullets {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.modal-bullets:empty { display: none; }
.modal-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: normal;
  font-size: 14px;
}
.modal-bullets li:last-child { margin-bottom: 0; }
.modal-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s ease;
}
.modal-close:hover { background: rgba(0,0,0,0.12); }

/* ---------- Engagement toast ---------- */
.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 200;
  width: 300px;
  max-width: calc(100vw - 48px);
  background: #1a1d1f;
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px 20px 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s cubic-bezier(.4,0,.2,1);
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.toast-close:hover { background: rgba(255,255,255,0.2); }
.toast-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.toast-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}
.toast-content { min-width: 0; padding-right: 16px; }
.toast-message {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.toast-cta {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.toast-cta:hover { border-color: #fff; opacity: 0.85; }

@media (max-width: 700px) {
  .toast { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .page { padding: 32px 16px 32px; }
  .header-top { flex-direction: column; align-items: center; }
  .header-identity { display: contents; }
  .header-identity > div { display: contents; }
  .cv-link { order: 1; align-self: center; margin-bottom: 24px; }
  .avatar { order: 2; align-self: center; width: 130px; height: 130px; margin-bottom: 16px; }
  .name { order: 3; align-self: center; text-align: center; }
  .title { order: 4; align-self: center; text-align: center; margin-bottom: 20px; }
  .header-socials { order: 5; align-self: center; margin-top: 0; }
  .intro-card, .case-row, .about-grid, .exp-edu-grid, .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .case-row.reverse .case-text, .case-row.reverse .case-image { order: initial; }
  .projects-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "etax"
      "etaxcap"
      "biblioteca"
      "bibcap"
      "academico"
      "acadcap"
      "muli"
      "mulicap";
  }
  .outro-card { flex: 0 0 calc(50% - 8px); }
  .footer-cta { flex-direction: column-reverse; text-align: center; }
  .footer-cta-text { display: flex; flex-direction: column; align-items: center; }
  .modal {
    width: 90vw;
    height: 85vh;
    max-width: 90vw;
    max-height: 85vh;
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 1fr;
  }
  .modal-image-wrap { height: 100%; max-height: 45vh; }
  .modal-info { height: auto; max-height: 40vh; }
  .name { font-size: 1.3rem; }
  .card { padding: 24px; }
}
