/* ========================================================================== 
   PORTFOLIO DIAMOND V1.78 — FINAL I18N, STATE & RESPONSIVE QA
   Single responsive source loaded last. Content-driven breakpoints:
   1536 / 1280 / 1100 / 900 / 680 / 430px.
   ========================================================================== */

:root{
  --deploy-header-h:66px;
  --deploy-shell:min(1480px,calc(100% - clamp(32px,6vw,96px)));
  --deploy-section-y:clamp(58px,6vw,92px);
  --deploy-section-y-compact:clamp(48px,5vw,76px);
  --deploy-gap:clamp(18px,2.4vw,34px);
}

*,*::before,*::after{box-sizing:border-box}
html{overflow-x:clip;scroll-padding-top:calc(var(--deploy-header-h) + 14px);-webkit-text-size-adjust:100%}
body{min-width:320px;overflow-x:clip}
img,video,svg,canvas{display:block;max-width:100%}
button,input,select,textarea{font:inherit}
a,button,[role="button"]{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
main>.site-section{padding-block:var(--deploy-section-y)!important}
#especialidades{padding-block:var(--deploy-section-y-compact)!important}
.site-section,.section-system{scroll-margin-top:calc(var(--deploy-header-h) + 12px)}
.interface,.hx-shell,.spx-shell,#sobre>.interface,.professional-overview,#portfolio .portfolio-container,#contato>.interface,.premium-footer>.interface{width:var(--deploy-shell);max-width:none;margin-inline:auto}

/* Prevent content-driven overflow in every major grid. */
.header-shell,.hx-layout,.hx-copy,.hx-command,.spx-carousel,.spx-viewport,.spx-track,.spx-card,.about-premium,.about-premium__intro,.txt-sobre,.img-sobre,.professional-overview,.impact-indicators,.career-panel,.career-timeline,.portfolio-hero,.portfolio-grid,.portfolio-card,.portfolio-card-body,.portfolio-card-stack,.portfolio-metrics,.portfolio-categories,.card-workspace,.case-category-shell,.case-detail-shell,.restricted-shell,.request-shell,.contact-premium__shell,.contact-premium__summary,.contact-premium__form-panel,.premium-footer__main,.premium-footer__utility,.premium-footer__bottom{min-width:0}

/* Header: stable desktop geometry. */
.site-header{height:auto;min-height:var(--deploy-header-h)}
.site-header .header-shell{width:var(--deploy-shell);min-height:var(--deploy-header-h);gap:clamp(14px,2vw,32px)}
.site-header .brand{flex:0 1 auto;min-width:0}
.site-header .brand-copy{min-width:0}
.site-header .brand-copy strong,.site-header .brand-copy small,.site-header .brand-copy em{white-space:nowrap}
.menu-desktop{min-width:0}
.menu-desktop ul{gap:clamp(13px,1.55vw,27px)}
.header-actions{flex:0 0 auto;gap:9px}
.menu-mobile{display:none}

/* Consistent interaction targets. */
.ui-btn,.hx-button,.spx-card__cta,.portfolio-card-button,.portfolio-footer-button,.contact-submit,.premium-footer__cta,.premium-access-button,.case-back{min-height:44px}

/* Hero */
#inicio.hx-hero{min-height:calc(100svh - var(--deploy-header-h));padding-inline:max(22px,calc((100vw - 1510px)/2 + 22px))}
#inicio .hx-shell{width:100%;max-width:1510px}
.hx-copy h1{text-wrap:balance;overflow-wrap:normal}
.hx-copy>p{max-width:62ch}
.hx-command{overflow:visible}
.hx-profile-card{max-width:100%}

/* Specialties: preserve active-card breathing room. */
.spx-section{overflow:visible!important}
.spx-shell{width:var(--deploy-shell)}
.spx-heading h2{max-width:100%;overflow:visible!important;text-wrap:balance}
.spx-carousel{max-width:100%}
.spx-viewport{max-width:100%;overscroll-behavior-inline:contain;scrollbar-width:none}
.spx-viewport::-webkit-scrollbar{display:none}
.spx-card h3,.spx-card>p{overflow-wrap:anywhere}
.spx-card__tech-list{align-content:start}

/* About and timeline */
.about-premium__intro{align-items:center}
.professional-overview{overflow:hidden}
.career-next-step{max-width:100%}

/* Portfolio and dynamic case panels */
#portfolio .portfolio-title,#portfolio .portfolio-categories--showcase .section-title{text-wrap:balance;overflow-wrap:anywhere}
#portfolio .portfolio-card{min-width:0}
#portfolio .portfolio-card-header h4{white-space:normal;overflow:visible;text-overflow:clip}
#portfolio .portfolio-card-media img{width:100%;height:100%;object-fit:cover}
#portfolio .card-workspace{max-width:100%;overflow:visible}
#portfolio .case-category-shell,#portfolio .case-detail-shell,#portfolio .restricted-shell,#portfolio .request-shell{max-width:100%}
#portfolio .case-category-hero h3,#portfolio .case-detail-copy h2,#portfolio .restricted-hero h2{overflow-wrap:anywhere;text-wrap:balance}
#portfolio .case-tags,#portfolio .case-meta,#portfolio .case-eyebrow{flex-wrap:wrap}
#portfolio .request-fields input,#portfolio .request-fields select,#portfolio .request-fields textarea{min-width:0}

/* Contact */
#contato .contact-field input,#contato .contact-field select,#contato .contact-field textarea{min-width:0;width:100%}
.contact-channel__value,.premium-footer__contact strong,.premium-footer__contact span{overflow-wrap:anywhere}

/* Footer */
.premium-footer__bottom{align-items:center}
.premium-footer__legal{display:flex;align-items:center;justify-content:center;gap:12px;white-space:nowrap}
.premium-footer__credit{min-width:0}

/* Large desktop: prevent excessive empty vertical distance. */
@media (min-width:1537px){
  :root{--deploy-shell:min(1540px,calc(100% - 112px));--deploy-section-y:88px;--deploy-section-y-compact:72px}
  .hx-layout{gap:clamp(42px,4vw,72px)}
  #portfolio .portfolio-grid--showcase{gap:22px}
}

/* Standard desktop / notebooks. */
@media (max-width:1536px){
  :root{--deploy-shell:min(1320px,calc(100% - 56px));--deploy-section-y:clamp(58px,5.5vw,82px);--deploy-section-y-compact:clamp(50px,4.8vw,70px)}
  .site-header .brand-copy em{display:none}
  .header-actions .ui-btn{padding-inline:14px}
  #inicio.hx-hero{padding-inline:28px}
  .hx-layout{grid-template-columns:minmax(380px,.88fr) minmax(500px,1.12fr);gap:28px}
  .hx-copy{padding-top:clamp(44px,5vh,68px)}
  .hx-copy h1{font-size:clamp(3.75rem,5.7vw,5.85rem)}
  .hx-orbit{--orbit-size:clamp(500px,47vw,625px)}
  #portfolio .portfolio-card--showcase{min-height:640px}
}

/* Small notebooks / tablet landscape. */
@media (max-width:1280px){
  :root{--deploy-shell:min(1080px,calc(100% - 40px));--deploy-section-y:68px;--deploy-section-y-compact:58px}
  .site-header .header-shell{gap:14px}
  .site-header .brand-copy small{display:none}
  .menu-desktop ul{gap:13px}
  .menu-desktop a{font-size:.72rem}
  .header-actions .header-cta{display:none}
  .header-actions .header-cv{padding-inline:13px}

  #inicio.hx-hero{min-height:auto;padding:62px 22px 42px}
  .hx-layout{grid-template-columns:1fr;gap:30px}
  .hx-copy{max-width:790px;padding-top:0}
  .hx-copy h1{font-size:clamp(4rem,8vw,6rem)}
  .hx-command{width:min(100%,800px);justify-self:center}
  .hx-orbit{--orbit-size:min(76vw,650px)}
  .hx-profile-card{width:min(92%,640px)}
  .hx-scroll{display:none}

  .spx-track{grid-auto-columns:calc((100% - 32px)/3)}
  .spx-card{min-height:585px}

  .about-premium__intro{grid-template-columns:minmax(0,1.05fr) minmax(300px,.72fr);gap:38px}
  .impact-indicators{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  .career-timeline{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:22px}
  .career-timeline::before{display:none}
  .career-timeline>article,.career-timeline>.career-current{border:1px solid rgba(87,114,197,.18);border-radius:16px;padding:18px;background:rgba(3,11,29,.55)}

  #portfolio .portfolio-hero--integrated{grid-template-columns:minmax(0,1fr) minmax(270px,.58fr);gap:28px}
  #portfolio .portfolio-grid--showcase{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
  #portfolio .portfolio-card--showcase{min-height:0}
  #portfolio .portfolio-metrics--integrated{grid-template-columns:repeat(2,minmax(0,1fr))}

  #contato .contact-premium__shell{grid-template-columns:1fr 1.08fr;gap:20px}
  .premium-footer__main{grid-template-columns:repeat(2,minmax(0,1fr))}
  .premium-footer__utility{grid-template-columns:1fr 1fr}
  .premium-footer__technologies{grid-column:1/-1}
}

/* Tablet portrait / navigation switch. */
@media (max-width:1100px){
  :root{--deploy-shell:min(860px,calc(100% - 32px));--deploy-header-h:62px;--deploy-section-y:62px;--deploy-section-y-compact:54px}
  .menu-desktop,.header-actions{display:none!important}
  .menu-mobile{display:block;margin-left:auto}
  .menu-toggle{display:grid;place-items:center;width:44px;height:44px}
  .mobile-panel{position:fixed;inset:0 0 0 auto;width:min(88vw,390px);height:100dvh;padding:max(18px,env(safe-area-inset-top)) 18px max(20px,env(safe-area-inset-bottom));background:linear-gradient(160deg,rgba(5,12,31,.995),rgba(1,5,17,.998));border-left:1px solid rgba(94,116,255,.34);box-shadow:-30px 0 80px rgba(0,0,0,.55);transform:translateX(105%);visibility:hidden;transition:transform .28s ease,visibility .28s;z-index:1001;display:flex;flex-direction:column;gap:8px;overflow-y:auto}
  .mobile-panel.is-open{transform:none;visibility:visible}
  .mobile-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
  .mobile-panel>a{display:flex;align-items:center;min-height:52px;padding:0 16px;border:1px solid rgba(91,111,190,.18);border-radius:12px;color:#eef3ff;text-decoration:none;background:rgba(10,18,43,.62)}
  body.menu-open{overflow:hidden;touch-action:none}

  .spx-track{grid-auto-columns:calc((100% - 16px)/2)}
  .spx-card{min-height:565px}

  .about-premium__intro{grid-template-columns:1fr;gap:30px}
  .img-sobre{width:min(100%,560px);justify-self:center}
  .professional-overview__header{grid-template-columns:1fr;gap:12px}
  .career-timeline{grid-template-columns:1fr 1fr}

  #portfolio .portfolio-hero--integrated{grid-template-columns:1fr;gap:24px}
  #portfolio .portfolio-highlight{width:min(100%,520px)}
  #portfolio .case-category-hero,#portfolio .case-detail-hero,#portfolio .restricted-hero,#portfolio .restricted-grid,#portfolio .request-shell{grid-template-columns:1fr}
  #portfolio .case-category-art{min-height:180px}
  #portfolio .case-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  #portfolio .case-story{grid-template-columns:1fr}
  #portfolio .case-story nav{display:flex;flex-direction:row;overflow-x:auto;gap:8px;padding:10px 0;scroll-snap-type:x proximity}
  #portfolio .case-story nav button{flex:0 0 auto;min-height:44px;white-space:nowrap;scroll-snap-align:start}
  #portfolio .case-story article{min-height:0;padding:22px 0;border-left:0;border-right:0}
  #portfolio .case-screen{transform:none!important}

  #contato .contact-premium__shell{grid-template-columns:1fr;gap:20px}
  .premium-footer__bottom{grid-template-columns:1fr;justify-items:center;text-align:center;gap:12px;padding-block:18px}
  .premium-footer__bottom>div:first-child,.premium-footer__legal,.premium-footer__center-mark,.premium-footer__credit,.premium-footer__top{grid-column:1;grid-row:auto}
  .premium-footer__legal{flex-wrap:wrap;white-space:normal;row-gap:8px}
  .premium-footer__credit{justify-content:center;white-space:normal;text-align:center}
}

/* Tablets and large phones. */
@media (max-width:900px){
  :root{--deploy-shell:min(720px,calc(100% - 28px));--deploy-section-y:56px;--deploy-section-y-compact:50px}
  #inicio.hx-hero{padding:52px 16px 36px}
  .hx-copy{max-width:100%}
  .hx-copy h1{font-size:clamp(3.35rem,11vw,5.35rem)}
  .hx-orbit{--orbit-size:min(92vw,590px)}

  .spx-heading{margin-bottom:30px}
  .spx-heading h2{font-size:clamp(3.1rem,11vw,5.3rem);line-height:.84}

  .impact-indicators{grid-template-columns:repeat(2,minmax(0,1fr))}

  #portfolio .portfolio-grid--showcase{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  #portfolio .portfolio-categories--showcase{padding:clamp(24px,5vw,38px)}
  #portfolio .case-facts,#portfolio .case-evidence{grid-template-columns:repeat(2,minmax(0,1fr))}
  #portfolio .case-process{grid-template-columns:1fr}
  #portfolio .request-fields{grid-template-columns:1fr}
  #portfolio .request-fields .wide{grid-column:auto}

  .premium-footer__main{grid-template-columns:1fr 1fr}
  .premium-footer__utility{grid-template-columns:1fr 1fr}
  .premium-footer__technologies{grid-column:1/-1}
}

/* Phones: Xiaomi/Redmi common CSS widths 360–430. */
@media (max-width:680px){
  :root{--deploy-shell:calc(100% - 22px);--deploy-section-y:48px;--deploy-section-y-compact:44px}
  .site-header .brand-logo-slot{width:40px;height:40px}
  .site-header .brand-copy strong{font-size:.82rem}
  .site-header .brand-copy small,.site-header .brand-copy em{display:none}
  .mobile-panel{width:100vw}

  #inicio.hx-hero{padding:44px 12px 30px}
  .hx-eyebrow{max-width:100%;white-space:normal;text-align:left;line-height:1.25;padding-block:8px}
  .hx-copy h1{font-size:clamp(2.95rem,15vw,4.55rem);line-height:.88}
  .hx-copy>p{font-size:.94rem}
  .hx-capabilities{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .hx-capabilities span{justify-content:center;min-width:0;padding-inline:8px;font-size:.64rem}
  .hx-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .hx-button{width:100%;min-width:0}
  .hx-techbar{display:grid;grid-template-columns:1fr 1fr}
  .hx-techbar span{justify-content:center;min-width:0;padding-inline:8px}
  .hx-techbar span:last-child{grid-column:1/-1}
  .hx-orbit{--orbit-size:min(110vw,490px)}
  .hx-node{width:72px;gap:4px}
  .hx-node span{width:57px;height:57px}
  .hx-node svg{width:27px;height:27px}
  .hx-node strong{font-size:.5rem}
  .hx-profile-card{width:100%}
  .hx-profile-main{grid-template-columns:1fr;padding:15px}
  .hx-status{padding:13px 0 0;border-left:0;border-top:1px solid rgba(111,134,194,.22)}
  .hx-profile-stats{grid-template-columns:1fr}
  .hx-profile-stats>div{border-right:0;border-bottom:1px solid rgba(111,134,194,.2)}
  .hx-profile-stats>div:last-child{border-bottom:0}

  .spx-carousel{--spx-active-space:44px}
  .spx-heading h2{font-size:clamp(2.7rem,15vw,4.3rem);line-height:.83}
  .spx-heading__ornament{grid-template-columns:52px 10px 52px}
  .spx-track{grid-auto-columns:88%;gap:14px}
  .spx-card{min-height:530px;padding:21px 18px 18px}
  .spx-nav{width:46px;height:46px}
  .spx-nav--prev{left:-3px}.spx-nav--next{right:-3px}

  .txt-sobre h2{font-size:clamp(2.65rem,13vw,4.15rem)}
  .about-path{display:flex;flex-wrap:wrap;gap:8px}
  .impact-indicators,.career-timeline{grid-template-columns:1fr}
  .career-panel{padding:17px}

  #portfolio .portfolio-grid--showcase,#portfolio .case-list,#portfolio .case-facts,#portfolio .case-evidence,#portfolio .request-fields,#portfolio .request-success>div{grid-template-columns:1fr}
  #portfolio .portfolio-card--showcase,#portfolio .portfolio-card-body,#portfolio .portfolio-card-stack{min-height:0}
  #portfolio .portfolio-categories--showcase{padding:24px 14px;border-radius:20px}
  #portfolio .portfolio-categories--showcase .section-title{font-size:clamp(2.35rem,12vw,3.65rem)}
  #portfolio .card-workspace{padding:15px!important}
  #portfolio .case-category-hero h3{font-size:clamp(2.55rem,14vw,3.9rem)}
  #portfolio .case-detail-copy h2,#portfolio .restricted-hero h2{font-size:clamp(2.35rem,13vw,3.65rem)}
  #portfolio .case-story aside{grid-template-columns:1fr}
  #portfolio .category-rail{display:none!important}
  #portfolio .case-back{width:100%;justify-content:center}


  .premium-footer{padding-top:30px}
  .premium-footer__panel{border-radius:19px}
  .premium-footer__main,.premium-footer__utility{grid-template-columns:1fr}
  .premium-footer__main>*{border-right:0!important;border-bottom:1px solid rgba(86,115,195,.16)}
  .premium-footer__main>*:last-child{border-bottom:0}
  .premium-footer__utility>*{border-right:0!important;border-bottom:1px solid rgba(86,115,195,.16)}
  .premium-footer__utility>*:last-child{border-bottom:0}
  .premium-footer__technologies{grid-column:auto}
  .premium-footer__cta{width:min(100%,300px);margin-inline:auto}
  .premium-footer__newsletter form{width:100%}
  .premium-footer__social-list,.premium-footer__technologies>div{flex-wrap:wrap}
}

/* Narrow phones (320–430 CSS px). */
@media (max-width:430px){
  :root{--deploy-shell:calc(100% - 18px);--deploy-section-y:44px;--deploy-section-y-compact:40px}
  .site-header .header-shell{gap:8px}
  .site-header .brand-logo-slot{width:38px;height:38px}
  .site-header .brand-copy strong{font-size:.76rem;letter-spacing:.12em}
  .menu-toggle{width:42px;height:42px}

  .hx-copy h1{font-size:clamp(2.65rem,15.5vw,3.9rem)}
  .hx-capabilities{grid-template-columns:1fr}
  .hx-techbar{grid-template-columns:1fr 1fr}
  .hx-orbit{--orbit-size:440px}
  .hx-node-python{left:12%}.hx-node-powerbi{right:9%}.hx-node-sql{left:3%}.hx-node-auto{right:3%}.hx-node-js{left:11%}.hx-node-analysis{right:10%}

  .spx-track{grid-auto-columns:92%}
  .spx-card{min-height:510px}
  .spx-card__cta span{font-size:.82rem}

  #portfolio .portfolio-categories--showcase{padding-inline:11px}
  #portfolio .portfolio-card-header{gap:10px}
  #portfolio .portfolio-card-header h4{font-size:.75rem}

  .premium-footer__identity{align-items:flex-start}
  .premium-footer__legal{gap:7px;font-size:.65rem}
  .premium-footer__legal-separator{display:none}
}

/* Short landscape screens: prevent hero from becoming a giant blank viewport. */
@media (max-height:620px) and (min-width:700px){
  #inicio.hx-hero{min-height:auto;padding-block:38px 28px}
  .hx-copy{padding-top:20px}
  .hx-scroll{display:none}
}

/* Touch devices: no sticky hover transforms. */
@media (hover:none) and (pointer:coarse){
  .hx-button:hover,.spx-card:hover,.portfolio-card:hover,.ui-btn:hover,.premium-access-button:hover{transform:none!important}
  .spx-card{cursor:default}
  a,button,[role="button"]{min-height:44px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* V1.78 — Cross-device stability and state-safe layouts. */
html,body{max-width:100%}
body{overflow-wrap:normal}
.language-switcher,.language-menu{max-width:min(92vw,320px)}
.language-menu{overflow:auto;overscroll-behavior:contain}
.portfolio-card.is-expanded{isolation:isolate}
.portfolio-card.is-expanded .card-workspace{width:100%;min-width:0}

@media (max-width:1280px){
  .portfolio-card-header{align-items:flex-start}
  .portfolio-card-category span{white-space:normal;overflow:visible;text-overflow:clip}
}

@media (max-width:1100px){
  .site-header{position:sticky;top:0}
  .mobile-panel .language-switcher{width:100%}
  #portfolio .portfolio-card.is-expanded{grid-column:1/-1}
  #portfolio .portfolio-card.is-expanded .card-workspace{overflow-x:hidden}
}

@media (max-width:680px){
  main>.site-section{padding-block:clamp(42px,11vw,52px)!important}
  #especialidades{padding-block:clamp(38px,10vw,48px)!important}
  .spx-card.is-active{transform:translateY(-8px) scale(1.015)!important}
  #portfolio .portfolio-card.is-expanded{border-radius:18px}
  #portfolio .case-category-shell,#portfolio .case-detail-shell,#portfolio .restricted-shell,#portfolio .request-shell{padding-inline:0}
  #portfolio .case-category-hero,#portfolio .case-detail-hero,#portfolio .restricted-hero{padding-inline:2px}
  #portfolio .case-list>*,#portfolio .request-shell>*{min-width:0}
  .premium-footer__bottom{padding-inline:12px}
}

@media (max-width:390px){
  :root{--deploy-shell:calc(100% - 14px)}
  .site-header .brand-copy strong{font-size:.7rem}
  .site-header .brand-logo-slot{width:36px;height:36px}
  .hx-copy h1{font-size:clamp(2.45rem,15vw,3.45rem)}
  .hx-orbit{--orbit-size:410px}
  .spx-track{grid-auto-columns:94%}
  #portfolio .portfolio-categories--showcase{padding-inline:9px}
  #portfolio .portfolio-card--showcase{border-radius:16px}
  #portfolio .card-workspace{padding:11px!important}
  #portfolio .case-back{font-size:.75rem}
}

@media (max-width:340px){
  :root{--deploy-shell:calc(100% - 10px)}
  .site-header .brand-copy{display:none}
  .hx-capabilities,.hx-techbar{grid-template-columns:1fr}
  .hx-techbar span:last-child{grid-column:auto}
  .spx-heading h2{font-size:2.45rem}
  #portfolio .portfolio-title{font-size:2.6rem}
}

@media (orientation:landscape) and (max-height:520px) and (pointer:coarse){
  .mobile-panel{padding-top:10px}
  #inicio.hx-hero{padding-block:26px}
  .hx-orbit{--orbit-size:min(72vh,430px)}
  main>.site-section{padding-block:38px!important}
}
